mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-15 03:24:10 -05:00
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
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";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue