2021-04-07 14:03:52 -07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2021-04-09 14:24:50 -07:00
|
|
|
with lib;
|
2021-04-29 21:39:21 -07:00
|
|
|
let primary-ip = "10.0.0.21";
|
2021-04-22 11:38:52 -07:00
|
|
|
|
2021-04-09 14:24:50 -07:00
|
|
|
in {
|
2021-04-07 14:03:52 -07:00
|
|
|
config = {
|
2021-04-10 13:25:43 -07:00
|
|
|
|
2021-04-29 21:39:21 -07:00
|
|
|
fudo.secrets = {
|
|
|
|
host-secrets.plato = {
|
|
|
|
host-keytab = {
|
|
|
|
source-file = /state/secrets/kerberos/plato.keytab;
|
|
|
|
target-file = "/etc/krb5.keytab";
|
|
|
|
user = "root";
|
2021-04-22 11:38:52 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-29 21:39:21 -07:00
|
|
|
secret-group = "fudo-secrets";
|
|
|
|
secret-users = [ "niten" ];
|
|
|
|
secret-paths = [ "/state/secrets" ];
|
|
|
|
};
|
2021-04-22 11:38:52 -07:00
|
|
|
|
2021-04-29 21:39:21 -07:00
|
|
|
systemd = let secrets-watcher-name = "secrets-ownership-fixer";
|
|
|
|
in {
|
2021-04-22 11:38:52 -07:00
|
|
|
tmpfiles.rules = [
|
|
|
|
"L /root/.gnupg - - - - /state/root/gnupg"
|
|
|
|
# "L /root/.emacs.d - - - - /state/root/emacs.d"
|
|
|
|
"L /root/.ssh/id_rsa - - - - /state/root/ssh/id_rsa"
|
|
|
|
"L /root/.ssh/id_rsa.pub - - - - /state/root/ssh/id_rsa.pub"
|
|
|
|
"L /root/.ssh/known_hosts - - - - /state/root/ssh/known_hosts"
|
|
|
|
"L /etc/ssh/ssh_host_ed25519_key - - - - /state/ssh/ssh_host_ed25519_key"
|
|
|
|
"L /etc/ssh/ssh_host_rsa_key - - - - /state/ssh/ssh_host_rsa_key"
|
|
|
|
];
|
|
|
|
};
|
2021-04-10 13:25:43 -07:00
|
|
|
|
2021-04-07 14:03:52 -07:00
|
|
|
environment.etc = {
|
|
|
|
nixos.source = "/state/nixos";
|
|
|
|
adjtime.source = "/state/etc/adjtime";
|
|
|
|
NIXOS.source = "/state/etc/NIXOS";
|
|
|
|
machine-id.source = "/state/etc/machine-id";
|
|
|
|
"host-config.nix".source = "/state/etc/host-config.nix";
|
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "20.09";
|
|
|
|
|
|
|
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
|
|
|
${pkgs.zfs}/bin/zfs rollback -r zroot/transient/root@blank
|
|
|
|
'';
|
|
|
|
|
|
|
|
security.sudo.extraConfig = ''
|
|
|
|
# rollback results in sudo lectures after each reboot
|
|
|
|
Defaults lecture = never
|
|
|
|
'';
|
|
|
|
|
2021-04-09 14:24:50 -07:00
|
|
|
networking = {
|
|
|
|
defaultGateway = {
|
|
|
|
address = "10.0.0.1";
|
|
|
|
interface = "intif0";
|
|
|
|
};
|
|
|
|
|
|
|
|
interfaces = {
|
|
|
|
intif0 = {
|
|
|
|
useDHCP = false;
|
|
|
|
ipv4.addresses = [{
|
|
|
|
address = primary-ip;
|
|
|
|
prefixLength = 22;
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-07 14:03:52 -07:00
|
|
|
services = {
|
|
|
|
openssh = {
|
|
|
|
hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/state/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/state/ssh/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = 4096;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|