diff options
| author | seth <[email protected]> | 2024-02-07 18:03:24 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-07 18:27:45 -0500 |
| commit | cffffeb678e9a1078eeba0f19c9607cda9f31bed (patch) | |
| tree | 8b8f68aa357becad06845f15b7e528474041371c /modules/shared/base/nix.nix | |
| parent | 48712d44fde91d2685089cca7f9d88295fd59817 (diff) | |
modules/nixos+darwin: move to traits + archetypes model
Diffstat (limited to 'modules/shared/base/nix.nix')
| -rw-r--r-- | modules/shared/base/nix.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix new file mode 100644 index 0000000..6e1bdf3 --- /dev/null +++ b/modules/shared/base/nix.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: let + cfg = config.base.nixSettings; + enable = config.base.enable && cfg.enable; +in { + options.base.nixSettings = { + enable = lib.mkEnableOption "nix settings" // {default = true;}; + }; + + config = lib.mkIf enable { + nix = { + registry.n.flake = lib.mkDefault inputs.nixpkgs; + + nixPath = [ + "nixpkgs=/etc/nix/inputs/nixpkgs" + ]; + + settings = { + auto-optimise-store = pkgs.stdenv.isLinux; + experimental-features = lib.mkDefault ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; + + trusted-substituters = lib.mkDefault ["https://getchoo.cachix.org"]; + trusted-public-keys = lib.mkDefault ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="]; + nix-path = config.nix.nixPath; + }; + + gc = { + automatic = lib.mkDefault true; + options = lib.mkDefault "--delete-older-than 7d"; + }; + }; + + nixpkgs = { + overlays = [inputs.self.overlays.default]; + config.allowUnfree = lib.mkDefault true; + }; + }; +} |
