From d63ef9f1255985e72fab98edbe70819d6df1e657 Mon Sep 17 00:00:00 2001 From: knoff Date: Fri, 12 Apr 2024 20:42:39 +0200 Subject: [PATCH 1/5] pyperland: added pyprland module to home-manager pyperland is a hyperland plugin manager. --- modules/lib/maintainers.nix | 6 ++++ modules/services/pyprland.nix | 56 +++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/services/pyprland.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 2c4fbd9d..6143e3c3 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -518,4 +518,10 @@ github = "zorrobert"; githubId = 118135271; }; + knoc-off = { + name = "Niko Selby"; + email = "selby@niko.ink"; + github = "knoc-off"; + githubId = 36494048; + }; } diff --git a/modules/services/pyprland.nix b/modules/services/pyprland.nix new file mode 100644 index 00000000..0f6f1aa6 --- /dev/null +++ b/modules/services/pyprland.nix @@ -0,0 +1,56 @@ +{ options, config, lib, pkgs, ... }: +let + cfg = config.services.pyprland; + settingsFormat = pkgs.formats.toml { }; +in with lib; { + + meta.maintainers = [ maintainers.knoc-off ]; + options.services.pyprland = { + enable = mkEnableOption "pyperland"; + + 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 + + for supported values. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + services.pyprland.settings = { + pyprland = { + plugins = cfg.extraPlugins + ++ (optional (cfg.settings.scratchpads != { }) "scratchpads"); + }; + }; + + home.file.".config/hypr/pyprland.toml".source = + settingsFormat.generate "pyprland-config.toml" cfg.settings; + }; +} + From 2a64009e00c5be4a531266390e4420c3c5c1b6bd Mon Sep 17 00:00:00 2001 From: knockoff <36494048+knoc-off@users.noreply.github.com> Date: Sat, 20 Apr 2024 11:05:12 +0200 Subject: [PATCH 2/5] Update pyprland.nix Spelling mistake --- modules/services/pyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/pyprland.nix b/modules/services/pyprland.nix index 0f6f1aa6..b58bd580 100644 --- a/modules/services/pyprland.nix +++ b/modules/services/pyprland.nix @@ -6,7 +6,7 @@ in with lib; { meta.maintainers = [ maintainers.knoc-off ]; options.services.pyprland = { - enable = mkEnableOption "pyperland"; + enable = mkEnableOption "pyprland"; package = mkOption { default = pkgs.pyprland; From 60b5af9bab2023cfadb26d528bef5417f11f1d0f Mon Sep 17 00:00:00 2001 From: knockoff <36494048+knoc-off@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:17:48 +0200 Subject: [PATCH 3/5] Update modules/services/pyprland.nix Co-authored-by: Robert Helgesson --- modules/services/pyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/pyprland.nix b/modules/services/pyprland.nix index b58bd580..e36ab3e6 100644 --- a/modules/services/pyprland.nix +++ b/modules/services/pyprland.nix @@ -4,7 +4,7 @@ let settingsFormat = pkgs.formats.toml { }; in with lib; { - meta.maintainers = [ maintainers.knoc-off ]; + meta.maintainers = [ hm.maintainers.knoc-off ]; options.services.pyprland = { enable = mkEnableOption "pyprland"; From aecb02c4ba00ee7d78d47868553dc0d2647a6801 Mon Sep 17 00:00:00 2001 From: knockoff <36494048+knoc-off@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:18:20 +0200 Subject: [PATCH 4/5] Update modules/services/pyprland.nix Co-authored-by: Robert Helgesson --- modules/services/pyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/pyprland.nix b/modules/services/pyprland.nix index e36ab3e6..bdf3c6c8 100644 --- a/modules/services/pyprland.nix +++ b/modules/services/pyprland.nix @@ -33,7 +33,7 @@ in with lib; { default = { }; description = '' Configuration for pyprland, see - + for supported values. ''; }; From b4c19aecb345bd1a303c817a20b9e31766789a0f Mon Sep 17 00:00:00 2001 From: knockoff <36494048+knoc-off@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:24:03 +0200 Subject: [PATCH 5/5] Update pyprland.nix Added suggested changes, to exec the pyprland service from hyprland. --- modules/services/pyprland.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/services/pyprland.nix b/modules/services/pyprland.nix index bdf3c6c8..7499a5ce 100644 --- a/modules/services/pyprland.nix +++ b/modules/services/pyprland.nix @@ -48,7 +48,8 @@ in with lib; { ++ (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; };