From 5648ade47cdd49ddb9a368938d6d95d94f8e133f Mon Sep 17 00:00:00 2001 From: = Date: Mon, 11 Mar 2024 00:57:59 -0500 Subject: [PATCH] move hardware config into git repo --- .gitignore | 4 +- systems/_common/configuration.nix | 2 +- systems/gpdPocket3/hardware-configuration.nix | 41 +++++++++++++++++++ users/_common/home.nix | 6 ++- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 systems/gpdPocket3/hardware-configuration.nix diff --git a/.gitignore b/.gitignore index 69fc791..c3f3b97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -hardware-configuration.nix +# if in /etc/nixos don't grab defaults +./hardware-configuration.nix +./configuration.nix diff --git a/systems/_common/configuration.nix b/systems/_common/configuration.nix index 74265c5..cfa91e9 100644 --- a/systems/_common/configuration.nix +++ b/systems/_common/configuration.nix @@ -11,7 +11,7 @@ in [ # Include the results of the hardware scan. # Note we need to be in the /etc/nixos directory with this entire config repo for this relative path to work - ../../hardware-configuration.nix + ../${settings.hostname}/hardware-configuration.nix # home manager import (import "${home-manager}/nixos") ]; diff --git a/systems/gpdPocket3/hardware-configuration.nix b/systems/gpdPocket3/hardware-configuration.nix new file mode 100644 index 0000000..d37ed08 --- /dev/null +++ b/systems/gpdPocket3/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" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3A6C-BF60"; + fsType = "vfat"; + # umask=0077 ensures that only the owner (root) can read, write, or execute files on the EFI partition, while all other users are denied all permissions + options = [ "umask=0077" ]; + }; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e740e27d-13bf-468c-a5c6-fa06fe4ac3cd"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/91682eed-a01c-482d-8000-bd1222d4952a"; } + ]; + + # 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.enp175s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/users/_common/home.nix b/users/_common/home.nix index bada79c..6b45328 100644 --- a/users/_common/home.nix +++ b/users/_common/home.nix @@ -1,4 +1,8 @@ -{ pkgs, ... }: { +{ pkgs, settings, ... }: { home.stateVersion = "23.11"; + + home.username = settings.user.username; + home.homeDirectory = "/home/${settings.user.username}"; + programs.home-manager.enable = true; }