split out services so they dont auto build on user include
This commit is contained in:
parent
aa052b998e
commit
2b95d8aebd
7 changed files with 36 additions and 18 deletions
|
|
@ -15,8 +15,6 @@
|
||||||
|
|
||||||
desktop.sway.enable = true;
|
desktop.sway.enable = true;
|
||||||
|
|
||||||
systemd.services.note_sync.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
module.gui.enable = true;
|
module.gui.enable = true;
|
||||||
module.wayland.enable = true;
|
module.wayland.enable = true;
|
||||||
module.programming.enable = true;
|
module.programming.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
module.appdevel.enable = true;
|
module.appdevel.enable = true;
|
||||||
module.art.enable = true;
|
module.art.enable = true;
|
||||||
|
|
||||||
|
service.note-sync.enable = true;
|
||||||
|
|
||||||
programs.noisetorch.enable = true;
|
programs.noisetorch.enable = true;
|
||||||
|
|
||||||
virtualisation.vmware.host.enable = true;
|
virtualisation.vmware.host.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@
|
||||||
./hardware
|
./hardware
|
||||||
./software
|
./software
|
||||||
./security
|
./security
|
||||||
|
./services
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@
|
||||||
sway.enable = lib.mkEnableOption "enables sway";
|
sway.enable = lib.mkEnableOption "enables sway";
|
||||||
i3.enable = lib.mkEnableOption "enables i3";
|
i3.enable = lib.mkEnableOption "enables i3";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
service = {
|
||||||
|
note-sync.enable = lib.mkEnableOption "enable note sync to repo";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set default option states in config
|
# Set default option states in config
|
||||||
|
|
@ -82,5 +86,9 @@
|
||||||
sway.enable = lib.mkDefault false;
|
sway.enable = lib.mkDefault false;
|
||||||
i3.enable = lib.mkDefault false;
|
i3.enable = lib.mkDefault false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
service = {
|
||||||
|
note-sync.enable = lib.mkDefault false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
modules/services/default.nix
Normal file
5
modules/services/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./note-sync.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
20
modules/services/note-sync.nix
Normal file
20
modules/services/note-sync.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
}: {
|
||||||
|
config.systemd.services.note_sync = lib.mkIf config.service.note-sync.enable {
|
||||||
|
enable = true;
|
||||||
|
description = "Auto sync notes to remote";
|
||||||
|
serviceConfig = {
|
||||||
|
User = "crow";
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
path = [
|
||||||
|
"/run/current-system/sw"
|
||||||
|
];
|
||||||
|
startAt = [
|
||||||
|
"*:0/5"
|
||||||
|
];
|
||||||
|
script = "cd /home/crow/Notes\ngit pull\ngit add .\ngit diff-index --quiet HEAD || git commit -am 'automatic backup'\ngit push";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -10,21 +10,5 @@
|
||||||
extraGroups = ["wheel" "networkmanager" "audio" "plugdev"];
|
extraGroups = ["wheel" "networkmanager" "audio" "plugdev"];
|
||||||
};
|
};
|
||||||
|
|
||||||
config.systemd.services.note_sync = {
|
|
||||||
enable = true;
|
|
||||||
description = "Auto sync notes to remote";
|
|
||||||
serviceConfig = {
|
|
||||||
User = "crow";
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
path = [
|
|
||||||
"/run/current-system/sw"
|
|
||||||
];
|
|
||||||
startAt = [
|
|
||||||
"*:0/5"
|
|
||||||
];
|
|
||||||
script = "cd /home/crow/Notes\ngit pull\ngit add .\ngit diff-index --quiet HEAD || git commit -am 'automatic backup'\ngit push";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.home-manager.users.crow = lib.mkIf config.user.crow.home.enable ./home.nix;
|
config.home-manager.users.crow = lib.mkIf config.user.crow.home.enable ./home.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue