mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
refactor: major refactor into proper reusable modules. No logical changes.
This commit is contained in:
parent
04872f6ec5
commit
84ac34cb6c
80 changed files with 761 additions and 776 deletions
58
modules/config/nix.nix
Normal file
58
modules/config/nix.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
stateVersion,
|
||||
...
|
||||
}: {
|
||||
environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" ''
|
||||
assert builtins.trace "This is a dummy config, use colmena!" false;
|
||||
{ }
|
||||
'';
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
allowed-users = ["@wheel"];
|
||||
trusted-users = ["root" "@wheel"];
|
||||
substituters = [
|
||||
"https://nix-config.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-config.cachix.org-1:Vd6raEuldeIZpttVQfrUbLvXJHzzzkS0pezXCVVjDG4="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
cores = 0;
|
||||
max-jobs = "auto";
|
||||
};
|
||||
daemonCPUSchedPolicy = "batch";
|
||||
daemonIOSchedPriority = 5;
|
||||
distributedBuilds = true;
|
||||
extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
experimental-features = nix-command flakes
|
||||
flake-registry = /etc/nix/registry.json
|
||||
'';
|
||||
nixPath = ["nixpkgs=/run/current-system/nixpkgs"];
|
||||
optimise.automatic = true;
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "monthly";
|
||||
options = "--delete-older-than 90d";
|
||||
};
|
||||
# Define global flakes for this system
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
p.flake = inputs.nixpkgs;
|
||||
pkgs.flake = inputs.nixpkgs;
|
||||
templates.flake = inputs.templates;
|
||||
};
|
||||
};
|
||||
|
||||
system = {
|
||||
extraSystemBuilderCmds = ''
|
||||
ln -sv ${pkgs.path} $out/nixpkgs
|
||||
'';
|
||||
inherit stateVersion;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue