From f324d84bc86db1b4b81c447f536adc24f7731578 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 23 Aug 2023 21:13:01 -0400 Subject: modules: merge some nixos/darwin modules --- modules/shared/base/nix.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/shared/base/nix.nix (limited to 'modules/shared/base/nix.nix') diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix new file mode 100644 index 0000000..21af0e0 --- /dev/null +++ b/modules/shared/base/nix.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.base.nix-settings; + inherit (lib) mkDefault mkEnableOption mkIf; + inherit (pkgs.stdenv) isLinux; +in { + options.base.nix-settings.enable = mkEnableOption "base nix settings"; + + config = mkIf cfg.enable { + nix = { + settings = { + auto-optimise-store = isLinux; + experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; + }; + + gc = { + automatic = mkDefault true; + options = mkDefault "--delete-older-than 7d"; + }; + }; + }; +} -- cgit v1.2.3