Files
nixos/modules/baseline.nix
T

187 lines
4.9 KiB
Nix
Raw Normal View History

2024-10-18 16:48:34 -05:00
{
pkgs,
config,
lib,
2024-10-19 16:39:24 -05:00
self,
2024-10-18 16:48:34 -05:00
...
}:
let
2024-11-04 11:04:45 -06:00
builderHosts =
if self != null then
(lib.attrNames (
lib.filterAttrs (_: v: v.config.greg.remote-builder.enable) self.nixosConfigurations
))
else
[ ];
2024-10-18 16:48:34 -05:00
in
2024-02-09 14:33:51 -06:00
{
# Enable flakes
nix = {
gc = {
automatic = true;
# Scheduling of them is different in nixos vs nix-darwin, so check for
# the extra details there
options = "--delete-older-than 30d";
2024-02-09 14:33:51 -06:00
};
settings = {
experimental-features = "nix-command flakes";
keep-outputs = true;
keep-derivations = true;
min-free = (toString (1024 * 1024 * 1024));
max-free = (toString (5 * 1024 * 1024 * 1024));
2024-10-18 16:46:35 -05:00
trusted-users = [
"greg"
"gregory.hellings"
]; # For home and for work machines
substituters = [
2025-01-21 14:53:11 -06:00
"http://nas.home:9000/binary-cache/"
"https://cache.garnix.io"
"https://ai.cachix.org"
2024-10-17 11:36:41 -05:00
"https://nixpkgs-python.cachix.org"
2024-10-19 02:14:43 -05:00
"https://greg-hellings.cachix.org"
2024-10-17 11:36:41 -05:00
"https://nix-community.cachix.org"
];
trusted-public-keys = [
2025-01-21 14:53:11 -06:00
"nix.home:0qWYHn3gGllXChhAaaxKlNZtRy6yG/XJs1RFSqV3nW8="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
2024-10-17 11:36:41 -05:00
"nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU="
2024-10-19 02:14:43 -05:00
"greg-hellings.cachix.org-1:y01Jl/L5evlhxdnUW6n56AiI1k8g1wxWhTxJCe7XSco="
2024-10-17 11:36:41 -05:00
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
2024-02-09 14:33:51 -06:00
};
2024-10-18 16:48:34 -05:00
buildMachines = (
lib.map (host: {
hostName = "${host}-builder";
system = "x86_64-linux";
protocol = "ssh-ng";
maxJobs = 12;
speedFactor = 2;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
}) (lib.filter (x: x != config.networking.hostName) builderHosts)
);
distributedBuilds = true;
extraOptions = ''
builders-use-substitutes = true
'';
};
2024-02-09 14:33:51 -06:00
2024-10-29 23:52:10 -05:00
programs.ssh = {
knownHosts = {
chronicles = {
extraHostNames = [
"chronicles.thehellings.lan"
"chronicles.home"
"nas"
"nas.thehellings.lan"
"nas.home"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS";
};
dns = {
extraHostNames = [
"dns"
"dns.me.ts"
"dns.home"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKRCXdhXWHEvw84V9JC5bAGovvj12DLVphcEnsTHDjxW";
};
"genesis" = {
extraHostNames = [
"genesis.shire-zebra.ts.net"
"genesis.home"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI9jbTPmEWQ0F2bLYmnIOLmBnag1fkKxHRjz3X8lB/k";
};
"git" = {
extraHostNames = [
"git.home"
"git.thehellings.lan"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCH6L3YT7W8regzG395UWfRVfjYyUMJtmM+3w579bsT";
};
hosea = {
extraHostNames = [
"hosea.home"
"hosea.thehellings.lan"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz";
};
isaiah = {
extraHostNames = [
"isaiah.home"
"isaiah.thehellings.lan"
2024-11-18 21:11:17 -06:00
"isaiah-builder"
2024-10-29 23:52:10 -05:00
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHleYKtfV4W1Z63Ysu9w5Rbglqlz4F92YcZoMkucoTNf";
};
jeremiah = {
extraHostNames = [
"jeremiah.home"
"jeremiah.thehellings.lan"
"jeremiah-builder"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0";
};
jude = {
extraHostNames = [
"jude.home"
"jude.thehellings.lan"
"jude-builder"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOos0zQePsa+T6Z2dsKbPOvEdrBQ8a6mx3s7pN6ysCI0";
};
linode = {
extraHostNames = [
"linode.home"
"linode.thehellings.lan"
"thehellings.com"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMv9Zud3kZOl86gtmkn+uj3D4kiXWDPtyUL02VVLNR4Q";
};
};
extraConfig = builtins.concatStringsSep "\n" (
2024-10-18 16:48:34 -05:00
lib.map (x: ''
Host ${x}-builder
Hostname ${x}.home
User remote-builder-user
'') builderHosts
2024-10-29 23:52:10 -05:00
);
};
2024-10-18 16:48:34 -05:00
nixpkgs.config = {
allowUnfree = true;
2024-10-17 11:36:41 -05:00
permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];
};
# Base packages that need to be in all my hosts
environment.systemPackages = with pkgs; [
agenix
bitwarden-cli
bmon
2024-10-19 02:14:43 -05:00
cachix
diffutils
git
gnupatch
gregpy
findutils
file
hms # My own home manager switcher
htop
iperf
killall
nano
pciutils
pwgen
unzip
wget
];
2024-02-13 23:58:38 -06:00
}