From df628838bfdb53f73e2a57f63c116d665114ea0e Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 20 Feb 2023 20:38:49 +0100 Subject: [PATCH] feat: add host zackbiene --- hosts/zackbiene/default.nix | 41 +++++++++++++++++++++++++++++++++++++ hosts/zackbiene/fs.nix | 16 +++++++++++++++ hosts/zackbiene/meta.nix | 7 +++++++ hosts/zackbiene/net.nix | 15 ++++++++++++++ modules/core/default.nix | 3 +++ 5 files changed, 82 insertions(+) create mode 100644 hosts/zackbiene/default.nix create mode 100644 hosts/zackbiene/fs.nix create mode 100644 hosts/zackbiene/meta.nix create mode 100644 hosts/zackbiene/net.nix diff --git a/hosts/zackbiene/default.nix b/hosts/zackbiene/default.nix new file mode 100644 index 0000000..c44bfbd --- /dev/null +++ b/hosts/zackbiene/default.nix @@ -0,0 +1,41 @@ +{ + config, + nixos-hardware, + pkgs, + ... +}: { + imports = [ + nixos-hardware.common-pc-ssd + + ../../modules/core + ../../modules/efi.nix + ../../modules/zfs.nix + + ../../users/root + + ./fs.nix + ./net.nix + ]; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + + powerManagement.cpuFreqGovernor = "powersave"; + services.home-assistant = { + enable = true; + extraComponents = ["default_config" "met" "zha"]; + openFirewall = true; + config = { + default_config = {}; + met = {}; + }; + }; + #networking.firewall.allowedTCPPorts = [1883]; + #services.zigbee2mqtt.enable = true; + #services.zigbee2mqtt.settings = { + # homeassistant = config.services.home-assistant.enable; + # permit_join = true; + # serial = { + # port = "/dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0"; + # }; + #}; +} diff --git a/hosts/zackbiene/fs.nix b/hosts/zackbiene/fs.nix new file mode 100644 index 0000000..92d8800 --- /dev/null +++ b/hosts/zackbiene/fs.nix @@ -0,0 +1,16 @@ +{ + fileSystems = { + "/" = { + device = "rpool/root/nixos"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/TODO"; + fsType = "vfat"; + }; + }; + + swapDevices = []; +} diff --git a/hosts/zackbiene/meta.nix b/hosts/zackbiene/meta.nix new file mode 100644 index 0000000..817f8d4 --- /dev/null +++ b/hosts/zackbiene/meta.nix @@ -0,0 +1,7 @@ +{ + type = "nixos"; + system = "aarch64-linux"; + physical_connections = { + "10-lan1" = "LAN 1"; + }; +} diff --git a/hosts/zackbiene/net.nix b/hosts/zackbiene/net.nix new file mode 100644 index 0000000..efeabb9 --- /dev/null +++ b/hosts/zackbiene/net.nix @@ -0,0 +1,15 @@ +{ + networking = { + hostId = "68a7bba3"; + }; + + systemd.network.networks = { + "10-lan1" = { + DHCP = "yes"; + matchConfig.MACAddress = "TODO"; + networkConfig.IPv6PrivacyExtensions = "kernel"; + dhcpV4Config.RouteMetric = 10; + dhcpV6Config.RouteMetric = 10; + }; + }; +} diff --git a/modules/core/default.nix b/modules/core/default.nix index 48fedbd..7769479 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -89,6 +89,9 @@ in { }; programs = { + # Required even when using home-manager's zsh module since the /etc/profile load order + # is partly controlled by this. See nix-community/home-manager#3681. + zsh.enable = true; git = { enable = true; config = {