Update configuration.nix
This commit is contained in:
@@ -6,18 +6,15 @@ in
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
# Critical boot settings for physical hardware
|
||||
# Critical boot settings
|
||||
boot.loader.systemd-boot.enable = 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 = [
|
||||
"xhci_pci" "ehci_pci" "ohci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod"
|
||||
"usbhid" "hid_generic" "hid_apple" "hid_logitech" "hid_cherry"
|
||||
"uas" "nvme" "mmc_block" "rtsx_pci_sdmmc"
|
||||
"ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "usb_storage" "sd_mod" "sr_mod"
|
||||
];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
|
||||
networking.hostName = "nixos-usb";
|
||||
networking.networkmanager.enable = true;
|
||||
@@ -66,12 +63,13 @@ in
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Essential packages (without openssh)
|
||||
# Essential packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
vim
|
||||
curl
|
||||
wget
|
||||
openssh
|
||||
rsync
|
||||
pciutils
|
||||
usbutils
|
||||
@@ -96,7 +94,7 @@ in
|
||||
|
||||
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 = ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
set -e
|
||||
@@ -129,7 +127,7 @@ in
|
||||
|
||||
environment.etc."first-boot-setup.sh".mode = "0700";
|
||||
|
||||
# Auto-update script (unchanged)
|
||||
# Auto-update script
|
||||
environment.etc."update-nixos-config.sh".text = ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
set -e
|
||||
@@ -162,11 +160,18 @@ in
|
||||
|
||||
environment.etc."update-nixos-config.sh".mode = "0700";
|
||||
|
||||
# First boot service
|
||||
# First boot service with proper PATH
|
||||
systemd.services.first-boot-setup = {
|
||||
description = "One-time setup for cloned NixOS USB";
|
||||
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 = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
@@ -179,6 +184,7 @@ in
|
||||
systemd.services.nixos-git-update = {
|
||||
description = "Update NixOS from Git config repository";
|
||||
script = "/etc/update-nixos-config.sh";
|
||||
path = with pkgs; [ git nixos-install-tools coreutils ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
|
||||
Reference in New Issue
Block a user