dotfiles

My PC Dotfiles & Website
commit 23c62a4b8d18cd834c4fdb7f9f2b9dd0ac2f17e3
parent 221f7ebdaf8c706866e850ce38cb1751af8414cb
Author: maydayv7 <maydayv7@gmail.com>
Date:   Tue, 21 Jul 2026 13:44:20 +0530

feat(valkyrie): Dual Boot

Diffstat:
Mfiles/_module.nix | 8+++++---
Mmodules/hardware/README.md | 4++--
Amodules/hosts/valkyrie/_disk/dualboot.nix | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/hosts/valkyrie/_disk/full.nix | 10++++++++++
Mmodules/hosts/valkyrie/_vm/default.nix | 11+++++++++--
Mmodules/hosts/valkyrie/_vm/windows.xml | 280++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/hosts/valkyrie/default.nix | 49+++++++++++++++++++++++--------------------------
Mmodules/system/base.nix | 44++++++++++++++++++++++++++------------------
Mmodules/system/security/default.nix | 19+------------------
Msecrets/passwords/default | 4++--
Msecrets/passwords/navya.secret | 17+++--------------
11 files changed, 282 insertions(+), 223 deletions(-)

diff --git a/files/_module.nix b/files/_module.nix @@ -12,12 +12,14 @@ in { system = "/etc/nixos"; persist = "/nix/state"; - data = "/data"; - sync = "${data}/sync"; gpg = "/etc/gpg"; sops = ../secrets/secrets.yaml; + data = "/data"; + files = "${data}/files"; + sync = "${data}/sync"; + cache = "maydayv7-dotfiles"; flake = "github:maydayv7/dotfiles"; repo = "https://github.com/maydayv7/dotfiles"; @@ -35,7 +37,7 @@ in { # Directory Bookmarks bookmarks = '' - file://${path.data}/files Files + file://${path.files} Files file://${path.sync} Sync file:/// Computer ''; diff --git a/modules/hardware/README.md b/modules/hardware/README.md @@ -19,5 +19,5 @@ The system may be set up using either a `simple` or `advanced` filesystem scheme #### Data Storage -All important persisted files are stored at `/data` (declared using either `system.fs.persist`, or `home.persist` for user files), while persisted system files are stored at `/nix/state` (declared using `environment.persist`). -Personal files and media are stored at `/data/files` +All important persisted files are stored at `/data` (declared using either `system.fs.persist`, or `home.persist` for user files), while persisted system files are stored at `/nix/state` (declared using `environment.persist`). +Personal files and media are stored at `/data/files`, while data synced with [Syncthing](https://syncthing.net/) is at `/data/sync` (defined with `config.flake.files.path`). diff --git a/modules/hosts/valkyrie/_disk/dualboot.nix b/modules/hosts/valkyrie/_disk/dualboot.nix @@ -0,0 +1,59 @@ +## Dual Boot Layout +{config, ...}: { + nixos = {lib, ...}: let + inherit (config.flake) files; + inherit (lib) mkForce; + in { + # Filesystem + system.fs = { + scheme = "advanced"; + disk = "/dev/disk/by-id/nvme-eui.00000000000000000026b7686ab56005"; + }; + + # Bypass Disko + disko.devices.disk.main = mkForce {}; + + # Boot Loader + boot = { + loader.timeout = mkForce 5; + lanzaboote.settings.default = mkForce "auto-windows"; + zfs.devNodes = mkForce "/dev/disk/by-partlabel/NixOS"; + }; + + # Zram SWAP + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 25; + }; + + # Shared ESP + fileSystems."/boot" = { + device = "/dev/disk/by-partuuid/4fdd8116-b999-4dab-97a6-bb56e99e0635"; + fsType = "vfat"; + options = ["umask=0077"]; + }; + + # Windows Partition + fileSystems."${files.path.data}/windows" = { + device = "/dev/disk/by-label/System"; + fsType = "ntfs3"; + options = ["rw" "nofail" "uid=1000" "gid=100" "dmask=022" "fmask=133"]; + }; + + fileSystems."${files.path.files}" = { + device = "${files.path.data}/windows/Files"; + fsType = "none"; + options = ["bind"]; + }; + + fileSystems."${files.path.sync}" = { + device = "${files.path.data}/windows/Files/Sync"; + fsType = "none"; + options = ["bind"]; + }; + + # System Clock + time.hardwareClockInLocalTime = true; + }; +} diff --git a/modules/hosts/valkyrie/_disk/full.nix b/modules/hosts/valkyrie/_disk/full.nix @@ -0,0 +1,10 @@ +## Full Disk Layout +_: { + nixos = _: { + system.fs = { + scheme = "advanced"; + disk = "/dev/disk/by-id/nvme-eui.00000000000000000026b7686ab56005"; + swap = "8G"; + }; + }; +} diff --git a/modules/hosts/valkyrie/_vm/default.nix b/modules/hosts/valkyrie/_vm/default.nix @@ -1,6 +1,10 @@ ## Windows VM # ? # Run 'virsh -c qemu:///system start windows' -{inputs}: { +{ + config, + inputs, + ... +}: { nixos = {pkgs, ...}: { imports = [inputs.nixvirt.nixosModules.default]; @@ -35,7 +39,10 @@ domains = [ { - definition = ./windows.xml; + definition = pkgs.writeText "windows.xml" ( + builtins.replaceStrings ["@files"] [config.flake.files.path.files] + (builtins.readFile ./windows.xml) + ); active = null; } ]; diff --git a/modules/hosts/valkyrie/_vm/windows.xml b/modules/hosts/valkyrie/_vm/windows.xml @@ -3,258 +3,261 @@ <uuid>58e5ada6-f247-4a07-91eb-8b361f99cca3</uuid> <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> - <libosinfo:os id="http://microsoft.com/win/11"/> + <libosinfo:os id="http://microsoft.com/win/11" /> </libosinfo:libosinfo> </metadata> <memory unit='KiB'>16777216</memory> <currentMemory unit='KiB'>16777216</currentMemory> <memoryBacking> <hugepages> - <page size='1048576' unit='KiB'/> + <page size='1048576' unit='KiB' /> </hugepages> - <access mode='shared'/> + <access mode='shared' /> </memoryBacking> <vcpu placement='static'>6</vcpu> <iothreads>1</iothreads> <cputune> - <vcpupin vcpu='0' cpuset='2'/> - <vcpupin vcpu='1' cpuset='10'/> - <vcpupin vcpu='2' cpuset='3'/> - <vcpupin vcpu='3' cpuset='11'/> - <vcpupin vcpu='4' cpuset='4'/> - <vcpupin vcpu='5' cpuset='12'/> - <emulatorpin cpuset='0-1,8-9'/> - <iothreadpin iothread='1' cpuset='0-1,8-9'/> + <vcpupin vcpu='0' cpuset='2' /> + <vcpupin vcpu='1' cpuset='10' /> + <vcpupin vcpu='2' cpuset='3' /> + <vcpupin vcpu='3' cpuset='11' /> + <vcpupin vcpu='4' cpuset='4' /> + <vcpupin vcpu='5' cpuset='12' /> + <emulatorpin cpuset='0-1,8-9' /> + <iothreadpin iothread='1' cpuset='0-1,8-9' /> </cputune> <os firmware='efi'> <type arch='x86_64' machine='pc-q35-10.2'>hvm</type> <firmware> - <feature enabled='no' name='enrolled-keys'/> - <feature enabled='yes' name='secure-boot'/> + <feature enabled='no' name='enrolled-keys' /> + <feature enabled='yes' name='secure-boot' /> </firmware> - <loader readonly='yes' secure='yes' type='pflash' format='raw'>/run/libvirt/nix-ovmf/edk2-x86_64-secure-code.fd</loader> - <nvram template='/run/libvirt/nix-ovmf/edk2-i386-vars.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/windows_VARS.fd</nvram> + <loader readonly='yes' secure='yes' type='pflash' format='raw'> + /run/libvirt/nix-ovmf/edk2-x86_64-secure-code.fd</loader> + <nvram template='/run/libvirt/nix-ovmf/edk2-i386-vars.fd' templateFormat='raw' format='raw'> + /var/lib/libvirt/qemu/nvram/windows_VARS.fd</nvram> </os> <features> - <acpi/> - <apic/> + <acpi /> + <apic /> <hyperv mode='custom'> - <relaxed state='on'/> - <vapic state='on'/> - <spinlocks state='on' retries='8191'/> - <vpindex state='on'/> - <runtime state='on'/> - <synic state='on'/> - <stimer state='on'/> - <frequencies state='on'/> - <tlbflush state='on'/> - <ipi state='on'/> - <avic state='on'/> + <relaxed state='on' /> + <vapic state='on' /> + <spinlocks state='on' retries='8191' /> + <vpindex state='on' /> + <runtime state='on' /> + <synic state='on' /> + <stimer state='on' /> + <frequencies state='on' /> + <tlbflush state='on' /> + <ipi state='on' /> + <avic state='on' /> </hyperv> - <vmport state='off'/> - <smm state='on'/> + <vmport state='off' /> + <smm state='on' /> </features> <cpu mode='host-passthrough' check='none' migratable='on'> - <topology sockets='1' dies='1' clusters='1' cores='3' threads='2'/> - <cache mode='passthrough'/> - <feature policy='require' name='topoext'/> + <topology sockets='1' dies='1' clusters='1' cores='3' threads='2' /> + <cache mode='passthrough' /> + <feature policy='require' name='topoext' /> </cpu> <clock offset='localtime'> - <timer name='rtc' tickpolicy='catchup'/> - <timer name='pit' tickpolicy='delay'/> - <timer name='hpet' present='no'/> - <timer name='hypervclock' present='yes'/> + <timer name='rtc' tickpolicy='catchup' /> + <timer name='pit' tickpolicy='delay' /> + <timer name='hpet' present='no' /> + <timer name='hypervclock' present='yes' /> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <pm> - <suspend-to-mem enabled='no'/> - <suspend-to-disk enabled='no'/> + <suspend-to-mem enabled='no' /> + <suspend-to-disk enabled='no' /> </pm> <devices> <emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator> <disk type='block' device='disk'> - <driver name='qemu' type='raw' cache='none' io='native' discard='unmap' iothread='1'/> - <source dev='/dev/zvol/fspool/vm/windows'/> - <target dev='vda' bus='virtio'/> - <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + <driver name='qemu' type='raw' cache='none' io='native' discard='unmap' iothread='1' /> + <source dev='/dev/zvol/fspool/vm/windows' /> + <target dev='vda' bus='virtio' /> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0' /> </disk> <filesystem type='mount' accessmode='passthrough'> - <driver type='virtiofs' queue='1024'/> - <source dir='/data/files'/> - <target dir='Files'/> + <driver type='virtiofs' queue='1024' /> + <source dir='@files' /> + <target dir='Files' /> </filesystem> <!-- Disk images <disk type='file' device='cdrom'> - <driver name='qemu' type='raw'/> - <source file='/data/vm/iso/Win11.iso'/> - <target dev='sda' bus='sata'/> - <readonly/> - <boot order='1'/> - <address type='drive' controller='0' bus='0' target='0' unit='0'/> + <driver name='qemu' type='raw' /> + <source file='/data/vm/iso/Win11.iso' /> + <target dev='sda' bus='sata' /> + <readonly /> + <boot order='1' /> + <address type='drive' controller='0' bus='0' target='0' unit='0' /> </disk> <disk type='file' device='cdrom'> - <driver name='qemu' type='raw'/> - <source file='/data/vm/iso/virtio-win.iso'/> - <target dev='sdb' bus='sata'/> - <readonly/> - <boot order='2'/> - <address type='drive' controller='0' bus='0' target='0' unit='1'/> + <driver name='qemu' type='raw' /> + <source file='/data/vm/iso/virtio-win.iso' /> + <target dev='sdb' bus='sata' /> + <readonly /> + <boot order='2' /> + <address type='drive' controller='0' bus='0' target='0' unit='1' /> </disk> --> <controller type='usb' index='0' model='qemu-xhci' ports='15'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0' /> </controller> - <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='0' model='pcie-root' /> <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x10'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + <model name='pcie-root-port' /> + <target chassis='1' port='0x10' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on' /> </controller> <controller type='pci' index='2' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='2' port='0x11'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + <model name='pcie-root-port' /> + <target chassis='2' port='0x11' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1' /> </controller> <controller type='pci' index='3' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='3' port='0x12'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + <model name='pcie-root-port' /> + <target chassis='3' port='0x12' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2' /> </controller> <controller type='pci' index='4' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='4' port='0x13'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> + <model name='pcie-root-port' /> + <target chassis='4' port='0x13' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3' /> </controller> <controller type='pci' index='5' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='5' port='0x14'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> + <model name='pcie-root-port' /> + <target chassis='5' port='0x14' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4' /> </controller> <controller type='pci' index='6' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='6' port='0x15'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> + <model name='pcie-root-port' /> + <target chassis='6' port='0x15' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5' /> </controller> <controller type='pci' index='7' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='7' port='0x16'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> + <model name='pcie-root-port' /> + <target chassis='7' port='0x16' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6' /> </controller> <controller type='pci' index='8' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='8' port='0x17'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> + <model name='pcie-root-port' /> + <target chassis='8' port='0x17' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7' /> </controller> <controller type='pci' index='9' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='9' port='0x18'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> + <model name='pcie-root-port' /> + <target chassis='9' port='0x18' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on' /> </controller> <controller type='pci' index='10' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='10' port='0x19'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> + <model name='pcie-root-port' /> + <target chassis='10' port='0x19' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1' /> </controller> <controller type='pci' index='11' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='11' port='0x1a'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/> + <model name='pcie-root-port' /> + <target chassis='11' port='0x1a' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2' /> </controller> <controller type='pci' index='12' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='12' port='0x1b'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/> + <model name='pcie-root-port' /> + <target chassis='12' port='0x1b' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3' /> </controller> <controller type='pci' index='13' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='13' port='0x1c'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/> + <model name='pcie-root-port' /> + <target chassis='13' port='0x1c' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4' /> </controller> <controller type='pci' index='14' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='14' port='0x1d'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/> + <model name='pcie-root-port' /> + <target chassis='14' port='0x1d' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5' /> </controller> <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2' /> </controller> <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' /> </controller> <interface type='network'> - <mac address='52:54:00:89:97:df'/> - <source network='default'/> - <model type='virtio'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + <mac address='52:54:00:89:97:df' /> + <source network='default' /> + <model type='virtio' /> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' /> </interface> <serial type='pty'> <target type='isa-serial' port='0'> - <model name='isa-serial'/> + <model name='isa-serial' /> </target> </serial> <console type='pty'> - <target type='serial' port='0'/> + <target type='serial' port='0' /> </console> <channel type='spicevmc'> - <target type='virtio' name='com.redhat.spice.0'/> - <address type='virtio-serial' controller='0' bus='0' port='1'/> + <target type='virtio' name='com.redhat.spice.0' /> + <address type='virtio-serial' controller='0' bus='0' port='1' /> </channel> <channel type='unix'> - <target type='virtio' name='org.qemu.guest_agent.0'/> - <address type='virtio-serial' controller='0' bus='0' port='2'/> + <target type='virtio' name='org.qemu.guest_agent.0' /> + <address type='virtio-serial' controller='0' bus='0' port='2' /> </channel> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> + <input type='mouse' bus='ps2' /> + <input type='keyboard' bus='ps2' /> <tpm model='tpm-crb'> <backend type='emulator' version='2.0'> - <profile name='default-v1'/> + <profile name='default-v1' /> </backend> </tpm> <graphics type='spice' autoport='yes'> - <listen type='address'/> - <image compression='off'/> + <listen type='address' /> + <image compression='off' /> </graphics> <sound model='ich9'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0' /> </sound> - <audio id='1' type='spice'/> + <audio id='1' type='spice' /> <video> - <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes' /> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' /> </video> <hostdev mode='subsystem' type='pci' managed='yes'> <source> - <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + <address domain='0x0000' bus='0x01' slot='0x00' function='0x0' /> </source> - <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0' /> </hostdev> <hostdev mode='subsystem' type='pci' managed='yes'> <source> - <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/> + <address domain='0x0000' bus='0x01' slot='0x00' function='0x1' /> </source> - <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0' /> </hostdev> <hostdev mode='subsystem' type='usb' managed='yes'> <source> <!-- Webcam --> - <vendor id='0x3277'/> - <product id='0x0018'/> + <vendor id='0x3277' /> + <product id='0x0018' /> </source> </hostdev> <redirdev bus='usb' type='spicevmc'> - <address type='usb' bus='0' port='2'/> + <address type='usb' bus='0' port='2' /> </redirdev> <redirdev bus='usb' type='spicevmc'> - <address type='usb' bus='0' port='3'/> + <address type='usb' bus='0' port='3' /> </redirdev> - <watchdog model='itco' action='reset'/> - <memballoon model='none'/> + <watchdog model='itco' action='reset' /> + <memballoon model='none' /> </devices> <qemu:commandline> - <qemu:arg value='-device'/> - <qemu:arg value='ivshmem-plain,id=shmem0,memdev=looking-glass,bus=pcie.0,addr=0x0a'/> - <qemu:arg value='-object'/> - <qemu:arg value='memory-backend-file,id=looking-glass,mem-path=/dev/kvmfr0,size=67108864,share=yes'/> + <qemu:arg value='-device' /> + <qemu:arg value='ivshmem-plain,id=shmem0,memdev=looking-glass,bus=pcie.0,addr=0x0a' /> + <qemu:arg value='-object' /> + <qemu:arg + value='memory-backend-file,id=looking-glass,mem-path=/dev/kvmfr0,size=67108864,share=yes' /> </qemu:commandline> -</domain> +</domain> +\ No newline at end of file diff --git a/modules/hosts/valkyrie/default.nix b/modules/hosts/valkyrie/default.nix @@ -3,7 +3,7 @@ config, inputs, ... -}: let +} @ args: let inherit (config.flake.modules) nixos homeManager; inherit (config) util; @@ -14,14 +14,14 @@ "printer" "docker" "mc-server" - "roblox" - "vfio" + #"roblox" + #"vfio" ]; hmModules = [ "secrets" "auth" - "syncthing" + #"syncthing" "internet" "firefox" "notes" @@ -30,9 +30,9 @@ "vscode" "antigravity" "zed" - "stream" + #"stream" "minecraft" - "osu" + #"osu" ]; mixedModules = [ @@ -45,11 +45,11 @@ "git" "office" "tools" - "flatpak" - "latex" - "wine" - "games" - "libvirt" + #"flatpak" + #"latex" + #"wine" + #"games" + #"libvirt" "hyprland" ]; @@ -57,9 +57,10 @@ util.map.array hmModules homeManager ++ util.map.array mixedModules homeManager; + disk = import ./_disk/dualboot.nix args; asus = import ./_asus {}; dev = import ./_dev.nix {}; - vm = import ./_vm {inherit inputs;}; + #vm = import ./_vm args; in { configurations.nixos.valkyrie = { system = "x86_64-linux"; @@ -71,7 +72,7 @@ in { imports = util.map.array nixosModules nixos ++ util.map.array mixedModules nixos - ++ [(asus.nixos or {}) (dev.nixos or {}) (vm.nixos or {})] + ++ [disk.nixos (asus.nixos or {}) (dev.nixos or {})] ++ util.map.array ["asus-zephyrus-ga402x-nvidia"] inputs.hardware.nixosModules; networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" "valkyrie"); @@ -83,10 +84,6 @@ in { system = { scheme = "secure"; - fs = { - scheme = "advanced"; - disk = "/dev/disk/by-id/nvme-eui.00000000000000000026b7686ab56005"; - }; # Kernel kernel = "zen"; @@ -124,15 +121,15 @@ in { }; # Virtualisation - virt.vfio = { - setup = true; - passthrough = [ - "10de:28e0" # Graphics - "10de:22be" # Audio - ]; - isolate = "2-4,10-12"; - hugepages = 16; - }; + # virt.vfio = { + # setup = true; + # passthrough = [ + # "10de:28e0" # Graphics + # "10de:22be" # Audio + # ]; + # isolate = "2-4,10-12"; + # hugepages = 16; + # }; # Minecraft Server games.mc-servers = [ diff --git a/modules/system/base.nix b/modules/system/base.nix @@ -8,30 +8,22 @@ _: { lib, ... }: let - inherit (builtins) attrNames map; - inherit - (lib) - hasPrefix - mkIf - mkOption - optionals - removePrefix - types - ; cfg = config.system; in { options.system = { - kernel = mkOption { + kernel = lib.mkOption { description = "Linux Kernel Variant to be used"; default = "lts"; - type = types.enum ( - ["lts"] ++ (map (name: removePrefix "linux_" name) (attrNames pkgs.linuxKernel.kernels)) + type = lib.types.enum ( + ["lts"] + ++ (map (name: lib.removePrefix "linux_" name) + (builtins.attrNames pkgs.linuxKernel.kernels)) ); }; - kernelModules = mkOption { + kernelModules = lib.mkOption { description = "Linux Kernel Modules to load"; - type = with types; listOf str; + type = with lib.types; listOf str; default = []; }; }; @@ -47,7 +39,7 @@ _: { then options.boot.kernelPackages.default else pkgs.linuxKernel.packages."${"linux_" + cfg.kernel}"; - initrd.availableKernelModules = optionals (cfg.kernelModules != []) ( + initrd.availableKernelModules = lib.optionals (cfg.kernelModules != []) ( cfg.kernelModules ++ [ "ahci" @@ -61,8 +53,8 @@ _: { environment = { etc."specialisation" = - mkIf (hasPrefix "special." cfg.nixos.label) - {text = removePrefix "special." cfg.nixos.label;}; + lib.mkIf (lib.hasPrefix "special." cfg.nixos.label) + {text = lib.removePrefix "special." cfg.nixos.label;}; # Essential Utilities systemPackages = with pkgs; [ @@ -134,6 +126,22 @@ _: { "/var/lib/alsa" "/var/lib/bluetooth" ]; + + # Recovery Account + specialisation.recovery.configuration = { + home-manager.verbose = true; + security.sudo.extraConfig = lib.mkAfter "recovery ALL=(ALL:ALL) NOPASSWD:ALL"; + users.extraUsers.recovery = { + name = "recovery"; + description = "Recovery Account"; + isNormalUser = true; + uid = 1100; + group = "users"; + extraGroups = ["wheel"]; + useDefaultShell = true; + initialHashedPassword = lib.mkDefault (lib.fileContents ../../secrets/passwords/default); + }; + }; }; }; diff --git a/modules/system/security/default.nix b/modules/system/security/default.nix @@ -23,24 +23,7 @@ in { }; programs.firejail.enable = true; - # Recovery Account - specialisation.recovery.configuration = { - home-manager.verbose = true; - services.openssh.enable = lib.mkForce false; - security.sudo.extraConfig = lib.mkAfter "recovery ALL=(ALL:ALL) NOPASSWD:ALL"; - users.extraUsers.recovery = { - name = "recovery"; - description = "Recovery Account"; - isNormalUser = true; - uid = 1100; - group = "users"; - extraGroups = ["wheel"]; - useDefaultShell = true; - initialHashedPassword = lib.mkDefault (lib.fileContents ../../../secrets/passwords/default); - }; - }; - - # Hardening + ## Hardening networking.stevenblack.enable = true; # Block Junk Sites boot = { # Kernel diff --git a/secrets/passwords/default b/secrets/passwords/default @@ -1 +1 @@ -$6$FNx60H2FPuC1zrR4$2UgQu2jzG5QpPpyxSk7KDrA51AinbcdUfn/iorYsAu.8AFQqpP2NPmWAU9kKAAMA.aEfZAP8y1DQKb3rvZjwR/ -\ No newline at end of file +$6$DhIlogBonDoCTghj$1CqrB/vyRkMOYyaBa6TT1iE1F92aubZkiWYHDZHAyXhxYoFawXnqVHjUWD7bDLZ2P/CKtVuQ7WVhUnUndKAaf. +\ No newline at end of file diff --git a/secrets/passwords/navya.secret b/secrets/passwords/navya.secret @@ -1,26 +1,16 @@ { "data": "ENC[AES256_GCM,data:XfcK6+N/uSHvmejQrtcU0XxYbNVnT78z08y6++p1yGWXevKCLXv387sbSp4E3Fqv2iiAQFm6R5GzbetC5eUv8GG/wcEE199Bsw==,iv:5qDsD8BJc4GTLIYS1gRwNeN65wnWoJbRFE6p1UjHQ8M=,tag:7kB9u2soOj+tc2n0NszM/w==,type:str]", "sops": { - "kms": null, - "gcp_kms": null, - "azure_kv": null, - "hc_vault": null, - "age": null, "lastmodified": "2023-02-22T04:23:28Z", "mac": "ENC[AES256_GCM,data:BgCdGY75ev5tenuOipS9uVq+NH+CQXftSuATlmerK2fC9ZIkR6ywJPAC2zbUH5sHJDAO4pC2Bei8LDSVuT4BSyUP9atKvvmaHIdu66JIvnxB7IAIS7fSGvLiaHjnoyc9ggPJys/FTbUYzpdGLyW3CoOjYwVazejGKD0Gjm3lP8U=,iv:/gU51plMBfwsQUpFhi/VGudaWvkdjYhhQlxwDFewx7A=,tag:Z4AQuO1OOlokkp1mKrVAdQ==,type:str]", "pgp": [ { - "created_at": "2022-02-05T06:45:44Z", - "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/AQ//eZipdqImGl1nZEkqgS0+4htARy7k9BbxH3Oit0pyhEPE\nvwQ4jM7Q5ZkjJYgawEhRmwaU8lvBAg6PLc3UeVag/3lHI7Ra7zb/TzI61Q1t2Oe1\nSo8PRyeI3TqkVopHR1BGmuwHRNhl5V3g42GO5Irc6iFeIGybhV5/tLiiUFcm9uUv\nyFwoUfW0S75UzpAXIKNukzg2egtj6tgYfSXN/aJybUxlwb/rgXgRT46fKYqLorav\nR4Z4ItAkk56dShxSUpOssoP2r5IKJFU2fcSLBL2RNxu2rReIg+WHAoiahX0TzQ5f\nI+yJWtRU6NbC2Q4Kp0BhZu4QYb/EE+0AB3Q7FYKVqFpclUlFDaMIvhp0Hhv4qypn\nwCx3QgDWwHxhTwZT+MvWPaq7RQjhChJ2d3bXW5g0in9C6N3ezTqWaNNGO7WscqQl\nr7i6zcgLH19U3BYEEe2uvrl/dwMSND+zh3wxhy4T4FMvPI/9Q99pOpNIchQpK1Jr\nWuPquMKaCR+Egy53SYX8s+LIdGFKiefZrjrA9C4dG+v+aOfgYVNxaSBhW2qlObbc\nwL4tCNVShNZBscR5SGCRDFWppFUUUfElzJVLnflwIZz/mwxjkLMzkJk/kHGjocCn\nWBENAEfv4+rjTU8AgwixeZzqfJqIwE+hYSwWFnmatRP3sX+ayUrWHuH+6olyJyTS\nXAFRhv8/ibQoS6GTsOIibvl9IbIkO4EP8ZekZbGg5kc9U3wqNV5nV4aEtnmHJ69t\n18bM31onOyulf9aNndQtyoW0vhY3tcxtAQl/WS0UPKV/DsR+8wVHP1QdjJ+T\n=YOl4\n-----END PGP MESSAGE-----\n", - "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" - }, - { - "created_at": "2022-02-05T06:45:44Z", - "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA6M7Q/u2jO+RAQ/+JaYt5n9hAG251efnPZP5H27EbRE4+RD8NZes/VubnTJx\n8BSa+/b2+rosq+t0wOMdgRGoktEKAnLfxfsUwzY3pWc8o2S3Y30xZ9aTwJM1KDWW\nGNj5ZR97OsPGPJ1EFfb+pePrphQWnJPq9LGtdhmogARPZUuKEYHDs7ylsy67P9TP\nikHNUvM0TJk8DyVzgutqq3DkchGXzo7Q3cs9p5Lo2TIeWayYykr7IqyOvi1Pwc3+\nBz4uD9HPrNgXJAxczCSDYcYwIXn/y25FqLLz+uYLurEjbzC39SdRIn0Re0oi9r7Q\nopO4prJewpGBkVPc416vVuthinnkwSdBa5UVksdGWMifeLvQV5NyxFffeHO522S1\nSKSB1UtzmAqKswtNMvW45RbwyDS3cSw8wRuW+b95HQdnJrhPnD5CVZ0JEE6kEk+Y\n6Pk+L5lS2+ELsqv3nNa/7XF3PEeB38S2c4glDm5vDoHi1xFqZi+LRjBsDKO76UR9\n+amU1lM9ba/QbGAMFv96pmCKID+P6pEOMpRrV3iB96eNUjqZU5sAiKnI2B1cEjGf\nWnsKKK10MdILLOmNLYu4Mgkor24UGeI7TWZw5LG8bJPYmX3xLY5x8Bar4teFsXJY\nanIttcx93IJBOHZG/EqjalaGi1dlepXbHjtIo+lgSvNnn+W5sHgzMxG6owsXhSrS\nXAFsR/LVniFSgi8l6SUwlOIRNtEakpS1mH3jHpHCv9oX+Vdlv4wZ3WY7SzhzxUJ4\nHxIeRUyxci8H67j454+nHTCtS1j5tYbVlw5PQWNk+s1wwuWWHxBoU1whtFlC\n=AozJ\n-----END PGP MESSAGE-----\n", + "created_at": "2026-07-20T17:50:25Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA6M7Q/u2jO+RAQ/7BVMMLyexYXGQ+eec93IJvVP8LwrntrB6yDTHEmyLAbIl\noBck9+dXgjO+OBtlhD2+BcRTYETgEdMhaCpS8R8EscPSQjd6Q9kiA4Irgum4RK4N\n1n7SegnxXOpY4joXOtzqjTp5A9ReTssHnFQ44PORWjacnPpbtHxbnoHkNMgDeCb9\nLunBPfC4OQTWwudA9lXKiM9ris5O5mml9oWqefJNUZb6yWEIc06wLoQsBPd1tLgc\nwqfDtdrZ9bMYFqk69PjFjR5Gf6MBM1iXHpY/JvGPgwAVO9++FhVkSgio8wc1SWev\nTnMxQj/Vz8Vep5WjHmqJ1iDfCSw8Kx4ElXC/mqBl0mXFFxgI7v/JWLl39JlDmwdy\nsGBb597SQQ99Cnbn91Cba79AdvkslLilfIuj7HI4LSb5h1/IExrFRUcxC+pEBCvr\nqNvk6xACzRYLrBF8o2Oa/+QqkAd5zlreTjwG60rzUnLnpaBhyRymCCl5QJ9t+Suk\nZwWj0ri5+Rvb3XbPcykLn7f5sIIMzR1XA0M+O9gT3fRRMoqLqZIIByYEb7exAMNw\nGAMo8bJHPmDsgZnpEq2LR9/y5PLmYdYT4f/+h23Wdn+eTuf9OP2ZZPzayzBMeHCU\n+wTfjmW7f2NHhjZbq74+M/KRLpDpDJeBfAApnfXyX6Ki/byg13AbjGIqAFK5RQ7S\nXAFeILzHKk5ZMDmWKtN5aYJDVevHvFHI+O6IFGjYUvxi18Gipxo1YYSlpPTXTN4J\n2H8aHOG9rjlNb82znUjPXka1WqaFP1GnATPbzbdALxIeHR2ZAnnJX7q6iSBN\n=W5b/\n-----END PGP MESSAGE-----", "fp": "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE" } ], "unencrypted_suffix": "_unencrypted", "version": "3.7.3" } -} -\ No newline at end of file +}