Upgraded snowfall lib
This commit is contained in:
parent
7e87dbc55b
commit
a1709f033f
58 changed files with 22 additions and 19 deletions
68
modules/nixos/nix/default.nix
Normal file
68
modules/nixos/nix/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.aa.nix;
|
||||
selfHostedCacheHost = "https://cache.kilonull.com/";
|
||||
in {
|
||||
options.aa.nix = with types; {
|
||||
enable = mkEnableOption "manage nix configuration.";
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.nixVersions.unstable;
|
||||
description = "Which nix package to use.";
|
||||
};
|
||||
|
||||
useSelfhostedCache = mkEnableOption "use self-hosted nix cache (currently hosted on gospel)";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
alejandra
|
||||
nix-prefetch
|
||||
];
|
||||
|
||||
nix = let
|
||||
users = ["root" config.aa.user.name];
|
||||
in {
|
||||
package = cfg.package;
|
||||
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
trusted-users = users;
|
||||
allowed-users = users;
|
||||
|
||||
builders-use-substitutes = cfg.useSelfhostedCache;
|
||||
substituters =
|
||||
if cfg.useSelfhostedCache
|
||||
then [
|
||||
selfHostedCacheHost
|
||||
"https://cache.nixos.org/"
|
||||
]
|
||||
else [];
|
||||
trusted-public-keys =
|
||||
if cfg.useSelfhostedCache
|
||||
then ["gospelCache:9cbn8Wm54BbwpPS0TXw+15wrYZBpfOJt4Fzfbfcq/pc="]
|
||||
else [];
|
||||
};
|
||||
|
||||
# TODO: Configure distributedBuilds and buildMachines?
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
|
||||
# TODO: Not sure if I want this
|
||||
# flake-utils-plus
|
||||
# generateRegistryFromInputs = true;
|
||||
# generateNixPathFromInputs = true;
|
||||
# linkInputs = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue