From 7c51db83594ef42d7631d5c2e085ed874476957e Mon Sep 17 00:00:00 2001 From: Spectre Date: Sun, 16 Mar 2025 00:08:37 +0100 Subject: [PATCH] lilith-pad --- flake.nix | 25 ++++++-------- hosts/lilith-pad/hardware-configuration.nix | 38 +++++++++++++++++++++ hosts/lilith-pc/config.nix | 3 -- hosts/lilith-pc/default.nix | 12 +++---- system/core/default.nix | 3 +- system/core/nix.nix | 6 +--- 6 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 hosts/lilith-pad/hardware-configuration.nix delete mode 100644 hosts/lilith-pc/config.nix diff --git a/flake.nix b/flake.nix index 268788a4..52e2479b 100644 --- a/flake.nix +++ b/flake.nix @@ -56,21 +56,17 @@ } @ inputs: let inherit (nixpkgs) lib; - systemFromHardwareConf = - hostname: - let - hardware = import ./hosts/${hostname}/hardware-configuration.nix; - args = builtins.functionArgs hardware // { lib.mkDefault = lib.id; }; - in + systemFromHardwareConf = hostname: let + hardware = import ./hosts/${hostname}/hardware-configuration.nix; + args = builtins.functionArgs hardware // {lib.mkDefault = lib.id;}; + in (hardware args).nixpkgs.hostPlatform; - importNixpkgs = system: nixpkgs: - let - config.allowUnfreePredicate = - pkg: - builtins.elem (lib.getName pkg) (import ./unfree.nix).allowed; - in - import nixpkgs { inherit system config; }; + importNixpkgs = system: nixpkgs: let + config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) (import ./unfree.nix).allowed; + in + import nixpkgs {inherit system config;}; makeHost = host: system: lib.nixosSystem { @@ -83,14 +79,13 @@ ./system {networking.hostName = host;} - ./home + ./home ]; }; in { nixosConfigurations = lib.pipe ./hosts [ builtins.readDir (lib.filterAttrs (_: type: type == "directory")) - # (lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix)) (builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name))) ]; }; diff --git a/hosts/lilith-pad/hardware-configuration.nix b/hosts/lilith-pad/hardware-configuration.nix new file mode 100644 index 00000000..5df571e2 --- /dev/null +++ b/hosts/lilith-pad/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/080fa116-424e-4079-a2a6-658a230e2721"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/40E8-A12D"; + fsType = "vfat"; + }; + + 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.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/lilith-pc/config.nix b/hosts/lilith-pc/config.nix deleted file mode 100644 index efab0596..00000000 --- a/hosts/lilith-pc/config.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - system = "x86_64-linux"; -} diff --git a/hosts/lilith-pc/default.nix b/hosts/lilith-pc/default.nix index d257187b..b3e714d0 100644 --- a/hosts/lilith-pc/default.nix +++ b/hosts/lilith-pc/default.nix @@ -1,22 +1,20 @@ -{ config, lib, ...}: { - +{lib, ...}: let + mkHostOverride = lib.mkOverride 75; +in { system.stateVersion = "24.11"; desktop.enable = true; gaming.enable = true; nfs.client.enable = true; auto_styling.enable = true; - - home-manager.users."lilith".wayland.windowManager.hyprland.settings = { - input.kb_layout = lib.mkForce "us"; + input.kb_layout = mkHostOverride "us"; - monitor = lib.mkForce [ + monitor = mkHostOverride [ "DP-3, 3840x2160, 0x0, 1.5" "DP-4, 2560x1440, 2560x0, 1" ",preferred,auto,1" ]; }; } - diff --git a/system/core/default.nix b/system/core/default.nix index cc60476a..151cf84f 100644 --- a/system/core/default.nix +++ b/system/core/default.nix @@ -1,4 +1,4 @@ -{ zen-browser, ...}: { +{...}: { imports = [ ./audio.nix ./bluetooth.nix @@ -15,6 +15,5 @@ ./syncthing.nix ./users.nix ./zsh.nix - zen-browser.nixosModules.zen-browser ]; } diff --git a/system/core/nix.nix b/system/core/nix.nix index ccadc8ca..870b737e 100644 --- a/system/core/nix.nix +++ b/system/core/nix.nix @@ -1,4 +1,4 @@ -{ lib, ...}: { +{...}: { nix = { gc = { automatic = true; @@ -12,8 +12,4 @@ trusted-users = ["root" "@wheel"]; }; }; - - # nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (lib.getName pkg) [ - # "steam" - # ]); }