2024-04-13 22:19:45 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-05-05 12:38:40 +02:00
|
|
|
}: let
|
2024-04-13 22:19:45 +02:00
|
|
|
cfg = config.myOptions.programs.quickshell;
|
2024-04-14 18:49:29 +02:00
|
|
|
inherit (config.myOptions.other.system) username;
|
2024-04-15 21:49:19 +02:00
|
|
|
|
2024-05-05 12:38:40 +02:00
|
|
|
inherit (lib) elem mkEnableOption mkIf mkOption;
|
|
|
|
inherit (lib.types) attrsOf listOf path str;
|
|
|
|
inherit (lib.strings) concatStrings;
|
|
|
|
inherit (lib.attrsets) mapAttrsToList;
|
|
|
|
|
2024-04-15 21:49:19 +02:00
|
|
|
defaultConfigs = {
|
|
|
|
powermenu = ./powermenu;
|
|
|
|
poz = ./poz;
|
|
|
|
};
|
2024-04-13 22:19:45 +02:00
|
|
|
in {
|
|
|
|
options.myOptions.programs.quickshell = {
|
|
|
|
enable = mkEnableOption "quickshell";
|
2024-04-15 21:49:19 +02:00
|
|
|
|
2024-04-15 23:20:04 +02:00
|
|
|
enabledConfigs = mkOption {
|
|
|
|
description = "enabled configs out of the defaults";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = listOf str;
|
2024-04-15 23:20:04 +02:00
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
|
2024-04-15 21:49:19 +02:00
|
|
|
extraConfigs = mkOption {
|
2024-04-15 21:51:52 +02:00
|
|
|
description = "extra configs (no need to enable these)";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = attrsOf path;
|
2024-04-15 21:49:19 +02:00
|
|
|
default = {};
|
|
|
|
};
|
2024-04-13 22:19:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home-manager.users.${username} = {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
inputs.quickshell.packages.${pkgs.system}.default
|
|
|
|
# for da poz
|
|
|
|
qt6.qtsvg
|
|
|
|
];
|
2024-04-15 00:31:19 +02:00
|
|
|
|
|
|
|
xdg.configFile."quickshell/manifest.conf".text = ''
|
2024-04-15 21:49:19 +02:00
|
|
|
${concatStrings (mapAttrsToList (name: value: ''
|
|
|
|
${name} = ${value}
|
2024-04-15 23:20:04 +02:00
|
|
|
'') ((lib.filterAttrs (name: _: elem name cfg.enabledConfigs) defaultConfigs) // cfg.extraConfigs))}
|
2024-04-15 00:31:19 +02:00
|
|
|
'';
|
2024-04-13 22:19:45 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|