Working config for fw13 amd

This commit is contained in:
Jurn Wubben 2025-02-14 19:40:27 +00:00
commit e706230566
48 changed files with 1812 additions and 0 deletions

44
system/nix/default.nix Normal file
View file

@ -0,0 +1,44 @@
{
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;
};
};
system.stateVersion = "25.05";
}

11
system/nix/nh.nix Normal file
View file

@ -0,0 +1,11 @@
{
programs.nh = {
enable = true;
# weekly cleanup
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
flake = "/home/jsw/NixOS";
};
}

5
system/nix/nixpkgs.nix Normal file
View file

@ -0,0 +1,5 @@
{self, ...}: {
nixpkgs = {
config.allowUnfree = true;
};
}

View file

@ -0,0 +1,28 @@
{
nix.settings = {
substituters = [
# high priority since it's almost always used
"https://cache.nixos.org?priority=10"
# "https://anyrun.cachix.org"
# "https://fufexan.cachix.org"
# "https://helix.cachix.org"
# "https://hyprland.cachix.org"
# "https://nix-community.cachix.org"
# "https://nix-gaming.cachix.org"
# "https://yazi.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
# "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
# "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY="
# "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
# "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
# "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
# "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k="
];
};
}