sane.programs: allow per-program config (and port web-browser to use that)
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
sane.web-browser = {
|
||||
sane.programs.web-browser.config = {
|
||||
# compromise impermanence for the sake of usability
|
||||
persistCache = "private";
|
||||
persistData = "private";
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{ config, sane-lib, ...}:
|
||||
|
||||
let
|
||||
www = config.sane.web-browser.browser.desktop;
|
||||
www = config.sane.programs.web-browser.config.browser.desktop;
|
||||
pdf = "org.gnome.Evince.desktop";
|
||||
md = "obsidian.desktop";
|
||||
thumb = "org.gnome.gThumb.desktop";
|
||||
|
@@ -9,7 +9,7 @@
|
||||
{ config, lib, pkgs, sane-lib, ...}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.sane.web-browser;
|
||||
cfg = config.sane.programs.web-browser.config;
|
||||
# allow easy switching between firefox and librewolf with `defaultSettings`, below
|
||||
librewolfSettings = {
|
||||
browser = pkgs.librewolf-unwrapped;
|
||||
@@ -100,24 +100,24 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
configOpts = {
|
||||
options = {
|
||||
sane.web-browser.browser = mkOption {
|
||||
browser = mkOption {
|
||||
default = defaultSettings;
|
||||
type = types.attrs;
|
||||
type = types.anything;
|
||||
};
|
||||
sane.web-browser.persistData = mkOption {
|
||||
persistData = mkOption {
|
||||
description = "optional store name to which persist browsing data (like history)";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
sane.web-browser.persistCache = mkOption {
|
||||
persistCache = mkOption {
|
||||
description = "optional store name to which persist browser cache";
|
||||
type = types.nullOr types.str;
|
||||
default = "cryptClearOnBoot";
|
||||
};
|
||||
sane.web-browser.addons = mkOption {
|
||||
addons = mkOption {
|
||||
type = types.attrsOf addonOpts;
|
||||
default = {
|
||||
# get names from:
|
||||
@@ -145,8 +145,16 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
in
|
||||
{
|
||||
config = mkMerge [
|
||||
({
|
||||
sane.programs.web-browser.configOption = mkOption {
|
||||
type = types.submodule configOpts;
|
||||
default = {};
|
||||
};
|
||||
})
|
||||
({
|
||||
sane.programs.web-browser = {
|
||||
inherit package;
|
||||
|
@@ -104,6 +104,19 @@ let
|
||||
the secret will have same owner as the user under which the program is enabled.
|
||||
'';
|
||||
};
|
||||
configOption = mkOption {
|
||||
type = types.raw;
|
||||
default = mkOption {
|
||||
type = types.submodule {};
|
||||
default = {};
|
||||
};
|
||||
description = ''
|
||||
declare any other options the program may be configured with.
|
||||
you probably want this to be a submodule.
|
||||
the option *definitions* can be set with `sane.programs."foo".config = ...`.
|
||||
'';
|
||||
};
|
||||
config = config.configOption;
|
||||
};
|
||||
|
||||
config = {
|
||||
|
Reference in New Issue
Block a user