2024-04-13 22:19:45 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-05-05 12:38:40 +02:00
|
|
|
}: let
|
2024-07-15 23:18:25 +02:00
|
|
|
cfg = config.poz.programs.quickshell;
|
|
|
|
inherit (config.poz.other.system) username;
|
2024-04-15 21:49:19 +02:00
|
|
|
|
2024-07-24 18:47:53 +02:00
|
|
|
inherit (lib.attrsets) filterAttrs mapAttrsToList;
|
|
|
|
inherit (lib.lists) elem;
|
2024-07-25 11:45:44 +02:00
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
2024-05-05 12:38:40 +02:00
|
|
|
inherit (lib.strings) concatStrings;
|
2024-07-24 18:47:53 +02:00
|
|
|
inherit (lib.types) attrsOf listOf path str;
|
2024-05-05 12:38:40 +02:00
|
|
|
|
2024-04-15 21:49:19 +02:00
|
|
|
defaultConfigs = {
|
|
|
|
powermenu = ./powermenu;
|
|
|
|
poz = ./poz;
|
|
|
|
};
|
2024-04-13 22:19:45 +02:00
|
|
|
in {
|
2024-07-15 23:18:25 +02:00
|
|
|
options.poz.programs.quickshell = {
|
2024-04-13 22:19:45 +02:00
|
|
|
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} = {
|
2024-08-25 20:17:14 +02:00
|
|
|
home.packages = [
|
2024-04-13 22:19:45 +02:00
|
|
|
inputs.quickshell.packages.${pkgs.system}.default
|
|
|
|
# for da poz
|
2024-08-25 20:17:14 +02:00
|
|
|
pkgs.qt6.qtsvg
|
2024-04-13 22:19:45 +02:00
|
|
|
];
|
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-07-24 18:47:53 +02:00
|
|
|
'') ((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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|