niksos/modules/gui/quickshell/default.nix

52 lines
1.4 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.myOptions.programs.quickshell;
inherit (config.myOptions.other.system) username;
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;
};
in {
options.myOptions.programs.quickshell = {
enable = mkEnableOption "quickshell";
enabledConfigs = mkOption {
description = "enabled configs out of the defaults";
type = listOf str;
default = [];
};
extraConfigs = mkOption {
description = "extra configs (no need to enable these)";
type = attrsOf path;
default = {};
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [
inputs.quickshell.packages.${pkgs.system}.default
# for da poz
qt6.qtsvg
];
xdg.configFile."quickshell/manifest.conf".text = ''
${concatStrings (mapAttrsToList (name: value: ''
${name} = ${value}
'') ((lib.filterAttrs (name: _: elem name cfg.enabledConfigs) defaultConfigs) // cfg.extraConfigs))}
'';
};
};
}