From 807d2b881b71e53bfc1e048b286f98306432c3bd Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Mon, 24 Mar 2025 11:47:37 -0700 Subject: [PATCH] Why pay for a dummy plug when you can have horrors beyond your comprehension??? --- common/firmware/EDID.bin | Bin 0 -> 512 bytes common/home/dotfiles/.zshrc | 7 +- common/home/dotfiles/tmux.conf | 2 +- common/home/home.nix | 56 +- common/home/packages/alien.nix | 5 +- common/nixos/default-config.nix | 24 +- common/overlays/default.nix | 6 +- common/overlays/looking-glass/default.nix | 30 - .../looking-glass/nanosvg-unvendor.diff | 28 - common/overlays/steam.nix | 10 + common/utils/nix-config.nix | 7 + common/utils/nix-ld.nix | 187 +++++++ nixos/custom-odin-nixos/configuration.nix | 526 ++++++++++++++++++ nixos/custom-odin-nixos/default.nix | 3 + .../hardware-configuration.nix | 36 ++ nixos/custom-odin-nixos/home.nix | 14 + .../latitude7390-loki-nixos/configuration.nix | 34 +- nixos/temp-installer-nixos/configuration.nix | 4 +- 18 files changed, 871 insertions(+), 108 deletions(-) create mode 100644 common/firmware/EDID.bin delete mode 100644 common/overlays/looking-glass/default.nix delete mode 100644 common/overlays/looking-glass/nanosvg-unvendor.diff create mode 100644 common/overlays/steam.nix create mode 100644 common/utils/nix-ld.nix create mode 100755 nixos/custom-odin-nixos/configuration.nix create mode 100755 nixos/custom-odin-nixos/default.nix create mode 100755 nixos/custom-odin-nixos/hardware-configuration.nix create mode 100755 nixos/custom-odin-nixos/home.nix diff --git a/common/firmware/EDID.bin b/common/firmware/EDID.bin new file mode 100644 index 0000000000000000000000000000000000000000..25db34588eeeb0d5e31e733b895e78451906e037 GIT binary patch literal 512 zcmZSh4+adZj~TZ}g)%S*D>1TcHI=Kd|GsohfaeNz?tqZ}?-?#0XlyXdFsyOSaIHzq zNUUM9YLFXkcV$Zehm2!0?B`$i&@*O92WP z7#RLC7;HIl!iEtl#@N8bZ1mBGk(pJ5MOa>lNpOO_GABEGGb01TW7fxv&)C=*lad&6 zr5G5P7!9^CfI;}8h6M!{at;O#rck?Oni@I^EOZ?V6ksCV`5-k8NFrdZm_)`%_dfvS CQFZ|U literal 0 HcmV?d00001 diff --git a/common/home/dotfiles/.zshrc b/common/home/dotfiles/.zshrc index 20b9ead..fb6c6fb 100644 --- a/common/home/dotfiles/.zshrc +++ b/common/home/dotfiles/.zshrc @@ -44,6 +44,12 @@ if command -v eza &> /dev/null; then alias tree="eza --icons --tree --git-ignore" fi +if command -v git &> /dev/null; then + if [ -d /etc/nixos ]; then + alias nix-git="git -C '$@'" + fi +fi + if command -v cargo-mommy &> /dev/null; then export CARGO_MOMMYS_PRONOUNS="his/their" export CARGO_MOMMYS_LITTLE="boy/pup/puppy" @@ -99,4 +105,3 @@ if [[ $- == *i* ]]; then fastfetch fortune | lolcat fi - diff --git a/common/home/dotfiles/tmux.conf b/common/home/dotfiles/tmux.conf index 5255f23..dba6e01 100644 --- a/common/home/dotfiles/tmux.conf +++ b/common/home/dotfiles/tmux.conf @@ -44,7 +44,7 @@ set -g status-position bottom set -g status-justify left set -g status-style 'fg=colour6' set -g status-left "" -set -g status-right '%Y-%m-%d %H:%M ' +set -g status-right '%Y-%m-%d %H:%M #{tmux_mode_indicator}' set -g status-right-length 50 set -g status-left-length 10 diff --git a/common/home/home.nix b/common/home/home.nix index 6ac5e56..378a7c1 100755 --- a/common/home/home.nix +++ b/common/home/home.nix @@ -78,7 +78,7 @@ }; theme = { - mode = "system"; + mode = "dark"; light = "One Light"; dark = "Carbonfox"; }; @@ -159,13 +159,36 @@ historyLimit = 500000; plugins = with pkgs.tmuxPlugins; [ - tmux-powerline - tmux-powerline + tmux-fzf + mode-indicator + ] ++ [ + (pkgs.tmuxPlugins.mkTmuxPlugin { + pluginName = "tmux-suspend"; + rtpFilePath = "suspend.tmux"; + version = "1a2f806666e0bfed37535372279fa00d27d50d14"; + + postInstall = '' + patchShebangs suspend.tmux + ''; + + src = pkgs.fetchFromGitHub { + owner = "MunifTanjim"; + repo = "tmux-suspend"; + rev = "1a2f806666e0bfed37535372279fa00d27d50d14"; + hash = "sha256-+1fKkwDmr5iqro0XeL8gkjOGGB/YHBD25NG+w3iW+0g="; + }; + }) ]; extraConfig = builtins.readFile ./dotfiles/tmux.conf; }; + fzf = { + enable = true; + tmux.enableShellIntegration = true; + enableZshIntegration = true; + }; + alacritty = import ./programs/alacritty.nix; hyprlock = { @@ -223,16 +246,23 @@ # emacs.enable = true; }; - home.file = { - # Configure the `rustfmt` formatter! - "rustfmt.toml" = { - target = ".config/rustfmt/rustfmt.toml"; - enable = true; - text = builtins.readFile ./dotfiles/rustfmt.toml; - }; - - # TODO: add remind script to this! - }; + home = { + file = { + # Configure the `rustfmt` formatter! + "rustfmt.toml" = { + target = ".config/rustfmt/rustfmt.toml"; + enable = true; + text = builtins.readFile ./dotfiles/rustfmt.toml; + }; + + # TODO: add remind script to this! + }; + + sessionVariables = { + GTK_THEME = "Breeze-Dark"; + NIXOS_OZONE_WL = "1"; + }; + }; # TODO: Translate alt DE configs (hyprland, hyprpapr, dunst, waybar) wayland.windowManager.hyprland = { diff --git a/common/home/packages/alien.nix b/common/home/packages/alien.nix index bab3848..a25c3ca 100644 --- a/common/home/packages/alien.nix +++ b/common/home/packages/alien.nix @@ -1,13 +1,14 @@ -{ pkgs, pkgs-stable, ... }: let +{ pkgs, ... }: let unstable = with pkgs; [ # Run Alien Software dosbox-x bottles - # looking-glass-client + looking-glass-client distrobox boxbuddy gearlever simh + kdePackages.kdialog ]; in { packages = unstable; diff --git a/common/nixos/default-config.nix b/common/nixos/default-config.nix index 191c722..de90b6a 100644 --- a/common/nixos/default-config.nix +++ b/common/nixos/default-config.nix @@ -1,4 +1,4 @@ -{ pkgs, pkgs-stable, config, options, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, hostConfig, lib, specialArgs, pwndbg, ... }: { +{ pkgs, lib, config, rust-overlay, nixGL, hostConfig, ... }: { imports = [ ../home ]; @@ -10,11 +10,7 @@ }; nixpkgs = { - config = import ../utils/nix-config.nix // { - packageOverrides = pkgs: { - intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; - }; - }; + config = import ../utils/nix-config.nix; overlays = [ nixGL.overlays.default @@ -44,11 +40,11 @@ extraModulePackages = with config.boot.kernelPackages; [ usbip apfs - # kvmfr - xone + kvmfr # gasket # shufflecake v4l2loopback + systemtap ]; # https://wiki.nixos.org/wiki/OSX-KVM @@ -121,15 +117,25 @@ theme = "robbyrussell"; }; }; + + java = { + enable = true; + binfmt = true; + }; + + nix-ld = { + enable = true; + libraries = import ../utils/nix-ld.nix { inherit pkgs lib; }; + }; command-not-found.enable = true; # This basically doesn't work imo. - nix-ld.enable = true; appimage.binfmt = true; }; services = { openssh.enable = true; atd.enable = true; + envfs.enable = true; tailscale = { enable = true; diff --git a/common/overlays/default.nix b/common/overlays/default.nix index b9f8af6..6f07fb9 100644 --- a/common/overlays/default.nix +++ b/common/overlays/default.nix @@ -1,11 +1,11 @@ let discord = import ./discord.nix; spotify = import ./spotify.nix; - looking-glass = import ./looking-glass; fortune = import ./fortune; + steam = import ./steam.nix; in [ discord spotify - # looking-glass fortune -] \ No newline at end of file + # steam +] diff --git a/common/overlays/looking-glass/default.nix b/common/overlays/looking-glass/default.nix deleted file mode 100644 index 6d70fee..0000000 --- a/common/overlays/looking-glass/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -# TODO: WARNING: This is temporary while https://github.com/NixOS/nixpkgs/issues/379503 is being fixed upstream by looking glass contributors... -final: prev: { - # linuxPackages_latest = prev.linuxPackages_latest.extend (lfinal: lprev: { - # kvmfr = prev.linuxPackages_latest.kvmfr.overrideAttrs (old: { - # patches = [ - # (prev.fetchpatch { - # url = "https://github.com/gnif/LookingGlass/commit/4251a5c5fe7723c5dc068839debd76a5148953b2.diff"; - # sha256 = "sha256-CswVgctC4G58cNFHrAh3sHsgOlB2ENJ/snyWQAHO6Ks="; - # stripLen = 1; - # includes = [ - # "dkms.conf" - # "kvmfr.c" - # ]; - # }) - # ]; - # }); - # }); - - looking-glass-client = prev.looking-glass-client.overrideAttrs (old: { - version = "master"; - src = prev.fetchFromGitHub { - owner = "ticpu"; - repo = "LookingGlass"; - rev = "4251a5c5fe7723c5dc068839debd76a5148953b2"; - sha256 = "sha256-R2Ic1FDMT7VkfwNJk5IAAPXtuDfWqqUOr5jwo8C02S0="; - fetchSubmodules = true; - }; - # patches = [ ./nanosvg-unvendor.diff ]; - }); -} \ No newline at end of file diff --git a/common/overlays/looking-glass/nanosvg-unvendor.diff b/common/overlays/looking-glass/nanosvg-unvendor.diff deleted file mode 100644 index 356e02e..0000000 --- a/common/overlays/looking-glass/nanosvg-unvendor.diff +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3755adc..55e1eb3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,6 +25,7 @@ include(OptimizeForNative) # option(OPTIMIZE_FOR_NATIVE) - include(UninstallTarget) - - find_package(PkgConfig) -+find_package(NanoSVG REQUIRED) - pkg_check_modules(FONTCONFIG REQUIRED IMPORTED_TARGET fontconfig) - - option(ENABLE_OPENGL "Enable the OpenGL renderer" ON) -@@ -106,7 +107,6 @@ include_directories( - ${PROJECT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/include -- ${PROJECT_TOP}/repos/nanosvg/src - ) - - link_libraries( -@@ -161,6 +161,7 @@ target_compile_definitions(looking-glass-client PRIVATE CIMGUI_DEFINE_ENUMS_AND_ - target_link_libraries(looking-glass-client - ${EXE_FLAGS} - PkgConfig::FONTCONFIG -+ NanoSVG::nanosvg - lg_resources - lg_common - displayservers \ No newline at end of file diff --git a/common/overlays/steam.nix b/common/overlays/steam.nix new file mode 100644 index 0000000..3fce898 --- /dev/null +++ b/common/overlays/steam.nix @@ -0,0 +1,10 @@ +final: prev: { + steam = prev.steam.override { + # withJava = true; + # withPrimus = true; + extraPkgs = steam_pkgs: with steam_pkgs; [ + bumblebee + glxinfo + ]; + }; +} diff --git a/common/utils/nix-config.nix b/common/utils/nix-config.nix index e5d1062..ea86302 100644 --- a/common/utils/nix-config.nix +++ b/common/utils/nix-config.nix @@ -1,10 +1,17 @@ { allowUnfree = true; + nvidia.acceptLicense = true; + permittedInsecurePackages = [ "electron-25.9.0" "electron-27.3.11" "olm-3.2.16" "dotnet-sdk-7.0.120" + "SDL_ttf-2.0.11" ]; + + packageOverrides = pkgs: { + intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; + }; } diff --git a/common/utils/nix-ld.nix b/common/utils/nix-ld.nix new file mode 100644 index 0000000..5679a2e --- /dev/null +++ b/common/utils/nix-ld.nix @@ -0,0 +1,187 @@ +# Taken from the old NixOS 23.11 steam-run fhsenv. All credits to them for this. +{ pkgs, lib, ... }: with pkgs; [ + # Needed for operating system detection until + # https://github.com/ValveSoftware/steam-for-linux/issues/5909 is resolved + lsb-release + # Errors in output without those + pciutils + # Games' dependencies + xorg.xrandr + which + # Needed by gdialog, including in the steam-runtime + perl + # Open URLs + xdg-utils + iana-etc + # Steam Play / Proton + python3 + # Steam VR + procps + usbutils + + fuse3 + wayland + kdePackages.wayland-protocols + pkg-config + cmake + + # It tries to execute xdg-user-dir and spams the log with command not founds + xdg-user-dirs + + # electron based launchers need newer versions of these libraries than what runtime provides + mesa + sqlite + + # These are required by steam with proper errors + xorg.libXcomposite + xorg.libXtst + xorg.libXrandr + xorg.libXext + xorg.libX11 + xorg.libXfixes + libGL + libva + pipewire + + # steamwebhelper + harfbuzz + libthai + pango + + lsof # friends options won't display "Launch Game" without it + file # called by steam's setup.sh + + # dependencies for mesa drivers, needed inside pressure-vessel + mesa.llvmPackages.llvm.lib + vulkan-loader + expat + wayland + xorg.libxcb + xorg.libXdamage + xorg.libxshmfence + xorg.libXxf86vm + libelf + (lib.getLib elfutils) + + # Without these it silently fails + xorg.libXinerama + xorg.libXcursor + xorg.libXrender + xorg.libXScrnSaver + xorg.libXi + xorg.libSM + xorg.libICE + gnome2.GConf + curlWithGnuTls + nspr + nss + cups + libcap + SDL2 + libusb1 + dbus-glib + gsettings-desktop-schemas + ffmpeg + libudev0-shim + + # Verified games requirements + fontconfig + freetype + xorg.libXt + xorg.libXmu + libogg + libvorbis + SDL + SDL2_image + glew110 + libdrm + libidn + tbb + zlib + + # SteamVR + udev + dbus + + # Other things from runtime + glib + gtk2 + bzip2 + flac + freeglut + libjpeg + libpng + libpng12 + libsamplerate + libmikmod + libtheora + libtiff + pixman + speex + SDL_image + SDL_ttf + SDL_mixer + SDL2_ttf + SDL2_mixer + libappindicator-gtk2 + libdbusmenu-gtk2 + libindicator-gtk2 + libcaca + libcanberra + libgcrypt + libunwind + libvpx + librsvg + xorg.libXft + libvdpau + + # required by coreutils stuff to run correctly + # Steam ends up with LD_LIBRARY_PATH=:/usr/lib: + # which overrides DT_RUNPATH in our binaries, so it tries to dynload the + # very old versions of stuff from the runtime. + # FIXME: how do we even fix this correctly + attr + + # Not formally in runtime but needed by some games + at-spi2-atk + at-spi2-core # CrossCode + gst_all_1.gstreamer + gst_all_1.gst-plugins-ugly + gst_all_1.gst-plugins-base + json-glib # paradox launcher (Stellaris) + libdrm + libxkbcommon # paradox launcher + libvorbis # Dead Cells + libxcrypt # Alien Isolation, XCOM 2, Company of Heroes 2 + mono + ncurses # Crusader Kings III + openssl + xorg.xkeyboardconfig + xorg.libpciaccess + xorg.libXScrnSaver # Dead Cells + icu # dotnet runtime, e.g. Stardew Valley + + # screeps dependencies + gtk3 + zlib + atk + cairo + freetype + gdk-pixbuf + fontconfig + + # Prison Architect + libGLU + libuuid + libbsd + alsa-lib + + # Loop Hero + # FIXME: Also requires openssl_1_1, which is EOL. Either find an alternative solution, or remove these dependencies (if not needed by other games) + libidn2 + libpsl + nghttp2.lib + rtmpdump +] + + diff --git a/nixos/custom-odin-nixos/configuration.nix b/nixos/custom-odin-nixos/configuration.nix new file mode 100755 index 0000000..8d712b0 --- /dev/null +++ b/nixos/custom-odin-nixos/configuration.nix @@ -0,0 +1,526 @@ +# 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, ... }: let + # TODO: Check if this exists and is the right display. + virtualDisplayId = "HDMI-A-2"; +in { + imports = [ + ./hardware-configuration.nix # Include the results of the hardware scan. + ]; + + boot = { + loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; # assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends). + }; + + grub = { + # despite what the configuration.nix manpage seems to indicate, + # as of release 17.09, setting device to "nodev" will still call + # `grub-install` if efiSupport is true + # (the devices list is not used by the EFI grub install, + # but must be set to some value in order to pass an assert in grub.nix) + devices = [ "nodev" ]; + efiSupport = true; + enable = true; + useOSProber = true; # ~~ false; # we should be using rEFInd~~ <- it's kinda weird atm... + efiInstallAsRemovable = false; + }; + }; + + plymouth.enable = true; + + kernelParams = [ + "psi=1" # Enable PSI to make sure that Binder doesn't die when using Waydroid. + "drm_kms_helper.edid_firmware=${virtualDisplayId}:edid/reboots-virtual-display.bin" # Set the custom EDID file to the virtual display interface. + ]; + }; + + powerManagement.enable = true; + + hardware = { + steam-hardware.enable = true; + xone.enable = true; + + graphics = { + enable = true; + enable32Bit = true; + + extraPackages = with pkgs; [ + mesa.drivers + ]; + }; + + # Use AMD's driver implementation (it's more correct when it comes to vulkan impl, but not as fast as RADV by freedesktop). + amdgpu = { + initrd.enable = true; + opencl.enable = true; + + amdvlk = { + enable = true; + support32Bit.enable = true; + }; + }; + + nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + open = true; + powerManagement.finegrained = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + opentabletdriver = { + enable = true; + daemon.enable = true; + }; + + bluetooth = { + enable = true; + powerOnBoot = true; + }; + + firmware = [ + # Add the EDID of our monitors to use for the virtual display. + (pkgs.runCommandNoCC "firmware-custom-edid" { compressFirmware = false; } '' + mkdir -p $out/lib/firmware/edid/ + cp "${../../common/firmware/EDID.bin}" $out/lib/firmware/edid/reboots-virtual-display.bin + '') + ]; + }; + + time.timeZone = "America/Phoenix"; + + networking = { + firewall = { + # Open ports in the firewall. + allowedTCPPortRanges = [ { from = 47984; to = 48010; } ]; + allowedUDPPortRanges = [ { from = 47998; to = 48010; } ]; + allowedTCPPorts = [ 3389 4455 3333 4444 50001 5567 1701 9001 ]; + allowedUDPPorts = [ 3389 4455 4444 50001 5567 1701 9001 ]; + + enable = true; # ~~false; # Or disable the firewall altogether.~~ + }; + }; + + security = { + rtkit.enable = true; + polkit.enable = true; + + # For hibernation + protectKernelImage = false; + }; + + fonts.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + roboto + roboto-serif + corefonts # the msft ones, seems to not load. + ]; + + systemd.services = { + syncthing = { + description = "Run Syncthing"; + serviceConfig = { + ExecStart = "${pkgs.syncthing}/bin/syncthing"; + User = "reboot"; + }; + }; + }; + + virtualisation = { + # Note, make sure to tell waydroid to use an AMD GPU (discrete or internal) with: https://github.com/Quackdoc/waydroid-scripts/blob/main/waydroid-choose-gpu.sh + waydroid.enable = true; + containers.enable = true; + + podman = { + enable = true; + dockerCompat = true; + dockerSocket.enable = true; + + defaultNetwork.settings.dns_enabled = true; + }; + + # virtualbox.host.enable = true; + # virtualbox.host.enableExtensionPack = true; # Requires previous, will compile all of vbox if enabled! + + libvirtd = { + enable = true; + + qemu = { + swtpm.enable = true; + ovmf.enable = true; + }; + }; + + appvm = { + enable = true; + user = "reboot"; + }; + + spiceUSBRedirection.enable = true; + }; + + programs = { + anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules + anime-games-launcher.enable = true; + honkers-railway-launcher.enable = true; + honkers-launcher.enable = true; + wavey-launcher.enable = true; + sleepy-launcher.enable = true; + + neovim = { + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + + gnupg.agent = { + enable = true; + pinentryPackage = pkgs.pinentry-qt; # HHHHHHH this is such a bitch and cmd-line fallbacks don't work. + enableSSHSupport = true; + }; + + adb.enable = true; + virt-manager.enable = true; + nbd.enable = true; + xwayland.enable = true; + hyprland.enable = true; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # mtr.enable = true; + + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; + + gamemode.enable = true; + dconf.enable = true; + }; + + xdg.portal = { + enable = true; + + extraPortals = with pkgs; [ + kdePackages.xdg-desktop-portal-kde + xdg-desktop-portal-hyprland + ]; + + config = { + common = { + default = [ "kde" ]; + }; + + hyprland = { + default = [ "hyprland" "gtk" ]; + "org.freedesktop.impl.portal.FileChooser" = "kde"; + }; + }; + }; + + services = { + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + zerotierone = { + enable = true; + + joinNetworks = [ + "56374ac9a475ea79" + ]; + }; + + pulseaudio.enable = false; # This is a pipewire-based system! + hardware.openrgb.enable = true; + + btrfs.autoScrub = { + enable = true; + interval = "weekly"; + fileSystems = [ "/" ]; + }; + + libinput.enable = true; + pcscd.enable = true; + + udev.packages = with pkgs; [ + qmk-udev-rules + android-udev-rules + ]; + + ratbagd.enable = true; + k3s.enable = true; + teamviewer.enable = true; + + printing = { + enable = true; + + drivers = with pkgs; [ + brlaser + brgenml1lpr + brgenml1cupswrapper + ]; + }; + + kubo.enable = true; + + sunshine = { + enable = true; + openFirewall = true; + capSysAdmin = true; + + applications = { + apps = [ + { + name = "1080p Desktop"; + prep-cmd = [ + { + # Runs: + # ${pkgs.kdePackages.libkscreen}/bin/kscreen-doctor -o | ${pkgs.gnused}/bin/sed -e 's/\x1b\[[0-9;]*m//g' | ${pkgs.gnused}/bin/sed -nE 's/^Output: [0-9]+ ([A-Za-z]+-[0-9]+) enabled connected (priority( 1))?.*$/\1\3/p' > /tmp/reboots-sunshine-display-config-backup + # First, which saves which display is primary and all the currently enabled screens in a temp file. + # + # Enables and makes the virtual display the primary display. + # + # After that, runs: + # cat /tmp/reboots-sunshine-display-config-backup | sed -nE 's/^([^ ]*)( 1)?$/output.\1.disable/p' | tr '\n' ' ' | rev | cut -d' ' -f2- | rev + # Which turns the list of enabled screens into configs that kscreen-doctor accepts. + # + # This is basically because I don't wanna fuck with telling nix with what display connector is primary, etc every time I change displays or whatever. + do = '' + ${pkgs.bash}/bin/bash -c "${pkgs.kdePackages.libkscreen}/bin/kscreen-doctor -o | ${pkgs.gnused}/bin/sed -e 's/\x1b\[[0-9;]*m//g' | ${pkgs.gnused}/bin/sed -nE 's/^Output: [0-9]+ ([A-Za-z]+-[0-9]+) enabled connected (priority( 1))?.*$/\1\3/p' > /tmp/reboots-sunshine-display-config-backup && ${pkgs.kdePackages.libkscreen}/bin/kscreen-doctor output.${virtualDisplayId}.enable output.${virtualDisplayId}.priority.1 $(${pkgs.coreutils-full}/bin/cat /tmp/reboots-sunshine-display-config-backup | ${pkgs.gnused}/bin/sed -nE 's/^([^ ]*)( 1)?$/output.\1.disable/p' | ${pkgs.coreutils-full}/bin/tr '\n' ' ' | ${pkgs.util-linux}/bin/rev | ${pkgs.coreutils-full}/bin/cut -d' ' -f2- | ${pkgs.utils-linux}/bin/rev)" + ''; + + # Runs: + # ${pkgs.coreutils-full}/bin/cat /tmp/reboots-sunshine-display-config-backup | ${pkgs.gnused}/bin/sed -nE 's/^([^ ]*)( 1)?$/output.\1.enable/p' | ${pkgs.coreutils-full}/bin/tr '\n' ' ' | ${pkgs.util-linux}/bin/rev | ${pkgs.coreutils-full}/bin/cut -d' ' -f2- | ${pkgs.utils-linux}/bin/rev + # To re-enable all disabled displays + # + # And then: + # ${pkgs.coreutils-full}/bin/cat /tmp/reboots-sunshine-display-config-backup | ${pkgs.gnused}/bin/sed -nE 's/^([^ ]*)( 1)$/output.\1.priority.1/p' + # To set the primary display again. + # + # And then turns off the virtual display. + undo = '' + ${pkgs.bash}/bin/bash -c "${pkgs.kdePackages.libkscreen}/bin/kscreen-doctor $(${pkgs.coreutils-full}/bin/cat /tmp/reboots-sunshine-display-config-backup | ${pkgs.gnused}/bin/sed -nE 's/^([^ ]*)( 1)?$/output.\1.enable/p' | ${pkgs.coreutils-full}/bin/tr '\n' ' ' | ${pkgs.util-linux}/bin/rev | ${pkgs.coreutils-full}/bin/cut -d' ' -f2- | ${pkgs.utils-linux}/bin/rev) $(${pkgs.coreutils-full}/bin/cat /tmp/reboots-sunshine-display-config-backup | ${pkgs.gnused}/bin/sed -nE 's/^([^ ]*)( 1)$/output.\1.priority.1/p') output.${virtualDisplayId}.disable" + ''; + } + ]; + } + ]; + }; + }; + + desktopManager.plasma6.enable = true; + + displayManager = { + defaultSession = "plasma"; + + ly = { + enable = true; + + settings = {}; + }; + }; + + xserver = { + enable = true; + # Prefer AMD GPUs over Nvidia over the modesetting over just fbdev. (But if one of the accelerators dies, use software rendering I guess.) + videoDrivers = [ "amdgpu" "nvidia" "modesetting" "fbdev" ]; + + xkb = { + layout = "us"; + variant = ""; + }; + + # displayManager = { + # lightdm = { + # greeter.enable = true; + # greeters.gtk.enable = true; + # }; + # }; + }; + + # displayManager.sddm.enable = true; # Not broken anymore probably, I'm just too lazy to deal with it. + spice-autorandr.enable = true; + + avahi.publish = { + enable = true; + userServices = true; + }; + + # https://nixos.wiki/wiki/IOS + usbmuxd = { + enable = true; + package = pkgs.usbmuxd2; + }; + + flatpak = { + enable = true; + + packages = [ + "dev.vencord.Vesktop" + "net.davidotek.pupgui2" + "com.github.tchx84.Flatseal" + "org.signal.Signal" + "io.github.hydrusnetwork.hydrus" + ]; + }; + }; + + environment = { + sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; + + systemPackages = with pkgs; [ + # Utils + cryptsetup + vim + neovim + busybox + wget + file + xxd + unzip + zip + progress + tldr + eza + fastfetch + btop + htop + at + tmux + starship + fortune + lolcat + screen + git + signify + cachix + solaar + arrpc + + # Shells + zsh + bash + + # System + man-pages + glibcInfo + stdmanpages + c-intro-and-ref + tkman + wikiman + stdman + texinfo + nixpkgs-manual + wl-clipboard + gnupg + libnotify + appimage-run + xorg.xhost + glfw + freetype + vulkan-headers + vulkan-loader + vulkan-validation-layers + vulkan-tools # vulkaninfo + alsa-utils + fluidsynth + soundfont-fluid + soundfont-arachno + soundfont-ydp-grand + soundfont-generaluser + x42-gmsynth + direnv + + # Hardware + pciutils + dmidecode + usbutils + libva-utils + pmutils + refind + efibootmgr + smartmontools + glxinfo + piper + openrgb-with-all-plugins + + # Network + nmap + socat + openssl + speedtest-cli + + # FS Manipulation + btrfs-progs + btrbk + fuzzel + sshfs + exfat + ntfs3g + mtpfs + libimobiledevice + ifuse + + # Python + # python3Full + pipx + + # Global Apps + firefox + links2 + alacritty + qpwgraph + + # media manipulation + mpv + imagemagickBig + ffmpeg + + # Services + sunshine + zerotierone + syncthing + nicotine-plus + + # Alt DE + waybar + wofi + wpaperd + hyprlock + hyprcursor + hypridle + dunst + kitty + kitty-img + kitty-themes + + # QT + kdePackages.qt6ct + kdePackages.breeze + libsForQt5.qt5ct + kdePackages.breeze-gtk + kdePackages.kdialog + + # VMs and Containers + dive + podman-tui + docker-compose + podman-compose + virtiofsd + appvm + ]; + }; +} diff --git a/nixos/custom-odin-nixos/default.nix b/nixos/custom-odin-nixos/default.nix new file mode 100755 index 0000000..114f596 --- /dev/null +++ b/nixos/custom-odin-nixos/default.nix @@ -0,0 +1,3 @@ +{ + imports = [ ./configuration.nix ./home.nix ]; +} \ No newline at end of file diff --git a/nixos/custom-odin-nixos/hardware-configuration.nix b/nixos/custom-odin-nixos/hardware-configuration.nix new file mode 100755 index 0000000..f4e47c0 --- /dev/null +++ b/nixos/custom-odin-nixos/hardware-configuration.nix @@ -0,0 +1,36 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "nvme" "usb_storage" "uas" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + swapDevices = [ + { device = "/swap/swapfile"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.cni0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.flannel.1.useDHCP = lib.mkDefault true; + # networking.interfaces.veth0456fdfb.useDHCP = lib.mkDefault true; + # networking.interfaces.veth35a0afbe.useDHCP = lib.mkDefault true; + # networking.interfaces.veth39cb70bf.useDHCP = lib.mkDefault true; + # networking.interfaces.vethdee336b8.useDHCP = lib.mkDefault true; + # networking.interfaces.vethe7e2f709.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.ztt6jt6i65.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/custom-odin-nixos/home.nix b/nixos/custom-odin-nixos/home.nix new file mode 100755 index 0000000..f67cea4 --- /dev/null +++ b/nixos/custom-odin-nixos/home.nix @@ -0,0 +1,14 @@ +# Home-Manager Module by Reboot-Codes on 2024-08-02 +{ config, pkgs, pkgs-stable, ...}: { + home-manager = { + users."reboot" = { + # TODO: Configure syncthing + + home = { + stateVersion = "23.11"; + username = "reboot"; + homeDirectory = "/home/reboot"; + }; + }; + }; +} diff --git a/nixos/latitude7390-loki-nixos/configuration.nix b/nixos/latitude7390-loki-nixos/configuration.nix index a1fa208..e267b45 100755 --- a/nixos/latitude7390-loki-nixos/configuration.nix +++ b/nixos/latitude7390-loki-nixos/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running 'nixos-help'). -{ config, pkgs, self, rust-overlay, ... }: { +{ pkgs, ... }: { imports = [ ./hardware-configuration.nix # Include the results of the hardware scan. ]; @@ -34,6 +34,9 @@ powerManagement.enable = true; hardware = { + steam-hardware.enable = true; + xone.enable = true; + graphics = { enable = true; enable32Bit = true; # For steam specifically, but will be for all of opengl... @@ -103,16 +106,6 @@ User = "reboot"; }; }; - - # TODO: This just fails and fails and fails, mostly because of encoder setup issues. - # sunshine = { - # description = "Remote Access"; - # serviceConfig = { - # ExecStart = "${pkgs.sunshine}/bin/sunshine"; - # User = "root"; - # Restart = "on-failure"; - # }; - # }; }; virtualisation = { @@ -264,7 +257,16 @@ }; desktopManager.plasma6.enable = true; - displayManager.defaultSession = "plasma"; + + displayManager = { + defaultSession = "plasma"; + + ly = { + enable = true; + + settings = {}; + }; + }; xserver = { enable = true; @@ -273,13 +275,6 @@ layout = "us"; variant = ""; }; - - displayManager = { - lightdm = { - greeter.enable = true; - greeters.gtk.enable = true; - }; - }; }; # displayManager.sddm.enable = true; # It's kinda broken right now. @@ -450,6 +445,7 @@ kdePackages.breeze libsForQt5.qt5ct kdePackages.breeze-gtk + kdePackages.kdialog # VMs and Containers dive diff --git a/nixos/temp-installer-nixos/configuration.nix b/nixos/temp-installer-nixos/configuration.nix index b25ccae..57d27b1 100644 --- a/nixos/temp-installer-nixos/configuration.nix +++ b/nixos/temp-installer-nixos/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, config, modulesPath, hostConfig, ... }: { +{ pkgs, modulesPath, hostConfig, ... }: { imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-base.nix") ]; users.users."${hostConfig.username}".password = "password"; @@ -22,7 +22,7 @@ #nvidia = { # modesetting.enable = true; # powerManagement.enable = false; - # open = false; + # open = true; # powerManagement.finegrained = false; # nvidiaSettings = true; # package = config.boot.kernelPackages.nvidiaPackages.stable; -- 2.51.2