Make config hardware-configuration agnostic

This commit is contained in:
Shaquille Soekhlal 2023-07-01 01:16:32 +02:00
parent c6f0f2c5d5
commit 2f3c5fe41e
3 changed files with 2 additions and 44 deletions

View File

@ -3,7 +3,6 @@
{ {
imports = imports =
[ [
<nixos-hardware/framework>
./hardware-configuration.nix ./hardware-configuration.nix
<home-manager/nixos> <home-manager/nixos>
./user-packages.nix ./user-packages.nix

View File

@ -1,43 +0,0 @@
# 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" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.resumeDevice = "/dev/disk/by-uuid/ab31e795-9965-4ee5-9160-e38839f195f3";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/43b375ab-3fe8-43b3-9be5-27c07b3d61f2";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-9c86820b-961f-4719-aba4-4c2208132828".device = "/dev/disk/by-uuid/9c86820b-961f-4719-aba4-4c2208132828";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/8D69-4583";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/ab31e795-9965-4ee5-9160-e38839f195f3"; }
];
# 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp170s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,7 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cp /etc/nixos/hardware-configuration.nix /tmp
rm /etc/nixos/*.nix rm /etc/nixos/*.nix
cp /tmp/hardware-configuration.nix /etc/nixos/
cp *.nix /etc/nixos/ cp *.nix /etc/nixos/
nixos-rebuild switch nixos-rebuild switch