From 20b6b2da48096e368eec35ada951f4627925a3ca Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 3 May 2025 16:16:02 +1000 Subject: [PATCH] steamui: init a decklike experience thing --- flake.lock | 44 +++++++++++++++++++++++++++++++++ flake.nix | 4 ++- modules/linux/steamui.nix | 33 +++++++++++++++++++++++++ stow/.config/hypr/hyprland.conf | 10 ++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 modules/linux/steamui.nix diff --git a/flake.lock b/flake.lock index 1fa0fb8..ab9aab8 100644 --- a/flake.lock +++ b/flake.lock @@ -95,6 +95,27 @@ "type": "github" } }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742021951, + "narHash": "sha256-Nxrkvh353BeG6/D8yPq50VCaYnCMKviS7krw4DfzLVU=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "ecaf8b6aa7d28cb7b87da334310fbe1ba31f8d64", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -141,6 +162,28 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1741851582, @@ -203,6 +246,7 @@ "root": { "inputs": { "disko": "disko", + "jovian": "jovian", "lanzaboote": "lanzaboote", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs" diff --git a/flake.nix b/flake.nix index fa909e6..004d288 100644 --- a/flake.nix +++ b/flake.nix @@ -10,9 +10,11 @@ nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; disko.url = "github:nix-community/disko/latest"; disko.inputs.nixpkgs.follows = "nixpkgs"; + jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; + jovian.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, lanzaboote, nix-darwin, disko, ... }@inputs: { + outputs = { self, nixpkgs, lanzaboote, nix-darwin, disko, jovian, ... }@inputs: { nixosConfigurations.twinkpad = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ diff --git a/modules/linux/steamui.nix b/modules/linux/steamui.nix new file mode 100644 index 0000000..2b6f655 --- /dev/null +++ b/modules/linux/steamui.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +{ + jovian.steam = { + enable = true; + autoStart = true; + user = "nico"; + desktopSession = "hyprland"; + updater.splash = "bgrt"; + }; + + boot = { + consoleLogLevel = 0; + initrd.verbose = false; + loader.timeout = 0; + kernelParams = [ + "quiet" + "splash" + "vga=current" + "rd.systemd.show_status=false" + ]; + }; + + environment.systemPackages = with pkgs; [ + (writeShellScriptBin "hyprexit" '' + CHOICE=$(echo -e "Yes\nNo" | walker -d -p "Are you sure you want to return to gaming mode?") + + if [ "$CHOICE" = "Yes" ]; then + hyprctl dispatch exit & loginctl terminate-user $USER & + fi + '') + ]; +} diff --git a/stow/.config/hypr/hyprland.conf b/stow/.config/hypr/hyprland.conf index 842b11a..220dfe4 100755 --- a/stow/.config/hypr/hyprland.conf +++ b/stow/.config/hypr/hyprland.conf @@ -232,6 +232,11 @@ bindm = $mainMod, mouse:273, resizewindow input:kb_options = caps:super +# Controllers Binds +bind = $mainMod, page_up, workspace, e+1 +bind = $mainMod, page_down, workspace, e-1 +bind = $mainMod, insert, exec, hyprexit + ############################## ### WINDOWS AND WORKSPACES ### ############################## @@ -276,5 +281,10 @@ windowrulev2 = center, initialClass:(^opensnitch_ui$) windowrulev2 = idleinhibit fullscreen, initialTitle:(.*) +windowrulev2 = pin, initialTitle:(^Steam Input On-screen Keyboard$) +windowrulev2 = noblur, initialTitle:(^Steam Input On-screen Keyboard$) +windowrulev2 = bordersize 0, initialTitle:(^Steam Input On-screen Keyboard$) +windowrulev2 = noshadow, initialTitle:(^Steam Input On-screen Keyboard$) + # layer rules layerrule = animation slide top, waybar