From dd42548b1b3bf6eee6f9438b8cc77c4cb80dd0b0 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sun, 26 Oct 2025 01:07:55 +0200 Subject: [PATCH] feat: adds new host configuration (`imilia`) --- hosts/imilia/default.nix | 77 +++++++++++++++++++++++++ hosts/imilia/hardware-configuration.nix | 41 +++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 hosts/imilia/default.nix create mode 100644 hosts/imilia/hardware-configuration.nix diff --git a/hosts/imilia/default.nix b/hosts/imilia/default.nix new file mode 100644 index 0000000..9cd047f --- /dev/null +++ b/hosts/imilia/default.nix @@ -0,0 +1,77 @@ +{ + inputs, + pkgs, + config, + lib, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ./../../modules/core/virtualization.nix + ./../../modules/services/tailscale.nix + ./../../modules/services/mpd.nix + ./../../modules/services/smart-monitoring.nix + ]; + + # install some system-utilities; set hosts to be editable by the user. + environment = { + systemPackages = with pkgs; [ + fwupd + fw-ectool + ]; + etc.hosts.mode = "0700"; + }; + + liv = { + laptop.enable = true; + desktop.enable = false; + creative.enable = true; + amdgpu.enable = false; + nvidia.enable = true; + gui.enable = true; + }; + + services = { + vnstat.enable = true; + hardware.bolt.enable = true; + }; + + # Disable light sensors and accelerometers as they are not used and consume extra battery + hardware.sensor.iio.enable = lib.mkForce false; + + networking = { + hostName = "imilia"; + # networkmanager.ethernet.macAddress = "13:37:6a:8a:ed:a4"; + }; + + powerManagement = { + enable = true; + # powertop.enable = true; + cpuFreqGovernor = lib.mkDefault "performance"; + }; + + services.logind.lidSwitchDocked = "ignore"; + services.logind.lidSwitch = "ignore"; + boot = { + 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 + v4l2loopback + ] + ++ [ pkgs.cpupower-gui ]; + extraModprobeConfig = '' + options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 + ''; + }; +} diff --git a/hosts/imilia/hardware-configuration.nix b/hosts/imilia/hardware-configuration.nix new file mode 100644 index 0000000..93412bf --- /dev/null +++ b/hosts/imilia/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/5ce2c98c-7212-42dc-b76b-ad83477b0f83"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-39d908a0-7163-4099-a9c9-846272fef7eb".device = "/dev/disk/by-uuid/39d908a0-7163-4099-a9c9-846272fef7eb"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/44F2-2D87"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}