1

System: Move cachix configuration to mkCommonNixSettings library function

This commit is contained in:
2026-04-17 12:44:58 +02:00
parent 5d699a2d58
commit 2fbf61c052
3 changed files with 31 additions and 39 deletions

View File

@ -9,14 +9,40 @@
mkCommonNixSettings = username: { mkCommonNixSettings = username: {
enable = true; enable = true;
package = pkgs.nixVersions.stable; package = pkgs.nixVersions.stable;
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes pipe-operators experimental-features = nix-command flakes pipe-operators
''; '';
settings.trusted-users = ["root" username];
gc.automatic = false; settings = {
gc.options = "--delete-older-than 5d"; trusted-users = ["root" username];
settings.auto-optimise-store = true; auto-optimise-store = true;
optimise.automatic = true;
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://comfyui.cachix.org"
# "https://ai.cachix.org"
# "https://app.cachix.org/cache/nixos-rocm"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"comfyui.cachix.org-1:33mf9VzoIjzVbp0zwj+fT51HG0y31ZTK3nzYZAX0rec="
# "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
# "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE="
];
};
gc = {
automatic = false;
options = "--delete-older-than 5d";
};
optimise = {
automatic = true;
};
registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs; registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs;
nixPath = [ nixPath = [
"nixpkgs=${inputs.nixpkgs.outPath}" "nixpkgs=${inputs.nixpkgs.outPath}"
@ -49,7 +75,6 @@
# Import the toplevel system configuration module. # Import the toplevel system configuration module.
../system ../system
../system/cachix.nix
# Host specific configuration # Host specific configuration
../system/${hostname} ../system/${hostname}
@ -123,9 +148,6 @@
# to allow installation of unfree software and my own overlays. # to allow installation of unfree software and my own overlays.
{nixpkgs.pkgs = pkgs;} {nixpkgs.pkgs = pkgs;}
# Import the toplevel system configuration module.
../system/cachix.nix
# Host specific configuration # Host specific configuration
../system/${hostname} ../system/${hostname}

View File

@ -1,16 +0,0 @@
# WARN: this file will get overwritten by $ cachix use <name>
{
pkgs,
lib,
...
}: let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports =
lib.mapAttrsToList toImport
(lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"];
}

View File

@ -1,14 +0,0 @@
{
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
# "https://app.cachix.org/cache/nixos-rocm"
# "https://ai.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE="
# "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
];
};
}