spacefm: sudo and gksu fixes #15758 and license update

+69 -6
+1
nixos/modules/module-list.nix
··· 76 76 ./programs/screen.nix 77 77 ./programs/shadow.nix 78 78 ./programs/shell.nix 79 + ./programs/spacefm.nix 79 80 ./programs/ssh.nix 80 81 ./programs/ssmtp.nix 81 82 ./programs/tmux.nix
+55
nixos/modules/programs/spacefm.nix
··· 1 + # Global configuration for spacefm. 2 + 3 + { config, lib, pkgs, ... }: 4 + 5 + with lib; 6 + 7 + let cfg = config.programs.spacefm; 8 + 9 + in 10 + { 11 + ###### interface 12 + 13 + options = { 14 + 15 + programs.spacefm = { 16 + 17 + enable = mkOption { 18 + type = types.bool; 19 + default = false; 20 + description = '' 21 + Whether to install SpaceFM and create <filename>/etc/spacefm/spacefm.conf<filename>. 22 + ''; 23 + }; 24 + 25 + settings = mkOption { 26 + type = types.attrs; 27 + default = { 28 + tmp_dir = "/tmp"; 29 + terminal_su = "${pkgs.sudo}/bin/sudo"; 30 + graphical_su = "${pkgs.gksu}/bin/gksu"; 31 + }; 32 + example = literalExample ''{ 33 + tmp_dir = "/tmp"; 34 + terminal_su = "''${pkgs.sudo}/bin/sudo"; 35 + graphical_su = "''${pkgs.gksu}/bin/gksu"; 36 + }''; 37 + description = '' 38 + The system-wide spacefm configuration. 39 + Parameters to be written to <filename>/etc/spacefm/spacefm.conf</filename>. 40 + Refer to the <link xlink:href="https://ignorantguru.github.io/spacefm/spacefm-manual-en.html#programfiles-etc">relevant entry</link> in the SpaceFM manual. 41 + ''; 42 + }; 43 + 44 + }; 45 + }; 46 + 47 + ###### implementation 48 + 49 + config = mkIf cfg.enable { 50 + environment.systemPackages = [ pkgs.spaceFM ]; 51 + 52 + environment.etc."spacefm/spacefm.conf".text = 53 + concatStrings (mapAttrsToList (n: v: "${n}=${toString v}\n") cfg.settings); 54 + }; 55 + }
+13 -6
pkgs/applications/misc/spacefm/default.nix
··· 1 - { pkgs, fetchFromGitHub, stdenv, gtk3, udev, desktop_file_utils, shared_mime_info 2 - , intltool, pkgconfig, wrapGAppsHook, ffmpegthumbnailer, jmtpfs, ifuse, lsof, udisks 3 - , hicolor_icon_theme, adwaita-icon-theme }: 1 + { pkgs, fetchFromGitHub, stdenv, gtk3, udev, desktop_file_utils 2 + , shared_mime_info, intltool, pkgconfig, wrapGAppsHook, ffmpegthumbnailer 3 + , jmtpfs, ifuse, lsof, udisks, hicolor_icon_theme, adwaita-icon-theme }: 4 4 5 5 stdenv.mkDerivation rec { 6 6 name = "spacefm-${version}"; ··· 15 15 16 16 configureFlags = [ 17 17 "--with-bash-path=${pkgs.bash}/bin/bash" 18 - "--with-preferable-sudo=${pkgs.sudo}/bin/sudo" 19 18 ]; 20 19 21 20 preConfigure = '' 22 21 configureFlags="$configureFlags --sysconfdir=$out/etc" 23 22 ''; 24 23 25 - buildInputs = [ gtk3 udev desktop_file_utils shared_mime_info intltool pkgconfig wrapGAppsHook ffmpegthumbnailer jmtpfs ifuse lsof udisks ]; 24 + postInstall = '' 25 + rm -f $out/etc/spacefm/spacefm.conf 26 + ln -s /etc/spacefm/spacefm.conf $out/etc/spacefm/spacefm.conf 27 + ''; 28 + 29 + buildInputs = [ 30 + gtk3 udev desktop_file_utils shared_mime_info intltool pkgconfig 31 + wrapGAppsHook ffmpegthumbnailer jmtpfs ifuse lsof udisks 32 + ]; 26 33 27 34 meta = with stdenv.lib; { 28 35 description = "A multi-panel tabbed file manager"; ··· 33 40 ''; 34 41 homepage = http://ignorantguru.github.io/spacefm/; 35 42 platforms = platforms.linux; 36 - license = licenses.gpl3; 43 + license = licenses.gpl3Plus; 37 44 maintainers = with maintainers; [ jagajaga obadz ]; 38 45 }; 39 46 }