# Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, lib, inputs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; nix.package = pkgs.lix; nix.settings.trusted-users = [ "alyx" "root" ]; boot.binfmt.emulatedSystems = [ "i686-linux" ]; services.blueman.enable = true; services.upower.enable = true; hardware.i2c.enable = true; services.pcscd.enable = true; services.tailscale = { enable = true; useRoutingFeatures = "both"; openFirewall = true; interfaceName = "userspace-networking"; }; networking.firewall.checkReversePath = "loose"; networking.useDHCP = false; services.resolved.enable = true; systemd.network.enable = true; systemd.network.networks."enp0s25" = { matchConfig.Name = "enp0s25"; networkConfig.DHCP = "yes"; }; services.networkd-dispatcher = { enable = true; rules."50-tailscale" = { onState = ["routable"]; script = '' "${pkgs.ethtool} NETDEV=$(ip -o route get 8.8.8.8 | cut -f 5 -d " ") | -K enp0s31f6 rx-udp-gro-forwarding on rx-gro-list off" ''; }; }; services.monado = { enable = true; defaultRuntime = true; }; programs.nh = { enable = true; clean.enable = true; clean.extraArgs = "--keep-since 4d --keep 3"; flake = "/home/alyx/.config/nixos"; }; programs.adb.enable = true; programs.steam.extraCompatPackages = with pkgs; [ proton-ge-rtsp-bin ]; environment.pathsToLink = [ "/share/xdg-desktop-portal" ]; security.sudo.package = pkgs.sudo.override { withInsults = true; }; services.gnome.gnome-keyring.enable = true; security.pam.services.greetd.enableGnomeKeyring = true; security.pam.services.greetd.gnupg.enable = true; security.pam.services.login = { enableGnomeKeyring = true; gnupg.enable = true; }; systemd = { services.setpci = { description = "this runs the command that binds 2 of my usb ports to the EHCI controller"; wantedBy = ["multi-user.target"]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.pciutils}/bin/setpci -s0:14.0 0xd0.W=0x3f3f"; }; }; user = { services.polkit-gnome-authentication-agent-1 = { description = "polkit-gnome-authentication-agent-1"; wantedBy = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; }; }; services.monado.environment = { STEAMVR_LH_ENABLE = "1"; XRT_COMPOSITOR_COMPUTE = "1"; WMR_HANDTRACKING = "0"; AMD_VULKAN_ICD="RADV"; }; }; }; hardware.wooting.enable = true; security.polkit.enable = true; boot.loader.systemd-boot.enable = false; boot.loader.limine = { enable = true; style.wallpapers = [ ]; additionalFiles = { "efi/memtest86/memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi"; "efi/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; }; extraEntries = '' /memtest86 protocol: efi path: boot():/limine/efi/memtest86/memtest86.efi /shell protocol: efi path: boot():/limine/efi/shell.efi ''; }; boot.loader.efi.canTouchEfiVariables = true; powerManagement.cpuFreqGovernor = "performance"; # Bootloader. programs.virt-manager.enable = true; services.gvfs.enable = true; hardware.keyboard.qmk.enable = true; virtualisation = { libvirtd = { enable = true; extraConfig = '' user="alyx" ''; onShutdown = "shutdown"; qemu = { ovmf.enable = true; package = pkgs.qemu_kvm; runAsRoot = true; verbatimConfig = '' namespaces = [] ''; }; }; spiceUSBRedirection.enable = true; }; systemd.packages = with pkgs; [lact]; services.udev.packages = with pkgs; [xr-hardware]; systemd.services.lactd.wantedBy = ["multi-user.target"]; networking.hostName = "absolution"; # Define your hostname. # Enable networking hardware.graphics = { enable = true; enable32Bit = true; extraPackages = with pkgs; [mesa.opencl libvdpau-va-gl vaapiVdpau vulkan-validation-layers]; extraPackages32 = with pkgs; [driversi686Linux.amdvlk driversi686Linux.mesa.opencl]; }; programs.bash.shellAliases = { nano = "nvim"; }; programs.gphoto2.enable = true; # Set your time zone. time.timeZone = "Europe/London"; # Select internationalisation properties. i18n.defaultLocale = "en_AU.UTF-8"; nix.settings.experimental-features = "nix-command flakes"; services.udisks2.enable = true; i18n.extraLocaleSettings = { LC_ADDRESS = "en_AU.UTF-8"; LC_IDENTIFICATION = "en_AU.UTF-8"; LC_MEASUREMENT = "en_AU.UTF-8"; LC_MONETARY = "en_AU.UTF-8"; LC_NAME = "en_AU.UTF-8"; LC_NUMERIC = "en_AU.UTF-8"; LC_PAPER = "en_AU.UTF-8"; LC_TELEPHONE = "en_AU.UTF-8"; LC_TIME = "en_AU.UTF-8"; }; # Enable the X11 windowing system. services.xserver.enable = true; programs.dconf.enable = true; # Configure keymap in X11 services.xserver.xkb = { layout = "us"; variant = ""; }; # Enable CUPS to print documents. services.printing.enable = true; services.printing.drivers = [pkgs.gutenprint]; nixpkgs.overlays = [ (self: super: { vlc = super.vlc.override { libbluray = super.libbluray.override { withAACS = true; withBDplus = true; }; }; }) ]; # Enable sound with pipewire. services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; jack.enable = true; extraConfig.pipewire.noresample = { "context.properties" = { "default.clock.allowed-rates" = [ 44100 48000 192000 ]; }; }; extraConfig.pipewire."92-low-latency" = { "context.properties" = { "default.clock.rate" = 192000; #"default.clock.quantum" = 288; #"default.clock.min-quantum" = 32; #"default.clock.max-quantum" = 288; }; }; extraConfig.pipewire-pulse."92-low-latency" = { context.modules = [ { name = "libpipewire-module-protocol-pulse"; args = { pulse.min.req = "32/48000"; pulse.default.req = "32/48000"; pulse.max.req = "192000"; # pulse.min.quantum = "32/48000"; # pulse.max.quantum = "288/192000"; }; } ]; stream.properties = { node.latency = "32/48000"; resample.quality = 1; }; }; }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.alyx = { isNormalUser = true; description = "Alyx"; extraGroups = [ "networkmanager" "wheel" "libvirtd" "qemu-libvirt" "camera" "input" "adbusers" "inputs" "uinput" "qemu-libvirtd" "lxd" "pipewire" ]; }; # Install firefox. services.libinput.enable = true; # Allow unfree packages nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ hyprlock file libsecret wget jmtpfs nautilus inputs.niri.packages.${pkgs.stdenv.hostPlatform.system}.xwayland-satellite-stable openrazer-daemon polychromatic ethtool networkd-dispatcher oversteer neovim cbfstool steamtinkerlaunch librewolf vulkan-tools r2modman index_camera_passthrough wayvr-dashboard wlx-overlay-s r2mod_cli git lact looking-glass-client keepassxc pulseaudio winetricks p7zip cabextract unzip pciutils wineWowPackages.stable (pkgs.python3.withPackages (ps: with ps; [tkinter])) ]; programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; programs.flashrom.enable = true; programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [xorg.libxcb libao xorg.libX11 libusb1 cargo rustc pkg-config cacert libpulseaudio libsecret file]; systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 alyx qemu-libvirtd -" ]; system.stateVersion = "24.11"; }