niksos/modules/gui/quickshell/default.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

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-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;
defaultConfigs = {
powermenu = ./powermenu;
poz = ./poz;
};
2024-04-13 22:19:45 +02:00
in {
options.myOptions.programs.quickshell = {
enable = mkEnableOption "quickshell";
enabledConfigs = mkOption {
description = "enabled configs out of the defaults";
2024-05-05 12:38:40 +02:00
type = listOf str;
default = [];
};
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;
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 = ''
${concatStrings (mapAttrsToList (name: value: ''
${name} = ${value}
'') ((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
};
};
}