chore: more factor

This commit is contained in:
Truxnell 2024-03-25 12:01:03 +11:00
parent f7895a7b5a
commit 32e6a70928
3 changed files with 30 additions and 106 deletions

View file

@ -25,45 +25,12 @@ in
type = lib.types.bool;
description = "Persistent timer for gc, runs at startup if timer missed";
default = true;
};
};
};
nix = {
settings = {
# Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
# Substitutions
trusted-substituters = [
"https://nix-community.cachix.org"
"https://numtide.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];
# Fallback quickly if substituters are not available.
connect-timeout = 5;
# Avoid copying unnecessary stuff over SSH
builders-use-substitutes = true;
trusted-users = [ "root" "@wheel" ];
warn-dirty = false;
# The default at 10 is rarely enough.
log-lines = lib.mkDefault 25;
};
optimise.automatic = cfg.autoOptimiseStore;

View file

@ -9,10 +9,10 @@ with lib;
# Not sure at this point a good way to manage globals in one place
# without mono-repo config.
# Generated by nixos-config-generate
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/installer/scan/not-detected.nix") # Generated by nixos-config-generate
./global/nix.nix
];

View file

@ -1,84 +1,41 @@
{ lib, ... }:
{ lib, config, ... }:
{
nix = {
nix = {
settings = {
# Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
# Substitutions
trusted-substituters = [
"https://nix-community.cachix.org"
"https://numtide.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];
# Fallback quickly if substituters are not available.
connect-timeout = 5;
# Avoid copying unnecessary stuff over SSH
builders-use-substitutes = true;
trusted-users = [ "root" "@wheel" ];
nix.settings = {
# Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
warn-dirty = false;
# Substitutions
trusted-substituters = [
"https://nix-community.cachix.org"
"https://numtide.cachix.org"
];
# The default at 10 is rarely enough.
log-lines = lib.mkDefault 25;
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];
};
};
settings = {
# Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
# Substitutions
trusted-substituters = [
"https://nix-community.cachix.org"
"https://numtide.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];
# Fallback quickly if substituters are not available.
connect-timeout = 5;
# Avoid copying unnecessary stuff over SSH
builders-use-substitutes = true;
# Fallback quickly if substituters are not available.
connect-timeout = 5;
# Avoid copying unnecessary stuff over SSH
builders-use-substitutes = true;
trusted-users = [ "root" "@wheel" ];
trusted-users = [ "root" "@wheel" ];
warn-dirty = false;
warn-dirty = false;
# The default at 10 is rarely enough.
log-lines = lib.mkDefault 25;
};
optimise.automatic = cfg.autoOptimiseStore;
# automatically garbage collect nix store
gc = mkIf cfg.gc.enabled {
# garbage collection
automatic = cfg.gc.enabled;
options = "--delete-older-than 30d";
persistent = cfg.gc.persistent;
};
# The default at 10 is rarely enough.
log-lines = lib.mkDefault 25;
};
}