diff options
author | Ram Kromberg <ramkromberg@mail.com> | 2016-07-01 18:40:21 +0300 |
---|---|---|
committer | Ram Kromberg <ramkromberg@mail.com> | 2016-07-03 01:43:34 +0300 |
commit | 1bbcd91b2ef0738709f7d955760a6624a9745fc2 (patch) | |
tree | 8e6e065a17e9d6f0972d69dd68fa032a0a9cbc7f /nixos/modules/programs/spacefm.nix | |
parent | 1c0af40757c6bf9c15bd50888c79ff27682df7e1 (diff) | |
download | nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar.gz nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar.bz2 nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar.lz nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar.xz nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.tar.zst nixlib-1bbcd91b2ef0738709f7d955760a6624a9745fc2.zip |
spacefm: sudo and gksu fixes #15758 and license update
Diffstat (limited to 'nixos/modules/programs/spacefm.nix')
-rw-r--r-- | nixos/modules/programs/spacefm.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/nixos/modules/programs/spacefm.nix b/nixos/modules/programs/spacefm.nix new file mode 100644 index 000000000000..5735f0c6b3e7 --- /dev/null +++ b/nixos/modules/programs/spacefm.nix @@ -0,0 +1,55 @@ +# Global configuration for spacefm. + +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.programs.spacefm; + +in +{ + ###### interface + + options = { + + programs.spacefm = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to install SpaceFM and create <filename>/etc/spacefm/spacefm.conf<filename>. + ''; + }; + + settings = mkOption { + type = types.attrs; + default = { + tmp_dir = "/tmp"; + terminal_su = "${pkgs.sudo}/bin/sudo"; + graphical_su = "${pkgs.gksu}/bin/gksu"; + }; + example = literalExample ''{ + tmp_dir = "/tmp"; + terminal_su = "''${pkgs.sudo}/bin/sudo"; + graphical_su = "''${pkgs.gksu}/bin/gksu"; + }''; + description = '' + The system-wide spacefm configuration. + Parameters to be written to <filename>/etc/spacefm/spacefm.conf</filename>. + Refer to the <link xlink:href="https://ignorantguru.github.io/spacefm/spacefm-manual-en.html#programfiles-etc">relevant entry</link> in the SpaceFM manual. + ''; + }; + + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + environment.systemPackages = [ pkgs.spaceFM ]; + + environment.etc."spacefm/spacefm.conf".text = + concatStrings (mapAttrsToList (n: v: "${n}=${toString v}\n") cfg.settings); + }; +} |