Personal-NixOS-Configuration/configurations/desktop/configuration.nix

130 lines
4.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
./../../modules/cspark-single-gpu-passthru/module.nix
inputs.home-manager.nixosModules.default
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.luks.devices."luks-9658340a-9d7d-4dbd-be1c-c8c7393ddfc3".device = "/dev/disk/by-uuid/9658340a-9d7d-4dbd-be1c-c8c7393ddfc3";
networking.hostName = "cspark-nixos-desktop"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# GTK themes are not applied in Wayland applications / Window Decorations missing / Cursor looks different
programs.dconf.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# My audio interface has issues after coming out from suspend/hibernate, this will reset it to fix it when necessary.
systemd.services.audiointerface-reset = {
description = "Resets audio interface to clear up any issues";
wantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ];
after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ];
path = with pkgs; [ bash coreutils kmod ];
enable = true;
serviceConfig = {
User = "root";
Group = "root";
ExecStart =
let
script = pkgs.writeShellScript "audiointerface-reset"
''
# Unbind audio interface
echo 3-3 > /sys/bus/usb/drivers/usb/unbind
# Remove snd_usb_audio once no longer in use
while ! modprobe -r snd_usb_audio; do
sleep 1
done
modprobe snd_usb_audio
# Rebind audio interface
echo 3-3 > /sys/bus/usb/drivers/usb/bind
'';
in
"${script}";
};
};
# Home Manager Configuration
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = {
"cspark" = import ./home.nix;
};
};
# Steam Game Platform
programs.steam = {
enable = true;
# remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
# dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
gamescopeSession.enable = true;
};
# Single GPU Passthru Configuration
cspark-single-gpu-passthru.enable = true;
cspark-single-gpu-passthru.vmName = "win11";
cspark-single-gpu-passthru.gpuPCI = "0000:08:00.0";
cspark-single-gpu-passthru.gpuAudioPCI = "0000:08:00.1";
# Waydroid Android Emulation
virtualisation.waydroid.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
git
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
cifs-utils
neofetch
appimage-run
wl-clipboard
python3
usbutils
nvtop-amd
];
}