diff --git a/nixos/ryu/configuration.nix b/nixos/ryu/configuration.nix index 1dbc4ac0..1fb7b490 100644 --- a/nixos/ryu/configuration.nix +++ b/nixos/ryu/configuration.nix @@ -54,11 +54,11 @@ extra-experimental-features = "nix-command flakes auto-allocate-uids"; trusted-users = ["root" "servius"]; substituters = [ - "https://nix-community.cachix.org" + # "https://nix-community.cachix.org" # "https://sh.darksailor.dev" ]; trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" # "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM=" ]; }; @@ -241,6 +241,7 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; + nixpkgs.config.cudaSupport = true; fonts.fontconfig.enable = true; fonts.fontDir.enable = true; @@ -253,6 +254,7 @@ winetricks wineWowPackages.waylandFull + virt-manager gparted nvtopPackages.nvidia quickemu diff --git a/nixos/ryu/services/default.nix b/nixos/ryu/services/default.nix index afaef29d..5bf1e613 100644 --- a/nixos/ryu/services/default.nix +++ b/nixos/ryu/services/default.nix @@ -3,6 +3,7 @@ ./samba.nix ./sunshine.nix ./ollama.nix + ./rsyncd.nix ]; services = { hardware.openrgb.enable = true; diff --git a/nixos/ryu/services/ollama.nix b/nixos/ryu/services/ollama.nix index 5504f2f6..daa00aa4 100644 --- a/nixos/ryu/services/ollama.nix +++ b/nixos/ryu/services/ollama.nix @@ -5,8 +5,7 @@ host = "127.0.0.1"; loadModels = ["deepseek-r1:7b" "deepseek-r1:14b"]; port = 11434; - package = pkgs.ollama-cuda; - # acceleration = "cuda"; + acceleration = "cuda"; }; open-webui = { enable = false; diff --git a/nixos/ryu/services/rsyncd.nix b/nixos/ryu/services/rsyncd.nix new file mode 100644 index 00000000..af04fa37 --- /dev/null +++ b/nixos/ryu/services/rsyncd.nix @@ -0,0 +1,19 @@ +{...}: { + services.rsyncd = { + enable = false; + # openFirewall = true; + settings = { + media = { + path = "/media"; + comment = "Media"; + "read only" = true; + # "use chroot" = "no"; + list = true; + uid = "root"; + gid = "root"; + }; + }; + }; + networking.firewall.allowedTCPPorts = [873]; + networking.firewall.allowedUDPPorts = [873]; +} diff --git a/nixos/ryu/vms/default.nix b/nixos/ryu/vms/default.nix index fb0743da..29f4249c 100644 --- a/nixos/ryu/vms/default.nix +++ b/nixos/ryu/vms/default.nix @@ -1,6 +1,5 @@ { imports = [ - # ./vfio.nix ./win11.nix ]; } diff --git a/nixos/ryu/vms/vfio.nix b/nixos/ryu/vms/vfio.nix deleted file mode 100644 index e69de29b..00000000 diff --git a/nixos/ryu/vms/win11.nix b/nixos/ryu/vms/win11.nix index d2acb8a7..9ac04f98 100644 --- a/nixos/ryu/vms/win11.nix +++ b/nixos/ryu/vms/win11.nix @@ -1,31 +1,34 @@ -{ config, pkgs, lib, ... }: - { + config, + pkgs, + lib, + ... +}: { virtualisation.libvirtd.enable = true; virtualisation.libvirtd.qemu.ovmf.enable = true; virtualisation.libvirtd.qemu.swtpm.enable = true; # IOMMU and VFIO settings - boot.kernelParams = [ - "amd_iommu=on" # Use "intel_iommu=on" for Intel CPUs - "iommu=pt" - "vfio-pci.ids=10de:2504,10de:228e" # Replace with your GPU's vendor:device IDs - ]; + # boot.kernelParams = [ + # "amd_iommu=on" # Use "intel_iommu=on" for Intel CPUs + # "iommu=pt" + # "vfio-pci.ids=10de:2504,10de:228e" # Replace with your GPU's vendor:device IDs + # ]; - boot.kernelModules = [ - "vfio_pci" - "vfio" - "vfio_iommu_type1" - "vfio_virqfd" - ]; - - # Early loading of VFIO - boot.initrd.kernelModules = [ - "vfio_pci" - "vfio" - "vfio_iommu_type1" - "vfio_virqfd" - ]; + # boot.kernelModules = [ + # "vfio_pci" + # "vfio" + # "vfio_iommu_type1" + # "vfio_virqfd" + # ]; + # + # # Early loading of VFIO + # boot.initrd.kernelModules = [ + # "vfio_pci" + # "vfio" + # "vfio_iommu_type1" + # "vfio_virqfd" + # ]; # Define the Windows 11 VM virtualisation.libvirtd.qemu.verbatimConfig = '' @@ -47,87 +50,15 @@ systemd.services.libvirtd-win11 = { description = "Windows 11 VM"; - after = [ "libvirtd.service" ]; - requires = [ "libvirtd.service" ]; + after = ["libvirtd.service"]; + requires = ["libvirtd.service"]; serviceConfig = { Type = "oneshot"; RemainAfterExit = "yes"; - ExecStart = let - win11xml = pkgs.writeText "win11.xml" '' - - win11 - 16 - 8 - - - - - - hvm - /run/libvirt/nix-ovmf/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/win11_VARS.fd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - ''; - in "${pkgs.libvirt}/bin/virsh define ${win11xml} && ${pkgs.libvirt}/bin/virsh start win11"; + ExecStart = "${pkgs.libvirt}/bin/virsh define ${./windows.xml} && ${pkgs.libvirt}/bin/virsh start win11"; ExecStop = "${pkgs.libvirt}/bin/virsh shutdown win11"; }; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; }; # Setup Looking Glass shared memory @@ -151,4 +82,5 @@ boot.kernel.sysctl."vm.nr_hugepages" = 8192; # Optional: Enable looking glass for low-latency VM display -} \ No newline at end of file +} +