switch over hopper fully (+ minor refactoring)

This commit is contained in:
xunuwu 2024-11-21 10:03:31 +01:00
parent c38c6b9b29
commit 6ab8a4e38d
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
97 changed files with 71 additions and 25 deletions

View file

@ -0,0 +1,38 @@
{
self,
super,
root,
}: {
config,
pkgs,
inputs,
lib,
...
}: {
imports = [
super.substituters
];
# git is needed for flakes
environment.systemPackages = [pkgs.git];
nix = {
# pin the registry to avoid downloading and evaling a new nixpkgs version every time
registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
# 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 = ["flakes" "nix-command" "pipe-operators" "no-url-literals"];
# for direnv GC roots
keep-outputs = true;
keep-derivations = true;
trusted-users = ["root" "@wheel"];
};
};
}

View file

@ -0,0 +1,7 @@
{
nix.gc = {
automatic = true;
options = "--delete-older-than 14d";
};
nix.optimise.automatic = true;
}

View file

@ -0,0 +1,18 @@
{
self,
super,
root,
}: {
nix.settings = {
substituters = [
# high priority since it's almost always used
"https://cache.nixos.org?priority=10"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}