This commit is contained in:
knockoff 2024-05-01 13:47:58 +05:30 committed by GitHub
commit 94eca13b94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 63 additions and 0 deletions

View File

@ -548,4 +548,10 @@
github = "zorrobert";
githubId = 118135271;
};
knoc-off = {
name = "Niko Selby";
email = "selby@niko.ink";
github = "knoc-off";
githubId = 36494048;
};
}

View File

@ -0,0 +1,57 @@
{ options, config, lib, pkgs, ... }:
let
cfg = config.services.pyprland;
settingsFormat = pkgs.formats.toml { };
in with lib; {
meta.maintainers = [ hm.maintainers.knoc-off ];
options.services.pyprland = {
enable = mkEnableOption "pyprland";
package = mkOption {
default = pkgs.pyprland;
type = types.package;
description = "The pyprland package to use";
};
extraPlugins = mkOption {
default = [ ];
type = with types; listOf str;
description = "Additional plugins to enable";
};
settings = mkOption {
type = types.submodule {
freeformType = settingsFormat.type;
options.scratchpads = mkOption {
default = { };
type = with types; attrsOf attrs;
description = "Scratchpad configurations";
};
};
default = { };
description = ''
Configuration for pyprland, see
<https://github.com/hyprland-community/pyprland/wiki/Getting-started#configuring">
for supported values.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
services.pyprland.settings = {
pyprland = {
plugins = cfg.extraPlugins
++ (optional (cfg.settings.scratchpads != { }) "scratchpads");
};
};
wayland.windowManager.hyprland.settings.exec-once = [(getExe cfg.package)];
home.file.".config/hypr/pyprland.toml".source =
settingsFormat.generate "pyprland-config.toml" cfg.settings;
};
}