From 8a9b7280c6eb9d0866e425384b68f4cdf8a3f3af Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 27 Jun 2024 19:02:43 -0400 Subject: [PATCH] refactor: move nix settings to system module, remove unused modules --- common/system/default.nix | 27 +++++++++++++++++++++++++++ flakes/nixos.nix | 8 -------- modules/common.nix | 1 - modules/nix.nix | 23 ----------------------- 4 files changed, 27 insertions(+), 32 deletions(-) create mode 100644 common/system/default.nix delete mode 100644 modules/nix.nix diff --git a/common/system/default.nix b/common/system/default.nix new file mode 100644 index 0000000..12bec4c --- /dev/null +++ b/common/system/default.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + ... +}: { + nix.gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + nix.optimise.automatic = true; + nix.settings = { + extra-experimental-features = [ + "flakes" + "nix-command" + ]; + keep-outputs = true; + log-lines = 25; + tarball-ttl = 43200; + trusted-users = [ + "root" + config.my.user + ]; + }; + nix.package = pkgs.nix; + programs.zsh.enable = true; + time.timeZone = "America/New_York"; +} diff --git a/flakes/nixos.nix b/flakes/nixos.nix index 79edc1c..781ceda 100644 --- a/flakes/nixos.nix +++ b/flakes/nixos.nix @@ -51,15 +51,9 @@ in { } ]; - baseHomeModule = { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = {inherit inputs;}; - }; fullNixOSModules = defaultModules ++ [ - baseHomeModule { home-manager.users.michael = import ../user/environments/nixos/home.nix; } @@ -102,8 +96,6 @@ in { modules = defaultModules ++ [ - ../modules/nix.nix - baseHomeModule { home-manager.users.michael = import ../user/environments/nixos-server/home.nix; } diff --git a/modules/common.nix b/modules/common.nix index f74e9ce..b468686 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -7,7 +7,6 @@ ./flatpak.nix ./fonts.nix ./hosts.nix - ./nix.nix ./sound.nix ]; } diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index 173fcf7..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, ...}: { - nix = { - extraOptions = '' - experimental-features = flakes nix-command - ''; - # this is required until nix 2.4 is released - package = pkgs.nixFlakes; - - settings = { - auto-optimise-store = true; - trusted-users = ["root" "michael"]; - }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - nixpkgs.config = { - allowUnfree = true; - }; -}