Nix configurations for my personal machines (Linux & macOS)

refactor: remove shared options from nix settings because it was causing problems

ovyerus.com 9d2b1143 d533b4a2

verified
Changed files
+64 -72
modules
+64 -72
modules/nix.nix
···
delib,
inputs,
...
-
}: let
-
shared = {
+
}:
+
delib.module {
+
name = "nix";
+
+
# TODO: double check home-manager options
+
home.always = {
nixpkgs.config = import ../files/nixpkgs-config.nix;
-
-
nix.settings = {
-
auto-optimise-store = true;
-
experimental-features = ["nix-command" "flakes"];
-
trusted-users = ["root" "@wheel" "ovy"];
-
};
+
xdg.configFile."nixpkgs/config.nix".source = ../files/nixpkgs-config.nix;
};
-
in
-
delib.module {
-
name = "nix";
+
+
nixos.always = {
+
nixpkgs.config = import ../files/nixpkgs-config.nix;
-
# TODO: double check home-manager options
-
home.always =
-
shared
-
// {
-
xdg.configFile."nixpkgs/config.nix".source = ../files/nixpkgs-config.nix;
+
nix = {
+
gc = {
+
automatic = true;
+
options = "--delete-older-than 10d";
+
dates = "weekly";
};
-
nixos.always =
-
shared
-
// {
-
nix = {
-
gc = {
-
automatic = true;
-
options = "--delete-older-than 10d";
-
dates = "weekly";
-
};
+
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
-
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
+
registry.nixpkgs.to = {
+
type = "path";
+
path = inputs.nixpkgs;
+
narHash = inputs.nixpkgs.narHash;
+
};
-
registry.nixpkgs.to = {
-
type = "path";
-
path = inputs.nixpkgs;
-
narHash = inputs.nixpkgs.narHash;
-
};
+
settings = {
+
auto-optimise-store = true;
+
experimental-features = ["nix-command" "flakes"];
+
trusted-users = ["root" "@wheel" "ovy"];
+
};
+
};
-
settings = {
-
auto-optimise-store = true;
-
experimental-features = ["nix-command" "flakes"];
-
trusted-users = ["root" "@wheel" "ovy"];
-
};
-
};
+
system.tools.nixos-option.enable = false;
+
};
-
system.tools.nixos-option.enable = false;
-
};
+
darwin.always = {
+
nixpkgs.config = import ../files/nixpkgs-config.nix;
-
darwin.always = {
-
nix = {
-
buildMachines = [
-
{
-
hostName = "rushing.axolotl-map.ts.net";
-
sshUser = "colmena-deploy";
-
system = "x86_64-linux";
-
speedFactor = 2;
-
maxJobs = 6;
-
protocol = "ssh-ng";
-
}
-
{
-
hostName = "skyline.axolotl-map.ts.net";
-
sshUser = "colmena-deploy";
-
system = "aarch64-linux";
-
speedFactor = 1;
-
maxJobs = 2;
-
protocol = "ssh-ng";
-
}
-
];
+
nix = {
+
buildMachines = [
+
{
+
hostName = "rushing.axolotl-map.ts.net";
+
sshUser = "colmena-deploy";
+
system = "x86_64-linux";
+
speedFactor = 2;
+
maxJobs = 6;
+
protocol = "ssh-ng";
+
}
+
{
+
hostName = "skyline.axolotl-map.ts.net";
+
sshUser = "colmena-deploy";
+
system = "aarch64-linux";
+
speedFactor = 1;
+
maxJobs = 2;
+
protocol = "ssh-ng";
+
}
+
];
-
distributedBuilds = true;
+
distributedBuilds = true;
-
gc = {
-
automatic = true;
-
options = "--delete-older-than 7d";
-
interval.Weekday = 6;
-
};
+
gc = {
+
automatic = true;
+
options = "--delete-older-than 7d";
+
interval.Weekday = 6;
+
};
-
optimise.automatic = true;
+
optimise.automatic = true;
-
settings = {
-
builders-use-substitutes = true;
-
experimental-features = "nix-command flakes";
-
trusted-users = ["root" "ovy"];
-
};
+
settings = {
+
builders-use-substitutes = true;
+
experimental-features = "nix-command flakes";
+
trusted-users = ["root" "ovy"];
+
sandbox = true;
};
};
-
}
+
};
+
}