Migrate global configuration to and expand home
- Move lots of system config to home (browser, editors, etc.)
- Improve catppuccin support (kitty, cursors, etc.)
- Improve overall theme (fonts, icons in kitty)
- Add coded's system hardware configuration ("shorthair")
- Add the ed editor
- Split minion's system hardware configuration ("greylag") into several files
- Improve shell support (aliases, useful packages, replacements, etc.)
Change-Id: Ie6d40f809b2662268a9a6fa8b241641bbfef9442
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/383
Tested-by: Skyler Grey <minion@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/systems/x86_64-linux/greylag/boot/filesystems/default.nix b/systems/x86_64-linux/greylag/boot/filesystems/default.nix
new file mode 100644
index 0000000..4890eb5
--- /dev/null
+++ b/systems/x86_64-linux/greylag/boot/filesystems/default.nix
@@ -0,0 +1,71 @@
+{ lib, ... }:
+{
+ fileSystems =
+ (lib.mapAttrs
+ (_: share_name: {
+ device = "/dev/disk/by-label/BTRFS0";
+ fsType = "btrfs";
+ options = [
+ "subvol=shared/${share_name}"
+ "compress=zstd:1"
+ ];
+ })
+ {
+ "/home/minion/Code" = "@Code";
+ "/var/lib/containers" = "@containers";
+ "/etc/NetworkManager" = "@NetworkManager";
+ "/home/minion/.local/share/containers/storage" = "@personal-containers";
+ "/home/minion/.gtimelog" = "@gtimelog";
+ "/home/minion/Documents" = "@documents";
+ }
+ )
+ // {
+ "/mnt" = {
+ device = "/dev/mapper/key";
+ fsType = "ext4";
+ };
+
+ "/" = {
+ device = "/dev/disk/by-label/BTRFS0";
+ fsType = "btrfs";
+ options = [
+ "subvol=@nixos"
+ "compress=zstd:1"
+ ];
+ };
+
+ "/var" = {
+ device = "/dev/disk/by-label/BTRFS0";
+ fsType = "btrfs";
+ options = [
+ "subvol=@nixos-var"
+ "compress=zstd:1"
+ ];
+ };
+
+ "/home" = {
+ device = "/dev/disk/by-label/BTRFS0";
+ fsType = "btrfs";
+ options = [
+ "subvol=@nixos-home"
+ "compress=zstd:1"
+ ];
+ };
+
+ "/nix" = {
+ device = "/dev/disk/by-label/BTRFS0";
+ fsType = "btrfs";
+ options = [
+ "subvol=@nixos-nix"
+ "compress=zstd:1"
+ ];
+ };
+
+ "/boot" = {
+ device = "/dev/disk/by-label/ESP";
+ fsType = "vfat";
+ };
+ };
+
+ swapDevices = [ ];
+}
diff --git a/systems/x86_64-linux/greylag/boot/initrd/default.nix b/systems/x86_64-linux/greylag/boot/initrd/default.nix
new file mode 100644
index 0000000..0ef8a71
--- /dev/null
+++ b/systems/x86_64-linux/greylag/boot/initrd/default.nix
@@ -0,0 +1,30 @@
+{ ... }:
+{
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ boot.initrd.availableKernelModules = [
+ "xhci_pci"
+ "thunderbolt"
+ "nvme"
+ "uas"
+ "usbhid"
+ "sd_mod"
+ "ext4"
+ ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ boot.initrd.systemd.enable = true; # needed for the way we do our YubiKey
+ boot.initrd.luks.devices."key".device = "/dev/disk/by-label/KEY";
+
+ boot.initrd.luks.devices."luks-expansion0" = {
+ device = "/dev/disk/by-label/EXPANSION0";
+ keyFile = "/key:/dev/mapper/key";
+ };
+ boot.initrd.luks.devices."luks-ssd0" = {
+ device = "/dev/disk/by-label/SSD0";
+ keyFile = "/key:/dev/mapper/key";
+ };
+}
diff --git a/systems/x86_64-linux/greylag/console/default.nix b/systems/x86_64-linux/greylag/console/default.nix
new file mode 100644
index 0000000..f629085
--- /dev/null
+++ b/systems/x86_64-linux/greylag/console/default.nix
@@ -0,0 +1,5 @@
+{ ... }:
+{
+ console.keyMap = "dvorak";
+ environment.pathsToLink = [ "/share/zsh" ];
+}
diff --git a/systems/x86_64-linux/greylag/cpu/default.nix b/systems/x86_64-linux/greylag/cpu/default.nix
new file mode 100644
index 0000000..589baa0
--- /dev/null
+++ b/systems/x86_64-linux/greylag/cpu/default.nix
@@ -0,0 +1,5 @@
+{ config, ... }:
+{
+ powerManagement.cpuFreqGovernor = "powersave";
+ hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
+}
diff --git a/systems/x86_64-linux/greylag/default.nix b/systems/x86_64-linux/greylag/default.nix
index 1d2532e..79563b3 100644
--- a/systems/x86_64-linux/greylag/default.nix
+++ b/systems/x86_64-linux/greylag/default.nix
@@ -1,123 +1,10 @@
+{ ... }:
{
- lib,
- pkgs,
- inputs,
- system,
- target,
- format,
- virtual,
- systems,
- config,
- ...
-}:
-{
- networking.hostName = "greylag";
- boot.loader.systemd-boot.enable = true;
- boot.loader.efi.canTouchEfiVariables = true;
-
- boot.initrd.availableKernelModules = [
- "xhci_pci"
- "thunderbolt"
- "nvme"
- "uas"
- "usbhid"
- "sd_mod"
- "ext4"
+ imports = [
+ ./boot/filesystems
+ ./boot/initrd
+ ./console
+ ./cpu
+ ./networking
];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-intel" ];
- boot.extraModulePackages = [ ];
-
- boot.initrd.systemd.enable = true; # needed for the way we do our YubiKey
- boot.initrd.luks.devices."key".device = "/dev/disk/by-label/KEY";
-
- boot.initrd.luks.devices."luks-expansion0" = {
- device = "/dev/disk/by-label/EXPANSION0";
- keyFile = "/key:/dev/mapper/key";
- };
- boot.initrd.luks.devices."luks-ssd0" = {
- device = "/dev/disk/by-label/SSD0";
- keyFile = "/key:/dev/mapper/key";
- };
-
- fileSystems =
- (lib.mapAttrs
- (_: share_name: {
- device = "/dev/disk/by-label/BTRFS0";
- fsType = "btrfs";
- options = [
- "subvol=shared/${share_name}"
- "compress=zstd:1"
- ];
- })
- {
- "/home/minion/Code" = "@Code";
- "/var/lib/containers" = "@containers";
- "/etc/NetworkManager" = "@NetworkManager";
- "/home/minion/.local/share/containers/storage" = "@personal-containers";
- "/home/minion/.gtimelog" = "@gtimelog";
- "/home/minion/Documents" = "@documents";
- }
- )
- // {
- "/mnt" = {
- device = "/dev/mapper/key";
- fsType = "ext4";
- };
-
- "/" = {
- device = "/dev/disk/by-label/BTRFS0";
- fsType = "btrfs";
- options = [
- "subvol=@nixos"
- "compress=zstd:1"
- ];
- };
-
- "/var" = {
- device = "/dev/disk/by-label/BTRFS0";
- fsType = "btrfs";
- options = [
- "subvol=@nixos-var"
- "compress=zstd:1"
- ];
- };
-
- "/home" = {
- device = "/dev/disk/by-label/BTRFS0";
- fsType = "btrfs";
- options = [
- "subvol=@nixos-home"
- "compress=zstd:1"
- ];
- };
-
- "/nix" = {
- device = "/dev/disk/by-label/BTRFS0";
- fsType = "btrfs";
- options = [
- "subvol=@nixos-nix"
- "compress=zstd:1"
- ];
- };
-
- "/boot" = {
- device = "/dev/disk/by-label/ESP";
- fsType = "vfat";
- };
- };
-
- swapDevices = [ ];
-
- # 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.enp0s13f0u4u4u4.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlp166s0.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;
}
diff --git a/systems/x86_64-linux/greylag/networking/default.nix b/systems/x86_64-linux/greylag/networking/default.nix
new file mode 100644
index 0000000..e757b94
--- /dev/null
+++ b/systems/x86_64-linux/greylag/networking/default.nix
@@ -0,0 +1,4 @@
+{
+ networking.hostName = "greylag";
+ networking.useDHCP = true;
+}
diff --git a/systems/x86_64-linux/shorthair/console/default.nix b/systems/x86_64-linux/shorthair/console/default.nix
new file mode 100644
index 0000000..d54e9fb
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/console/default.nix
@@ -0,0 +1,4 @@
+{ ... }:
+{
+ console.keymap = "us";
+}
diff --git a/systems/x86_64-linux/shorthair/default.nix b/systems/x86_64-linux/shorthair/default.nix
index 61b0ecb..3b77fc8 100644
--- a/systems/x86_64-linux/shorthair/default.nix
+++ b/systems/x86_64-linux/shorthair/default.nix
@@ -1,48 +1,10 @@
+{ ... }:
{
- config,
- lib,
- pkgs,
- modulesPath,
- ...
-}:
-
-{
- imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
-
- boot.initrd.availableKernelModules = [
- "nvme"
- "xhci_pci"
- "ahci"
- "usb_storage"
- "usbhid"
- "sd_mod"
- "sr_mod"
+ imports = [
+ ./hardware/boot
+ ./hardware/filesystems
+ ./hardware/cpu
+ ./console
+ ./networking
];
- boot.initrd.kernelModules = [ "amdgpu" ];
- boot.kernelModules = [ ];
- boot.extraModulePackages = [ ];
-
- boot.initrd = {
- luks.devices."luks-bf23eee1-7cb7-43b9-822f-a9f49ea0a768".device =
- "/dev/disk/by-uuid/bf23eee1-7cb7-43b9-822f-a9f49ea0a768";
- luks.devices."luks-c38bc921-8979-4a25-9520-f3354dee3557".device =
- "/dev/disk/by-uuid/c38bc921-8979-4a25-9520-f3354dee3557";
- };
-
- fileSystems."/" = {
- device = "/dev/disk/by-uuid/63caf2b5-90d4-49a7-99e9-98dcdd797859";
- fsType = "ext4";
- };
-
- fileSystems."/boot" = {
- device = "/dev/disk/by-uuid/5B78-4B2D";
- fsType = "vfat";
- };
-
- swapDevices = [ { device = "/dev/disk/by-uuid/3a9212d4-6c39-4d5b-abf0-49294bd991c9"; } ];
-
- networking.useDHCP = lib.mkDefault true;
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
diff --git a/systems/x86_64-linux/shorthair/hardware/boot/default.nix b/systems/x86_64-linux/shorthair/hardware/boot/default.nix
new file mode 100644
index 0000000..6301e3b
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/hardware/boot/default.nix
@@ -0,0 +1,20 @@
+{ ... }:
+{
+ boot.initrd.availableKernelModules = [
+ "nvme"
+ "xhci_pci"
+ "ahci"
+ "usb_storage"
+ "usbhid"
+ "sd_mod"
+ "sr_mod"
+ ];
+ boot.initrd.kernelModules = [ "amdgpu" ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ boot.initrd = {
+ luks.devices."luks-bf23eee1-7cb7-43b9-822f-a9f49ea0a768".device = "/dev/disk/by-uuid/bf23eee1-7cb7-43b9-822f-a9f49ea0a768";
+ luks.devices."luks-c38bc921-8979-4a25-9520-f3354dee3557".device = "/dev/disk/by-uuid/c38bc921-8979-4a25-9520-f3354dee3557";
+ };
+}
diff --git a/systems/x86_64-linux/shorthair/hardware/cpu/default.nix b/systems/x86_64-linux/shorthair/hardware/cpu/default.nix
new file mode 100644
index 0000000..c019598
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/hardware/cpu/default.nix
@@ -0,0 +1,4 @@
+{ lib, config, ... }:
+{
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/systems/x86_64-linux/shorthair/hardware/filesystems/default.nix b/systems/x86_64-linux/shorthair/hardware/filesystems/default.nix
new file mode 100644
index 0000000..f9ce7e8
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/hardware/filesystems/default.nix
@@ -0,0 +1,14 @@
+{ ... }:
+{
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/63caf2b5-90d4-49a7-99e9-98dcdd797859";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/5B78-4B2D";
+ fsType = "vfat";
+ };
+
+ swapDevices = [ { device = "/dev/disk/by-uuid/3a9212d4-6c39-4d5b-abf0-49294bd991c9"; } ];
+}
diff --git a/systems/x86_64-linux/shorthair/networking/default.nix b/systems/x86_64-linux/shorthair/networking/default.nix
new file mode 100644
index 0000000..694d5f9
--- /dev/null
+++ b/systems/x86_64-linux/shorthair/networking/default.nix
@@ -0,0 +1,8 @@
+{ lib, ... }:
+{
+
+ networking = {
+ hostname = "shorthair";
+ useDHCP = lib.mkDefault true;
+ };
+}