From 35857a57f50367378840e28c7409a53d22440427 Mon Sep 17 00:00:00 2001 From: Toast <39011842+toast003@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:25:03 +0100 Subject: [PATCH] Add initial support for profiles in konsole module --- modules/apps/konsole.nix | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/modules/apps/konsole.nix b/modules/apps/konsole.nix index f4254026..700d631d 100644 --- a/modules/apps/konsole.nix +++ b/modules/apps/konsole.nix @@ -4,6 +4,17 @@ with lib; let cfg = config.programs.konsole; + profilesSubmodule = { + options = { + name = mkOption { + type = types.str; + default = null; + description = '' + Name of the profile that will be shown in Konsole + ''; + }; + }; + }; in { @@ -21,6 +32,14 @@ in To see what options you have, just take a look at ~/.local/share/konsole/ ''; }; + + profiles = mkOption { + type = with types; nullOr (attrsOf (submodule profilesSubmodule)); + default = {}; + description = '' + Plasma profiles to generate + ''; + }; }; config = mkIf (config.programs.plasma.enable && cfg.enable) { @@ -31,5 +50,28 @@ in } ) ]; + + # Konsole is fine with using symlinked profiles so I'll use the home-manager way + programs.plasma.dataFile = mkIf (cfg.profiles != {}) ( + mkMerge ([ + ( + mkMerge ( + mapAttrsToList ( + name: profile: { + "konsole/${name}.profile" = { + "General" = { + "Name" = profile.name; + # Konsole generated profiles seem to allways have this + "Parent" = "FALLBACK/"; + }; + # this is for testing only + "Appearance"."ColorScheme" = "Solarized"; + }; + } + ) cfg.profiles + ) + ) + ]) + ); }; -} \ No newline at end of file +}