nixos/users/modules/persway.nix

38 lines
1.1 KiB
Nix

{
pkgs,
lib,
config,
...
}: let
cfg = config.services.persway;
pkg = pkgs.callPackage ../../pkgs/persway.nix {};
in {
options.services.persway = with lib; {
enable = mkEnableOption "persway, the friendly sway IPC daemon";
autolayout.enable = mkEnableOption "the autolayout feature";
workspaceRenaming.enable = mkEnableOption "the workspace renaming feature";
# TODO: -e -f
};
config = lib.mkIf cfg.enable {
warnings = lib.optional (builtins.elem "persway" (builtins.attrNames pkgs)) "Persway has been packaged upstream!";
systemd.user.services."persway" = {
Unit = {
Description = "Persway Sway IPC daemon";
PartOf = "graphical-session.target";
After = "graphical-session.target";
};
Service = {
ExecStart = ''
${pkg}/bin/persway ${
lib.optionalString cfg.autolayout.enable "--autolayout"
} ${
lib.optionalString cfg.workspaceRenaming.enable "--workspace-renaming"
}
'';
};
Install.WantedBy = ["graphical-session.target"];
};
};
}