From 7da48159dc95e4991d1af5c4c5ddbdf7ff55632e Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 19 Dec 2024 15:39:23 +0100 Subject: [PATCH] feat: adds configuration for ichiyo --- hosts/ichiyo/default.nix | 36 +++++++++++++++++++++++++ hosts/ichiyo/hardware-configuration.nix | 36 +++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 hosts/ichiyo/default.nix create mode 100644 hosts/ichiyo/hardware-configuration.nix diff --git a/hosts/ichiyo/default.nix b/hosts/ichiyo/default.nix new file mode 100644 index 0000000..c38c5e8 --- /dev/null +++ b/hosts/ichiyo/default.nix @@ -0,0 +1,36 @@ +{ lib, inputs, pkgs, config, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ]; + + powerManagement = { + enable = true; + # powertop.enable = true; + cpuFreqGovernor = lib.mkDefault "ondemand"; + }; + + liv.laptop.enable = true; + + # Bootloader stuff + boot.loader.grub.enable = lib.mkForce true; + boot.loader.grub.device = lib.mkForce "/dev/sda"; + boot.loader.grub.useOSProber = lib.mkForce true; + boot.initrd.secrets = { + "/crypto_keyfile.bin" = null; + }; + boot.loader.grub.enableCryptodisk = lib.mkForce true; + boot.initrd.luks.devices."luks-729500c5-557b-45c8-ab3f-5c365db28284".keyFile = lib.mkForce "/crypto_keyfile.bin"; + + networking.hostName = "ichiyo"; + + boot = { + extraModulePackages = with config.boot.kernelPackages; + [ + acpi_call + cpupower + ] + ++ [pkgs.cpupower-gui]; + }; +} diff --git a/hosts/ichiyo/hardware-configuration.nix b/hosts/ichiyo/hardware-configuration.nix new file mode 100644 index 0000000..96cba70 --- /dev/null +++ b/hosts/ichiyo/hardware-configuration.nix @@ -0,0 +1,36 @@ +# 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" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/348a526e-113e-4b62-b54e-b0bf9ad101a2"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-729500c5-557b-45c8-ab3f-5c365db28284".device = "/dev/disk/by-uuid/729500c5-557b-45c8-ab3f-5c365db28284"; + + 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.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s20u4i6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}