modules/nixfiles: add modules for system hydra sync
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
./monitoring
|
||||
./nginx-port-forward
|
||||
./nixfiles
|
||||
./nixfiles/system-auto-sync-to-hydra.nix
|
||||
./update-from-hydra
|
||||
./wg-clerie
|
||||
./wireguard-initrd
|
||||
|
29
modules/nixfiles/system-auto-sync-to-hydra.nix
Normal file
29
modules/nixfiles/system-auto-sync-to-hydra.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.clerie.nixfiles.system-auto-sync-to-hydra;
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
clerie.nixfiles.system-auto-sync-to-hydra = {
|
||||
enable = mkEnableOption "clerie nixfiles tools";
|
||||
allowReboot = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Monitor NixOS";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.nixfiles-system-auto-sync-to-hydra = {
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = pkgs.nixfiles-system-sync-to-hydra + "/bin/nixfiles-system-sync-to-hydra${optionalString cfg.allowReboot " --allow-reboot"}";
|
||||
};
|
||||
startAt = "*-*-* 06:47:00";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user