diff --git a/flake.nix b/flake.nix index 8efc778..04c74c3 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,12 @@ nixos-mailserver.nixosModule ]; }; + JimDeck = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./nixos/deck.nix + ]; + }; }; # Standalone home-manager configuration entrypoint @@ -87,6 +93,13 @@ ./home-manager/jimbo_server.nix ]; }; + "jimbo@JimDeck" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home-manager/jimbo_server.nix + ]; + }; # Derivation for ssh envrionments on other people's servers "jimbo@SSH" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; diff --git a/nixos/deck.nix b/nixos/deck.nix new file mode 100644 index 0000000..d591d49 --- /dev/null +++ b/nixos/deck.nix @@ -0,0 +1,37 @@ +{ + imports = [ + # Base configs + ./base.nix + + # Import users and groups + ./users/jimbo.nix + ./users/groups.nix + + # Desktop only + ./desktop/misc.nix + ./desktop/sway.nix + ./desktop/gaming.nix + ./desktop/pipewire.nix + ./desktop/bluetooth.nix + ./desktop/firewall.nix + ./desktop/fonts.nix + ./desktop/qt.nix + + # Steam Deck only + ./deck/jovian.nix + + # Modules + ./modules/security.nix + + # Hardware + ./hardware/machines/deck.nix + ./hardware/systemdboot.nix + ./hardware/opengl.nix + + # Services + ./services/openssh.nix + ./services/mpd.nix + ]; + + networking.hostName = "JimDesktop"; +} diff --git a/nixos/deck/greetd-steam.nix b/nixos/deck/greetd-steam.nix new file mode 100644 index 0000000..5e1164b --- /dev/null +++ b/nixos/deck/greetd-steam.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + services = { + # Configure greetd for "auto" login (single user only) + greetd = { + enable = true; + restart = true; + settings = { + terminal = { + vt = 2; + switch = true; + }; + default_session = { + command = "start-gamescope-session"; + user = "jimbo"; + }; + }; + }; + }; +} diff --git a/nixos/deck/jovian.nix b/nixos/deck/jovian.nix new file mode 100644 index 0000000..099ccf3 --- /dev/null +++ b/nixos/deck/jovian.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./greetd-steam.nix + ]; + + jovian = { + steam = { + enable = true; + desktopSession = "sway"; + }; + decky-loader.enable = true; + devices.steamdeck.enable = true; + steamos.useSteamOSConfig = true; + }; +} diff --git a/nixos/desktop.nix b/nixos/desktop.nix index f18c17d..0f5ac9b 100644 --- a/nixos/desktop.nix +++ b/nixos/desktop.nix @@ -10,6 +10,7 @@ # Desktop only ./desktop/misc.nix ./desktop/sway.nix + ./desktop/greetd-sway.nix ./desktop/printing.nix ./desktop/gaming.nix ./desktop/pipewire.nix diff --git a/nixos/desktop/greetd-sway.nix b/nixos/desktop/greetd-sway.nix new file mode 100644 index 0000000..11a4bea --- /dev/null +++ b/nixos/desktop/greetd-sway.nix @@ -0,0 +1,39 @@ +{pkgs, ...}: { + services = { + # Configure greetd for "auto" login (single user only) + greetd = let + startSway = pkgs.writeScript "startsway" '' + # Use NVIDIA variables if drivers are in use + if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then + # NVIDIA/AMD variables + export LIBVA_DRIVER_NAME=nvidia + export GBM_BACKEND=nvidia-drm + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export WLR_NO_HARDWARE_CURSORS=1 + else + : + fi + + # Sway/Wayland + export XDG_CURRENT_DESKTOP=sway + export QT_QPA_PLATFORM="wayland;xcb" + + # Start Sway + sway --unsupported-gpu + ''; + in { + enable = true; + restart = true; + settings = { + terminal = { + vt = 2; + switch = true; + }; + default_session = { + command = "${startSway}"; + user = "jimbo"; + }; + }; + }; + }; +} diff --git a/nixos/desktop/wayland.nix b/nixos/desktop/wayland.nix index 250e4cc..ceb211f 100644 --- a/nixos/desktop/wayland.nix +++ b/nixos/desktop/wayland.nix @@ -1,54 +1,12 @@ {pkgs, ...}: { - services = { - # Configure greetd for "auto" login (single user only) - greetd = let - startSway = pkgs.writeScript "startsway" '' - # Use NVIDIA variables if drivers are in use - if lspci -k | grep "Kernel driver in use: nvidia" &> /dev/null; then - # NVIDIA/AMD variables - export LIBVA_DRIVER_NAME=nvidia - export GBM_BACKEND=nvidia-drm - export __GLX_VENDOR_LIBRARY_NAME=nvidia - export WLR_NO_HARDWARE_CURSORS=1 - else - : - fi - - # Sway/Wayland - export XDG_CURRENT_DESKTOP=sway - export QT_QPA_PLATFORM="wayland;xcb" - - # Start Sway - sway --unsupported-gpu - ''; - in { - enable = true; - restart = true; - settings = { - terminal = { - vt = 2; - switch = true; - }; - default_session = { - command = "${startSway}"; - user = "jimbo"; - }; - }; - }; - dbus.enable = true; - }; - - programs.xwayland = { - enable = true; - }; - - # Enable backlight and theme control programs = { dconf.enable = true; light.enable = true; + xwayland.enable = true; }; - # Packages needed for Wayland + services.dbus.enable = true; + environment.systemPackages = with pkgs; [ wl-clipboard wdisplays