From e9bd003401ee5e069420b03d7607fef7045add1b Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sat, 26 Jul 2025 23:35:29 +0200 Subject: [PATCH] feat: adds `zinnia` host --- flake.nix | 11 +++++ hosts/zinnia/default.nix | 61 +++++++++++++++++++++++++ hosts/zinnia/hardware-configuration.nix | 45 ++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 hosts/zinnia/default.nix create mode 100644 hosts/zinnia/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 854257d..34b2afc 100644 --- a/flake.nix +++ b/flake.nix @@ -111,6 +111,17 @@ inherit self inputs username; }; }; + zinnia = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + (import ./hosts/zinnia) + agenix.nixosModules.default + ]; + specialArgs = { + host = "zinnia"; + inherit self inputs username; + }; + }; }; }; } diff --git a/hosts/zinnia/default.nix b/hosts/zinnia/default.nix new file mode 100644 index 0000000..f7ba60b --- /dev/null +++ b/hosts/zinnia/default.nix @@ -0,0 +1,61 @@ +{ + lib, + config, + pkgs, + ... +}: + +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ./../../modules/services/tailscale.nix + ./../../modules/services/mpd.nix + ]; + + liv = { + laptop.enable = true; + gui.enable = true; + desktop.enable = false; + creative.enable = false; + amdgpu.enable = false; + }; + + services = { + vnstat.enable = true; + }; + + networking.hostName = "zinnia"; + + powerManagement = { + enable = true; + powertop.enable = true; + cpuFreqGovernor = lib.mkDefault "ondemand"; + }; + + boot.initrd.luks.devices."luks-59aff546-c2c2-4697-a5f2-40a12f259f5a".device = + "/dev/disk/by-uuid/59aff546-c2c2-4697-a5f2-40a12f259f5a"; + + boot = { + kernelParams = [ + "mem_sleep_default=deep" + ]; + kernelModules = [ "acpi_call" ]; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + systemd-boot.configurationLimit = 10; + }; + extraModulePackages = + with config.boot.kernelPackages; + [ + acpi_call + cpupower + ] + ++ [ pkgs.cpupower-gui ]; + }; + + time.timeZone = "Europe/Amsterdam"; + nixpkgs.config.allowUnfree = true; +} diff --git a/hosts/zinnia/hardware-configuration.nix b/hosts/zinnia/hardware-configuration.nix new file mode 100644 index 0000000..eb9890f --- /dev/null +++ b/hosts/zinnia/hardware-configuration.nix @@ -0,0 +1,45 @@ +# 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 + "/hardware/network/broadcom-43xx.nix") + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c9f69c59-2014-41de-b169-53c38c7d9f15"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-ad0e2f90-490d-4a2b-8484-8d18bc9bdff5".device = "/dev/disk/by-uuid/ad0e2f90-490d-4a2b-8484-8d18bc9bdff5"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/0AEC-87AF"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/18a2707c-9fe0-4dc4-a15f-6908cc34f26e"; } + ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s20f0u2c2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}