From f7c36a91b83acd0e3e0f3d0fa23382d5d65c4067 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Mon, 20 Oct 2025 12:14:46 +0200 Subject: [PATCH] feat: adds `sunflower` host --- flake.nix | 10 +++ hosts/sunflower/default.nix | 79 ++++++++++++++++++++++ hosts/sunflower/hardware-configuration.nix | 37 ++++++++++ modules/services/sunflower.nix | 13 ++++ 4 files changed, 139 insertions(+) create mode 100644 hosts/sunflower/default.nix create mode 100644 hosts/sunflower/hardware-configuration.nix create mode 100644 modules/services/sunflower.nix diff --git a/flake.nix b/flake.nix index 74cece5..9bc7784 100644 --- a/flake.nix +++ b/flake.nix @@ -148,6 +148,16 @@ inherit self inputs username; }; }; + sunflower = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + (import ./hosts/sunflower) + ]; + specialArgs = { + host = "sunflower"; + inherit self inputs username; + }; + }; }; }; } diff --git a/hosts/sunflower/default.nix b/hosts/sunflower/default.nix new file mode 100644 index 0000000..2289ba5 --- /dev/null +++ b/hosts/sunflower/default.nix @@ -0,0 +1,79 @@ +{ + lib, + pkgs, + config, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ./variables.nix + ./../../modules/core/default.server.nix + ./../../modules/services/sunflower.nix + ]; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + liv.server.enable = true; + + nixpkgs.config.permittedInsecurePackages = [ + "jitsi-meet-1.0.8043" + "olm-3.2.16" + ]; + + networking = { + hostName = "sunflower"; + firewall = { + allowedTCPPorts = [ + 5201 + ]; + allowedUDPPorts = [ + 5201 + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + kitty.terminfo + zfs + ]; + + boot = { + loader = { + grub = { + enable = true; + device = "/dev/sdb"; + useOSProber = true; + }; + }; + supportedFilesystems = [ "zfs" ]; + }; + + networking.hostId = "6b57f171"; + + #services.zfs = { + # autoScrub.enable = true; + # autoScrub.interval = "weekly"; + # trim.enable = true; + #}; + + #boot.zfs.extraPools = [ + # "spinners" + #]; + + # fileSystems = { + # "/spinners/rootvol" = { + # device = "spinners/rootvol"; + # fsType = "zfs"; + # }; + # "/spinners/ahwx" = { + # device = "spinners/ahwx"; + # fsType = "zfs"; + # }; + # "/spinners/violet" = { + # device = "spinners/violet"; + # fsType = "zfs"; + # }; + # }; +} diff --git a/hosts/sunflower/hardware-configuration.nix b/hosts/sunflower/hardware-configuration.nix new file mode 100644 index 0000000..ba999f1 --- /dev/null +++ b/hosts/sunflower/hardware-configuration.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "mpt3sas" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/208edd71-e6cd-41ee-89d3-163c3f57ad2f"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.ens7f0.useDHCP = lib.mkDefault true; + # networking.interfaces.ens7f1.useDHCP = lib.mkDefault true; + # networking.interfaces.ens7f2.useDHCP = lib.mkDefault true; + # networking.interfaces.ens7f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/services/sunflower.nix b/modules/services/sunflower.nix new file mode 100644 index 0000000..c243a22 --- /dev/null +++ b/modules/services/sunflower.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = + [ (import ./docker.nix) ] + # ++ [ (import ./immich.nix) ] + # ++ [ (import ./nextcloud.nix) ] + # ++ [ (import ./home-assistant.nix) ] + ++ [ (import ./monitoring.nix) ] + ++ [ (import ./smart-monitoring.nix) ] + ++ [ (import ./tailscale.nix) ] + # ++ [ (import ./nfs.nix) ] + ++ [ (import ./hd-idle.nix) ]; +}