summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorArseniy Seroka <jagajaga@users.noreply.github.com>2016-07-05 13:02:43 +0300
committerGitHub <noreply@github.com>2016-07-05 13:02:43 +0300
commit7926a98a7162d822e658bdaba171773c73a2992f (patch)
tree76eafb0f9950a6980a014c737d71433c47883aa4 /nixos
parent0385abbc707e859dc16e146365dc8e072cf6caa3 (diff)
parent1bbcd91b2ef0738709f7d955760a6624a9745fc2 (diff)
downloadnixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar.gz
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar.bz2
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar.lz
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar.xz
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.tar.zst
nixlib-7926a98a7162d822e658bdaba171773c73a2992f.zip
Merge pull request #16650 from RamKromberg/fix/spacefm-issue-15758
spacefm: sudo and gksu fixes #15758 and license update
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/spacefm.nix55
2 files changed, 56 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 49e3e2d4a948..67178e765c8a 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -76,6 +76,7 @@
   ./programs/screen.nix
   ./programs/shadow.nix
   ./programs/shell.nix
+  ./programs/spacefm.nix
   ./programs/ssh.nix
   ./programs/ssmtp.nix
   ./programs/tmux.nix
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);
+  };
+}