Update configuration.nix

This commit is contained in:
ska
2025-12-19 23:07:03 +00:00
parent d485e12556
commit 83aa0b3c90

View File

@@ -6,18 +6,15 @@ in
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
# Critical boot settings for physical hardware # Critical boot settings
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Generic kernel modules for maximum hardware compatibility # Keep QEMU profile for testing, but make it work on physical hardware too
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "ehci_pci" "ohci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "usb_storage" "sd_mod" "sr_mod"
"usbhid" "hid_generic" "hid_apple" "hid_logitech" "hid_cherry"
"uas" "nvme" "mmc_block" "rtsx_pci_sdmmc"
]; ];
boot.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
networking.hostName = "nixos-usb"; networking.hostName = "nixos-usb";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@@ -66,12 +63,13 @@ in
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Essential packages (without openssh) # Essential packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
git git
vim vim
curl curl
wget wget
openssh
rsync rsync
pciutils pciutils
usbutils usbutils
@@ -96,7 +94,7 @@ in
programs.firefox.enable = true; programs.firefox.enable = true;
# First-boot setup script without SSH components # First-boot setup script with proper PATH setup
environment.etc."first-boot-setup.sh".text = '' environment.etc."first-boot-setup.sh".text = ''
#!/run/current-system/sw/bin/bash #!/run/current-system/sw/bin/bash
set -e set -e
@@ -129,7 +127,7 @@ in
environment.etc."first-boot-setup.sh".mode = "0700"; environment.etc."first-boot-setup.sh".mode = "0700";
# Auto-update script (unchanged) # Auto-update script
environment.etc."update-nixos-config.sh".text = '' environment.etc."update-nixos-config.sh".text = ''
#!/run/current-system/sw/bin/bash #!/run/current-system/sw/bin/bash
set -e set -e
@@ -162,11 +160,18 @@ in
environment.etc."update-nixos-config.sh".mode = "0700"; environment.etc."update-nixos-config.sh".mode = "0700";
# First boot service # First boot service with proper PATH
systemd.services.first-boot-setup = { systemd.services.first-boot-setup = {
description = "One-time setup for cloned NixOS USB"; description = "One-time setup for cloned NixOS USB";
script = "/etc/first-boot-setup.sh"; script = "/etc/first-boot-setup.sh";
path = with pkgs; [ systemd git ]; path = with pkgs; [
systemd
git
nixos-install-tools # Provides nixos-generate-config
coreutils
findutils
glibc
];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
@@ -179,6 +184,7 @@ in
systemd.services.nixos-git-update = { systemd.services.nixos-git-update = {
description = "Update NixOS from Git config repository"; description = "Update NixOS from Git config repository";
script = "/etc/update-nixos-config.sh"; script = "/etc/update-nixos-config.sh";
path = with pkgs; [ git nixos-install-tools coreutils ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "root"; User = "root";