Files

177 lines
3.6 KiB
Nix
Raw Permalink Normal View History

2025-06-10 14:28:46 -05:00
{
config,
lib,
2025-12-26 23:05:37 -06:00
metadata,
2025-06-10 14:28:46 -05:00
pkgs,
2026-05-12 21:25:24 -05:00
top,
2025-06-10 14:28:46 -05:00
...
}:
{
imports = [
2025-06-10 15:05:09 -05:00
../modules/nix-conf.nix
2026-05-12 21:25:24 -05:00
top.niks3.nixosModules.niks3-auto-upload
2025-06-10 14:28:46 -05:00
];
2026-05-12 21:25:24 -05:00
age.secrets.niks3-api-token.file = ../secrets/niks3/api_token.age;
2025-06-10 14:28:46 -05:00
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
environment.systemPackages = with pkgs; [
2026-05-12 21:25:24 -05:00
top.niks3.packages.${pkgs.stdenv.hostPlatform.system}.niks3
2025-06-10 14:28:46 -05:00
agenix
bitwarden-cli
bmon
btop
btrfs-progs
coreutils-full
diffutils
efibootmgr
findutils
file
git
gnupatch
2026-05-13 08:06:57 -05:00
top.self.packages.${pkgs.stdenv.hostPlatform.system}.hms # My own home manager switcher
2025-06-10 14:28:46 -05:00
iperf
killall
nano
2026-02-02 10:41:04 -06:00
nfs-utils
2025-06-10 14:28:46 -05:00
lshw
pciutils
psmisc
pwgen
unzip
usbutils
wget
xfsprogs
];
i18n.defaultLocale = "en_US.UTF-8";
nix = {
gc.dates = "weekly";
settings.auto-optimise-store = true;
};
# Network Manager pulls in too many deps
networking = {
2026-04-17 15:43:57 -05:00
extraHosts =
let
onNetwork =
attr: _k: v:
(builtins.hasAttr attr v) && v.${attr} != null;
getIPs =
attr: domain:
(lib.mapAttrsToList (host: v: "${builtins.getAttr attr v} ${host}.${domain}") (
lib.filterAttrs (onNetwork attr) metadata.hosts
));
in
builtins.concatStringsSep "\n" (
(getIPs "ts" "shire-zebra.ts.net")
++ (getIPs "nebulaIp" "nebula.thehellings.com")
++ (getIPs "nebulaIp" "nebula")
++ (getIPs "ip" "thehellings.lan")
);
2025-06-10 14:28:46 -05:00
search = [
2026-04-17 15:43:57 -05:00
"nebula.thehellings.com"
2025-06-10 14:28:46 -05:00
];
networkmanager.enable = false;
};
programs = {
2025-12-02 15:05:46 -06:00
gnupg.agent.enable = true;
2025-06-10 14:28:46 -05:00
xonsh = {
enable = true;
};
ssh = {
2025-12-26 23:05:37 -06:00
knownHosts = builtins.mapAttrs (n: v: {
extraHostNames = [
"${n}.thehellings.lan"
"${n}.shire-zebra.ts.net"
];
publicKey = v.pubkey;
}) (lib.filterAttrs (_: v: v ? "pubkey") metadata.hosts);
2025-06-10 14:28:46 -05:00
};
};
# Enable the OpenSSH daemon for remote control
services = {
2025-07-02 11:55:35 -05:00
locate.enable = true;
2026-05-12 21:25:24 -05:00
niks3-auto-upload = {
enable = config.greg.nix.cache;
authTokenFile = config.age.secrets.niks3-api-token.path;
serverUrl = "http://hosea.nebula.thehellings.com:5751";
verifyS3Integrity = true;
};
2025-06-10 14:28:46 -05:00
openssh = {
enable = true;
settings.X11Forwarding = true;
};
2025-11-20 23:08:52 -06:00
prometheus.exporters = {
node = {
enable = true;
2025-12-02 15:05:46 -06:00
enabledCollectors = [
"ethtool"
"logind"
"mountstats"
"systemd"
"tcpstat"
];
2025-11-20 23:08:52 -06:00
};
ping = {
enable = true;
settings = {
ping = {
interval = "10s";
timeout = "5s";
};
2025-12-02 15:05:46 -06:00
targets = [
"thehellings.com"
"genesis.shire-zebra.ts.net"
"www.google.com"
];
2025-11-20 23:08:52 -06:00
};
};
systemd.enable = true;
2025-11-19 22:43:10 -06:00
};
2025-06-10 14:28:46 -05:00
};
2026-04-17 15:43:57 -05:00
security = {
sudo-rs = {
enable = true;
extraRules = [
2025-06-10 14:28:46 -05:00
{
2026-04-17 15:43:57 -05:00
users = [ "greg" ];
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
2025-06-10 14:28:46 -05:00
}
];
2026-04-17 15:43:57 -05:00
};
sudo.enable = false;
};
2025-06-10 14:28:46 -05:00
# Define a user account. Don't forget to set a password with passwd.
users.users.greg = {
isNormalUser = true;
createHome = true;
extraGroups = [
"wheel"
]; # Enable sudo for the user.
shell = config.programs.xonsh.package;
initialPassword = "password";
openssh.authorizedKeys.keys = lib.strings.splitString "\n" (
2025-06-10 21:48:12 -05:00
builtins.readFile ../home/ssh/authorized_keys
2025-06-10 14:28:46 -05:00
);
};
system.stateVersion = "24.11";
}