cosmic checkpoint

This commit is contained in:
atagen 2024-08-14 01:01:53 +10:00
parent 4031a614a8
commit f623faa0ef
26 changed files with 1163 additions and 538 deletions

View file

@ -4,15 +4,22 @@
...
}: let
inherit (builtins) getAttr stringLength substring;
inherit (lib) mkOption getExe;
inherit (lib) mkOption getExe listToAttrs attrsToList imap;
inherit (lib.attrsets) filterAttrs mapAttrs mapAttrs' nameValuePair;
inherit (lib.strings) concatStringsSep toUpper;
enumerate = a:
listToAttrs (imap (id: {
name,
value,
}: {
inherit name;
value = value // {inherit id;};
}) (attrsToList a));
make-app-profiles = cfg:
mapAttrs' (name: cfg:
nameValuePair "home-manager-webapp-${name}" {
inherit (cfg) id;
userChrome = ''
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@ -82,10 +89,10 @@ in {
description = "The URL of the webapp to launch.";
};
id = mkOption {
type = int;
description = "The Firefox profile ID to set.";
};
# id = mkOption {
# type = int;
# description = "The Firefox profile ID to set.";
# };
hidden = mkOption {
type = bool;
@ -174,7 +181,7 @@ in {
};
config = {
programs.firefox.profiles = make-app-profiles config.programs.firefox.webapps;
programs.firefox.profiles = make-app-profiles (enumerate config.programs.firefox.webapps);
xdg.desktopEntries =
mapAttrs (name: cfg: {