about summary refs log tree commit diff
path: root/nixos/hardware.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-22T18·44+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-02-22T18·44+0000
commit695de12482044badda02088eea24c02598e18382 (patch)
treec179959f190ef26b87e1d5fcd57349cc189bb67d /nixos/hardware.nix
parentb53ae61db2228022cbe9883b539bd90eb07c96a8 (diff)
Incorporate NixOS configuration
TL;DR:
- Move /etc/nixos/configuration.nix -> //nixos/configuration.nix
- Move /etc/nixos/hardware-configuration.nix -> //nixos/harware.nix
- Document installer.nix
- Create rebuild.nix wrapper around `sudo nixos-rebuild switch`

Previously I sketched ideas for the configuration.nix for socrates -- also known
as flattop -- the inexpensive Acer laptop residing in my flat and stored that
configuration.nix file in briefcase. Now, however, I have successfully installed
NixOS onto socrates. By default NixOS saves the configuration.nix and
hardware-configuration.nix files to /etc/nixos/. I'm moving both of these files
into briefcase.

Because the command `nixos-rebuild` looks for the NixOS configuration
file in /etc/nixos, I wrote rebuild.nix, which creates a program to
call `nixos-rebuild` with the new location of my configuration.nix.
Diffstat (limited to 'nixos/hardware.nix')
-rw-r--r--nixos/hardware.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/hardware.nix b/nixos/hardware.nix
new file mode 100644
index 000000000000..dde14eb1e627
--- /dev/null
+++ b/nixos/hardware.nix
@@ -0,0 +1,30 @@
+# 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, ... }:
+
+{
+  imports =
+    [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
+    ];
+
+  boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-intel" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/aadf1a77-1e98-4b5f-8e74-abf8e77bda34";
+      fsType = "ext4";
+    };
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/1613-35B9";
+      fsType = "vfat";
+    };
+
+  swapDevices = [ ];
+
+  nix.maxJobs = lib.mkDefault 2;
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+}