niksos/modules/gui/quickshell/default.nix

55 lines
1.5 KiB
Nix
Raw Permalink 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-07-15 23:18:25 +02:00
cfg = config.poz.programs.quickshell;
inherit (config.poz.other.system) username;
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
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";
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 {
users.users.${username}.packages = [
2024-10-13 23:25:45 +02:00
inputs.quickshell.packages.${pkgs.stdenv.system}.default
# for da poz
pkgs.qt6.qtsvg
];
2024-04-15 00:31:19 +02:00
home-manager.users.${username} = {
2024-04-15 00:31:19 +02:00
xdg.configFile."quickshell/manifest.conf".text = ''
${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
};
};
}