Revert "Merge pull request #5626 from matthiasbeyer/add-fish_shell_module"

This reverts commit 157d199b33bee85aeeb256e84abf55523539eaa0, reversing
changes made to 4c7adddcb7ae435cdecceeb627dca22ae581ca09.

-115
-115
nixos/modules/programs/fish/fish.nix
··· 1 - # This module defines global configuration for the fish. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - 9 - cfge = config.environment; 10 - 11 - cfg = config.programs.fish; 12 - 13 - fishAliases = concatStringsSep "\n" ( 14 - mapAttrsFlatten (k: v: "alias ${k}='${v}'") cfg.shellAliases 15 - ); 16 - 17 - in 18 - 19 - { 20 - 21 - options = { 22 - 23 - programs.fish = { 24 - 25 - enable = mkOption { 26 - default = false; 27 - description = '' 28 - Whenever to configure fish as an interactive shell. 29 - ''; 30 - type = types.bool; 31 - }; 32 - 33 - shellAliases = mkOption { 34 - default = config.environment.shellAliases; 35 - description = '' 36 - Set of aliases for zsh shell. See <option>environment.shellAliases</option> 37 - for an option format description. 38 - ''; 39 - type = types.attrs; # types.attrsOf types.stringOrPath; 40 - }; 41 - 42 - shellInit = mkOption { 43 - default = ""; 44 - description = '' 45 - Shell script code called during fish shell initialisation. 46 - ''; 47 - type = types.lines; 48 - }; 49 - 50 - loginShellInit = mkOption { 51 - default = ""; 52 - description = '' 53 - Shell script code called during fish login shell initialisation. 54 - ''; 55 - type = types.lines; 56 - }; 57 - 58 - interactiveShellInit = mkOption { 59 - default = ""; 60 - description = '' 61 - Shell script code called during interactive fish initialisation. 62 - ''; 63 - type = types.lines; 64 - }; 65 - 66 - promptInit = mkOption { 67 - default = ""; 68 - description = '' 69 - Shell script code used to initialise the fish prompt. 70 - ''; 71 - type = types.lines; 72 - }; 73 - 74 - }; 75 - 76 - }; 77 - 78 - config = mkIf cfg.enable { 79 - 80 - programs.fish = { 81 - 82 - shellInit = '' 83 - . ${config.system.build.setEnvironment} 84 - 85 - ${cfge.shellInit} 86 - ''; 87 - 88 - loginShellInit = cfge.loginShellInit; 89 - 90 - interactiveShellInit = '' 91 - ${cfge.interactiveShellInit} 92 - 93 - ${cfg.promptInit} 94 - 95 - ${fishAliases} 96 - ''; 97 - 98 - }; 99 - 100 - environment.profileRelativeEnvVars = { }; 101 - 102 - environment.systemPackages = [ pkgs.fish ]; 103 - 104 - #users.defaultUserShell = mkDefault "/run/current-system/sw/bin/fish"; 105 - 106 - environment.shells = 107 - [ "/run/current-system/sw/bin/fish" 108 - "/var/run/current-system/sw/bin/fish" 109 - "${pkgs.fish}/bin/fish" 110 - ]; 111 - 112 - }; 113 - 114 - } 115 -
···