Files
Cassandra Comar 0a601a67d7 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.
2026-07-06 09:52:22 -04:00

71 lines
2.0 KiB
Nix

{
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 ];
}