From a15a7177b7a03d286b1e7cff7ff3d0209fe1a0ed Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Date: Mon, 8 Jan 2024 03:21:45 +0000
Subject: [PATCH] Added silversin computer

---
 config/silversin/config.nix  | 39 ++++++++++++++++++
 config/silversin/default.nix | 79 ++++++++++++++++++++++++++++++++++++
 flake.nix                    |  8 ++++
 3 files changed, 126 insertions(+)
 create mode 100644 config/silversin/config.nix
 create mode 100644 config/silversin/default.nix

diff --git a/config/silversin/config.nix b/config/silversin/config.nix
new file mode 100644
index 0000000..6a9d74c
--- /dev/null
+++ b/config/silversin/config.nix
@@ -0,0 +1,39 @@
+{config, pkgs, lib, inputs, modulesPath, flake, ...}:
+{
+  config.desktop.enable = true;
+  config.desktop.default_session = "sway";
+  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/freemo
+    ../../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/silversin/default.nix b/config/silversin/default.nix
new file mode 100644
index 0000000..e7a1f13
--- /dev/null
+++ b/config/silversin/default.nix
@@ -0,0 +1,79 @@
+{ config, pkgs, lib, inputs, modulesPath, flake, ... }:
+
+{
+  imports =
+    [
+      ./config.nix
+      ../../pkgs/hardware/location/philadelphia
+      ../../pkgs/hardware/locale/en_us
+      ../../pkgs/hardware/common
+      ../../pkgs/hardware/common/laptop
+    ];
+
+  networking.hostName = "silversin";
+
+  boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
+  boot.initrd.kernelModules = [ "dm-snapshot" ];
+  boot.kernelModules = [ "kvm-intel" "v4l2loopback" ];
+  boot.extraModulePackages = with pkgs; [ config.boot.kernelPackages.v4l2loopback.out ];
+
+  # Setup keyfile
+  boot.initrd.secrets = {
+    "/crypto_keyfile.bin" = null;
+  };
+
+  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/CCC2-5AFE";
+      fsType = "vfat";
+    };
+
+  swapDevices =
+    [ { device = "/dev/disk/by-uuid/cf0e3eb9-f7c4-426a-a8cf-66e7d4867def"; }
+    ];
+
+  # 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.wlp1s0.useDHCP = lib.mkDefault true;
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+  luks = {
+    # Support for Yubikey PBA
+    yubikeySupport = true;
+
+    devices."pv_main" = {
+      device = "/dev/disk/by-uuid/83988b6e-ad46-4fc7-b133-db1a3941d0b6"; #  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/CCC2-5AFE"; #nvme0n1p1
+          fsType = "vfat";
+          path = "/crypt-storage/default";
+        };
+      };
+    };
+  };
+  system.stateVersion = "23.11";
+}
diff --git a/flake.nix b/flake.nix
index ac36ea4..136bd79 100644
--- a/flake.nix
+++ b/flake.nix
@@ -76,6 +76,14 @@
               ./config/envy
             ];
           };
+          silversin = self.lib.mkLinuxSystem {
+            imports = [
+              stylix.nixosModules.stylix
+              self.nixosModules.home-manager
+              inputs.agenix.nixosModules.default
+              ./config/silversin
+            ];
+          };
           hermes = self.lib.mkLinuxSystem {
             imports = [
               #stylix.nixosModules.stylix
-- 
GitLab