organise all options into modules

This commit is contained in:
atagen 2024-05-08 15:05:43 +10:00
parent c7c6606d14
commit 3192b6ca09
43 changed files with 518 additions and 423 deletions

View file

@ -22,7 +22,7 @@
default = {};
};
# for launching a systemd target on wm startup
# for specifying an additional systemd target
extraTarget = with lib;
mkOption {
type = with types; listOf str;

View file

@ -4,7 +4,7 @@
...
}: let
inherit (builtins) getAttr stringLength substring;
inherit (lib) mkOption;
inherit (lib) mkOption getExe;
inherit (lib.attrsets) filterAttrs mapAttrs mapAttrs' nameValuePair;
inherit (lib.strings) concatStringsSep toUpper;
@ -190,7 +190,7 @@ in {
type = "Application";
exec = concatStringsSep " " ([
"${lib.getExe config.programs.firefox.package}"
"${getExe config.programs.firefox.package}"
"--name"
"${name}"
"--app-id"

View file

@ -6,6 +6,7 @@
}: let
inherit (lib) mkOption;
inherit (lib.attrsets) mapAttrs mapAttrs' nameValuePair;
inherit (lib) getExe getExe';
# make a firefox webapp entry for the client app
make-firefox = cfg:
mapAttrs' (
@ -35,10 +36,10 @@
inherit (cfg) name icon genericName;
type = "Application";
exec = "${let
notify-send = "${lib.getExe' pkgs.libnotify "notify-send"} -a \"${cfg.name}\"";
systemctl = "${lib.getExe' pkgs.systemd "systemctl"}";
dex = "${lib.getExe pkgs.dex}";
curl = "${lib.getExe pkgs.curl}";
notify-send = "${getExe' pkgs.libnotify "notify-send"} -a \"${cfg.name}\"";
systemctl = "${getExe' pkgs.systemd "systemctl"}";
dex = "${getExe pkgs.dex}";
curl = "${getExe pkgs.curl}";
in
pkgs.writeShellScript "${name}"
''