From b3d97cdc5f0beb17a3388dcb213b15c016f03929 Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 01:13:48 -0400 Subject: [PATCH 01/16] wehhhh --- README.md | 0 common/desktop/core.nix | 2 +- common/desktop/sway.nix | 11 ++++++-- common/efi.nix | 0 common/nvidia.nix | 0 common/services.nix | 0 common/system.nix | 0 common/users.nix | 0 flake.lock | 0 flake.nix | 0 home/regent/home.nix | 22 +++++++++++++--- host-secrets.nix | 0 hosts/buer/default.nix | 0 hosts/buer/hardware.nix | 0 hosts/buer/secrets.nix | 0 hosts/focalor/backup.nix | 41 +++++++++++++++++++++++++++++ hosts/focalor/default.nix | 9 +++++++ hosts/focalor/hardware.nix | 19 ++++++++----- hosts/focalor/secrets.nix | 0 hosts/focalor/vfio.nix | 19 +++++++++++++ hosts/morax/default.nix | 0 hosts/morax/hardware.nix | 0 hosts/morax/secrets.nix | 0 hosts/valefar/default.nix | 0 hosts/valefar/hardware.nix | 0 hosts/valefar/secrets.nix | 0 modules/caddy/default.nix | 0 modules/forgejo/default.nix | 0 modules/garage/default.nix | 0 modules/github-runners/default.nix | 0 secrets/build-token.age | Bin secrets/garage-admin-token.age | Bin secrets/garage-metrics-token.age | Bin secrets/garage-rpc-secret.age | Bin secrets/secrets.nix | 0 35 files changed, 110 insertions(+), 13 deletions(-) mode change 100644 => 100755 README.md mode change 100644 => 100755 common/desktop/core.nix mode change 100644 => 100755 common/desktop/sway.nix mode change 100644 => 100755 common/efi.nix mode change 100644 => 100755 common/nvidia.nix mode change 100644 => 100755 common/services.nix mode change 100644 => 100755 common/system.nix mode change 100644 => 100755 common/users.nix mode change 100644 => 100755 flake.lock mode change 100644 => 100755 flake.nix mode change 100644 => 100755 home/regent/home.nix mode change 100644 => 100755 host-secrets.nix mode change 100644 => 100755 hosts/buer/default.nix mode change 100644 => 100755 hosts/buer/hardware.nix mode change 100644 => 100755 hosts/buer/secrets.nix create mode 100755 hosts/focalor/backup.nix mode change 100644 => 100755 hosts/focalor/default.nix mode change 100644 => 100755 hosts/focalor/hardware.nix mode change 100644 => 100755 hosts/focalor/secrets.nix create mode 100644 hosts/focalor/vfio.nix mode change 100644 => 100755 hosts/morax/default.nix mode change 100644 => 100755 hosts/morax/hardware.nix mode change 100644 => 100755 hosts/morax/secrets.nix mode change 100644 => 100755 hosts/valefar/default.nix mode change 100644 => 100755 hosts/valefar/hardware.nix mode change 100644 => 100755 hosts/valefar/secrets.nix mode change 100644 => 100755 modules/caddy/default.nix mode change 100644 => 100755 modules/forgejo/default.nix mode change 100644 => 100755 modules/garage/default.nix mode change 100644 => 100755 modules/github-runners/default.nix mode change 100644 => 100755 secrets/build-token.age mode change 100644 => 100755 secrets/garage-admin-token.age mode change 100644 => 100755 secrets/garage-metrics-token.age mode change 100644 => 100755 secrets/garage-rpc-secret.age mode change 100644 => 100755 secrets/secrets.nix diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/common/desktop/core.nix b/common/desktop/core.nix old mode 100644 new mode 100755 index cad4382..d03941d --- a/common/desktop/core.nix +++ b/common/desktop/core.nix @@ -2,7 +2,7 @@ { environment.systemPackages = with pkgs; [ - ghostty + #ghostty kitty vscode inputs.zen-browser.packages."${system}".default diff --git a/common/desktop/sway.nix b/common/desktop/sway.nix old mode 100644 new mode 100755 index 7e6615a..10c3505 --- a/common/desktop/sway.nix +++ b/common/desktop/sway.nix @@ -17,13 +17,20 @@ in mako ]; - services.gnome.gnome-keyring.enable = true; - programs.sway = { enable = true; wrapperFeatures.gtk = true; }; + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + GTK_USE_PORTAL=0; + }; + + services.gvfs.enable = true; + services.gnome.gnome-keyring.enable = true; + programs.dconf.enable = true; + services.greetd = { enable = true; settings = { diff --git a/common/efi.nix b/common/efi.nix old mode 100644 new mode 100755 diff --git a/common/nvidia.nix b/common/nvidia.nix old mode 100644 new mode 100755 diff --git a/common/services.nix b/common/services.nix old mode 100644 new mode 100755 diff --git a/common/system.nix b/common/system.nix old mode 100644 new mode 100755 diff --git a/common/users.nix b/common/users.nix old mode 100644 new mode 100755 diff --git a/flake.lock b/flake.lock old mode 100644 new mode 100755 diff --git a/flake.nix b/flake.nix old mode 100644 new mode 100755 diff --git a/home/regent/home.nix b/home/regent/home.nix old mode 100644 new mode 100755 index 017d8d5..2902573 --- a/home/regent/home.nix +++ b/home/regent/home.nix @@ -11,8 +11,23 @@ /*waybar = { doesnt work for some reason enable = true; };*/ + ghostty.enable = true; + ghostty.flavor = "mocha"; }; + programs.ghostty.enable = true; + programs.ghostty.settings = { + font-size = 24; + theme = "catppuccin-mocha"; + }; + + home.pointerCursor = { + gtk.enable = true; + package = pkgs.phinger-cursors; + name = "Phinger-cursors-light"; + size = 48; + }; + programs.waybar = { enable = true; style = @@ -55,13 +70,14 @@ window#waybar { padding: 0px; margin: 0px; border: 0px; - background-color:rgb(0, 0, 0); + /*background-color:rgb(0, 0, 0);*/ + background-color: rgba(0, 0, 0, 0.9); color: @text; } -window#waybar.empty { +/*window#waybar.empty { background-color:rgba(255, 255, 255, 0); -} +}*/ #workspaces { border-radius: 1rem; diff --git a/host-secrets.nix b/host-secrets.nix old mode 100644 new mode 100755 diff --git a/hosts/buer/default.nix b/hosts/buer/default.nix old mode 100644 new mode 100755 diff --git a/hosts/buer/hardware.nix b/hosts/buer/hardware.nix old mode 100644 new mode 100755 diff --git a/hosts/buer/secrets.nix b/hosts/buer/secrets.nix old mode 100644 new mode 100755 diff --git a/hosts/focalor/backup.nix b/hosts/focalor/backup.nix new file mode 100755 index 0000000..a97777f --- /dev/null +++ b/hosts/focalor/backup.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2009b305-f22d-4a5c-c49a2303232b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E53C-502F"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ #{ device = "/dev/disk/by-uuid/3029e270-a5f5-4a97-a29b-f2bc3e3a33a8"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix old mode 100644 new mode 100755 index 80f6a7a..41e15fc --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -73,4 +73,13 @@ buildGoModule = pkgs.buildGo123Module; }; }; + + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + ]; + }; } diff --git a/hosts/focalor/hardware.nix b/hosts/focalor/hardware.nix old mode 100644 new mode 100755 index ec76a06..730004d --- a/hosts/focalor/hardware.nix +++ b/hosts/focalor/hardware.nix @@ -8,25 +8,30 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ + "vfio" "vfio_iommu_type1" "vfio_pci" + "nvidia" "nvidia-modeset" "nvidia_uvm" "nvidia_drm" + ]; boot.kernelModules = [ "kvm-amd" ]; + boot.kernelParams = [ + "amd_iommu=on" + "vfio-pci.ids=10de:2484,10de228b,1022:149c" + ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/01c4129c-ace4-495a-941e-c5fa893a0bb4"; + { device = "/dev/disk/by-uuid/2009b305-f22d-4d5c-a9d3-c49a2303232b"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6CCE-47E4"; + { device = "/dev/disk/by-uuid/E53C-502F"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; - swapDevices = - [ { device = "/dev/disk/by-uuid/3029e270-a5f5-4a97-a29b-f2bc3e3a33a8"; } - ]; + swapDevices = [ ]; # 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 diff --git a/hosts/focalor/secrets.nix b/hosts/focalor/secrets.nix old mode 100644 new mode 100755 diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix new file mode 100644 index 0000000..e0d1cfa --- /dev/null +++ b/hosts/focalor/vfio.nix @@ -0,0 +1,19 @@ +programs.virt-manager.enable = true; +virtualisation.spiceUSBRedirection.enable = true; +virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [(pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd]; + }; + }; +}; + +users.extraUsers.regent.extraGroups = [ "libvirtd" ]; \ No newline at end of file diff --git a/hosts/morax/default.nix b/hosts/morax/default.nix old mode 100644 new mode 100755 diff --git a/hosts/morax/hardware.nix b/hosts/morax/hardware.nix old mode 100644 new mode 100755 diff --git a/hosts/morax/secrets.nix b/hosts/morax/secrets.nix old mode 100644 new mode 100755 diff --git a/hosts/valefar/default.nix b/hosts/valefar/default.nix old mode 100644 new mode 100755 diff --git a/hosts/valefar/hardware.nix b/hosts/valefar/hardware.nix old mode 100644 new mode 100755 diff --git a/hosts/valefar/secrets.nix b/hosts/valefar/secrets.nix old mode 100644 new mode 100755 diff --git a/modules/caddy/default.nix b/modules/caddy/default.nix old mode 100644 new mode 100755 diff --git a/modules/forgejo/default.nix b/modules/forgejo/default.nix old mode 100644 new mode 100755 diff --git a/modules/garage/default.nix b/modules/garage/default.nix old mode 100644 new mode 100755 diff --git a/modules/github-runners/default.nix b/modules/github-runners/default.nix old mode 100644 new mode 100755 diff --git a/secrets/build-token.age b/secrets/build-token.age old mode 100644 new mode 100755 diff --git a/secrets/garage-admin-token.age b/secrets/garage-admin-token.age old mode 100644 new mode 100755 diff --git a/secrets/garage-metrics-token.age b/secrets/garage-metrics-token.age old mode 100644 new mode 100755 diff --git a/secrets/garage-rpc-secret.age b/secrets/garage-rpc-secret.age old mode 100644 new mode 100755 diff --git a/secrets/secrets.nix b/secrets/secrets.nix old mode 100644 new mode 100755 From 7fcf7e9bfb7d3429d5ab8ec48716ff790c7b7094 Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 02:59:19 -0400 Subject: [PATCH 02/16] add vnc and add it to focalor --- common/vnc.nix | 17 +++++++++++++++++ flake.nix | 9 +++++++++ hosts/focalor/default.nix | 34 ++++++++++++++++++++++++++++++++-- hosts/focalor/vfio.nix | 36 ++++++++++++++++++++---------------- 4 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 common/vnc.nix diff --git a/common/vnc.nix b/common/vnc.nix new file mode 100644 index 0000000..60225ff --- /dev/null +++ b/common/vnc.nix @@ -0,0 +1,17 @@ +{ pkgs, config, ...}: + +{ + services.xserver.enable = true; + services.xserver.displayManager.autoLogin = { + enable = true; + user = "regent"; + }; + + services.xserver.displayManager.sessionCommands = '' + ${pkgs.x11vnc}/bin/x11vnc -rfbauth $HOME/.vnc/passwd & + ''; + + services.xserver.desktopManager.xfce = { + enable = true; + } +}; diff --git a/flake.nix b/flake.nix index bbcf3d8..8c3f80a 100755 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,8 @@ url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + #microvm.url = "github:astro/microvm.nix"; + #microvm.inputs.nixpkgs.follows = "nixpkgs"; catppuccin.url = "github:catppuccin/nix"; home-manager = { @@ -46,6 +48,13 @@ ./hosts/focalor lix-module.nixosModules.default + /*microvm.nixosModules.host + { + microvm.autostart = [ + "windows" + ]; + }*/ + vscode-server.nixosModules.default agenix.nixosModules.default diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 41e15fc..0ae05c4 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -6,6 +6,7 @@ # Host-specific hardware ./hardware.nix ./secrets.nix + ./vfio.nix # Common modules shared across hosts ../../common/system.nix @@ -16,6 +17,7 @@ # Desktop modules ../../common/desktop/core.nix ../../common/desktop/sway.nix + ../../common/desktop/vnc.nix # Nvidia ../../common/nvidia.nix @@ -34,7 +36,35 @@ networking.hostName = "focalor"; networking.hostId = "84bdc587"; - networking = { + systemd.network = { + enable = true; + netdevs."br0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; + }; + networks = { + "10-lan" = { + matchConfig.Name = ["enp5s0" "vm-*"]; + networkConfig = { + Bridge = "br0"; + }; + }; + "10-lan-bridge" = { + matchConfig.Name = "br0"; + networkConfig = { + Address = ["10.0.0.34/24" "2601:5c2:8400:26c0:aaa1:59ff:fe94:5aba/64"]; + Gateway = "10.0.0.1"; + DNS = ["10.0.0.210" "1.1.1.1"]; + IPv6AcceptRA = true; + }; + linkConfig.RequiredForOnline = "routable"; + }; + }; + }; + + /*networking = { firewall.enable = false; firewall.trustedInterfaces = [ "tailscale0" @@ -42,7 +72,7 @@ nameservers = [ "10.0.0.210" "1.1.1.1" ]; useDHCP = true; firewall.allowedTCPPorts = [22 80 443 2456 2457 9000 9001 9002]; - }; + };*/ services.resolved = { enable = true; diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index e0d1cfa..eb144df 100644 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -1,19 +1,23 @@ -programs.virt-manager.enable = true; -virtualisation.spiceUSBRedirection.enable = true; -virtualisation.libvirtd = { - enable = true; - qemu = { - package = pkgs.qemu_kvm; - runAsRoot = true; - swtpm.enable = true; - ovmf = { - enable = true; - packages = [(pkgs.OVMF.override { - secureBoot = true; - tpmSupport = true; - }).fd]; +{ config, lib, system, pkgs, modulesPath, inputs, ... }: + +{ + programs.virt-manager.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [(pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd]; + }; }; }; -}; -users.extraUsers.regent.extraGroups = [ "libvirtd" ]; \ No newline at end of file + users.extraUsers.regent.extraGroups = [ "libvirtd" ]; +} \ No newline at end of file From fd98ce38b06ba7479d4f03c341d5c7a2f34db65b Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 02:59:54 -0400 Subject: [PATCH 03/16] I HATE --- common/{ => desktop}/vnc.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename common/{ => desktop}/vnc.nix (100%) diff --git a/common/vnc.nix b/common/desktop/vnc.nix similarity index 100% rename from common/vnc.nix rename to common/desktop/vnc.nix From 4c43693c0f56ce70f36c8a4f330ba479c5a179c0 Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 23:31:18 +0000 Subject: [PATCH 04/16] wehhh --- common/desktop/vnc.nix | 18 ++++++------------ hosts/focalor/default.nix | 5 ++++- hosts/focalor/hardware.nix | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/common/desktop/vnc.nix b/common/desktop/vnc.nix index 60225ff..e395c0a 100644 --- a/common/desktop/vnc.nix +++ b/common/desktop/vnc.nix @@ -2,16 +2,10 @@ { services.xserver.enable = true; - services.xserver.displayManager.autoLogin = { - enable = true; - user = "regent"; - }; + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.sessionCommands = '' - ${pkgs.x11vnc}/bin/x11vnc -rfbauth $HOME/.vnc/passwd & - ''; - - services.xserver.desktopManager.xfce = { - enable = true; - } -}; + services.xrdp.enable = true; + services.xrdp.defaultWindowManager = "startplasma-x11"; + services.xrdp.openFirewall = true; +} diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 0ae05c4..b7e3f8a 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -87,10 +87,13 @@ #services.zfs.autoScrub.enable = true; #services.zfs.trim.enable = true; + + services.vscode-server.enable = true; + services.vscode-server.nodejsPackage = pkgs.nodejs_20; environment.systemPackages = with pkgs; [ #lm_sensors - code-server + #code-server inputs.agenix.packages.x86_64-linux.default ]; diff --git a/hosts/focalor/hardware.nix b/hosts/focalor/hardware.nix index 730004d..d17b906 100755 --- a/hosts/focalor/hardware.nix +++ b/hosts/focalor/hardware.nix @@ -16,7 +16,7 @@ boot.kernelModules = [ "kvm-amd" ]; boot.kernelParams = [ "amd_iommu=on" - "vfio-pci.ids=10de:2484,10de228b,1022:149c" + "vfio-pci.ids=10de:2484,10de228b,1022:149c,15b7:5045" ]; boot.extraModulePackages = [ ]; From 822c9b62bf4c1daccf8d3c9560fecbb8e836d4cb Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 20:17:19 -0400 Subject: [PATCH 05/16] idk --- common/desktop/vnc.nix | 0 hosts/focalor/backup.nix | 17 +++++++++++------ hosts/focalor/default.nix | 4 ++-- hosts/focalor/hardware.nix | 19 ++++++------------- hosts/focalor/vfio.nix | 0 5 files changed, 19 insertions(+), 21 deletions(-) mode change 100644 => 100755 common/desktop/vnc.nix mode change 100644 => 100755 hosts/focalor/vfio.nix diff --git a/common/desktop/vnc.nix b/common/desktop/vnc.nix old mode 100644 new mode 100755 diff --git a/hosts/focalor/backup.nix b/hosts/focalor/backup.nix index a97777f..d17b906 100755 --- a/hosts/focalor/backup.nix +++ b/hosts/focalor/backup.nix @@ -8,13 +8,20 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ + "vfio" "vfio_iommu_type1" "vfio_pci" + "nvidia" "nvidia-modeset" "nvidia_uvm" "nvidia_drm" + ]; boot.kernelModules = [ "kvm-amd" ]; + boot.kernelParams = [ + "amd_iommu=on" + "vfio-pci.ids=10de:2484,10de228b,1022:149c,15b7:5045" + ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/2009b305-f22d-4a5c-c49a2303232b"; + { device = "/dev/disk/by-uuid/2009b305-f22d-4d5c-a9d3-c49a2303232b"; fsType = "ext4"; }; @@ -24,9 +31,7 @@ options = [ "fmask=0077" "dmask=0077" ]; }; - swapDevices = - [ #{ device = "/dev/disk/by-uuid/3029e270-a5f5-4a97-a29b-f2bc3e3a33a8"; } - ]; + swapDevices = [ ]; # 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 diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index b7e3f8a..5fde37e 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -6,7 +6,7 @@ # Host-specific hardware ./hardware.nix ./secrets.nix - ./vfio.nix + #./vfio.nix # Common modules shared across hosts ../../common/system.nix @@ -26,7 +26,7 @@ #../../host-secrets.nix ]; - system.stateVersion = "24.11"; + system.stateVersion = "25.05"; # pin host platform & microcode nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/hosts/focalor/hardware.nix b/hosts/focalor/hardware.nix index d17b906..b290f2f 100755 --- a/hosts/focalor/hardware.nix +++ b/hosts/focalor/hardware.nix @@ -8,27 +8,20 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ - "vfio" "vfio_iommu_type1" "vfio_pci" - "nvidia" "nvidia-modeset" "nvidia_uvm" "nvidia_drm" - ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; - boot.kernelParams = [ - "amd_iommu=on" - "vfio-pci.ids=10de:2484,10de228b,1022:149c,15b7:5045" - ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/2009b305-f22d-4d5c-a9d3-c49a2303232b"; + { device = "/dev/disk/by-uuid/5d42a325-ba0d-4d40-906b-d28603b433ef"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/E53C-502F"; + { device = "/dev/disk/by-uuid/404A-728D"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ "fmask=0022" "dmask=0022" ]; }; swapDevices = [ ]; @@ -37,7 +30,7 @@ # (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..useDHCP`. - networking.useDHCP = lib.mkDefault true; + # networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix old mode 100644 new mode 100755 From eb628e5a7490b8cd6781b5c54f2d1e19bf45dd10 Mon Sep 17 00:00:00 2001 From: waveringana Date: Wed, 11 Jun 2025 20:23:59 -0400 Subject: [PATCH 06/16] update vnc.nix --- common/desktop/vnc.nix | 4 ++-- hosts/focalor/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/desktop/vnc.nix b/common/desktop/vnc.nix index e395c0a..527c39b 100755 --- a/common/desktop/vnc.nix +++ b/common/desktop/vnc.nix @@ -2,8 +2,8 @@ { services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; services.xrdp.enable = true; services.xrdp.defaultWindowManager = "startplasma-x11"; diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 5fde37e..497f0f3 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -6,7 +6,7 @@ # Host-specific hardware ./hardware.nix ./secrets.nix - #./vfio.nix + ./vfio.nix # Common modules shared across hosts ../../common/system.nix From 1a13656f958ebdd855058b524176c1c964420d56 Mon Sep 17 00:00:00 2001 From: waveringana Date: Sun, 15 Jun 2025 05:35:32 -0400 Subject: [PATCH 07/16] add end script --- hosts/focalor/hardware.nix | 6 +++++- hosts/focalor/scripts/end.sh | 20 ++++++++++++++++++++ hosts/focalor/vfio.nix | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 hosts/focalor/scripts/end.sh diff --git a/hosts/focalor/hardware.nix b/hosts/focalor/hardware.nix index b290f2f..126d39c 100755 --- a/hosts/focalor/hardware.nix +++ b/hosts/focalor/hardware.nix @@ -9,8 +9,12 @@ ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" ]; boot.kernelModules = [ "kvm-amd" ]; + boot.kernelParams = [ + "amd_iommu=on" + "vfio-pci.ids=10de:2484,10de228b,1022:149c,15b7:5045,1dbe:5236,1022:149c" + ]; boot.extraModulePackages = [ ]; fileSystems."/" = diff --git a/hosts/focalor/scripts/end.sh b/hosts/focalor/scripts/end.sh new file mode 100644 index 0000000..a08a269 --- /dev/null +++ b/hosts/focalor/scripts/end.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -x + +virsh nodedev-reattach pci_0000_0a_00_0 +virsh nodedev-reattach pci_0000_0a_00_1 +virsh nodedev-reattach pci_0000_06_00_1 +virsh nodedev-reattach pci_0000_06_00_3 +virsh nodedev-reattach pci_0000_0c_00_3 + +modprobe -r vfio-pci + +modprobe nvidia_modeset +modprobe nvidia_uvm +modprobe nvidia_drm +modprobe nvidia + +modprobe -r xhci_pci +modprobe xhci_pci + +systemctl restart display-manager diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index eb144df..e0d73f7 100755 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -17,6 +17,9 @@ }).fd]; }; }; + hooks.qemu = { + end = "./scripts/end.sh"; + }; }; users.extraUsers.regent.extraGroups = [ "libvirtd" ]; From e0c6926ba044fdfde43793d47d6a07b564be83ff Mon Sep 17 00:00:00 2001 From: waveringana Date: Sun, 15 Jun 2025 05:57:32 -0400 Subject: [PATCH 08/16] more fixes --- hosts/focalor/scripts/end.sh | 20 --------- hosts/focalor/scripts/vm-win11-hook.sh | 57 ++++++++++++++++++++++++++ hosts/focalor/vfio.nix | 37 ++++++++++++++++- result | 1 + 4 files changed, 94 insertions(+), 21 deletions(-) delete mode 100644 hosts/focalor/scripts/end.sh create mode 100644 hosts/focalor/scripts/vm-win11-hook.sh create mode 120000 result diff --git a/hosts/focalor/scripts/end.sh b/hosts/focalor/scripts/end.sh deleted file mode 100644 index a08a269..0000000 --- a/hosts/focalor/scripts/end.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -x - -virsh nodedev-reattach pci_0000_0a_00_0 -virsh nodedev-reattach pci_0000_0a_00_1 -virsh nodedev-reattach pci_0000_06_00_1 -virsh nodedev-reattach pci_0000_06_00_3 -virsh nodedev-reattach pci_0000_0c_00_3 - -modprobe -r vfio-pci - -modprobe nvidia_modeset -modprobe nvidia_uvm -modprobe nvidia_drm -modprobe nvidia - -modprobe -r xhci_pci -modprobe xhci_pci - -systemctl restart display-manager diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh new file mode 100644 index 0000000..59b39f5 --- /dev/null +++ b/hosts/focalor/scripts/vm-win11-hook.sh @@ -0,0 +1,57 @@ +#!/run/current-system/sw/bin/bash + +readonly GUEST_NAME="$1" +readonly HOOK_NAME="$2" +readonly STATE_NAME="$3" + +function start_hook() { + # Stops GUI + systemctl isolate multi-user.target + + # Avoids race condition + sleep 2 + + # Unloads the NVIDIA drivers + modprobe -r nvidia_drm + modprobe -r nvidia_uvm + modprobe -r nvidia_modeset + modprobe -r nvidia + + # Other code you might want to run +} + +function revert_hook() { + virsh nodedev-reattach pci_0000_0a_00_0 + virsh nodedev-reattach pci_0000_0a_00_1 + virsh nodedev-reattach pci_0000_06_00_1 + virsh nodedev-reattach pci_0000_06_00_3 + virsh nodedev-reattach pci_0000_0c_00_3 + + modprobe -r vfio-pci + + # Loads the NVIDIA drivers + modprobe nvidia_modeset + modprobe nvidia_uvm + modprobe nvidia_drm + modprobe nvidia + + modprobe -r xhci_pci + modprobe xhci_pci + + # Starts the UI again + systemctl restart display-manager + systemctl isolate graphical.target +} + +# I am not using the script from Passthrough-Post +# because hooks option saves it to /var/lib/libvirt/hooks/qemu.d. +# It's simpler to just rewrite it for NixOS. +if [[ "$GUEST_NAME" != "win11" ]]; then + exit 0 +fi + +if [[ "$HOOK_NAME" == "prepare" && "$STATE_NAME" == "begin" ]]; then + start_hook +elif [[ "$HOOK_NAME" == "release" && "$STATE_NAME" == "end" ]]; then + revert_hook +fi \ No newline at end of file diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index e0d73f7..ebd2e0c 100755 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -18,9 +18,44 @@ }; }; hooks.qemu = { - end = "./scripts/end.sh"; + "win11" = ./scripts/vm-win11-hook.sh; }; }; + systemd.services.libvirtd = { + path = let + env = pkgs.buildEnv { + name = "qemu-hook-env"; + paths = with pkgs; [ + bash + libvirt + kmod + systemd + ripgrep + sd + ]; + }; + in + [ env ]; + + /*preStart = + '' + mkdir -p /var/lib/libvirt/hooks + mkdir -p /var/lib/libvirt/hooks/qemu.d/win10/prepare/begin + mkdir -p /var/lib/libvirt/hooks/qemu.d/win10/release/end + mkdir -p /var/lib/libvirt/vgabios + + ln -sf /home/regent/symlinks/qemu /var/lib/libvirt/hooks/qemu + ln -sf /home/regent/symlinks/kvm.conf /var/lib/libvirt/hooks/kvm.conf + ln -sf /home/regent/symlinks/start.sh /var/lib/libvirt/hooks/qemu.d/win11/prepare/begin/start.sh + ln -sf /home/regent/symlinks/stop.sh /var/lib/libvirt/hooks/qemu.d/win11/release/end/stop.sh + + chmod +x /var/lib/libvirt/hooks/qemu + chmod +x /var/lib/libvirt/hooks/kvm.conf + chmod +x /var/lib/libvirt/hooks/qemu.d/win11/prepare/begin/start.sh + chmod +x /var/lib/libvirt/hooks/qemu.d/win11/release/end/stop.sh + '';*/ + }; + users.extraUsers.regent.extraGroups = [ "libvirtd" ]; } \ No newline at end of file diff --git a/result b/result new file mode 120000 index 0000000..3785af3 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/4483jzzk7w649g57g0p1gfnk2skkz85v-nixos-system-focalor-25.05.20250525.7c43f08 \ No newline at end of file From 23bf9ccaa3ed405f9459092bbd8e4d228dca3ba0 Mon Sep 17 00:00:00 2001 From: waveringana Date: Sun, 15 Jun 2025 06:11:29 -0400 Subject: [PATCH 09/16] meow --- hosts/focalor/scripts/vm-win11-hook.sh | 6 +++++- hosts/focalor/vfio.nix | 4 ++-- result | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 120000 result diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh index 59b39f5..6c9232e 100644 --- a/hosts/focalor/scripts/vm-win11-hook.sh +++ b/hosts/focalor/scripts/vm-win11-hook.sh @@ -1,5 +1,9 @@ #!/run/current-system/sw/bin/bash +echo "qemu-hook: ${1} ${2}" >> /tmp/qemu-hook.log + +set -x + readonly GUEST_NAME="$1" readonly HOOK_NAME="$2" readonly STATE_NAME="$3" @@ -54,4 +58,4 @@ if [[ "$HOOK_NAME" == "prepare" && "$STATE_NAME" == "begin" ]]; then start_hook elif [[ "$HOOK_NAME" == "release" && "$STATE_NAME" == "end" ]]; then revert_hook -fi \ No newline at end of file +fi diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index ebd2e0c..07cac37 100755 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -18,7 +18,7 @@ }; }; hooks.qemu = { - "win11" = ./scripts/vm-win11-hook.sh; + win11 = ./scripts/vm-win11-hook.sh; }; }; @@ -58,4 +58,4 @@ }; users.extraUsers.regent.extraGroups = [ "libvirtd" ]; -} \ No newline at end of file +} diff --git a/result b/result deleted file mode 120000 index 3785af3..0000000 --- a/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/4483jzzk7w649g57g0p1gfnk2skkz85v-nixos-system-focalor-25.05.20250525.7c43f08 \ No newline at end of file From 8cd6aa6afe6414224d309d93b3d2b8f514d7842d Mon Sep 17 00:00:00 2001 From: waveringana Date: Sun, 15 Jun 2025 06:14:33 -0400 Subject: [PATCH 10/16] maybe its permission issues --- hosts/focalor/scripts/vm-win11-hook.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 hosts/focalor/scripts/vm-win11-hook.sh diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh old mode 100644 new mode 100755 From 8f7da696e5b5523492a9c7ee1885c54ddfbadaa6 Mon Sep 17 00:00:00 2001 From: waveringana Date: Sun, 15 Jun 2025 19:59:08 -0400 Subject: [PATCH 11/16] use swayfx --- common/desktop/sway.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/desktop/sway.nix b/common/desktop/sway.nix index 10c3505..f6514b4 100755 --- a/common/desktop/sway.nix +++ b/common/desktop/sway.nix @@ -20,6 +20,7 @@ in programs.sway = { enable = true; wrapperFeatures.gtk = true; + package = pkgs.swayfx; }; environment.sessionVariables = { From 397d3b06f1d4cf88b964f137c2e024f1b62bcf3f Mon Sep 17 00:00:00 2001 From: waveringana Date: Mon, 16 Jun 2025 00:33:29 -0400 Subject: [PATCH 12/16] why cant git pull just pull --- common/desktop/core.nix | 1 + common/desktop/sway.nix | 1 - home/regent/home.nix | 22 +++++++++++++++++++--- hosts/focalor/default.nix | 21 +++++---------------- hosts/focalor/scripts/vm-win11-hook.sh | 2 +- hosts/focalor/vfio.nix | 18 ------------------ 6 files changed, 26 insertions(+), 39 deletions(-) diff --git a/common/desktop/core.nix b/common/desktop/core.nix index d03941d..1589246 100755 --- a/common/desktop/core.nix +++ b/common/desktop/core.nix @@ -10,6 +10,7 @@ hyfetch sway-contrib.grimshot discord + pamixer ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/common/desktop/sway.nix b/common/desktop/sway.nix index f6514b4..10c3505 100755 --- a/common/desktop/sway.nix +++ b/common/desktop/sway.nix @@ -20,7 +20,6 @@ in programs.sway = { enable = true; wrapperFeatures.gtk = true; - package = pkgs.swayfx; }; environment.sessionVariables = { diff --git a/home/regent/home.nix b/home/regent/home.nix index 2902573..eec321a 100755 --- a/home/regent/home.nix +++ b/home/regent/home.nix @@ -13,6 +13,8 @@ };*/ ghostty.enable = true; ghostty.flavor = "mocha"; + nvim.enable = true; + nvim.flavor = "mocha"; }; programs.ghostty.enable = true; @@ -21,6 +23,20 @@ theme = "catppuccin-mocha"; }; + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + plugins = with pkgs.vimPlugins; [ + nvim-lspconfig + nvim-treesitter.withAllGrammars + plenary-nvim + mini-nvim + ]; + }; + home.pointerCursor = { gtk.enable = true; package = pkgs.phinger-cursors; @@ -71,7 +87,7 @@ window#waybar { margin: 0px; border: 0px; /*background-color:rgb(0, 0, 0);*/ - background-color: rgba(0, 0, 0, 0.9); + background-color: rgba(0, 0, 0, 0.8); color: @text; } @@ -130,7 +146,7 @@ window#waybar { height = 34; output = [ "HDMI-A-1" - "DP-2" + "DP-1" ]; modules-left = [ "sway/workspaces" ]; modules-center = [ "sway/window" ]; @@ -145,4 +161,4 @@ window#waybar { }; home.stateVersion = "25.05"; -} \ No newline at end of file +} diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 497f0f3..a76c701 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -36,6 +36,11 @@ networking.hostName = "focalor"; networking.hostId = "84bdc587"; + programs.steam.enable = true; + programs.steam.gamescopeSession.enable = true; + programs.appimage.enable = true; + programs.appimage.binfmt = true; + systemd.network = { enable = true; netdevs."br0" = { @@ -64,16 +69,6 @@ }; }; - /*networking = { - firewall.enable = false; - firewall.trustedInterfaces = [ - "tailscale0" - ]; - nameservers = [ "10.0.0.210" "1.1.1.1" ]; - useDHCP = true; - firewall.allowedTCPPorts = [22 80 443 2456 2457 9000 9001 9002]; - };*/ - services.resolved = { enable = true; dnssec = "true"; @@ -82,12 +77,6 @@ dnsovertls = "true"; }; - #boot.supportedFilesystems = [ "zfs" ]; - #boot.kernelModules = [ "nct6775" "coretemp" ]; - - #services.zfs.autoScrub.enable = true; - #services.zfs.trim.enable = true; - services.vscode-server.enable = true; services.vscode-server.nodejsPackage = pkgs.nodejs_20; diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh index 6c9232e..ab8a870 100755 --- a/hosts/focalor/scripts/vm-win11-hook.sh +++ b/hosts/focalor/scripts/vm-win11-hook.sh @@ -55,7 +55,7 @@ if [[ "$GUEST_NAME" != "win11" ]]; then fi if [[ "$HOOK_NAME" == "prepare" && "$STATE_NAME" == "begin" ]]; then - start_hook + echo "do nothing" elif [[ "$HOOK_NAME" == "release" && "$STATE_NAME" == "end" ]]; then revert_hook fi diff --git a/hosts/focalor/vfio.nix b/hosts/focalor/vfio.nix index 07cac37..85b3b1c 100755 --- a/hosts/focalor/vfio.nix +++ b/hosts/focalor/vfio.nix @@ -37,24 +37,6 @@ }; in [ env ]; - - /*preStart = - '' - mkdir -p /var/lib/libvirt/hooks - mkdir -p /var/lib/libvirt/hooks/qemu.d/win10/prepare/begin - mkdir -p /var/lib/libvirt/hooks/qemu.d/win10/release/end - mkdir -p /var/lib/libvirt/vgabios - - ln -sf /home/regent/symlinks/qemu /var/lib/libvirt/hooks/qemu - ln -sf /home/regent/symlinks/kvm.conf /var/lib/libvirt/hooks/kvm.conf - ln -sf /home/regent/symlinks/start.sh /var/lib/libvirt/hooks/qemu.d/win11/prepare/begin/start.sh - ln -sf /home/regent/symlinks/stop.sh /var/lib/libvirt/hooks/qemu.d/win11/release/end/stop.sh - - chmod +x /var/lib/libvirt/hooks/qemu - chmod +x /var/lib/libvirt/hooks/kvm.conf - chmod +x /var/lib/libvirt/hooks/qemu.d/win11/prepare/begin/start.sh - chmod +x /var/lib/libvirt/hooks/qemu.d/win11/release/end/stop.sh - '';*/ }; users.extraUsers.regent.extraGroups = [ "libvirtd" ]; From c2db155794f1f285951ec09ec1299c67f47935ed Mon Sep 17 00:00:00 2001 From: waveringana Date: Mon, 16 Jun 2025 00:33:50 -0400 Subject: [PATCH 13/16] idk --- common/desktop/core.nix | 1 - home/regent/home.nix | 22 +++------------------- hosts/focalor/default.nix | 21 ++++++++++++++++----- hosts/focalor/scripts/vm-win11-hook.sh | 2 +- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/common/desktop/core.nix b/common/desktop/core.nix index 1589246..d03941d 100755 --- a/common/desktop/core.nix +++ b/common/desktop/core.nix @@ -10,7 +10,6 @@ hyfetch sway-contrib.grimshot discord - pamixer ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/home/regent/home.nix b/home/regent/home.nix index eec321a..2902573 100755 --- a/home/regent/home.nix +++ b/home/regent/home.nix @@ -13,8 +13,6 @@ };*/ ghostty.enable = true; ghostty.flavor = "mocha"; - nvim.enable = true; - nvim.flavor = "mocha"; }; programs.ghostty.enable = true; @@ -23,20 +21,6 @@ theme = "catppuccin-mocha"; }; - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - plugins = with pkgs.vimPlugins; [ - nvim-lspconfig - nvim-treesitter.withAllGrammars - plenary-nvim - mini-nvim - ]; - }; - home.pointerCursor = { gtk.enable = true; package = pkgs.phinger-cursors; @@ -87,7 +71,7 @@ window#waybar { margin: 0px; border: 0px; /*background-color:rgb(0, 0, 0);*/ - background-color: rgba(0, 0, 0, 0.8); + background-color: rgba(0, 0, 0, 0.9); color: @text; } @@ -146,7 +130,7 @@ window#waybar { height = 34; output = [ "HDMI-A-1" - "DP-1" + "DP-2" ]; modules-left = [ "sway/workspaces" ]; modules-center = [ "sway/window" ]; @@ -161,4 +145,4 @@ window#waybar { }; home.stateVersion = "25.05"; -} +} \ No newline at end of file diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index a76c701..497f0f3 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -36,11 +36,6 @@ networking.hostName = "focalor"; networking.hostId = "84bdc587"; - programs.steam.enable = true; - programs.steam.gamescopeSession.enable = true; - programs.appimage.enable = true; - programs.appimage.binfmt = true; - systemd.network = { enable = true; netdevs."br0" = { @@ -69,6 +64,16 @@ }; }; + /*networking = { + firewall.enable = false; + firewall.trustedInterfaces = [ + "tailscale0" + ]; + nameservers = [ "10.0.0.210" "1.1.1.1" ]; + useDHCP = true; + firewall.allowedTCPPorts = [22 80 443 2456 2457 9000 9001 9002]; + };*/ + services.resolved = { enable = true; dnssec = "true"; @@ -77,6 +82,12 @@ dnsovertls = "true"; }; + #boot.supportedFilesystems = [ "zfs" ]; + #boot.kernelModules = [ "nct6775" "coretemp" ]; + + #services.zfs.autoScrub.enable = true; + #services.zfs.trim.enable = true; + services.vscode-server.enable = true; services.vscode-server.nodejsPackage = pkgs.nodejs_20; diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh index ab8a870..6c9232e 100755 --- a/hosts/focalor/scripts/vm-win11-hook.sh +++ b/hosts/focalor/scripts/vm-win11-hook.sh @@ -55,7 +55,7 @@ if [[ "$GUEST_NAME" != "win11" ]]; then fi if [[ "$HOOK_NAME" == "prepare" && "$STATE_NAME" == "begin" ]]; then - echo "do nothing" + start_hook elif [[ "$HOOK_NAME" == "release" && "$STATE_NAME" == "end" ]]; then revert_hook fi From 6361ad60f800f51f880074efaec8cfb8cdb24a3b Mon Sep 17 00:00:00 2001 From: waveringana Date: Mon, 16 Jun 2025 04:17:13 -0400 Subject: [PATCH 14/16] we --- common/bluetooth.nix | 8 +++ common/desktop/core.nix | 5 ++ common/desktop/sway.nix | 1 + home/regent/home.nix | 94 ++++++++++++++++++++++---- hosts/focalor/default.nix | 3 + hosts/focalor/scripts/vm-win11-hook.sh | 3 +- 6 files changed, 100 insertions(+), 14 deletions(-) create mode 100644 common/bluetooth.nix diff --git a/common/bluetooth.nix b/common/bluetooth.nix new file mode 100644 index 0000000..cbb24dc --- /dev/null +++ b/common/bluetooth.nix @@ -0,0 +1,8 @@ +{config, lib ,...} + +{ + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + services.blueman.enable = true; +} diff --git a/common/desktop/core.nix b/common/desktop/core.nix index d03941d..0ff1ff3 100755 --- a/common/desktop/core.nix +++ b/common/desktop/core.nix @@ -10,6 +10,11 @@ hyfetch sway-contrib.grimshot discord + pamixer + ]; + + fonts.packages = [ + pkgs.nerd-fonts.fira-code ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/common/desktop/sway.nix b/common/desktop/sway.nix index 10c3505..f6514b4 100755 --- a/common/desktop/sway.nix +++ b/common/desktop/sway.nix @@ -20,6 +20,7 @@ in programs.sway = { enable = true; wrapperFeatures.gtk = true; + package = pkgs.swayfx; }; environment.sessionVariables = { diff --git a/home/regent/home.nix b/home/regent/home.nix index 2902573..a72a81f 100755 --- a/home/regent/home.nix +++ b/home/regent/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, system, inputs, ... }: +{ config, pkgs, system, inputs, lib, ... }: { home.username = "regent"; @@ -13,6 +13,8 @@ };*/ ghostty.enable = true; ghostty.flavor = "mocha"; + nvim.enable = true; + nvim.flavor = "mocha"; }; programs.ghostty.enable = true; @@ -21,7 +23,20 @@ theme = "catppuccin-mocha"; }; - home.pointerCursor = { + programs.neovim.enable = true; + programs.neovim = { + extraPackages = with pkgs; [ + lua-language-server + stylua + ripgrep + ]; + + plugins = with pkgs.vimPlugins; [ + lazy-nvim + ]; + }; + + home.pointerCursor = { gtk.enable = true; package = pkgs.phinger-cursors; name = "Phinger-cursors-light"; @@ -61,7 +76,7 @@ * { - font-family: FantasqueSansMono Nerd Font; + font-family: 'Fira Code', monospace; font-size: 17px; min-height: 0; } @@ -71,7 +86,7 @@ window#waybar { margin: 0px; border: 0px; /*background-color:rgb(0, 0, 0);*/ - background-color: rgba(0, 0, 0, 0.9); + background-color: @base; color: @text; } @@ -82,11 +97,10 @@ window#waybar { #workspaces { border-radius: 1rem; margin: 5px; - background-color: @surface0; margin-left: 1rem; + background-color: rgba(0, 0, 0, 0.21); } - #workspaces button { color: @lavender; border-radius: 1rem; @@ -96,6 +110,7 @@ window#waybar { #workspaces button.active { color: @sky; border-radius: 1rem; + background-color: rgba(255, 255, 255, 0.5); } #workspaces button:hover { @@ -111,35 +126,88 @@ window#waybar { #pulseaudio, #custom-lock, #custom-power { - background-color: @surface0; padding: 0.5rem 1rem; margin: 5px 0; + color: @text; } #clock { - color: @blue; + color: @text; border-radius: 0px 1rem 1rem 0px; margin-right: 1rem; } - ''; settings = { mainBar = { layer = "top"; position = "top"; - height = 34; + mod = "dock"; + exclusive = true; + passthrough = false; + #gtk-layer-shell = true; + height = 0; output = [ "HDMI-A-1" - "DP-2" + "DP-1" + ]; + modules-left = [ + "sway/workspaces" ]; - modules-left = [ "sway/workspaces" ]; modules-center = [ "sway/window" ]; - modules-right = [ "clock" ]; + modules-right = [ + "pulseaudio" + "clock" + ]; "sway/workspaces" = { disable-scroll = true; sort-by-name = true; }; + tray = { + icon-size = 13; + tooltip = false; + spacing = 10; + }; + network = { + format = "󰖩 {essid}"; + format-disconnected = "󰖪 disconnected"; + }; + clock = { + format = " {:%I:%M %p %m/%d} "; + tooltip-format = '' + {:%Y %B} + {calendar}''; + }; + + pulseaudio = { + format = "{icon} {volume}%"; + tooltip = false; + format-muted = " Muted"; + on-click = "pamixer -t"; + on-scroll-up = "pamixer -i 5"; + on-scroll-down = "pamixer -d 5"; + scroll-step = 5; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ "" "" "" ]; + }; + }; + + "pulseaudio#microphone" = { + format = "{format_source}"; + tooltip = false; + format-source = " {volume}%"; + format-source-muted = " Muted"; + on-click = "pamixer --default-source -t"; + on-scroll-up = "pamixer --default-source -i 5"; + on-scroll-down = "pamixer --default-source -d 5"; + scroll-step = 5; + }; }; }; }; diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 497f0f3..0b77d08 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -13,6 +13,7 @@ ../../common/users.nix ../../common/services.nix ../../common/efi.nix + ../../common/bluetooth.nix # Desktop modules ../../common/desktop/core.nix @@ -64,6 +65,8 @@ }; }; + programs.steam.enable = true; + /*networking = { firewall.enable = false; firewall.trustedInterfaces = [ diff --git a/hosts/focalor/scripts/vm-win11-hook.sh b/hosts/focalor/scripts/vm-win11-hook.sh index 6c9232e..fab6c4f 100755 --- a/hosts/focalor/scripts/vm-win11-hook.sh +++ b/hosts/focalor/scripts/vm-win11-hook.sh @@ -55,7 +55,8 @@ if [[ "$GUEST_NAME" != "win11" ]]; then fi if [[ "$HOOK_NAME" == "prepare" && "$STATE_NAME" == "begin" ]]; then - start_hook + #start_hook + echo "do nothing" elif [[ "$HOOK_NAME" == "release" && "$STATE_NAME" == "end" ]]; then revert_hook fi From 67e4051a2df2451a4030dc2ab3b5bc09376149d7 Mon Sep 17 00:00:00 2001 From: waveringana Date: Mon, 16 Jun 2025 06:33:24 -0400 Subject: [PATCH 15/16] bluetooth --- common/bluetooth.nix | 2 +- hosts/focalor/default.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/bluetooth.nix b/common/bluetooth.nix index cbb24dc..5f33c6a 100644 --- a/common/bluetooth.nix +++ b/common/bluetooth.nix @@ -1,4 +1,4 @@ -{config, lib ,...} +{ config, lib ,... }: { hardware.bluetooth.enable = true; diff --git a/hosts/focalor/default.nix b/hosts/focalor/default.nix index 0b77d08..6d650ea 100755 --- a/hosts/focalor/default.nix +++ b/hosts/focalor/default.nix @@ -94,6 +94,15 @@ services.vscode-server.enable = true; services.vscode-server.nodejsPackage = pkgs.nodejs_20; + + programs.obs-studio = { + enable = true; + enableVirtualCamera = true; + plugins = with pkgs.obs-studio-plugins; [ + droidcam-obs + ]; + }; + environment.systemPackages = with pkgs; [ #lm_sensors #code-server From 058f9bcebdf67b209147ebdd7461b7c01f4e1032 Mon Sep 17 00:00:00 2001 From: waveringana Date: Mon, 16 Jun 2025 06:42:16 -0400 Subject: [PATCH 16/16] add immich --- modules/immich/default.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 modules/immich/default.nix diff --git a/modules/immich/default.nix b/modules/immich/default.nix new file mode 100644 index 0000000..16715d4 --- /dev/null +++ b/modules/immich/default.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.immich; + + immichRoot = "/storage/immich"; #TODO make this configurable through nix + immichPhotos = "${immichRoot}/photos"; +in +{ + options = { + modules = { + immich = { + enable = mkEnableOption "Deploy immich"; + }; + }; + }; + + config = mkIf cfg.enable { + services.immich = { + enable = true; + port = 2283; + host = "photos.nekomimi.pet"; + mediaLocation = immichPhotos; + settings = null; + }; + }; +}; \ No newline at end of file