at 24.11-pre 1.0 kB view raw
1{ config, lib, pkgs, ... }: 2 3let 4 cfg = config.programs.nautilus-open-any-terminal; 5in 6{ 7 options.programs.nautilus-open-any-terminal = { 8 enable = lib.mkEnableOption "nautilus-open-any-terminal"; 9 10 terminal = lib.mkOption { 11 type = with lib.types; nullOr str; 12 default = null; 13 description = '' 14 The terminal emulator to add to context-entry of nautilus. Supported terminal 15 emulators are listed in https://github.com/Stunkymonkey/nautilus-open-any-terminal#supported-terminal-emulators. 16 ''; 17 }; 18 }; 19 20 config = lib.mkIf cfg.enable { 21 environment.systemPackages = with pkgs; [ 22 gnome.nautilus-python 23 nautilus-open-any-terminal 24 ]; 25 programs.dconf = lib.optionalAttrs (cfg.terminal != null) { 26 enable = true; 27 profiles.user.databases = [{ 28 settings."com/github/stunkymonkey/nautilus-open-any-terminal".terminal = cfg.terminal; 29 lockAll = true; 30 }]; 31 }; 32 }; 33 meta = { 34 maintainers = with lib.maintainers; [ stunkymonkey linsui ]; 35 }; 36}