Initial commit

This commit is contained in:
2026-03-31 16:53:11 +02:00
commit d0eba1c834
343 changed files with 34443 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
{
config,
pkgs,
inputs,
lib,
...
}: {
imports = [
./nh.nix
./nixpkgs.nix
./substituters.nix
];
# we need git for flakes
environment.systemPackages = [pkgs.git];
nix = let
flakeInputs = lib.filterAttrs (_: v: lib.isType "flake" v) inputs;
in {
package = pkgs.lix;
# pin the registry to avoid downloading and evaling a new nixpkgs version every time
registry = lib.mapAttrs (_: v: {flake = v;}) flakeInputs;
# set the path for channels compat
nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
experimental-features = ["nix-command" "flakes"];
flake-registry = "/etc/nix/registry.json";
# for direnv GC roots
keep-derivations = true;
keep-outputs = true;
trusted-users = ["root" "@wheel"];
accept-flake-config = false;
};
};
}
+13
View File
@@ -0,0 +1,13 @@
_: {
# nh default flake
environment.variables.NH_FLAKE = "/etc/nixos";
programs.nh = {
enable = true;
# weekly cleanup
clean = {
enable = true;
extraArgs = "--keep-since 7d";
};
};
}
+10
View File
@@ -0,0 +1,10 @@
_: {
nixpkgs = {
config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-38.7.1"
];
};
};
}
+25
View File
@@ -0,0 +1,25 @@
{
nix.settings = {
substituters = [
# high priority since it's almost always used
"https://cache.nixos.org?priority=10"
"https://attic.xuyh0120.win/lantian"
"https://chaotic-nyx.cachix.org/"
"https://fufexan.cachix.org"
"https://niri.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
"lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc="
"someone.cachix.org-1:2K7KEjzbd3U+qMQRte/DGqttosw8EGgGVvu8vKu8D6A="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}