1 # Global configuration for spacefm.
3 { config, lib, pkgs, ... }:
5 let cfg = config.programs.spacefm;
15 enable = lib.mkOption {
16 type = lib.types.bool;
19 Whether to install SpaceFM and create {file}`/etc/spacefm/spacefm.conf`.
23 settings = lib.mkOption {
24 type = lib.types.attrs;
27 terminal_su = "${pkgs.sudo}/bin/sudo";
29 defaultText = lib.literalExpression ''
32 terminal_su = "''${pkgs.sudo}/bin/sudo";
36 The system-wide spacefm configuration.
37 Parameters to be written to {file}`/etc/spacefm/spacefm.conf`.
38 Refer to the [relevant entry](https://ignorantguru.github.io/spacefm/spacefm-manual-en.html#programfiles-etc) in the SpaceFM manual.
47 config = lib.mkIf cfg.enable {
48 environment.systemPackages = [ pkgs.spaceFM ];
50 environment.etc."spacefm/spacefm.conf".text =
51 lib.concatStrings (lib.mapAttrsToList (n: v: "${n}=${builtins.toString v}\n") cfg.settings);