Reformatted with nixfmt

This commit is contained in:
alejandro-angulo 2025-03-31 22:34:25 -07:00
parent f51256c3ae
commit 3f16537322
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
80 changed files with 1454 additions and 992 deletions

View file

@ -3,12 +3,19 @@
pkgs,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption types;
}:
let
inherit (lib)
mkIf
mkEnableOption
mkOption
types
;
cfg = config.aa.nix;
selfHostedCacheHost = "https://cache.kilonull.com/";
in {
in
{
options.aa.nix = {
enable = mkEnableOption "manage nix configuration.";
package = mkOption {
@ -26,37 +33,43 @@ in {
nixfmt-rfc-style
];
nix = let
users = ["root" config.aa.user.name];
in {
package = cfg.package;
nix =
let
users = [
"root"
config.aa.user.name
];
in
{
package = cfg.package;
settings = {
experimental-features = "nix-command flakes";
trusted-users = users;
allowed-users = users;
settings = {
experimental-features = "nix-command flakes";
trusted-users = users;
allowed-users = users;
builders-use-substitutes = cfg.useSelfhostedCache;
substituters =
if cfg.useSelfhostedCache
then [
# TESTING
"https://minio.kilonull.com/nix-store"
selfHostedCacheHost
]
else [];
trusted-public-keys =
mkIf cfg.useSelfhostedCache
["gospelCache:9cbn8Wm54BbwpPS0TXw+15wrYZBpfOJt4Fzfbfcq/pc="];
builders-use-substitutes = cfg.useSelfhostedCache;
substituters =
if cfg.useSelfhostedCache then
[
# TESTING
"https://minio.kilonull.com/nix-store"
selfHostedCacheHost
]
else
[ ];
trusted-public-keys = mkIf cfg.useSelfhostedCache [
"gospelCache:9cbn8Wm54BbwpPS0TXw+15wrYZBpfOJt4Fzfbfcq/pc="
];
};
# TODO: Configure distributedBuilds and buildMachines?
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 30d";
};
};
# TODO: Configure distributedBuilds and buildMachines?
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 30d";
};
};
};
}