diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2022-09-25 14:11:36 +0200 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2022-09-25 14:11:36 +0200 |
| commit | 6b7c3879c75f41469edc6897a9dfabf5f0ae17d9 (patch) | |
| tree | 34c72a75bc051ab0b0a791c64282f9d4907151df /home/pkgs | |
| parent | 97c1db512c252e5dc82ad8092973fa591ff813f6 (diff) | |
home: systemd: refactor services with a timer
Diffstat (limited to 'home/pkgs')
| -rw-r--r-- | home/pkgs/lib/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/home/pkgs/lib/default.nix b/home/pkgs/lib/default.nix new file mode 100644 index 0000000..55e6c20 --- /dev/null +++ b/home/pkgs/lib/default.nix @@ -0,0 +1,11 @@ +{ pkgs }: + +{ + serviceWithTimer = name: { Unit, Service, Timer, Install, ... }@config: { + services.${name} = { inherit (config) Unit Install Service; }; + timers.${name} = { + inherit (config) Unit Install; + Timer = config.Timer // { Unit = "${name}.service"; }; + }; + }; +} |
