web browser: set $BROWSER environment variable

this gets used as fallback by e.g. xdg-email
This commit is contained in:
2023-06-30 08:50:58 +00:00
parent daabe09bb4
commit 3df165593c
3 changed files with 26 additions and 1 deletions

View File

@@ -193,6 +193,9 @@ in
sane.programs.web-browser = { sane.programs.web-browser = {
inherit package; inherit package;
# env.BROWSER = "${package}/bin/${cfg.browser.libName}";
env.BROWSER = cfg.browser.libName; # used by misc tools like xdg-email, as fallback
# uBlock filter list configuration. # uBlock filter list configuration.
# specifically, enable the GDPR cookie prompt blocker. # specifically, enable the GDPR cookie prompt blocker.
# data.toOverwrite.filterLists is additive (i.e. it supplements the default filters) # data.toOverwrite.filterLists is additive (i.e. it supplements the default filters)

View File

@@ -156,6 +156,7 @@ let
# conditionally persist relevant user dirs and create files # conditionally persist relevant user dirs and create files
sane.users = mapAttrs (user: en: optionalAttrs en { sane.users = mapAttrs (user: en: optionalAttrs en {
inherit (p) persist; inherit (p) persist;
environment = p.env;
fs = mkMerge [ fs = mkMerge [
# make every fs entry wanted by system boot: # make every fs entry wanted by system boot:
(mapAttrs (_path: sane-lib.fs.wanted) p.fs) (mapAttrs (_path: sane-lib.fs.wanted) p.fs)

View File

@@ -29,6 +29,15 @@ let
entries to pass onto `sane.persist.sys` after prepending the user's home-dir to the path. entries to pass onto `sane.persist.sys` after prepending the user's home-dir to the path.
''; '';
}; };
environment = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
environment variables to place in user's shell profile.
these end up in ~/.profile
'';
};
}; };
}; };
userModule = types.submodule ({ name, config, ... }: { userModule = types.submodule ({ name, config, ... }: {
@@ -50,8 +59,20 @@ let
}; };
}; };
config = lib.mkMerge [
# if we're the default user, inherit whatever settings were routed to the default user # if we're the default user, inherit whatever settings were routed to the default user
config = mkIf config.default sane-user-cfg; (mkIf config.default sane-user-cfg)
{
fs.".profile".symlink.text =
let
env = lib.mapAttrsToList
(key: value: ''export ${key}="${value}"'')
config.environment
;
in
lib.concatStringsSep "\n" env;
}
];
}); });
processUser = user: defn: processUser = user: defn:
let let