From 2f326e3add8918b49bb23deab5136aac44bc2e88 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me> Date: Wed, 10 Jan 2024 22:12:50 +0000 Subject: [PATCH] Added neoteric computer --- config/neoteric/config.nix | 43 +++++++++++++++++++ config/neoteric/default.nix | 86 +++++++++++++++++++++++++++++++++++++ flake.nix | 36 +--------------- 3 files changed, 131 insertions(+), 34 deletions(-) create mode 100644 config/neoteric/config.nix create mode 100644 config/neoteric/default.nix diff --git a/config/neoteric/config.nix b/config/neoteric/config.nix new file mode 100644 index 0000000..0d4f688 --- /dev/null +++ b/config/neoteric/config.nix @@ -0,0 +1,43 @@ +{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 1920x1080"; + config.screens.secondary = "DP-3"; + config.screens.secondary_orientation = "normal"; + config.screens.secondary_pos = "0 1080 res 1920x515"; + config.screens.has_secondary = true; + + config.swaybar.font_size = 11.0; + config.sway.inner_gap = 10; + config.sway.outer_gap = 10; + + imports = [ + ../common.nix + ../../users/myself/freemo + ../../pkgs/desktop + ../../pkgs/lib + ../../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 + ../../pkgs/multimedia/stylix + ]; +} diff --git a/config/neoteric/default.nix b/config/neoteric/default.nix new file mode 100644 index 0000000..ac3d9c1 --- /dev/null +++ b/config/neoteric/default.nix @@ -0,0 +1,86 @@ +{config, pkgs, lib, inputs, modulesPath, flake, ...}: +{ + imports = [ + ./config.nix + ../../pkgs/hardware/location/philadelphia + ../../pkgs/hardware/locale/en_us + ../../pkgs/hardware/common + #../../pkgs/hardware/common/asus-zenbook-duo + ../../pkgs/hardware/common/laptop + ../../pkgs/hardware/common/touchpad-disable-tap + #../../pkgs/hardware/common/nvidia_proprietary + ]; + + networking.hostName = "neoteric"; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "uas" "sd_mod" "rtsx_usb_sdmmc" "usbhid" "usb_storage" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "vfat" "nls_cp437" "nls_iso8859-1" "usbhid" ]; + boot.kernelModules = [ "kvm-amd" "v4l2loopback" ]; + boot.extraModulePackages = with pkgs; [ config.boot.kernelPackages.v4l2loopback.out ]; + boot.kernelParams = [ "nomodeset" ] + + # 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/509A-6D78"; + fsType = "vfat"; + }; + + swapDevices = + [ + { device = "/dev/mapper/vg_main-swap"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + system.stateVersion = "23.11"; + + boot.initrd.luks = { + # Support for Yubikey PBA + yubikeySupport = true; + + devices."pv_main" = { + device = "/dev/disk/by-uuid/d4100943-c355-4e4a-9d7a-bea1ef7afee8"; # 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/509A-6D78"; #nvme0n1p1 + fsType = "vfat"; + path = "/crypt-storage/default"; + }; + }; + }; + }; + + #fixes secondary screen turning off when lid shut + services.logind.extraConfig = '' + LidSwitchIgnoreInhibited=yes + ''; + services.upower.ignoreLid = true; + +} diff --git a/flake.nix b/flake.nix index edad0d8..ac36ea4 100644 --- a/flake.nix +++ b/flake.nix @@ -76,30 +76,6 @@ ./config/envy ]; }; - hyperion = self.lib.mkLinuxSystem { - imports = [ - #stylix.nixosModules.stylix - self.nixosModules.home-manager - inputs.agenix.nixosModules.default - ./config/hyperion - ]; - }; - macaria = self.lib.mkLinuxSystem { - imports = [ - #stylix.nixosModules.stylix - self.nixosModules.home-manager - inputs.agenix.nixosModules.default - ./config/macaria - ]; - }; - ramos = self.lib.mkLinuxSystem { - imports = [ - #stylix.nixosModules.stylix - self.nixosModules.home-manager - inputs.agenix.nixosModules.default - ./config/ramos - ]; - }; hermes = self.lib.mkLinuxSystem { imports = [ #stylix.nixosModules.stylix @@ -108,20 +84,12 @@ ./config/hermes ]; }; - dolly = self.lib.mkLinuxSystem { - imports = [ - #stylix.nixosModules.stylix - self.nixosModules.home-manager - inputs.agenix.nixosModules.default - ./config/dolly - ]; - }; - kinnara = self.lib.mkLinuxSystem { + neoteric = self.lib.mkLinuxSystem { imports = [ #stylix.nixosModules.stylix self.nixosModules.home-manager inputs.agenix.nixosModules.default - ./config/kinnara + ./config/neoteric ]; }; }; -- GitLab