From 79d460d08f565835e7aea65164231b6b23d6c8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Sun, 1 Jun 2025 16:57:37 +0300 Subject: [PATCH] Finalize lithium flakes test --- flake.nix | 7 ++-- hosts/lithium/configuration.nix | 8 +++-- hosts/lithium/hardware-configuration.nix | 45 ++++++++++++++++++++++++ personal/desktop.nix | 2 +- personal/programs/i3.nix | 2 +- shared/base.nix | 11 +++--- 6 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 hosts/lithium/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index e1525bb..f88e84e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - nixvim.url = "github:nix-community/nixvim/nixos-25.05"; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -19,7 +22,7 @@ nixpkgs.lib.nameValuePair host ( nixpkgs.lib.nixosSystem { specialArgs = { - inherit nixpkgs; + nixpkgs-flake = nixpkgs; inherit nixvim; }; system = "x86_64-linux"; diff --git a/hosts/lithium/configuration.nix b/hosts/lithium/configuration.nix index e1e3d75..53a9323 100644 --- a/hosts/lithium/configuration.nix +++ b/hosts/lithium/configuration.nix @@ -1,11 +1,13 @@ { lib, ... }: { - system.stateVersion = 24.05; - networking.hostName = "lithium"; + # MANUAL STATE + system.stateVersion = "24.05"; + boot.kernelParams = [ "resume_offset=39292928" ]; + # MANUAL STATE + networking.hostName = "lithium"; custom.home_wg_suffix = "3"; system.autoUpgrade.allowReboot = lib.mkForce false; - # boot.kernelParams = [ "resume_offset=39292928" ]; imports = [ ../../shared/base.nix diff --git a/hosts/lithium/hardware-configuration.nix b/hosts/lithium/hardware-configuration.nix new file mode 100644 index 0000000..0eac55a --- /dev/null +++ b/hosts/lithium/hardware-configuration.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + modulesPath, + ... +}: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/b43fe465-80e9-48d4-a4be-1113c917330e"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/4dc2fd8c-71da-4b95-91d5-7a118387172b"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D8BB-B91A"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/personal/desktop.nix b/personal/desktop.nix index 9227521..9385863 100644 --- a/personal/desktop.nix +++ b/personal/desktop.nix @@ -22,7 +22,7 @@ displayManager = { lightdm.enable = true; sessionCommands = ''${pkgs.xorg.xrdb}/bin/xrdb -merge < ${ - (import ./embedded/xresources.nix { inherit pkgs; }) + (import ./programs/embedded/xresources.nix { inherit pkgs; }) }''; }; }; diff --git a/personal/programs/i3.nix b/personal/programs/i3.nix index a6f3d69..3806dda 100644 --- a/personal/programs/i3.nix +++ b/personal/programs/i3.nix @@ -22,7 +22,7 @@ xserver.windowManager.i3 = { enable = true; extraPackages = [ ]; - configFile = "${(import ./embedded/i3.nix { inherit pkgs; })}"; + configFile = "${(import ./embedded/i3-conf.nix { inherit pkgs; })}"; }; }; } diff --git a/shared/base.nix b/shared/base.nix index b81ab93..6e5ba7a 100644 --- a/shared/base.nix +++ b/shared/base.nix @@ -1,7 +1,7 @@ { pkgs, lib, - nixpkgs, + nixpkgs-flake, ... }: { @@ -134,7 +134,9 @@ ######################################## Housekeeping ########################################### system.autoUpgrade = { enable = true; - flake = "git+https://gitea.sinerva.eu/VSinerva/nixos-conf.git?ref=main&shallow=1"; + + #TODO Change to main once everything gets switched over to flakes + flake = "git+https://gitea.sinerva.eu/VSinerva/nixos-conf.git?ref=clean_slate&shallow=1"; dates = "04:00"; randomizedDelaySec = "30min"; allowReboot = true; @@ -144,9 +146,10 @@ }; }; + nixpkgs.config.allowUnfree = true; nix = { registry = { - nixpkgs.flake = nixpkgs; + nixpkgs.flake = nixpkgs-flake; }; settings = { experimental-features = [ @@ -164,8 +167,6 @@ }; ######################################## Misc. ################################################## - nixpkgs.config.allowUnfree = true; - networking = { # Easiest to use and most distros use this by default. networkmanager = {