From a8c12af44dad608e3ad7a5b443680d8bd707abc2 Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Date: Fri, 5 Jan 2024 15:55:05 +0200
Subject: [PATCH] Added back hermes computer

---
 config/hermes/config.nix  | 39 +++++++++++++++++++++
 config/hermes/default.nix | 73 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 config/hermes/config.nix
 create mode 100644 config/hermes/default.nix

diff --git a/config/hermes/config.nix b/config/hermes/config.nix
new file mode 100644
index 0000000..d71dd20
--- /dev/null
+++ b/config/hermes/config.nix
@@ -0,0 +1,39 @@
+{config, pkgs, lib, inputs, modulesPath, flake, ...}:
+{
+  config.desktop.enable = true;
+  config.desktop.default_session = "plasmawayland";
+  config.desktop.dm_use_wayland = true;
+  config.laptop.enable = true;
+  config.screens.primary = "eDP-1";
+  config.screens.primary_orientation = "normal";
+  config.screens.primary_pos = "0 0 res 1920x1200";
+  #config.screens.secondary = "";
+  #config.screens.secondary_orientation = "";
+  #config.screens.secondary_pos = "";
+  config.screens.has_secondary = false;
+
+  config.swaybar.font_size = 12.0;
+  config.sway.inner_gap = 10;
+  config.sway.outer_gap = 10;
+
+  imports = [
+    ../common.nix
+    ../../users/myself/shmuelr
+    ../../pkgs/desktop
+    ../../pkgs/security
+    ../../pkgs/dev
+    ../../pkgs/editor
+    ../../pkgs/web_browser
+    ../../pkgs/terminal
+    ../../pkgs/shell
+    ../../pkgs/util
+    ../../pkgs/communication
+    ../../pkgs/multimedia
+    ../../pkgs/gaming
+    ../../pkgs/disk
+    ../../pkgs/database
+    ../../pkgs/social_media
+    ../../pkgs/virtualisation
+    ../../pkgs/productivity
+  ];
+}
diff --git a/config/hermes/default.nix b/config/hermes/default.nix
new file mode 100644
index 0000000..dd1f35a
--- /dev/null
+++ b/config/hermes/default.nix
@@ -0,0 +1,73 @@
+{ config, pkgs, lib, inputs, modulesPath, flake, ... }:
+
+{
+  imports =
+    [
+      ./config.nix
+      ../../pkgs/hardware/location/rehovot
+      ../../pkgs/hardware/locale/en_il
+      ../../pkgs/hardware/common
+      ../../pkgs/hardware/common/laptop
+    ];
+
+  networking.hostName = "hermes";
+
+  boot.kernelModules = [ "kvm-intel" "v4l2loopback" ];
+  boot.extraModulePackages = with pkgs; [ config.boot.kernelPackages.v4l2loopback.out ];
+
+  fileSystems."/" =
+    { device = "/dev/mapper/vg_main-root";
+      fsType = "btrfs";
+      options = [ "subvol=root" ];
+    };
+
+  fileSystems."/home" =
+    { device = "/dev/mapper/vg_main-root";
+      fsType = "btrfs";
+      options = [ "subvol=home" ];
+    };
+
+  fileSystems."/boot/efi" =
+    { device = "/dev/disk/by-uuid/4CAA-0DA3";
+      fsType = "vfat";
+    };
+
+  swapDevices =
+    [ { device = "/dev/mapper/vg_main-swap"; }
+    ];
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+  system.stateVersion = "23.05";
+
+  boot.initrd = {
+    availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" ];
+    # Required to open the EFI partition and Yubikey
+    kernelModules = [ "vfat" "nls_cp437" "nls_iso8859-1" "usbhid" "dm-snapshot" ];
+
+
+    luks = {
+      # Support for Yubikey PBA
+      yubikeySupport = true;
+
+      devices."pv_main" = {
+        device = "/dev/disk/by-uuid/c4805374-e37e-4a9b-8a50-fe86626c44fd"; #  nvme0n1p2
+        preLVM = true; # You may want to set this to false if you need to start a network service first
+        yubikey = {
+          slot = 2;
+          twoFactor = true; # Set to false for 1FA
+          #gracePeriod = 30; # Time in seconds to wait for Yubikey to be inserted
+          keyLength = 64; # Set to $KEY_LENGTH/8
+          saltLength = 16; # Set to $SALT_LENGTH
+
+          storage = {
+            device = "/dev/disk/by-uuid/4CAA-0DA3"; #nvme0n1p1
+            fsType = "vfat";
+            path = "/crypt-storage/default";
+          };
+        };
+      };
+    };
+  };
+}
-- 
GitLab