From 367b0c114f38d5c332f5ee971ad13dd69e302dec Mon Sep 17 00:00:00 2001 From: tilpner Date: Mon, 15 Jun 2020 09:53:06 +0200 Subject: WIP towards module based configuration --- nix/options.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 nix/options.nix (limited to 'nix/options.nix') diff --git a/nix/options.nix b/nix/options.nix new file mode 100644 index 0000000..cbd21a5 --- /dev/null +++ b/nix/options.nix @@ -0,0 +1,66 @@ +{ options, pkgs, lib, ... }: + +with lib; +let + # https://github.com/NixOS/nixpkgs/pull/75584 + json = with lib.types; let + valueType = nullOr (oneOf [ + bool + int + float + str + (attrsOf valueType) + (listOf valueType) + ]) // { + description = "Boolean, Integer, Float, String, or lists or attribute sets of these types"; + }; + in valueType; +in { + options = { + meta.description = mkOption { + type = types.lines; + default = ""; + internal = true; + }; + + preferences = mkOption { + type = json; + default = {}; + + description = '' + These nested values are translated directly into Firefox preferences, as can be + found in user.js, prefs.js, or about:config. + ''; + + example = { + }; + }; + + policies = mkOption { + type = json; + default = {}; + + description = '' + These nested values must follow the pattern of https://github.com/mozilla/policy-templates/, + but compliance is not validated immediately. + ''; + + example = { + FirefoxHome = { + Pocket = false; + Locked = true; + }; + NewTabPage = false; + }; + }; + + omnija.browser.patchCommand = mkOption { + type = types.lines; + default = ""; + + description = '' + This is a shell script to be executed for patching omni.ja + ''; + }; + }; +} -- cgit v1.2.3