From f804cb2cf18a16c80153cdd9a23c7e9f675142ab Mon Sep 17 00:00:00 2001 From: xunuwu Date: Wed, 28 May 2025 17:29:45 +0200 Subject: [PATCH] nix config changes --- sys/profiles/nix/default.nix | 62 +++++++++++++++++++------------ sys/profiles/nix/substituters.nix | 16 -------- 2 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 sys/profiles/nix/substituters.nix diff --git a/sys/profiles/nix/default.nix b/sys/profiles/nix/default.nix index 0e8f32f..adf3ab8 100644 --- a/sys/profiles/nix/default.nix +++ b/sys/profiles/nix/default.nix @@ -1,34 +1,50 @@ -{ - config, - pkgs, - inputs, - lib, - ... -}: { - imports = [ - ./substituters.nix - ]; - - # git is needed for flakes - environment.systemPackages = [pkgs.git]; - +{inputs, ...}: { nix = { - # pin the registry to avoid downloading and evaling a new nixpkgs version every time - registry = lib.mapAttrs (_: v: {flake = v;}) inputs; + registry.nixpkgs.to = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + rev = inputs.nixpkgs.rev; + }; - # set the path for channels compat - nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + nixPath = ["nixpkgs=${inputs.nixpkgs.outPath}"]; settings = { - #auto-optimise-store = true; builders-use-substitutes = true; - experimental-features = ["flakes" "nix-command" "pipe-operators" "no-url-literals"]; - - # for direnv GC roots keep-outputs = true; keep-derivations = true; + accept-flake-config = true; + use-xdg-base-directories = true; - trusted-users = ["root" "@wheel"]; + flake-registry = builtins.toFile "none.json" (builtins.toJSON { + flakes = []; + version = 2; + }); + + experimental-features = [ + "flakes" + "nix-command" + "pipe-operators" + "no-url-literals" + "ca-derivations" + ]; + + trusted-users = [ + "root" + "@wheel" + ]; + + substituters = [ + "https://cache.nixos.org?priority=10" + "https://nix-community.cachix.org?priority=11" + "https://nix-gaming.cachix.org?priority=12" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + ]; }; }; } diff --git a/sys/profiles/nix/substituters.nix b/sys/profiles/nix/substituters.nix deleted file mode 100644 index b21c0e2..0000000 --- a/sys/profiles/nix/substituters.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - nix.settings = { - substituters = [ - # high priority since it's almost always used - "https://cache.nixos.org?priority=10" - "https://nix-community.cachix.org" - "https://nix-gaming.cachix.org" - ]; - - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" - ]; - }; -}