From 8a32f0be60b3dca3b72c30268900350e9af6d2e1 Mon Sep 17 00:00:00 2001 From: logical_code Date: Sun, 6 Jul 2025 22:30:15 -0400 Subject: [PATCH] Add modules/nixos/system/default.nix --- modules/nixos/system/default.nix | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/nixos/system/default.nix diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix new file mode 100644 index 0000000..062eb24 --- /dev/null +++ b/modules/nixos/system/default.nix @@ -0,0 +1,49 @@ +{ + lib, + config, + inputs, + ... +}: let + inherit (lib.attrsets) mapAttrs mapAttrsToList; +in { + config = { + # Common Nix Settings, registry thing is specifically for flakes + nix = { + registry = lib.mkForce (mapAttrs (_: value: {flake = value;}) inputs); + nixPath = lib.mkForce (mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry); + optimise.automatic = true; + + gc = { + automatic = true; + options = "--delete-older-than 14d"; + }; + + settings = { + experimental-features = "nix-command flakes"; + warn-dirty = false; + keep-derivations = true; + keep-env-derivations = true; + keep-outputs = true; + auto-optimise-store = false; + + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; + + nixpkgs = { + config.allowUnfree = true; + + overlays = [ + # overlays if you want them + ]; + }; + }; +} \ No newline at end of file