From f94f6eab884a847485748fcbd40d8aaa33d67bd6 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sun, 8 Oct 2023 09:51:05 +0300 Subject: [PATCH] a --- flake.lock | 74 ++++++++ flake.nix | 3 + hosts/tkaronto/default.nix | 11 +- hosts/tkaronto/modules/docker.nix | 3 + hosts/tkaronto/modules/gnome.nix.disabled | 1 + hosts/tkaronto/modules/gpu.nix.disabled | 55 ++++++ hosts/tkaronto/modules/tlp.nix | 2 +- hosts/tkaronto/win11.xml | 213 ++++++++++++++++++++++ modules/de/gnome/default.nix | 29 ++- pkgs-set/overlays/calf.nix | 14 ++ pkgs-set/pkgs-to-export.nix | 7 +- pkgs-set/pkgs/fluidsynth-dssi.nix | 40 ++++ pkgs-set/pkgs/phantom.nix | 24 +++ users/modules/sway/default.nix | 2 +- users/patriot/default.nix | 40 +++- users/patriot/stylix.nix | 1 + 16 files changed, 497 insertions(+), 22 deletions(-) create mode 100644 hosts/tkaronto/modules/docker.nix create mode 120000 hosts/tkaronto/modules/gnome.nix.disabled create mode 100644 hosts/tkaronto/modules/gpu.nix.disabled create mode 100644 hosts/tkaronto/win11.xml create mode 100644 pkgs-set/overlays/calf.nix create mode 100644 pkgs-set/pkgs/fluidsynth-dssi.nix create mode 100644 pkgs-set/pkgs/phantom.nix diff --git a/flake.lock b/flake.lock index 7d0fb8a..f709a0b 100644 --- a/flake.lock +++ b/flake.lock @@ -636,6 +636,24 @@ "type": "github" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -1011,6 +1029,21 @@ "type": "github" } }, + "nix-std": { + "locked": { + "lastModified": 1685917625, + "narHash": "sha256-2manVKofCZrCToVDnDYNvtYUFBYOM5JhdDoNGVY4fq4=", + "owner": "chessai", + "repo": "nix-std", + "rev": "e20af8822b5739434b875643bfc61fe0195ea2fb", + "type": "github" + }, + "original": { + "owner": "chessai", + "repo": "nix-std", + "type": "github" + } + }, "nixd": { "inputs": { "flake-parts": "flake-parts_2", @@ -1170,6 +1203,24 @@ "type": "github" } }, + "nixpkgs-lib_5": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-master": { "locked": { "lastModified": 1694874640, @@ -1422,6 +1473,7 @@ "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", "stylix": "stylix", + "vfio": "vfio", "vscode-extensions": "vscode-extensions" } }, @@ -1713,6 +1765,28 @@ "type": "github" } }, + "vfio": { + "inputs": { + "flake-parts": "flake-parts_3", + "nix-std": "nix-std", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696457108, + "narHash": "sha256-aC7zKhCO11ffT/WMuku/YErHmKJRcl3/lz2s2APgD5s=", + "owner": "yusdacra", + "repo": "nixos-vfio", + "rev": "fb9a8c28811fc5b98973d870659e8c1c0e592206", + "type": "github" + }, + "original": { + "owner": "yusdacra", + "repo": "nixos-vfio", + "type": "github" + } + }, "vscode-extensions": { "inputs": { "flake-compat": "flake-compat_7", diff --git a/flake.nix b/flake.nix index 6bda405..1c97bf8 100644 --- a/flake.nix +++ b/flake.nix @@ -56,6 +56,9 @@ nh.url = "github:viperML/nh"; nh.inputs.nixpkgs.follows = "nixpkgs"; + vfio.url = "github:yusdacra/nixos-vfio"; + vfio.inputs.nixpkgs.follows = "nixpkgs"; + # needed for hyprland setup # hyprland.url = "github:hyprwm/Hyprland"; # hyprland.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/tkaronto/default.nix b/hosts/tkaronto/default.nix index ee78ebc..b30e411 100644 --- a/hosts/tkaronto/default.nix +++ b/hosts/tkaronto/default.nix @@ -9,7 +9,11 @@ imports = with inputs; with nixos-hardware.nixosModules; [ - inputs.agenix.nixosModules.default + # vfio.nixosModules.kvmfr + # vfio.nixosModules.virtualisation + # vfio.nixosModules.vfio + # vfio.nixosModules.libvirtd + agenix.nixosModules.default nixpkgs.nixosModules.notDetected nixos-persistence.nixosModule common-pc-ssd @@ -55,6 +59,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + jack.enable = true; }; hardware.pulseaudio = { enable = false; @@ -101,7 +106,6 @@ environment = { sessionVariables.FLAKE = "/etc/nixos"; - systemPackages = [pkgs.ntfs3g]; pathsToLink = ["/share/zsh"]; persistence."${config.system.persistDir}" = { directories = lib.flatten [ @@ -116,7 +120,8 @@ }; }; - networking.firewall.allowedUDPPorts = [4990 4995]; + # warframe + networking.firewall.allowedUDPPorts = [4990 4991 4992 4993 4994 4995]; # musikcube networking.firewall.allowedTCPPorts = [7905 7906] ++ [6695 6696 6697 6698 6699]; diff --git a/hosts/tkaronto/modules/docker.nix b/hosts/tkaronto/modules/docker.nix new file mode 100644 index 0000000..5caae56 --- /dev/null +++ b/hosts/tkaronto/modules/docker.nix @@ -0,0 +1,3 @@ +{ + config.virtualisation.docker.enable = true; +} diff --git a/hosts/tkaronto/modules/gnome.nix.disabled b/hosts/tkaronto/modules/gnome.nix.disabled new file mode 120000 index 0000000..80622b4 --- /dev/null +++ b/hosts/tkaronto/modules/gnome.nix.disabled @@ -0,0 +1 @@ +../../../modules/de/gnome/default.nix \ No newline at end of file diff --git a/hosts/tkaronto/modules/gpu.nix.disabled b/hosts/tkaronto/modules/gpu.nix.disabled new file mode 100644 index 0000000..171094b --- /dev/null +++ b/hosts/tkaronto/modules/gpu.nix.disabled @@ -0,0 +1,55 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + virt-manager + virtiofsd + looking-glass-client + ]; + virtualisation = { + spiceUSBRedirection.enable = true; + libvirtd = { + enable = true; + # extraConfig = '' + # user="patriot" + # ''; + qemu = { + ovmf.enable = true; + # runAsRoot = true; + # Full is needed for TPM and secure boot emulation + ovmf.packages = [pkgs.OVMFFull.fd]; + swtpm.enable = true; + # verbatimConfig = '' + # namespaces = [] + # cgroup_device_acl = [ "/dev/vfio/9", "/dev/kvm", "/dev/null" ] + # user = "patriot" + # group = "libvirtd" + # ''; + }; + }; + vfio = { + enable = true; + IOMMUType = "amd"; + devices = [ + "10de:25a2" # GPU + ]; + blacklistNvidia = true; + ignoreMSRs = true; + disableEFIfb = false; + }; + kvmfr = { + enable = true; + devices = [ + { + dimensions = { + width = 1920; + height = 1080; + }; + permissions = { + user = "patriot"; + group = "kvm"; + mode = "0660"; + }; + } + ]; + }; + }; +} diff --git a/hosts/tkaronto/modules/tlp.nix b/hosts/tkaronto/modules/tlp.nix index 8bb6fec..acd5e5f 100644 --- a/hosts/tkaronto/modules/tlp.nix +++ b/hosts/tkaronto/modules/tlp.nix @@ -3,7 +3,7 @@ enable = true; settings = { RADEON_DPM_PERF_LEVEL_ON_AC = "auto"; - RADEON_DPM_PERF_LEVEL_ON_BAT = "low"; + RADEON_DPM_PERF_LEVEL_ON_BAT = "auto"; RADEON_DPM_STATE_ON_AC = "balanced"; RADEON_DPM_STATE_ON_BAT = "battery"; PCIE_ASPM_ON_AC = "powersave"; diff --git a/hosts/tkaronto/win11.xml b/hosts/tkaronto/win11.xml new file mode 100644 index 0000000..ccda7b9 --- /dev/null +++ b/hosts/tkaronto/win11.xml @@ -0,0 +1,213 @@ + + win11 + 92ad85b8-9635-48ed-9abb-697e58f0c569 + + + + + + 8388608 + 8388608 + + + + + 8 + + hvm + /run/libvirt/nix-ovmf/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/win11_VARS.fd + + + + + + + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /run/libvirt/nix-emulators/qemu-system-x86_64 + + + + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + +
+ + +
+ + +
+ + + + + + +
+ + + + + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ +