diff options
| author | Joe Mou <dev@mou.fo> | 2023-09-28 00:53:11 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2023-09-29 17:06:04 -0400 |
| commit | 8391bd18f4f7cd80095c5f27abdf034db0ff5f3f (patch) | |
| tree | 26e20ff374efa2d0f6eaba9590d2d5708037d1ef /hostnix/weebnix/system.nix | |
| parent | 2cf7ccc1b157167add591d1e1b1e488cec618646 (diff) | |
Refactor system and dyndns modules
Diffstat (limited to 'hostnix/weebnix/system.nix')
| -rw-r--r-- | hostnix/weebnix/system.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/hostnix/weebnix/system.nix b/hostnix/weebnix/system.nix new file mode 100644 index 0000000..94dca6d --- /dev/null +++ b/hostnix/weebnix/system.nix @@ -0,0 +1,45 @@ +{ pkgs, lib, ... }: + +{ + boot.loader.systemd-boot.enable = true; + # Raspberry Pi has no NVRAM. + boot.loader.efi.canTouchEfiVariables = false; + + boot.kernelPackages = pkgs.linuxPackages_rpi4; + # https://github.com/NixOS/nixpkgs/issues/122130#issuecomment-1568815007 + # It's unclear if these are strictly necessary with the downstream kernel, + # but let's leave them in to keep working with mainline. + boot.initrd.availableKernelModules = [ "uas" "pcie-brcmstb" "reset-raspberrypi" ]; + + networking.hostName = "weebnix"; + networking.domain = "mou.fo"; + # TODO secrets management or switch to wired + networking.wireless = { + enable = true; + networks."oldschool".psk = builtins.readFile /var/lib/secrets/oldschool.wpa-psk; + }; + + systemd.network.enable = true; + networking.dhcpcd.enable = false; + networking.tempAddresses = "disabled"; + + systemd.network.networks = let + default = { + networkConfig = { + DHCP = "yes"; + MulticastDNS = "yes"; + }; + ipv6AcceptRAConfig.Token = "prefixstable"; # RFC 7217 + }; + in { + "10-wlan" = lib.recursiveUpdate default { + matchConfig.Name = "wlan0"; + }; + "10-eth" = lib.recursiveUpdate default { + matchConfig.Name = "end0"; + linkConfig.RequiredForOnline = "no"; + }; + }; + + time.timeZone = "America/New_York"; +} |
