nixos/mods/host.nix
2026-10-28 13:28:36 +09:00

73 lines
1.8 KiB
Nix

{ config, pkgs, ... }: {
boot = {
extraModulePackages = [ config.boot.kernelPackages.amneziawg ];
kernelModules = [ "amneziawg" ];
loader.limine.secureBoot.enable = true;
};
fileSystems."/".device = "/dev/mapper/root";
imports = [
../common.nix
./fs.nix
./pxeboot.nix
./vps-init.nix
];
networking = {
networkmanager = {
dns = "dnsmasq";
ensureProfiles = {
environmentFiles = [ config.sops.secrets.wifi-env.path ];
profiles.home-wifi = {
connection = {
id = "home-wifi";
type = "wifi";
};
ipv4 = {
gateway = "10.1.0.1";
method = "manual";
};
ipv6 = {
gateway = "fc01::1";
method = "manual";
};
wifi-security = {
key-mgmt = "sae";
psk = "$BOGALE_5_PSK";
};
wifi.ssid = "bogale_5";
};
};
};
wg-quick.interfaces.awg0.type = "amneziawg";
};
services.dnsmasq = {
enable = true;
settings = {
bogus-priv = true;
cache-size = 4096;
domain-needed = true;
no-resolv = true;
server = [
"1.0.0.2"
"1.1.1.2"
"2606:4700:4700::1002"
"2606:4700:4700::1112"
];
};
};
sops = {
age.keyFile = "/var/lib/sops-nix/key.txt";
defaultSopsFile = ../.secrets.yaml;
secrets = {
awg-obf = { };
root-passwd = { };
wifi-env = { };
};
};
systemd.tmpfiles.rules = [
"L /root/backup/base/nixos - - - - /etc/nixos"
"L /root/backup/base/sbctl - - - - /var/lib/sbctl"
"L /root/backup/base/sops-nix - - - - /var/lib/sops-nix"
"d /root/backup/base"
];
users.users.root.hashedPasswordFile = config.sops.secrets.root-passwd.path;
}