diff options
author | Parnell Springmeyer <parnell@digitalmentat.com> | 2017-01-26 02:00:04 -0800 |
---|---|---|
committer | Parnell Springmeyer <parnell@digitalmentat.com> | 2017-01-26 02:00:04 -0800 |
commit | a26a796d5c7fa305e007c2b5229e0521c8b3fb0f (patch) | |
tree | 6c35defae305b0da581f757b72b461a8f6052620 /nixos/modules/programs | |
parent | ad8fde5e5d9bc25a54ac238f485e28b37d6d185a (diff) | |
parent | 142696de884213e01cc518af813a20d2e2ece3cc (diff) | |
download | nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar.gz nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar.bz2 nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar.lz nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar.xz nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.tar.zst nixpkgs-a26a796d5c7fa305e007c2b5229e0521c8b3fb0f.zip |
Merging against master - updating smokingpig, rebase was going to be messy
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/chromium.nix | 85 | ||||
-rw-r--r-- | nixos/modules/programs/man.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/nano.nix | 12 | ||||
-rw-r--r-- | nixos/modules/programs/zsh/zsh.nix | 11 |
4 files changed, 101 insertions, 8 deletions
diff --git a/nixos/modules/programs/chromium.nix b/nixos/modules/programs/chromium.nix new file mode 100644 index 00000000000..54739feab97 --- /dev/null +++ b/nixos/modules/programs/chromium.nix @@ -0,0 +1,85 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.programs.chromium; + + defaultProfile = filterAttrs (k: v: v != null) { + HomepageLocation = cfg.homepageLocation; + DefaultSearchProviderSearchURL = cfg.defaultSearchProviderSearchURL; + DefaultSearchProviderSuggestURL = cfg.defaultSearchProviderSuggestURL; + ExtensionInstallForcelist = map (extension: + "${extension};https://clients2.google.com/service/update2/crx" + ) cfg.extensions; + }; +in + +{ + ###### interface + + options = { + programs.chromium = { + enable = mkEnableOption "<command>chromium</command> policies"; + + extensions = mkOption { + type = types.listOf types.str; + description = '' + List of chromium extensions to install. + For list of plugins ids see id in url of extensions on + <link xlink:href="https://chrome.google.com/webstore/category/extensions">chrome web store</link> + page. + ''; + default = []; + example = literalExample '' + [ + "chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet + "mbniclmhobmnbdlbpiphghaielnnpgdp" # lightshot + "gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere + ] + ''; + }; + + homepageLocation = mkOption { + type = types.nullOr types.str; + description = "Chromium default homepage"; + default = null; + example = "https://nixos.org"; + }; + + defaultSearchProviderSearchURL = mkOption { + type = types.nullOr types.str; + description = "Chromium default search provider url."; + default = null; + example = + "https://encrypted.google.com/search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google: + ↪searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}ie={inputEncoding}"; + }; + + defaultSearchProviderSuggestURL = mkOption { + type = types.nullOr types.str; + description = "Chromium default search provider url for suggestions."; + default = null; + example = + "https://encrypted.google.com/complete/search?output=chrome&q={searchTerms}"; + }; + + extraOpts = mkOption { + type = types.attrs; + description = '' + Extra chromium policy options, see + <link xlink:href="https://www.chromium.org/administrators/policy-list-3">https://www.chromium.org/administrators/policy-list-3</link> + for a list of avalible options + ''; + default = {}; + }; + }; + }; + + ###### implementation + + config = lib.mkIf cfg.enable { + environment.etc."chromium/policies/managed/default.json".text = builtins.toJSON defaultProfile; + environment.etc."chromium/policies/managed/extra.json".text = builtins.toJSON cfg.extraOpts; + }; +} diff --git a/nixos/modules/programs/man.nix b/nixos/modules/programs/man.nix index e59ffd6f936..5b20a38d885 100644 --- a/nixos/modules/programs/man.nix +++ b/nixos/modules/programs/man.nix @@ -11,6 +11,7 @@ with lib; default = true; description = '' Whether to enable manual pages and the <command>man</command> command. + This also includes "man" outputs of all <literal>systemPackages</literal>. ''; }; diff --git a/nixos/modules/programs/nano.nix b/nixos/modules/programs/nano.nix index b8803eec7be..27b6d446c75 100644 --- a/nixos/modules/programs/nano.nix +++ b/nixos/modules/programs/nano.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.programs.nano; @@ -20,16 +20,22 @@ in example = '' set nowrap set tabstospaces - set tabsize 4 + set tabsize 2 ''; }; + syntaxHighlight = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to enable syntax highlight for various languages."; + }; }; }; ###### implementation config = lib.mkIf (cfg.nanorc != "") { - environment.etc."nanorc".text = cfg.nanorc; + environment.etc."nanorc".text = lib.concatStrings [ cfg.nanorc + (lib.optionalString cfg.syntaxHighlight ''include "${pkgs.nano}/share/nano/*.nanorc"'') ]; }; } diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index b4d941a7770..990e6648e82 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -123,11 +123,6 @@ in setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK - ${cfge.interactiveShellInit} - - ${cfg.promptInit} - ${zshAliases} - # Tell zsh how to find installed completions for p in ''${(z)NIX_PROFILES}; do fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions) @@ -143,6 +138,12 @@ in "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" } + ${zshAliases} + ${cfg.promptInit} + + ${cfge.interactiveShellInit} + + HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help" ''; |