64cdc0dd3c
Reproducible development environment for NixOS/Nix contributors: - Dev shell with Node 22, system Electron, Playwright, LD_LIBRARY_PATH for X11/Wayland/audio libs, activated automatically via direnv - buildNpmPackage derivation wrapping system Electron with desktop file and hicolor icons - NixOS module (programs.openscreen.enable) with xdg-desktop-portal - Home Manager module for per-user installation - Overlay for composing with other flakes Tested: nix flake show, nix develop, nix build, nixos-rebuild switch
43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
# NixOS module for OpenScreen
|
|
# Usage in flake-based NixOS config:
|
|
#
|
|
# inputs.openscreen.url = "github:siddharthvaddem/openscreen";
|
|
#
|
|
# { inputs, ... }: {
|
|
# imports = [ inputs.openscreen.nixosModules.default ];
|
|
# programs.openscreen.enable = true;
|
|
# }
|
|
self:
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.openscreen;
|
|
in
|
|
{
|
|
options.programs.openscreen = {
|
|
enable = lib.mkEnableOption "OpenScreen screen recorder";
|
|
|
|
package = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.openscreen;
|
|
defaultText = lib.literalExpression "inputs.openscreen.packages.\${pkgs.stdenv.hostPlatform.system}.openscreen";
|
|
description = "The OpenScreen package to use.";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
# Screen capture on Wayland requires xdg-desktop-portal.
|
|
# We enable the base portal; users should also enable a
|
|
# desktop-specific portal (e.g. xdg-desktop-portal-gtk,
|
|
# xdg-desktop-portal-hyprland) in their DE config.
|
|
xdg.portal.enable = lib.mkDefault true;
|
|
};
|
|
}
|