diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index ef47a83..d636b62 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -33,8 +33,6 @@ in { ../programs/libreoffice.nix ../programs/neovim.nix ../programs/vscode - - ../programs/obs-studio.nix ]; home.sessionVariables.HM_CONFIG = "graphical-fullblown"; diff --git a/nix/home-manager/profiles/sway-desktop.nix b/nix/home-manager/profiles/sway-desktop.nix index dcf6544..6f093be 100644 --- a/nix/home-manager/profiles/sway-desktop.nix +++ b/nix/home-manager/profiles/sway-desktop.nix @@ -1,3 +1,18 @@ +/* +TODO: create helper scripts for sharing of a screen portion +``` +swaymsg create_output + +# find the name and the workspace number +swaymsg -t get_outputs | jq '.[] | select(.name | test("HEADLESS-.*")) | (.name, .current_workspace)' + +swaymsg output HEADLESS-1 mode 1920@108060Hz + +# mirror the headless workspace on the current one +nix run nixpkgs\#wl-mirror -- HEADLESS-1 + +# shift windows to the workspace and switch the focus to it +*/ { pkgs, config, diff --git a/nix/home-manager/programs/obs-studio.nix b/nix/home-manager/programs/obs-studio.nix index 8673eb0..b053e24 100644 --- a/nix/home-manager/programs/obs-studio.nix +++ b/nix/home-manager/programs/obs-studio.nix @@ -9,7 +9,7 @@ builtins.map (plugin: (plugin.overrideAttrs (attrs: { meta = lib.mkMerge [ {inherit (attrs) meta;} - {meta.platforms = ["aarch64-linux"];} + {meta.platforms = [pkgs.stdenv.system];} ]; }))) (with pkgs.obs-studio-plugins; [ diff --git a/nix/home-manager/programs/waybar.nix b/nix/home-manager/programs/waybar.nix index 05392c5..b6137e1 100644 --- a/nix/home-manager/programs/waybar.nix +++ b/nix/home-manager/programs/waybar.nix @@ -22,7 +22,14 @@ layer = "top"; position = "bottom"; height = 30; - output = ["*"]; + output = + # hide the bar on HEADDLESS displays as i use them only for screensharing + ( + builtins.genList (i: "!HEADLESS-${builtins.toString i}") 99 + ) + ++ [ + "*" + ]; # output = [ # "eDP-1" # "DP-*" diff --git a/nix/os/devices/steveej-x13s/configuration.nix b/nix/os/devices/steveej-x13s/configuration.nix index f10f307..2d2e6b0 100644 --- a/nix/os/devices/steveej-x13s/configuration.nix +++ b/nix/os/devices/steveej-x13s/configuration.nix @@ -72,10 +72,12 @@ nodeFlake.inputs.disko.nixosModules.disko ./disko.nix + ../../profiles/common/user.nix + ../../snippets/nix-settings.nix ../../snippets/nix-settings-holo-chain.nix ../../snippets/mycelium.nix - ../../profiles/common/user.nix + ../../snippets/obs-studio.nix { services.openssh.enable = true; diff --git a/nix/os/devices/steveej-x13s/flake.lock b/nix/os/devices/steveej-x13s/flake.lock index 8805ba8..1e4bcd7 100644 --- a/nix/os/devices/steveej-x13s/flake.lock +++ b/nix/os/devices/steveej-x13s/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1723685519, - "narHash": "sha256-GkXQIoZmW2zCPp1YFtAYGg/xHNyFH/Mgm79lcs81rq0=", + "lastModified": 1725377834, + "narHash": "sha256-tqoAO8oT6zEUDXte98cvA1saU9+1dLJQe3pMKLXv8ps=", "owner": "nix-community", "repo": "disko", - "rev": "276a0d055a720691912c6a34abb724e395c8e38a", + "rev": "e55f9a8678adc02024a4877c2a403e3f6daf24fe", "type": "github" }, "original": { @@ -96,11 +96,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", "type": "github" }, "original": { @@ -148,11 +148,11 @@ ] }, "locked": { - "lastModified": 1720042825, - "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", + "lastModified": 1725703823, + "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", "owner": "nix-community", "repo": "home-manager", - "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", "type": "github" }, "original": { @@ -162,6 +162,23 @@ "type": "github" } }, + "linux-jhovold": { + "flake": false, + "locked": { + "lastModified": 1725261528, + "narHash": "sha256-p2rP8fErEnrlrkl2l4ZfnWOG2U/ohAC9blx+sTpU4+I=", + "owner": "jhovold", + "repo": "linux", + "rev": "2997053728cd0675469399212061423e63b48c1f", + "type": "github" + }, + "original": { + "owner": "jhovold", + "ref": "wip/sc8280xp-6.11-rc6", + "repo": "linux", + "type": "github" + } + }, "mycelium": { "inputs": { "crane": "crane", @@ -171,11 +188,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1722599161, - "narHash": "sha256-befejQIW6Tc6znCpEW4MrrTLT8c6kRszAmxvB+ojFJo=", + "lastModified": 1725529869, + "narHash": "sha256-ekEL4HrZbAeoZmopkxvZ4Z4ufkUEv09b4liGnIIiryc=", "owner": "threefoldtech", "repo": "mycelium", - "rev": "c5ac0a8cf3341a53bb136bbbb42ede4f62041c24", + "rev": "43c774cc1d5bae9558d0086e2be334812cafe2be", "type": "github" }, "original": { @@ -224,20 +241,21 @@ "nixos-x13s": { "inputs": { "flake-parts": "flake-parts_2", + "linux-jhovold": "linux-jhovold", "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1722396240, - "narHash": "sha256-t4C/I1CttOGFLYzzjd6zNOPvPleykqbPwO0YT19S6jI=", - "ref": "refs/heads/main", - "rev": "a59ae21e47538cecddadc220ea16a7b8e2485f66", - "revCount": 97, + "lastModified": 1725606185, + "narHash": "sha256-ur40KNuaj90nv3tmNhozvNvhLWxFzyodtkYi/JOBZLE=", + "ref": "refs/heads/remaintain", + "rev": "759bf531bb9ffa1a45cabb01c6ee1bdb23b9b49b", + "revCount": 101, "type": "git", - "url": "https://codeberg.org/adamcstephens/nixos-x13s" + "url": "file:///home/steveej/src/others/nixos-x13s" }, "original": { "type": "git", - "url": "https://codeberg.org/adamcstephens/nixos-x13s" + "url": "file:///home/steveej/src/others/nixos-x13s" } }, "nixpkgs": { @@ -258,23 +276,23 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "lastModified": 1725233747, + "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1723637854, - "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { @@ -286,11 +304,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1722062969, - "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -302,11 +320,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1723688146, - "narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=", + "lastModified": 1725826545, + "narHash": "sha256-L64N1rpLlXdc94H+F6scnrbuEu+utC03cDDVvvJGOME=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c3d4ac725177c030b1e289015989da2ad9d56af0", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", "type": "github" }, "original": { diff --git a/nix/os/devices/steveej-x13s/flake.nix b/nix/os/devices/steveej-x13s/flake.nix index 5104910..511f6fc 100644 --- a/nix/os/devices/steveej-x13s/flake.nix +++ b/nix/os/devices/steveej-x13s/flake.nix @@ -14,7 +14,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s"; + nixos-x13s.url = + # "git+https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git?branch=remaintain" + "/home/steveej/src/others/nixos-x13s" + # + ; + # nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s?ref=refs/tags/2024-02-28"; # nixos-x13s.url = "path:/home/steveej/src/others/nixos-x13s"; # nixos-x13s.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/nix/os/snippets/obs-studio.nix b/nix/os/snippets/obs-studio.nix new file mode 100644 index 0000000..c46305e --- /dev/null +++ b/nix/os/snippets/obs-studio.nix @@ -0,0 +1,31 @@ +{config, ...}: let + # TODO: make configurable + homeUser = "steveej"; +in { + boot.extraModulePackages = [ + config.boot.kernelPackages.v4l2loopback.out + ]; + + # Activate kernel modules (choose from built-ins and extra ones) + boot.kernelModules = [ + # Virtual Camera + "v4l2loopback" + # Virtual Microphone, built-in + "snd-aloop" + ]; + + # exclusive_caps: Skype, Zoom, Teams etc. will only show device when actually streaming + # card_label: Name of virtual camera, how it'll show up in Skype, Zoom, Teams + # https://github.com/umlaeute/v4l2loopback + boot.extraModprobeConfig = '' + options v4l2loopback devices=1 video_nr=1 card_label="OBSCam" exclusive_caps=1 + ''; + + security.polkit.enable = true; + + home-manager.users.${homeUser} = _: { + imports = [ + ../../home-manager/programs/obs-studio.nix + ]; + }; +} diff --git a/nix/os/snippets/sway-desktop.nix b/nix/os/snippets/sway-desktop.nix index ec6859c..8d6d9f1 100644 --- a/nix/os/snippets/sway-desktop.nix +++ b/nix/os/snippets/sway-desktop.nix @@ -40,6 +40,25 @@ in { wlr = { enable = true; + settings = { + screencast = { + chooser_type = "dmenu"; + # display the output as a list in favor of the default mouse selection + chooser_cmd = lib.getExe (pkgs.writeShellApplication { + name = "chooser_cmd"; + runtimeInputs = [ + pkgs.sway + pkgs.jq + pkgs.fuzzel + pkgs.gnused + ]; + text = '' + swaymsg -t get_outputs | jq '.[] | "\(.name)@\(.current_mode.width)x\(.current_mode.height) on \(.model)"' | sed 's/"//g' | fuzzel -d | sed 's/@.*//' + ''; + }); + max_fps = 30; + }; + }; }; # keep the behaviour in < 1.17, which uses the first portal implementation found in lexicographical order, use the following: