2020-04-24 23:36:52 +00:00
|
|
|
# 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;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
|
|
|
Whether to install SpaceFM and create {file}`/etc/spacefm/spacefm.conf`.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = {
|
|
|
|
tmp_dir = "/tmp";
|
|
|
|
terminal_su = "${pkgs.sudo}/bin/sudo";
|
|
|
|
};
|
2021-10-06 13:57:05 +00:00
|
|
|
defaultText = literalExpression ''
|
|
|
|
{
|
|
|
|
tmp_dir = "/tmp";
|
|
|
|
terminal_su = "''${pkgs.sudo}/bin/sudo";
|
|
|
|
}
|
|
|
|
'';
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
The system-wide spacefm configuration.
|
2022-08-12 12:06:08 +00:00
|
|
|
Parameters to be written to {file}`/etc/spacefm/spacefm.conf`.
|
|
|
|
Refer to the [relevant entry](https://ignorantguru.github.io/spacefm/spacefm-manual-en.html#programfiles-etc) in the SpaceFM manual.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### 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);
|
|
|
|
};
|
|
|
|
}
|