This commit is contained in:
dusk 2023-10-08 09:51:05 +03:00
parent 1b0956f14a
commit f94f6eab88
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw
16 changed files with 497 additions and 22 deletions

View File

@ -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",

View File

@ -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";

View File

@ -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];

View File

@ -0,0 +1,3 @@
{
config.virtualisation.docker.enable = true;
}

View File

@ -0,0 +1 @@
../../../modules/de/gnome/default.nix

View File

@ -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";
};
}
];
};
};
}

View File

@ -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";

213
hosts/tkaronto/win11.xml Normal file
View File

@ -0,0 +1,213 @@
<domain type='kvm'>
<name>win11</name>
<uuid>92ad85b8-9635-48ed-9abb-697e58f0c569</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/11"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<memoryBacking>
<source type='memfd'/>
<access mode='shared'/>
</memoryBacking>
<vcpu placement='static'>8</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-8.1'>hvm</type>
<loader readonly='yes' type='pflash'>/run/libvirt/nix-ovmf/OVMF_CODE.fd</loader>
<nvram template='/run/libvirt/nix-ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<hyperv mode='custom'>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
</hyperv>
<vmport state='off'/>
</features>
<cpu mode='host-passthrough' check='none' migratable='on'/>
<clock offset='localtime'>
<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'/>
</pm>
<devices>
<emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/persist/home/patriot/disks/win11.qcow2'/>
<target dev='sda' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0' model='qemu-xhci' ports='15'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</controller>
<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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</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'/>
</controller>
<controller type='pci' index='15' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='15' port='0x1e'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x6'/>
</controller>
<controller type='pci' index='16' model='pcie-to-pci-bridge'>
<model name='pcie-pci-bridge'/>
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<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'/>
</controller>
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<binary path='/run/current-system/sw/bin/virtiofsd'/>
<source dir='/home/patriot/Downloads'/>
<target dir='linux_downloads'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</filesystem>
<interface type='network'>
<mac address='52:54:00:9a:7b:db'/>
<source network='default'/>
<model type='e1000e'/>
<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'/>
</target>
</serial>
<console type='pty'>
<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'/>
</channel>
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<tpm model='tpm-crb'>
<backend type='emulator' version='2.0'/>
</tpm>
<graphics type='spice' autoport='yes'>
<listen type='address'/>
<image compression='off'/>
<gl enable='no'/>
</graphics>
<sound model='ich9'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
</sound>
<audio id='1' type='spice'/>
<video>
<model type='vga' vram='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'/>
</source>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</hostdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='2'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='3'/>
</redirdev>
<watchdog model='itco' action='reset'/>
<memballoon model='none'/>
<shmem name='looking-glass'>
<model type='ivshmem-plain'/>
<size unit='M'>32</size>
<address type='pci' domain='0x0000' bus='0x10' slot='0x01' function='0x0'/>
</shmem>
</devices>
</domain>

View File

@ -7,19 +7,19 @@
gnome-keyring.enable = true;
core-shell.enable = true;
core-os-services.enable = true;
at-spi2-core.enable = true;
at-spi2-core.enable = lib.mkForce false;
gnome-browser-connector.enable = true;
gnome-online-accounts.enable = true;
gnome-online-miners.enable = true;
tracker-miners.enable = true;
tracker.enable = true;
gnome-online-accounts.enable = false;
gnome-online-miners.enable = lib.mkForce false;
tracker-miners.enable = false;
tracker.enable = false;
sushi.enable = true;
gnome-remote-desktop.enable = false;
};
services.tumbler.enable = true;
programs = {
geary.enable = lib.mkForce false;
gnome-terminal.enable = true;
gnome-terminal.enable = lib.mkForce false;
evince.enable = true;
};
services.xserver = {
@ -45,6 +45,19 @@
"autovt@tty1".enable = false;
};
services.power-profiles-daemon.enable = false;
environment.systemPackages = with pkgs; [gnomeExtensions.unite gnome.gnome-tweaks ffmpegthumbnailer webp-pixbuf-loader];
environment.gnome.excludePackages = with pkgs; [gnome-console gnome-tour gnome.gnome-maps];
environment.systemPackages = with pkgs; [
gnomeExtensions.unite
gnome.gnome-tweaks
ffmpegthumbnailer
webp-pixbuf-loader
yaru-theme
];
environment.gnome.excludePackages = with pkgs; [
gnome-console
gnome-tour
gnome.gnome-maps
];
# environment.etc."environment.d/10-use-amd.conf".text = ''
# __EGL_VENDOR_LIBRARY_FILENAMES=/run/opengl-driver/glvnd/egl_vendor.d/50_mesa.json
# '';
}

View File

@ -0,0 +1,14 @@
final: prev: {
calf = prev.calf.overrideAttrs (old: {
src = final.fetchFromGitHub {
owner = "calf-studio-gear";
repo = "calf";
rev = "024e9deab2d32b26e90b556d36d9c74f6b0aeb17";
sha256 = "sha256-av6quHkesND9M8vlkOQKLXK4prf+oQxOLANuNsWL+eg=";
};
nativeBuildInputs = old.nativeBuildInputs ++ (with final; [automake autoconf pkg-config libtool]);
configurePhase = ''
$SHELL autogen.sh
'';
});
}

View File

@ -1,11 +1,10 @@
pkgs: (
pkgs.lib.getAttrs
[
"fractal-next"
"phantom"
"comic-mono"
"chromium"
"discordo"
"abaddon"
"fluidsynth-dssi"
"calf"
]
pkgs
)

View File

@ -0,0 +1,40 @@
{ lib, stdenv, fetchurl, alsa-lib, autoconf, automake, dssi, gtk2, libjack2,
ladspaH, ladspaPlugins, liblo, pkg-config, fluidsynth, rpm2targz, libtool, ... }:
stdenv.mkDerivation rec {
pname = "fluidsynth-dssi";
version = "1.9.9";
src = fetchurl {
url = "https://download.opensuse.org/source/distribution/leap/15.4/repo/oss/src/fluidsynth-dssi-1.9.9+git13012019-bp154.1.42.src.rpm";
sha256 = "sha256-DJSrdxQpjvQTzio6e3p/iSYJWu+AbydyKkeKsRQA6qc=";
};
nativeBuildInputs = [ autoconf automake pkg-config rpm2targz libtool ];
buildInputs = [ alsa-lib dssi gtk2 libjack2 ladspaH ladspaPlugins liblo fluidsynth.dev ];
unpackPhase = ''
rpm2targz $src
tar -xf *.tar.gz
rm *.src.tar.gz
tar -xf *.tar.gz
rm *.diff
rm *.spec
rm *.tar.gz
cd fluidsynth-dssi-*
'';
configurePhase = ''
$SHELL autogen.sh
$SHELL configure
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
cp src/FluidSynth-DSSI_gtk $out/bin
cp src/.libs/* $out/lib
'';
meta = with lib; {
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}

24
pkgs-set/pkgs/phantom.nix Normal file
View File

@ -0,0 +1,24 @@
{stdenv, libsForQt5, ...}:
stdenv.mkDerivation {
pname = "phantomstyle";
version = "309c97";
src = builtins.fetchGit {
url = "https://github.com/randrew/phantomstyle.git";
rev = "309c97a955f6cdfb1987d1dd04c34d667e4bfce1";
};
dontWrapQtApps = true;
buildInputs = [libsForQt5.qt5.qtbase];
buildPhase = ''
cd src/styleplugin
qmake && make
'';
installPhase = ''
mkdir -p $out/$qtPluginPrefix/styles
mv libphantomstyleplugin.so $out/$qtPluginPrefix/styles
'';
}

View File

@ -105,10 +105,10 @@
output = {
"*" = {
bg = "${config.stylix.image} fill";
# adaptive_sync = "on";
};
"eDP-1" = {
scale = "2";
adaptive_sync = "on";
};
"HDMI-A-1" = {
mode = "1920x1080@60.000Hz";

View File

@ -23,6 +23,7 @@ in {
"nix-build-key-access"
(l.optional nixosConfig.networking.networkmanager.enable "networkmanager")
(l.optional nixosConfig.virtualisation.docker.enable "docker")
(l.optionals nixosConfig.virtualisation.libvirtd.enable ["libvirtd" "kvm"])
];
shell = pkgs.zsh;
hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
@ -105,9 +106,9 @@ in {
modulesToEnable = l.flatten [
# wm
# ["hyprland" "foot"]
["sway" "foot"]
["sway" "wayland" "foot"]
# desktop stuff
["wayland"]
# ["wayland" "foot"]
["obsidian" "firefox"]
# cli stuff
["zoxide" "zsh" "fzf" "starship" "direnv"]
@ -143,16 +144,17 @@ in {
"direnv"
"zsh"
"keyrings"
"lutris"
# "lutris"
# "Terraria"
# "PrismLauncher"
]
++ mkPaths ".config" [
# "lutris"
"dconf"
"retroarch"
];
files = l.flatten [
# ".config/gnome-initial-setup-done"
".config/gnome-initial-setup-done"
(lib.removePrefix "~/" config.programs.ssh.userKnownHostsFile)
];
allowOther = true;
@ -172,6 +174,23 @@ in {
gtk.enable = true;
x11.enable = true;
};
gtk.enable = true;
gtk.theme.package = pkgs.yaru-theme;
gtk.theme.name = "Yaru-dark";
home.sessionVariables.QT_QPA_PLATFORMTHEME = "qt5ct";
xdg.configFile = {
"environment.d/20-apply-qtct.conf".text = ''
QT_QPA_PLATFORMTHEME=qt5ct
'';
};
qt.enable = true;
qt.platformTheme = "qtct";
qt.style.name = "phantom";
qt.style.package = pkgs.phantom;
stylix.targets.gnome.enable = lib.mkForce false;
stylix.targets.gtk.enable = lib.mkForce false;
home = {
homeDirectory = nixosConfig.users.users.patriot.home;
@ -189,7 +208,6 @@ in {
ffmpeg
mupdf
xdg-utils
lutris
protontricks
# fractal-next
# obs-studio
@ -202,6 +220,18 @@ in {
# steam-tui
gtkcord4
gh
transmission_4-gtk
# yabridge
# yabridgectl
# bitwig-studio
# reaper
# ardour
(retroarch.override {
cores = with libretro; [desmume melonds];
})
# wineWowPackages.stagingFull
# lutris
distrobox
];
};
programs = {

View File

@ -2,6 +2,7 @@
inputs,
config,
pkgs,
lib,
...
}: {
imports = [