From fa8299ee29c5ef2057a29fd450df68b7882a67c0 Mon Sep 17 00:00:00 2001 From: Bun Date: Sun, 16 Mar 2025 00:30:10 -0400 Subject: [PATCH] Add Tablet --- flake.nix | 1 + hosts/intuos/boot/default.nix | 4 ++ hosts/intuos/default.nix | 21 +++++++ hosts/intuos/disko/default.nix | 90 +++++++++++++++++++++++++++ hosts/intuos/filesystems/default.nix | 8 +++ hosts/intuos/hardware/default.nix | 12 ++++ hosts/intuos/id_ed25519.pub | 1 + hosts/intuos/users/default.nix | 4 ++ hosts/intuos/users/main/default.nix | 8 +++ hosts/pear/default.nix | 1 - modules/system/users/main/default.nix | 1 + 11 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 hosts/intuos/boot/default.nix create mode 100644 hosts/intuos/default.nix create mode 100644 hosts/intuos/disko/default.nix create mode 100644 hosts/intuos/filesystems/default.nix create mode 100644 hosts/intuos/hardware/default.nix create mode 100644 hosts/intuos/id_ed25519.pub create mode 100644 hosts/intuos/users/default.nix create mode 100644 hosts/intuos/users/main/default.nix diff --git a/flake.nix b/flake.nix index 1dedaf13..a8433d76 100644 --- a/flake.nix +++ b/flake.nix @@ -61,6 +61,7 @@ envy = mkNix [ ./hosts/envy ]; # HP Convertable pear = mkNix [ ./hosts/pear ]; # MacBook Pro + intuos = mkNix [ ./hosts/intuos ]; # Wacom Intuos Tablet redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot iso = mkNix [ ./hosts/iso ]; # ISO File diff --git a/hosts/intuos/boot/default.nix b/hosts/intuos/boot/default.nix new file mode 100644 index 00000000..50d146f5 --- /dev/null +++ b/hosts/intuos/boot/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/intuos/default.nix b/hosts/intuos/default.nix new file mode 100644 index 00000000..57cdc79e --- /dev/null +++ b/hosts/intuos/default.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: +{ + imports = [ + ./boot + ./disko + ./filesystems + ./hardware + ./users + ../../modules/system + ]; + + networking.hostName = "intuos"; + + system = { + desktop.enable = true; + lanzaboote.enable = true; + fancyboot.enable = true; + wireless.enable = true; + stateVersion = "24.11"; + }; +} diff --git a/hosts/intuos/disko/default.nix b/hosts/intuos/disko/default.nix new file mode 100644 index 00000000..36d1bd7e --- /dev/null +++ b/hosts/intuos/disko/default.nix @@ -0,0 +1,90 @@ +{ config, disko, ... }: +{ + imports = [ disko.nixosModules.disko ]; + + disko.devices = { + disk = { + "${config.networking.hostName}" = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "${config.networking.hostName}-disk"; + settings.allowDiscards = true; + passwordFile = "/tmp/secret.key"; + content = { + type = "lvm_pv"; + vg = "${config.networking.hostName}"; + }; + }; + }; + }; + }; + }; + }; + + lvm_vg = { + "${config.networking.hostName}" = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/prev" = { + mountpoint = "/prev"; + mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + + # Impermanence + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/persist/.snapshots" = { }; + "/persist/home/${config.sysusers.main}" = { }; + "/persist/home/${config.sysusers.main}/.snapshots" = { }; + }; + }; + }; + swap = { + size = "8G"; + content = { + type = "swap"; + discardPolicy = "both"; + }; + }; + }; + }; + }; + }; + + # Needed for impermanence + fileSystems."/persist".neededForBoot = true; +} diff --git a/hosts/intuos/filesystems/default.nix b/hosts/intuos/filesystems/default.nix new file mode 100644 index 00000000..299da259 --- /dev/null +++ b/hosts/intuos/filesystems/default.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + fileSystems."/home/${config.sysusers.main}/Midas" = { + device = "${config.ips.server}:/"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ]; + }; +} diff --git a/hosts/intuos/hardware/default.nix b/hosts/intuos/hardware/default.nix new file mode 100644 index 00000000..7cb41957 --- /dev/null +++ b/hosts/intuos/hardware/default.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/intuos/id_ed25519.pub b/hosts/intuos/id_ed25519.pub new file mode 100644 index 00000000..d2f44375 --- /dev/null +++ b/hosts/intuos/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDmBxF07N2nRylP2BpcDZTe7jb325jD+wl4t1kGlObSv bun@intuos diff --git a/hosts/intuos/users/default.nix b/hosts/intuos/users/default.nix new file mode 100644 index 00000000..57e7f20b --- /dev/null +++ b/hosts/intuos/users/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./main ]; +} diff --git a/hosts/intuos/users/main/default.nix b/hosts/intuos/users/main/default.nix new file mode 100644 index 00000000..b609338c --- /dev/null +++ b/hosts/intuos/users/main/default.nix @@ -0,0 +1,8 @@ +{ config, lib, ... }: +{ + home-manager.users."${config.sysusers.main}".home = { + desktop.enable = true; + production.enable = true; + stateVersion = lib.mkForce config.system.stateVersion; + }; +} diff --git a/hosts/pear/default.nix b/hosts/pear/default.nix index 0027e370..5a07770f 100644 --- a/hosts/pear/default.nix +++ b/hosts/pear/default.nix @@ -16,7 +16,6 @@ system = { desktop.enable = true; - #lanzaboote.enable = true; fancyboot.enable = true; wireless.enable = true; wireguard.client.enable = true; diff --git a/modules/system/users/main/default.nix b/modules/system/users/main/default.nix index 69096b3f..d4051841 100644 --- a/modules/system/users/main/default.nix +++ b/modules/system/users/main/default.nix @@ -16,6 +16,7 @@ ../../../../hosts/envy/id_ed25519.pub ../../../../hosts/pear/id_ed25519.pub + ../../../../hosts/intuos/id_ed25519.pub ../../../../hosts/redmond/id_ed25519.pub ../../../../hosts/midas/id_ed25519.pub