From 5cc282d784ae7a0cf4cc7ce6d166aacb5dc0e3bf Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Mon, 29 Mar 2021 20:21:02 -0400 Subject: [PATCH] inline auto-update --- modules/auto-update.nix | 11 ----------- modules/profiles.nix | 15 +++++++++++---- 2 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 modules/auto-update.nix diff --git a/modules/auto-update.nix b/modules/auto-update.nix deleted file mode 100644 index 50fdd40..0000000 --- a/modules/auto-update.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - system.autoUpgrade = { - enable = true; - allowReboot = true; - }; - nix.gc = { - automatic = true; - options = "--delete-older-than 30d"; - }; -} diff --git a/modules/profiles.nix b/modules/profiles.nix index 57c4d95..7c97ea2 100644 --- a/modules/profiles.nix +++ b/modules/profiles.nix @@ -10,10 +10,17 @@ in config = mkMerge [ - (mkIf (cfg == "server") (mkMerge [ - { services.openssh.enable = true; } - (import ./auto-update.nix { }) - ])) + (mkIf (cfg == "server") { + services.openssh.enable = true; + system.autoUpgrade = { + enable = true; + allowReboot = true; + }; + nix.gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + }) (mkIf (cfg == "desktop-sway") (import ./sway.nix { inherit pkgs; })) (mkIf (cfg == "desktop-gnome") (import ./gnome.nix { inherit pkgs; }))