nixos/pinnacle: init module
add a nixos module to set up pinnacle as an available session. a user service/targets are still required to actually run the compositor -- these are best configured via home-manager, using a module I intend to PR to home-manager once this PR has been merged into nixpkgs.
This commit is contained in:
@@ -354,6 +354,7 @@
|
||||
./programs/wayland/mangowc.nix
|
||||
./programs/wayland/miracle-wm.nix
|
||||
./programs/wayland/niri.nix
|
||||
./programs/wayland/pinnacle.nix
|
||||
./programs/wayland/river.nix
|
||||
./programs/wayland/sway.nix
|
||||
./programs/wayland/uwsm.nix
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.pinnacle;
|
||||
inherit (lib.options) mkEnableOption mkPackageOption;
|
||||
in
|
||||
{
|
||||
options.programs.pinnacle = {
|
||||
enable = mkEnableOption "pinnacle";
|
||||
package = mkPackageOption pkgs "pinnacle" {
|
||||
default = "pinnacle";
|
||||
example = "pkgs.pinnacle";
|
||||
extraDescription = "package containing the pinnacle server binary";
|
||||
};
|
||||
xdg-portals.enable = mkEnableOption "enable xdg-portals for pinnacle";
|
||||
withUWSM = mkEnableOption ''
|
||||
manage the pinnacle session with [UWSM](https://github.com/Vladimir-csp/uwsm) instead
|
||||
of independent systemd services and targets.
|
||||
'';
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
pkgs.protobuf
|
||||
cfg.package.lua-client-api
|
||||
];
|
||||
environment.pathsToLink = [
|
||||
# For /run/current-system/sw/share/pinnacle protobuf files - for
|
||||
# pinnacle to be able to launch with a non-default config out of the
|
||||
# box.
|
||||
"/share/pinnacle"
|
||||
];
|
||||
xdg.portal = lib.mkIf cfg.xdg-portals.enable {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
configPackages = [ cfg.package ];
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-wlr
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.gnome-keyring
|
||||
];
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.withUWSM) {
|
||||
programs.uwsm.enable = true;
|
||||
# Configure UWSM to launch Pinnacle from a display manager like SDDM
|
||||
programs.uwsm.waylandCompositors = {
|
||||
pinnacle = {
|
||||
prettyName = "Pinnacle";
|
||||
comment = "Pinnacle compositor managed by UWSM";
|
||||
binPath = "/run/current-system/sw/bin/pinnacle";
|
||||
extraArgs = [ "--session" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.mkIf (!cfg.withUWSM) {
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ cassandracomar ];
|
||||
}
|
||||
Reference in New Issue
Block a user