diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
commit | c4625b175f8200f643fd6e11010932ea44c78433 (patch) | |
tree | bce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/shells | |
parent | 49f735974dd103039ddc4cb576bb76555164a9e7 (diff) | |
parent | d661aa56a8843e991261510c1bb28fdc2f6975ae (diff) |
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie
git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7
git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/shells')
67 files changed, 3389 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/shells/any-nix-shell/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/any-nix-shell/default.nix new file mode 100644 index 000000000000..bab39aef2441 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/any-nix-shell/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "any-nix-shell"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "haslersn"; + repo = "any-nix-shell"; + rev = "v${version}"; + sha256 = "02cv86csk1m8nlh2idvh7bjw43lpssmdawya2jhr4bam2606yzdv"; + }; + + nativeBuildInputs = [ makeWrapper ]; + installPhase = '' + mkdir -p $out/bin + cp -r bin $out + wrapProgram $out/bin/any-nix-shell --prefix PATH ":" $out/bin + ''; + + meta = with stdenv.lib; { + description = "fish and zsh support for nix-shell"; + license = licenses.mit; + homepage = "https://github.com/haslersn/any-nix-shell"; + maintainers = with maintainers; [ haslersn ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/4.4.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/4.4.nix new file mode 100644 index 000000000000..deeb4093c682 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/4.4.nix @@ -0,0 +1,141 @@ +{ stdenv, buildPackages +, fetchurl, binutils ? null, bison, autoconf, utillinux + +# patch for cygwin requires readline support +, interactive ? stdenv.isCygwin, readline70 ? null +, withDocs ? false, texinfo ? null +}: + +with stdenv.lib; + +assert interactive -> readline70 != null; +assert withDocs -> texinfo != null; +assert stdenv.hostPlatform.isDarwin -> binutils != null; + +# Note: this package is used for bootstrapping fetchurl, and thus +# cannot use fetchpatch! All mutable patches (generated by GitHub or +# cgit) that are needed here should be included directly in Nixpkgs as +# files. + +let + upstreamPatches = import ./bash-4.4-patches.nix (nr: sha256: fetchurl { + url = "mirror://gnu/bash/bash-4.4-patches/bash44-${nr}"; + inherit sha256; + }); +in + +stdenv.mkDerivation rec { + name = "bash-${optionalString interactive "interactive-"}${version}-p${toString (builtins.length upstreamPatches)}"; + version = "4.4"; + + src = fetchurl { + url = "mirror://gnu/bash/bash-${version}.tar.gz"; + sha256 = "1jyz6snd63xjn6skk7za6psgidsd53k05cr3lksqybi0q6936syq"; + }; + + hardeningDisable = [ "format" ]; + + outputs = [ "out" "dev" "man" "doc" "info" ]; + + NIX_CFLAGS_COMPILE = '' + -DSYS_BASHRC="/etc/bashrc" + -DSYS_BASH_LOGOUT="/etc/bash_logout" + -DDEFAULT_PATH_VALUE="/no-such-path" + -DSTANDARD_UTILS_PATH="/no-such-path" + -DNON_INTERACTIVE_LOGIN_SHELLS + -DSSH_SOURCE_BASHRC + ''; + + patchFlags = [ "-p0" "-T" ]; + + patches = upstreamPatches + ++ [ ./pgrp-pipe-4.4.patch ] + ++ optional stdenv.hostPlatform.isCygwin ./cygwin-bash-4.4.11-2.src.patch + # https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00006.html + ++ optional stdenv.hostPlatform.isMusl (fetchurl { + url = "https://lists.gnu.org/archive/html/bug-bash/2016-10/patchJxugOXrY2y.patch"; + sha256 = "1m4v9imidb1cc1h91f2na0b8y9kc5c5fgmpvy9apcyv2kbdcghg1"; + }); + + configureFlags = [ + (if interactive then "--with-installed-readline" else "--disable-readline") + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "bash_cv_job_control_missing=nomissing" + "bash_cv_sys_named_pipes=nomissing" + "bash_cv_getcwd_malloc=yes" + ] ++ optionals stdenv.hostPlatform.isCygwin [ + "--without-libintl-prefix" + "--without-libiconv-prefix" + "--with-installed-readline" + "bash_cv_dev_stdin=present" + "bash_cv_dev_fd=standard" + "bash_cv_termcap_lib=libncurses" + ] ++ optionals (stdenv.hostPlatform.libc == "musl") [ + "--without-bash-malloc" + "--disable-nls" + ]; + + # Note: Bison is needed because the patches above modify parse.y. + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ bison ] + ++ optional withDocs texinfo + ++ optional stdenv.hostPlatform.isDarwin binutils + ++ optional (stdenv.hostPlatform.libc == "musl") autoconf; + + buildInputs = optional interactive readline70; + + # Bash randomly fails to build because of a recursive invocation to + # build `version.h'. + enableParallelBuilding = false; + + makeFlags = optional stdenv.hostPlatform.isCygwin [ + "LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a" + "SHOBJ_LIBS=-lbash" + ]; + + checkInputs = [ utillinux ]; + doCheck = false; # dependency cycle, needs to be interactive + + postInstall = '' + ln -s bash "$out/bin/sh" + rm -f $out/lib/bash/Makefile.inc + ''; + + postFixup = if interactive + then '' + substituteInPlace "$out/bin/bashbug" \ + --replace '${stdenv.shell}' "$out/bin/bash" + '' + # most space is taken by locale data + else '' + rm -rf "$out/share" "$out/bin/bashbug" + ''; + + meta = with stdenv.lib; { + homepage = "https://www.gnu.org/software/bash/"; + description = + "GNU Bourne-Again Shell, the de facto standard shell on Linux" + + (if interactive then " (for interactive use)" else ""); + + longDescription = '' + Bash is the shell, or command language interpreter, that will + appear in the GNU operating system. Bash is an sh-compatible + shell that incorporates useful features from the Korn shell + (ksh) and C shell (csh). It is intended to conform to the IEEE + POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers + functional improvements over sh for both programming and + interactive use. In addition, most sh scripts can be run by + Bash without modification. + ''; + + license = licenses.gpl3Plus; + + platforms = platforms.all; + + maintainers = [ maintainers.peti ]; + }; + + passthru = { + shellPath = "/bin/bash"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/5.0.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/5.0.nix new file mode 100644 index 000000000000..09030493fb60 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/5.0.nix @@ -0,0 +1,127 @@ +{ stdenv, buildPackages +, fetchurl, binutils ? null, bison, utillinux + +# patch for cygwin requires readline support +, interactive ? stdenv.isCygwin, readline80 ? null +, withDocs ? false, texinfo ? null +}: + +with stdenv.lib; + +assert interactive -> readline80 != null; +assert withDocs -> texinfo != null; +assert stdenv.hostPlatform.isDarwin -> binutils != null; + +let + upstreamPatches = import ./bash-5.0-patches.nix (nr: sha256: fetchurl { + url = "mirror://gnu/bash/bash-5.0-patches/bash50-${nr}"; + inherit sha256; + }); +in + +stdenv.mkDerivation rec { + name = "bash-${optionalString interactive "interactive-"}${version}-p${toString (builtins.length upstreamPatches)}"; + version = "5.0"; + + src = fetchurl { + url = "mirror://gnu/bash/bash-${version}.tar.gz"; + sha256 = "0kgvfwqdcd90waczf4gx39xnrxzijhjrzyzv7s8v4w31qqm0za5l"; + }; + + hardeningDisable = [ "format" ]; + + outputs = [ "out" "dev" "man" "doc" "info" ]; + + NIX_CFLAGS_COMPILE = '' + -DSYS_BASHRC="/etc/bashrc" + -DSYS_BASH_LOGOUT="/etc/bash_logout" + -DDEFAULT_PATH_VALUE="/no-such-path" + -DSTANDARD_UTILS_PATH="/no-such-path" + -DNON_INTERACTIVE_LOGIN_SHELLS + -DSSH_SOURCE_BASHRC + ''; + + patchFlags = [ "-p0" "-T" ]; + + patches = upstreamPatches + ++ [ ./pgrp-pipe-5.0.patch ]; + + configureFlags = [ + (if interactive then "--with-installed-readline" else "--disable-readline") + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "bash_cv_job_control_missing=nomissing" + "bash_cv_sys_named_pipes=nomissing" + "bash_cv_getcwd_malloc=yes" + ] ++ optionals stdenv.hostPlatform.isCygwin [ + "--without-libintl-prefix" + "--without-libiconv-prefix" + "--with-installed-readline" + "bash_cv_dev_stdin=present" + "bash_cv_dev_fd=standard" + "bash_cv_termcap_lib=libncurses" + ] ++ optionals (stdenv.hostPlatform.libc == "musl") [ + "--without-bash-malloc" + "--disable-nls" + ]; + + # Note: Bison is needed because the patches above modify parse.y. + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ bison ] + ++ optional withDocs texinfo + ++ optional stdenv.hostPlatform.isDarwin binutils; + + buildInputs = optional interactive readline80; + + enableParallelBuilding = true; + + makeFlags = optional stdenv.hostPlatform.isCygwin [ + "LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a" + "SHOBJ_LIBS=-lbash" + ]; + + checkInputs = [ utillinux ]; + doCheck = false; # dependency cycle, needs to be interactive + + postInstall = '' + ln -s bash "$out/bin/sh" + rm -f $out/lib/bash/Makefile.inc + ''; + + postFixup = if interactive + then '' + substituteInPlace "$out/bin/bashbug" \ + --replace '${stdenv.shell}' "$out/bin/bash" + '' + # most space is taken by locale data + else '' + rm -rf "$out/share" "$out/bin/bashbug" + ''; + + meta = with stdenv.lib; { + homepage = "https://www.gnu.org/software/bash/"; + description = + "GNU Bourne-Again Shell, the de facto standard shell on Linux" + + (if interactive then " (for interactive use)" else ""); + + longDescription = '' + Bash is the shell, or command language interpreter, that will + appear in the GNU operating system. Bash is an sh-compatible + shell that incorporates useful features from the Korn shell + (ksh) and C shell (csh). It is intended to conform to the IEEE + POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers + functional improvements over sh for both programming and + interactive use. In addition, most sh scripts can be run by + Bash without modification. + ''; + + license = licenses.gpl3Plus; + + platforms = platforms.all; + + maintainers = with maintainers; [ peti dtzWill ]; + }; + + passthru = { + shellPath = "/bin/bash"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-4.4-patches.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-4.4-patches.nix new file mode 100644 index 000000000000..a79ec90213a0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-4.4-patches.nix @@ -0,0 +1,27 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +(patch "001" "03vzy7qwjdd5qvl3ydg99naazas2qmyd0yhnrflgjbbm64axja1y") +(patch "002" "0lrwq6vyqism3yqv9s7kzaf3dsl4q5w9r5svcqz279qp7qca083h") +(patch "003" "1chqww2rj6g42b8s60q5zlzy0jzp684jkpsbrbfy1vzxja8mmpsi") +(patch "004" "1cy8abf96hkrjhw921ndr0shlcnc52bg45rn6xri4v5clhq0l25d") +(patch "005" "0a8515kyk4zsgmvlqvlganjfr7pq0j6kzpr4d6xx02kpbdr4n7i2") +(patch "006" "1f24wgqngmj2mrj9yibwvc2zvlmn5xi53mnw777g3l40c4m2x3ka") +(patch "007" "1bzdsnqaf05gdbqpsixhan8vygjxpcxlz1dd8d9f5jdznw3wq76y") +(patch "008" "1firw915mjm03hbbw9a70ch3cpgrgnvqjpllgdnn6csr8q04f546") +(patch "009" "0g1l56kvw61rpw7dqa9fcl9llkl693h73g631hrhxlm030ddssqb") +(patch "010" "01lfhrkdsdkdz8ypzapr614ras23x7ckjnr60aa5bzkaqprccrc4") +(patch "011" "038p7mhnq9m65g505hi3827jkf9f35nd1cy00w8mwafpyxp44mnx") +(patch "012" "0gh6lbb1rwpk44pvbamm6vzdfi50xnwkqd9v7s8cjwk3pz973hps") +(patch "013" "1djkx0w9v62q78gz3jsvamj1jq53i6hbfrfhhsw86ihwpjnfy98v") +(patch "014" "0z5ikcq9zyxw79d0z36r5p0mspnb5piavbv03jmlan1wnknmrxx7") +(patch "015" "09n307fi1j257abhm295k6ksmnzw47ka2zhnr0i5lbdnpvn04xnk") +(patch "016" "1cgi1y6mifm8hsgv4avj5ih76535js3qba1sqwbfvp7si76927sh") +(patch "017" "0w6jpj2giakji1ir83rpkx1y7n7xqppah3j748m6dm38hywr0gvp") +(patch "018" "1k58h4wxbsg7r4rwhrvzx5hfbapba2nxjysbhh6qp6ki5ys99i2v") +(patch "019" "07n1i5610lbs672x1s8g82qn3qfj06s0ip3z80sri0g8vxp0s5r7") +(patch "020" "0b2jk5n1af1vh590qfc52hv65mafb4vl1xv26s8j5a3byb5y4h0q") +(patch "021" "1hblcd2xmqqlp0idnavw66570n7m0yv5rbbr873c2gkn982mk3xx") +(patch "022" "0yfbjzr79vzjs2hyi5m8iy2b38fq7vikdfa4zqdvjsp36q4iycs5") +(patch "023" "1dlism6qdx60nvzj0v7ndr7lfahl4a8zmzckp13hqgdx7xpj7v2g") +] diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-5.0-patches.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-5.0-patches.nix new file mode 100644 index 000000000000..4315191d1939 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-5.0-patches.nix @@ -0,0 +1,22 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +(patch "001" "12bjfdy6bg8nhyw27bdgxn7h4paylx8d927skfmi9pxd1wgrxzpj") +(patch "002" "01w7yrzmz10mw06ys0546vhl7isv2v402ziyvfd7k67588spvs47") +(patch "003" "0ny81ridp5n0j69hb8ixrc7dmxybby54jbsz5hikly8kgg1wvssf") +(patch "004" "021gqqvgydixkrmqss64b6srfdlkvnx88lyfzpxfrn5d6bc7li0l") +(patch "005" "0xl2kyzm84nlyklrqzkn73ixabhzfhn9x91lzcmis89cppclvxav") +(patch "006" "0844749ixk1z60437nkznzms1f0nzh9an62kj7sny6r0zyk2k1fn") +(patch "007" "16xg37gp1b8zlj5969w8mcrparwqlcbj9695vn3qhgb7wdz1xd0p") +(patch "008" "1qyp19krjh8zxvb0jgwmyjz40djslwcf4xi7kc1ab0iaca44bipf") +(patch "009" "00yrjjqd95s81b21qq3ba1y7h879q8jaajlkjggc6grhcwbs4g7d") +(patch "010" "04ca5bjv456v538mkspzvn4xb2zdphh31r4fpvfm9p5my0jw7yyn") +(patch "011" "1sklyixvsv8993kxzs0jigacpdchjrq7jv5xpdx7kbqyp4rf6k9c") +(patch "012" "0cz21qg2gbr40lfgza7g02bqi2qknwqgxnq459pjj640d0cywhr9") +(patch "013" "16h9nwz3yzwj7fnxvlidjymdc4yr30h818433gh9j1x3in6igmzm") +(patch "014" "12gm5bvv2pd3m72z2ilj26pa08c61az253dsgfl24vpf2ijywvjx") +(patch "015" "0pm0px758w4i23s55wajcv6lqfiym7zgxvq0pxf6vclkv8nxy5x5") +(patch "016" "0vdha332km2iwx8g2ld15jy7d24cbplzgr1531dpzylr9ajxglgz") +(patch "017" "0cfw5lz3fcvq9h1fxihxvw940fjk68015jazvl8x8rlazgxbkwsc") +(patch "018" "1lw1vv0aj6x254hgx4klbz8qkvwxif0g6i7dx116cnhhb8vlwcbw") +] diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-completion/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-completion/default.nix new file mode 100644 index 000000000000..eeb175a5e789 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/bash-completion/default.nix @@ -0,0 +1,71 @@ +{ stdenv, fetchFromGitHub +, fetchpatch +, autoreconfHook +, perl +, ps +, python3Packages +, bashInteractive +}: + +stdenv.mkDerivation rec { + pname = "bash-completion"; + version = "2.10"; + + src = fetchFromGitHub { + owner = "scop"; + repo = "bash-completion"; + rev = version; + sha256 = "047yjryy9d6hp18wkigbfrw9r0sm31inlsp8l28fhxg8ii032sgq"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + # tests are super flaky unfortunately, and regularily break. + # let's disable them for now. + doCheck = false; + checkInputs = [ + # perl is assumed by perldoc completion + perl + # ps assumed to exist by gdb, killall, pgrep, pidof, + # pkill, pwdx, renice, and reptyr completions + ps + python3Packages.pexpect + python3Packages.pytest + bashInteractive + ]; + + # - ignore test_gcc on ARM because it assumes -march=native + # - ignore test_chsh because it assumes /etc/shells exists + # - ignore test_ether_wake, test_ifdown, test_ifstat, test_ifup, + # test_iperf, test_iperf3, test_nethogs and ip_addresses + # because they try to touch network + # - ignore test_ls because impure logic + # - ignore test_screen because it assumes vt terminals exist + checkPhase = '' + pytest . \ + ${stdenv.lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \ + --ignore=test/t/test_chsh.py \ + --ignore=test/t/test_ether_wake.py \ + --ignore=test/t/test_ifdown.py \ + --ignore=test/t/test_ifstat.py \ + --ignore=test/t/test_ifup.py \ + --ignore=test/t/test_iperf.py \ + --ignore=test/t/test_iperf3.py \ + --ignore=test/t/test_nethogs.py \ + --ignore=test/t/unit/test_unit_ip_addresses.py \ + --ignore=test/t/test_ls.py \ + --ignore=test/t/test_screen.py + ''; + + prePatch = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i -e 's/readlink -f/readlink/g' bash_completion completions/* + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/scop/bash-completion"; + description = "Programmable completion for the bash shell"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = [ maintainers.peti maintainers.xfix ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patch b/infra/libkookie/nixpkgs/pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patch new file mode 100644 index 000000000000..488373109625 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patch @@ -0,0 +1,607 @@ +--- bashline.c 2017-01-23 13:28:06.955247200 -0600 ++++ bashline.c 2017-01-23 13:55:07.992877600 -0600 +@@ -76,6 +76,16 @@ + # include "pcomplete.h" + #endif + ++#if __CYGWIN__ ++# ifdef __x86_64__ ++# define IMP(x) __imp_##x ++# else ++# define IMP(x) _imp__##x ++# endif ++#else ++# define IMP(x) x ++#endif ++ + /* These should agree with the defines for emacs_mode and vi_mode in + rldefs.h, even though that's not a public readline header file. */ + #ifndef EMACS_EDITING_MODE +@@ -271,6 +281,11 @@ int no_empty_command_completion; + are the only possible matches, even if FIGNORE says to. */ + int force_fignore = 1; + ++#if __CYGWIN__ ++/* If set, shorten "foo.exe" to "foo" when they are the same file. */ ++int completion_strip_exe; ++#endif /* __CYGWIN__ */ ++ + /* Perform spelling correction on directory names during word completion */ + int dircomplete_spelling = 0; + +@@ -498,11 +513,12 @@ initialize_readline () + kseq[0] = CTRL('J'); + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); +- if (func == rl_vi_editing_mode) ++ extern rl_command_func_t *IMP(rl_vi_editing_mode); ++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode)) + rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap); + kseq[0] = CTRL('M'); + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); +- if (func == rl_vi_editing_mode) ++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode)) + rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap); + #if defined (VI_MODE) + rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap); +@@ -521,7 +537,8 @@ initialize_readline () + kseq[0] = '~'; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); +- if (func == 0 || func == rl_tilde_expand) ++ extern rl_command_func_t *IMP(rl_tilde_expand); ++ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand)) + rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap); + + rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap); +@@ -544,7 +561,8 @@ initialize_readline () + kseq[0] = TAB; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); +- if (func == 0 || func == rl_tab_insert) ++ extern rl_command_func_t *IMP(rl_tab_insert); ++ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert)) + rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap); + + /* Tell the completer that we want a crack first. */ +@@ -2194,6 +2212,21 @@ globword: + + if (match && executable_completion ((searching_path ? val : cval), searching_path)) + { ++#if __CYGWIN__ ++ if (completion_strip_exe) ++ { ++ size_t val_len = strlen (val); ++ char *candidate; ++ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe") ++ && (candidate = strdup (val))) ++ { ++ candidate[val_len - 4] = '\0'; ++ if (same_file (val, candidate, NULL, NULL)) ++ temp[strlen (temp) - 4] = '\0'; ++ free (candidate); ++ } ++ } ++#endif + if (cval != val) + free (cval); + free (val); +@@ -2929,6 +2962,17 @@ test_for_directory (name) + int r; + + fn = bash_tilde_expand (name, 0); ++#if __CYGWIN ++ /* stat("//server") can only be successful as a directory, but can take ++ seconds to time out on failure. It is much faster to assume that ++ "//server" is a valid name than it is to wait for a stat, even if it ++ gives false positives on bad names. */ ++ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/')) ++ { ++ free (fn); ++ return 1; ++ } ++#endif + r = file_isdir (fn); + free (fn); + +--- builtins/read.def 2017-01-23 13:28:07.017686500 -0600 ++++ builtins/read.def 2017-01-23 13:55:07.992877600 -0600 +@@ -85,7 +85,6 @@ $END + + #ifdef __CYGWIN__ + # include <fcntl.h> +-# include <io.h> + #endif + + #include "../bashintl.h" +@@ -530,10 +529,6 @@ read_builtin (list) + fflush (stderr); + } + +-#if defined (__CYGWIN__) && defined (O_TEXT) +- setmode (0, O_TEXT); +-#endif +- + ps2 = 0; + for (print_ps2 = eof = retval = 0;;) + { +@@ -664,6 +659,14 @@ read_builtin (list) + if (c == '\0' && delim != '\0') + continue; /* skip NUL bytes in input */ + ++#ifdef __CYGWIN__ ++ { ++ extern igncr; ++ if (igncr && c == '\r' && delim != '\r') ++ continue; /* skip carriage return */ ++ } ++#endif ++ + if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) + { + saw_escape++; +--- builtins/set.def 2016-06-02 19:10:10.000000000 -0500 ++++ builtins/set.def 2017-01-23 13:55:07.992877600 -0600 +@@ -56,6 +56,13 @@ extern int dont_save_function_defs; + #if defined (READLINE) + extern int no_line_editing; + #endif /* READLINE */ ++#ifdef __CYGWIN__ ++extern int igncr; ++static int set_minus_o_option_maybe (int, const char *, int); ++# define INTERACTIVE_ONLY ,1 ++#else ++# define INTERACTIVE_ONLY ++#endif + + $BUILTIN set + $FUNCTION set_builtin +@@ -92,6 +99,9 @@ Options: + #if defined (HISTORY) + history enable command history + #endif ++#ifdef __CYGWIN__ ++ igncr on Cygwin, ignore \r in line endings ++#endif + ignoreeof the shell will not exit upon reading EOF + interactive-comments + allow comments to appear in interactive commands +@@ -192,29 +202,39 @@ const struct { + int *variable; + setopt_set_func_t *set_func; + setopt_get_func_t *get_func; ++#ifdef __CYGWIN__ ++ /* Cygwin users have taken to exporting SHELLOPTS for the cygwin-specific ++ igncr. As a result, we want to ensure SHELLOPTS parsing does not turn ++ on interactive options when exported from an interactive shell, but ++ parse in a non-interactive setting, so as not to break POSIX /bin/sh */ ++ int interactive_only; ++#endif + } o_options[] = { + { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + #if defined (BRACE_EXPANSION) + { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + #endif + #if defined (READLINE) +- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode }, ++ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY }, + #endif + { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + #if defined (BANG_HISTORY) +- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, ++ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY }, + #endif /* BANG_HISTORY */ + #if defined (HISTORY) +- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL }, ++ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY }, ++#endif ++#ifdef __CYGWIN__ ++ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL }, + #endif + { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL }, + { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + #if defined (JOB_CONTROL) +- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, ++ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY }, + #endif + { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +@@ -233,7 +253,7 @@ const struct { + { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + #if defined (READLINE) +- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode }, ++ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY }, + #endif + { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +@@ -455,6 +475,15 @@ int + set_minus_o_option (on_or_off, option_name) + int on_or_off; + char *option_name; ++#ifdef __CYGWIN__ ++{ ++ /* See Cygwin comments above. */ ++ return set_minus_o_option_maybe (on_or_off, option_name, 0); ++} ++static int ++set_minus_o_option_maybe (int on_or_off, const char *option_name, ++ int avoid_interactive) ++#endif /* __CYGWIN__ */ + { + register int i; + +@@ -462,6 +491,10 @@ set_minus_o_option (on_or_off, option_na + { + if (STREQ (option_name, o_options[i].name)) + { ++#ifdef __CYGWIN__ ++ if (o_options[i].interactive_only && avoid_interactive) ++ return EXECUTION_SUCCESS; ++#endif + if (o_options[i].letter == 0) + { + previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name); +@@ -588,7 +621,11 @@ parse_shellopts (value) + vptr = 0; + while (vname = extract_colon_unit (value, &vptr)) + { ++#ifdef __CYGWIN__ ++ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell); ++#else + set_minus_o_option (FLAG_ON, vname); ++#endif + free (vname); + } + } +--- builtins/shopt.def 2016-05-06 14:00:02.000000000 -0500 ++++ builtins/shopt.def 2017-01-23 13:55:07.992877600 -0600 +@@ -92,6 +92,10 @@ extern int glob_asciirange; + extern int lastpipe_opt; + extern int inherit_errexit; + ++#ifdef __CYGWIN__ ++extern int completion_strip_exe; ++#endif ++ + #if defined (EXTENDED_GLOB) + extern int extended_glob; + #endif +@@ -169,6 +173,9 @@ static struct { + { "compat41", &shopt_compat41, set_compatibility_level }, + { "compat42", &shopt_compat42, set_compatibility_level }, + { "compat43", &shopt_compat43, set_compatibility_level }, ++#ifdef __CYGWIN__ ++ { "completion_strip_exe", &completion_strip_exe, NULL }, ++#endif + #if defined (READLINE) + { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL}, + { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand }, +--- config-top.h 2016-05-19 13:34:02.000000000 -0500 ++++ config-top.h 2017-01-23 13:55:07.992877600 -0600 +@@ -87,10 +87,10 @@ + #define DEFAULT_BASHRC "~/.bashrc" + + /* System-wide .bashrc file for interactive shells. */ +-/* #define SYS_BASHRC "/etc/bash.bashrc" */ ++#define SYS_BASHRC "/etc/bash.bashrc" + + /* System-wide .bash_logout for login shells. */ +-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ ++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout" + + /* Define this to make non-interactive shells begun with argv[0][0] == '-' + run the startup files when not in posix mode. */ +@@ -100,7 +100,7 @@ + sshd and source the .bashrc if so (like the rshd behavior). This checks + for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, + which can be fooled under certain not-uncommon circumstances. */ +-/* #define SSH_SOURCE_BASHRC */ ++#define SSH_SOURCE_BASHRC + + /* Define if you want the case-capitalizing operators (~[~]) and the + `capcase' variable attribute (declare -c). */ +--- doc/Makefile.in 2015-12-06 18:55:56.000000000 -0600 ++++ doc/Makefile.in 2017-01-23 13:55:07.992877600 -0600 +@@ -189,7 +189,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER) + $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi + + bash.info: bashref.info +- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \ ++ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \ + + bash.txt: bash.1 + bash.ps: bash.1 +@@ -252,9 +252,9 @@ install: info installdirs + -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir) + # uncomment the next lines to install the builtins man page +-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 +-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 ++ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 ++ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} ++ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + -if test -f bash.info; then d=.; else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info + # run install-info if it is present to update the info directory +--- doc/bash.1 2016-08-26 08:45:17.000000000 -0500 ++++ doc/bash.1 2017-01-23 13:55:08.008447700 -0600 +@@ -9607,6 +9607,10 @@ filenames. + This variable is set by default, which is the default bash behavior in + versions through 4.2. + .TP 8 ++.B completion_strip_exe ++If set, whenever bash sees \fIfoo.exe\fP during completion, it checks if ++\fIfoo\fP is the same file and strips the suffix. ++.TP 8 + .B direxpand + If set, + .B bash +--- doc/bashref.texi 2016-09-07 16:13:36.000000000 -0500 ++++ doc/bashref.texi 2017-01-23 13:55:08.008447700 -0600 +@@ -5123,6 +5123,10 @@ filenames. + This variable is set by default, which is the default Bash behavior in + versions through 4.2. + ++@item completion_strip_exe ++If set, whenever bash sees @file{foo.exe} during completion, it checks if ++@file{foo} is the same file and strips the suffix. ++ + @item direxpand + If set, Bash + replaces directory names with the results of word expansion when performing +--- doc/builtins.1 2012-02-21 13:32:05.000000000 -0600 ++++ doc/builtins.1 2017-01-23 13:55:08.008447700 -0600 +@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim + ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1) + .SH BASH BUILTIN COMMANDS + .nr zZ 1 +-.so bash.1 ++.so man1/bash.1 + .SH SEE ALSO + bash(1), sh(1) +--- general.c 2016-08-11 10:16:56.000000000 -0500 ++++ general.c 2017-01-23 13:55:08.008447700 -0600 +@@ -48,6 +48,10 @@ + + #include <tilde/tilde.h> + ++#ifdef __CYGWIN__ ++# include <sys/cygwin.h> ++#endif ++ + #if !defined (errno) + extern int errno; + #endif /* !errno */ +@@ -718,7 +722,8 @@ make_absolute (string, dot_path) + { + char pathbuf[PATH_MAX + 1]; + +- cygwin_conv_to_full_posix_path (string, pathbuf); ++ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf, ++ sizeof pathbuf); + result = savestring (pathbuf); + } + #else +--- input.c 2015-09-24 18:49:23.000000000 -0500 ++++ input.c 2017-01-23 13:55:08.008447700 -0600 +@@ -44,6 +44,10 @@ + #include "quit.h" + #include "trap.h" + ++#ifdef __CYGWIN__ ++int igncr; ++#endif ++ + #if !defined (errno) + extern int errno; + #endif /* !errno */ +@@ -561,6 +565,19 @@ buffered_getchar () + { + CHECK_TERMSIG; + ++#ifdef __CYGWIN__ ++ /* shopt igncr discards carriage returns from the input stream. ++ If cr is the only character left in the buffer, recurse to pick ++ up the next byte; otherwise flatten the buffer. */ ++ if (igncr) ++ { ++ int ch; ++ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd])) ++ == '\r') ++ ; ++ return ch; ++ } ++#endif + #if !defined (DJGPP) + return (bufstream_getc (buffers[bash_input.location.buffered_fd])); + #else +--- lib/sh/pathphys.c 2013-05-28 14:33:58.000000000 -0500 ++++ lib/sh/pathphys.c 2017-01-23 13:55:08.008447700 -0600 +@@ -35,6 +35,7 @@ + #include <stdio.h> + #include <chartypes.h> + #include <errno.h> ++#include <stdlib.h> + + #include "shell.h" + +@@ -76,6 +77,9 @@ sh_physpath (path, flags) + char *path; + int flags; + { ++#ifdef __CYGWIN__ ++ return realpath (path, NULL); ++#endif + char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1]; + char *result, *p, *q, *qsave, *qbase, *workpath; + int double_slash_path, linklen, nlink; +@@ -214,11 +218,7 @@ error: + { + q = result; + /* Duplicating some code here... */ +-#if defined (__CYGWIN__) +- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1; +-#else + qbase = workpath + 1; +-#endif + double_slash_path = DOUBLE_SLASH (workpath); + qbase += double_slash_path; + +--- lib/sh/tmpfile.c 2016-08-11 10:05:58.000000000 -0500 ++++ lib/sh/tmpfile.c 2017-01-23 13:55:08.008447700 -0600 +@@ -101,7 +101,7 @@ get_tmpdir (flags) + if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX)) + tdir = 0; + +- if (tdir == 0) ++ if (tdir == 0 || !file_iswdir (tdir)) + tdir = get_sys_tmpdir (); + + #if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX) +--- mksyntax.c 2012-07-29 18:48:38.000000000 -0500 ++++ mksyntax.c 2017-01-23 13:55:08.008447700 -0600 +@@ -29,13 +29,13 @@ + + #ifdef HAVE_UNISTD_H + # include <unistd.h> ++#else ++extern int optind; ++extern char *optarg; + #endif + + #include "syntax.h" + +-extern int optind; +-extern char *optarg; +- + #ifndef errno + extern int errno; + #endif +--- parse.y 2016-09-11 10:31:46.000000000 -0500 ++++ parse.y 2017-01-23 13:55:08.008447700 -0600 +@@ -1539,14 +1539,20 @@ yy_string_get () + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ +- if (string && *string) ++ while (string && *string) + { + c = *string++; + bash_input.location.string = string; ++#ifdef __CYGWIN__ ++ { ++ extern int igncr; ++ if (igncr && c == '\r') ++ continue; ++ } ++#endif + return (c); + } +- else +- return (EOF); ++ return (EOF); + } + + static int +--- subst.c 2017-01-23 13:28:06.955247200 -0600 ++++ subst.c 2017-01-23 13:55:08.008447700 -0600 +@@ -43,6 +43,7 @@ + #include "posixstat.h" + #include "bashintl.h" + ++#define NEED_SH_SETLINEBUF_DECL + #include "shell.h" + #include "parser.h" + #include "flags.h" +@@ -5964,6 +5965,13 @@ read_comsub (fd, quoted, rflag) + #endif + continue; + } ++#ifdef __CYGWIN__ ++ { ++ extern int igncr; ++ if (igncr && c == '\r') ++ continue; ++ } ++#endif + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); +@@ -6088,6 +6096,28 @@ command_substitute (string, quoted) + goto error_exit; + } + ++#ifdef __CYGWIN__ ++ /* Passing a pipe through std fds can cause hangs when talking to a ++ non-cygwin child. Move it. */ ++ if (fildes[0] < 3) ++ { ++ int fd = fcntl (fildes[0], F_DUPFD, 3); ++ close (fildes[0]); ++ fildes[0] = fd; ++ } ++ if (fildes[1] < 3) ++ { ++ int fd = fcntl (fildes[1], F_DUPFD, 3); ++ close (fildes[1]); ++ fildes[1] = fd; ++ } ++ if (fildes[0] < 0 || fildes[1] < 0) ++ { ++ sys_error (_("cannot make pipe for command substitution")); ++ goto error_exit; ++ } ++#endif /* __CYGWIN__ */ ++ + old_pid = last_made_pid; + #if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; +--- support/bashversion.c 2008-09-09 08:31:53.000000000 -0500 ++++ support/bashversion.c 2017-01-23 13:55:08.024037200 -0600 +@@ -26,6 +26,9 @@ + + #if defined (HAVE_UNISTD_H) + # include <unistd.h> ++#else ++extern int optind; ++extern char *optarg; + #endif + + #include "bashansi.h" +@@ -41,9 +44,6 @@ + #define LFLAG 0x0020 + #define XFLAG 0x0040 + +-extern int optind; +-extern char *optarg; +- + extern char *dist_version; + extern int patch_level; + +--- support/mkversion.sh 2008-08-13 07:25:57.000000000 -0500 ++++ support/mkversion.sh 2017-01-23 13:55:08.024037200 -0600 +@@ -29,7 +29,7 @@ source_dir="." + while [ $# -gt 0 ]; do + case "$1" in + -o) shift; OUTFILE=$1; shift ;; +- -b) shift; inc_build=yes ;; ++ -b) shift; ;; # inc_build=yes ;; # hacked out for cygport + -s) shift; rel_status=$1; shift ;; + -p) shift; patch_level=$1; shift ;; + -d) shift; dist_version=$1; shift ;; +--- variables.c 2016-06-15 15:05:52.000000000 -0500 ++++ variables.c 2017-01-23 13:55:08.024037200 -0600 +@@ -5239,6 +5239,7 @@ sv_winsize (name) + /* Update the value of HOME in the export environment so tilde expansion will + work on cygwin. */ + #if defined (__CYGWIN__) ++void + sv_home (name) + char *name; + { diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/nix-bash-completions/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/bash/nix-bash-completions/default.nix new file mode 100644 index 000000000000..5dfd673a6298 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/nix-bash-completions/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + version = "0.6.8"; + pname = "nix-bash-completions"; + + src = fetchFromGitHub { + owner = "hedning"; + repo = "nix-bash-completions"; + rev = "v${version}"; + sha256 = "1n5zs6xcnv4bv1hdaypmz7fv4j7dsr4a0ifah99iyj4p5j85i1bc"; + }; + + # To enable lazy loading via. bash-completion we need a symlink to the script + # from every command name. + installPhase = '' + commands=$( + function complete() { shift 2; echo "$@"; } + shopt -s extglob + source _nix + ) + install -Dm444 -t $out/share/bash-completion/completions _nix + cd $out/share/bash-completion/completions + for c in $commands; do + ln -s _nix $c + done + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/hedning/nix-bash-completions"; + description = "Bash completions for Nix, NixOS, and NixOps"; + license = licenses.bsd3; + platforms = platforms.all; + maintainers = with maintainers; [ hedning ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-4.4.patch b/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-4.4.patch new file mode 100644 index 000000000000..ea3d7bdf92b4 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-4.4.patch @@ -0,0 +1,29 @@ +diff -u ./configure ../bash-4.4-fixed/configure +--- ./configure 2016-09-07 22:57:01.000000000 +0200 ++++ ../bash-4.4-fixed/configure 2020-01-08 14:10:26.316858174 +0100 +@@ -16064,10 +16064,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 2.[456789]*|[34]*) $as_echo "#define PGRP_PIPE 1" >>confdefs.h +- ;; +- esac ;; ++ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;; + *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; + powerux*) LOCAL_LIBS="-lgen" ;; +diff -u ./configure.ac ../bash-4.4-fixed/configure.ac +--- ./configure.ac 2016-09-07 22:56:28.000000000 +0200 ++++ ../bash-4.4-fixed/configure.ac 2016-09-07 22:56:28.000000000 +0200 +@@ -1092,9 +1092,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 2.[[456789]]*|[[34]]*) AC_DEFINE(PGRP_PIPE) ;; +- esac ;; ++ AC_DEFINE(PGRP_PIPE) ;; + *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; + powerux*) LOCAL_LIBS="-lgen" ;; diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-5.0.patch b/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-5.0.patch new file mode 100644 index 000000000000..2a9fa6f33c3b --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/pgrp-pipe-5.0.patch @@ -0,0 +1,31 @@ +diff -u ./configure ../bash-5.0-fixed/configure +--- ./configure 2019-01-02 15:43:31.000000000 +0100 ++++ ../bash-5.0-fixed/configure 2020-01-08 14:18:21.017296179 +0100 +@@ -16312,11 +16312,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 1.*|2.[0123]*) : ;; +- *) $as_echo "#define PGRP_PIPE 1" >>confdefs.h +- ;; +- esac ;; ++ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;; + netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; + *qnx[67]*) LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; +diff -u ./configure.ac ../bash-5.0-fixed/configure.ac +--- ./configure.ac 2019-01-02 15:39:11.000000000 +0100 ++++ ../bash-5.0-fixed/configure.ac 2019-01-02 15:39:11.000000000 +0100 +@@ -1108,10 +1108,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 1.*|2.[[0123]]*) : ;; +- *) AC_DEFINE(PGRP_PIPE) ;; +- esac ;; ++ AC_DEFINE(PGRP_PIPE) ;; + netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; + *qnx[[67]]*) LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; diff --git a/infra/libkookie/nixpkgs/pkgs/shells/bash/update-patch-set.sh b/infra/libkookie/nixpkgs/pkgs/shells/bash/update-patch-set.sh new file mode 100755 index 000000000000..cb4f372f5433 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/bash/update-patch-set.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env nix-shell +#!nix-shell --pure -i bash -p wget -p gnupg -p cacert + +# Update patch set for GNU Bash or Readline. + +if [ $# -ne 2 ] +then + echo "Usage: $(basename $0) PROJECT VERSION" + echo "" + echo "Update the patch set for PROJECT (one of \`bash' or \`readline') for" + echo "the given version (e.g., \`4.0'). Produce \`PROJECT-patches.nix'." + exit 1 +fi + +PROJECT="$1" +VERSION="$2" +VERSION_CONDENSED="$(echo $VERSION | sed -es/\\.//g)" +PATCH_LIST="$PROJECT-$VERSION-patches.nix" + +set -e + +start=1 +end=100 # must be > 99 for correct padding + +rm -vf "$PATCH_LIST" + +wget "https://tiswww.case.edu/php/chet/gpgkey.asc" +echo "4ef5051ce7200241e65d29c11eb57df8 gpgkey.asc" > gpgkey.asc.md5 +md5sum -c gpgkey.asc.md5 +gpg --import ./gpgkey.asc +rm gpgkey.asc{,.md5} + +( echo "# Automatically generated by \`$(basename $0)'; do not edit." ; \ + echo "" ; \ + echo "patch: [" ) \ +>> "$PATCH_LIST" + +for i in `seq -w $start $end` +do + wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i || break + wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i.sig + gpg --verify $PROJECT$VERSION_CONDENSED-$i.sig + echo "(patch \"$i\" \"$(nix-hash --flat --type sha256 --base32 $PROJECT$VERSION_CONDENSED-$i)\")" \ + >> "$PATCH_LIST" + + rm -f $PROJECT$VERSION_CONDENSED-$i{,.sig} +done + +echo "]" >> "$PATCH_LIST" + +echo "Got $(expr $i - 1) patches." +echo "Patch list has been written to \`$PATCH_LIST'." diff --git a/infra/libkookie/nixpkgs/pkgs/shells/dash/0001-fix-dirent64-et-al-on-darwin.patch b/infra/libkookie/nixpkgs/pkgs/shells/dash/0001-fix-dirent64-et-al-on-darwin.patch new file mode 100644 index 000000000000..f2e0802f7981 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/dash/0001-fix-dirent64-et-al-on-darwin.patch @@ -0,0 +1,41 @@ +From 7e75779eaeacdbb46a387a59d9aaf1481a1da3e5 Mon Sep 17 00:00:00 2001 +From: Adrian Gierakowski <agierakowski@gmail.com> +Date: Sun, 19 Jul 2020 08:38:05 +0100 +Subject: [PATCH] fix dirent64 et al on darwin + +--- + configure.ac | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/configure.ac b/configure.ac +index b8faca9..cee1e4d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -139,6 +139,7 @@ if test "$ac_cv_func_signal" != yes; then + [klibc has bsd_signal instead of signal])]) + fi + ++dnl TODO: stat64 is deprecated since macOS 10.6 + dnl Check for stat64 (dietlibc/klibc). + AC_CHECK_FUNC(stat64,, [ + AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit]) +@@ -155,6 +156,16 @@ AC_CHECK_FUNC(open64,, [ + AC_DEFINE(open64, open, [64-bit operations are the same as 32-bit]) + ]) + ++dnl OS X apparently has stat64 but not readdir64. ++AC_CHECK_FUNC(readdir64,, [ ++ AC_DEFINE(readdir64, readdir, [64-bit operations are the same as 32-bit]) ++]) ++ ++dnl OS X apparently has stat64 but not dirent64. ++AC_CHECK_TYPE(struct dirent64,, [ ++ AC_DEFINE(dirent64, dirent, [64-bit operations are the same as 32-bit]) ++],[#include <dirent.h>]) ++ + dnl Check if struct stat has st_mtim. + AC_MSG_CHECKING(for stat::st_mtim) + AC_COMPILE_IFELSE( +-- +2.15.1 + diff --git a/infra/libkookie/nixpkgs/pkgs/shells/dash/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/dash/default.nix new file mode 100644 index 000000000000..030e5695b225 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/dash/default.nix @@ -0,0 +1,28 @@ +{ stdenv, buildPackages, autoreconfHook, fetchurl }: + +stdenv.mkDerivation rec { + name = "dash-0.5.11.2"; + + src = fetchurl { + url = "http://gondor.apana.org.au/~herbert/dash/files/${name}.tar.gz"; + sha256 = "0pvdpm1cgfbc25ramn4305a0158yq031q1ain4dc972rnxl7vyq0"; + }; + + hardeningDisable = [ "format" ]; + + # Temporary fix until a proper one is accepted upstream + patches = stdenv.lib.optional stdenv.isDarwin ./0001-fix-dirent64-et-al-on-darwin.patch; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook; + + meta = with stdenv.lib; { + homepage = "http://gondor.apana.org.au/~herbert/dash/"; + description = "A POSIX-compliant implementation of /bin/sh that aims to be as small as possible"; + platforms = platforms.unix; + license = with licenses; [ bsd3 gpl2 ]; + }; + + passthru = { + shellPath = "/bin/dash"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/dgsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/dgsh/default.nix new file mode 100644 index 000000000000..0314180e2d55 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/dgsh/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchFromGitHub, autoconf, automake, pkgconfig, + libtool, check, bison, git, gperf, + perl, texinfo, help2man, gettext, ncurses +}: + +stdenv.mkDerivation { + pname = "dgsh-unstable"; + version = "2017-02-05"; + + src = fetchFromGitHub { + owner = "dspinellis"; + repo = "dgsh"; + rev = "bc4fc2e8009c069ee4df5140c32a2fc15d0acdec"; + sha256 = "0k3hmnarz56wphw45mabn5zcc427l5p77jldh1qqy89pxqy1wnql"; + fetchSubmodules = true; + }; + + patches = [ ./glibc-2.26.patch ]; + + nativeBuildInputs = [ autoconf automake pkgconfig libtool check + bison git gettext gperf perl texinfo help2man ncurses + ]; + + configurePhase = '' + cp -r ./unix-tools/coreutils/gnulib gnulib + perl -pi -e \ + 's#./bootstrap #./bootstrap --no-bootstrap-sync --skip-po --no-git --gnulib-srcdir='$PWD/gnulib' #g' \ + unix-tools/Makefile + find . -name \*.diff | xargs rm -f + rm -rf unix-tools/*/gnulib + patchShebangs unix-tools/diffutils/man/help2man + export RSYNC=true # set to rsync binary, eventhough it is not used. + make PREFIX=$out config + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "The Directed Graph Shell"; + homepage = "http://www.dmst.aueb.gr/dds/sw/dgsh"; + license = with licenses; asl20; + maintainers = with maintainers; [ vrthra ]; + platforms = with platforms; all; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/dgsh/glibc-2.26.patch b/infra/libkookie/nixpkgs/pkgs/shells/dgsh/glibc-2.26.patch new file mode 100644 index 000000000000..c66768151316 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/dgsh/glibc-2.26.patch @@ -0,0 +1,12 @@ +diff --git a/core-tools/src/dgsh-httpval.c b/core-tools/src/dgsh-httpval.c +index 8b5dce3..7b43c3d 100644 +--- a/core-tools/src/dgsh-httpval.c ++++ b/core-tools/src/dgsh-httpval.c +@@ -40,6 +40,7 @@ + #include <sys/stat.h> + #include <unistd.h> + #include <stdlib.h> ++#include <stdint.h> + #include <stdio.h> + #include <string.h> + #include <ctype.h> diff --git a/infra/libkookie/nixpkgs/pkgs/shells/elvish/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/elvish/default.nix new file mode 100644 index 000000000000..2cb45f33f7bc --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/elvish/default.nix @@ -0,0 +1,38 @@ +{ stdenv, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "elvish"; + version = "0.14.1"; + + excludedPackages = [ "website" ]; + + buildFlagsArray = [ "-ldflags=-s -w -X github.com/elves/elvish/pkg/buildinfo.Version==${version} -X github.com/elves/elvish/pkg/buildinfo.Reproducible=true" ]; + + src = fetchFromGitHub { + owner = "elves"; + repo = pname; + rev = "v${version}"; + sha256 = "05wp3cx4s2cjf60yncdpmycs5h4z1dlin56dmljmfwz4z099079b"; + }; + + vendorSha256 = "1f971n17h9bc0qcgs9ipiaw0x9807mz761fqm605br4ch1kp0897"; + + doCheck = false; + + meta = with stdenv.lib; { + description = "A friendly and expressive command shell"; + longDescription = '' + Elvish is a friendly interactive shell and an expressive programming + language. It runs on Linux, BSDs, macOS and Windows. Despite its pre-1.0 + status, it is already suitable for most daily interactive use. + ''; + homepage = "https://elv.sh/"; + license = licenses.bsd2; + maintainers = with maintainers; [ vrthra AndersonTorres ]; + platforms = with platforms; linux ++ darwin; + }; + + passthru = { + shellPath = "/bin/elvish"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/es/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/es/default.nix new file mode 100644 index 000000000000..761846843fea --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/es/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, readline, yacc }: + +let + version = "0.9.1"; +in +stdenv.mkDerivation { + + pname = "es"; + inherit version; + + src = fetchurl { + url = "https://github.com/wryun/es-shell/releases/download/v${version}/es-${version}.tar.gz"; + sha256 = "1fplzxc6lncz2lv2fyr2ig23rgg5j96rm2bbl1rs28mik771zd5h"; + }; + + # The distribution tarball does not have a single top-level directory. + preUnpack = '' + mkdir $name + cd $name + sourceRoot=. + ''; + + buildInputs = [ readline yacc ]; + + configureFlags = [ "--with-readline" ]; + + meta = with stdenv.lib; { + description = "Es is an extensible shell"; + longDescription = + '' + Es is an extensible shell. The language was derived + from the Plan 9 shell, rc, and was influenced by + functional programming languages, such as Scheme, + and the Tcl embeddable programming language. + ''; + homepage = "http://wryun.github.io/es-shell/"; + license = licenses.publicDomain; + maintainers = with maintainers; [ sjmackenzie ttuegel ]; + platforms = platforms.all; + }; + + passthru = { + shellPath = "/bin/es"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/fish/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/fish/default.nix new file mode 100644 index 000000000000..3faa7f996575 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/fish/default.nix @@ -0,0 +1,248 @@ +{ stdenv +, lib +, fetchurl +, coreutils +, utillinux +, which +, gnused +, gnugrep +, groff +, gawk +, man-db +, getent +, libiconv +, pcre2 +, gettext +, ncurses +, python3 +, cmake + +, runCommand +, writeText +, nixosTests +, useOperatingSystemEtc ? true +}: +let + etcConfigAppendix = writeText "config.fish.appendix" '' + ############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ############### + # # + # Origin: + # This fish package was called with the attribute + # "useOperatingSystemEtc = true;". + # + # Purpose: + # Fish ordinarily sources /etc/fish/config.fish as + # $__fish_sysconfdir/config.fish, + # and $__fish_sysconfdir is defined at compile-time, baked into the C++ + # component of fish. By default, it is set to "/etc/fish". When building + # through Nix, $__fish_sysconfdir gets set to $out/etc/fish. Here we may + # have included a custom $out/etc/config.fish in the fish package, + # as specified, but according to the value of useOperatingSystemEtc, we + # may want to further source the real "/etc/fish/config.fish" file. + # + # When this option is enabled, this segment should appear the very end of + # "$out/etc/config.fish". This is to emulate the behavior of fish itself + # with respect to /etc/fish/config.fish and ~/.config/fish/config.fish: + # source both, but source the more global configuration files earlier + # than the more local ones, so that more local configurations inherit + # from but override the more global locations. + + if test -f /etc/fish/config.fish + source /etc/fish/config.fish + end + + # # + ############### ↑ Nix hook for sourcing /etc/fish/config.fish ↑ ############### + ''; + + fishPreInitHooks = writeText "__fish_build_paths_suffix.fish" '' + # source nixos environment + # note that this is required: + # 1. For all shells, not just login shells (mosh needs this as do some other command-line utilities) + # 2. Before the shell is initialized, so that config snippets can find the commands they use on the PATH + builtin status --is-login + or test -z "$__fish_nixos_env_preinit_sourced" -a -z "$ETC_PROFILE_SOURCED" -a -z "$ETC_ZSHENV_SOURCED" + and test -f /etc/fish/nixos-env-preinit.fish + and source /etc/fish/nixos-env-preinit.fish + and set -gx __fish_nixos_env_preinit_sourced 1 + + test -n "$NIX_PROFILES" + and begin + # We ensure that __extra_* variables are read in $__fish_datadir/config.fish + # with a preference for user-configured data by making sure the package-specific + # data comes last. Files are loaded/sourced in encounter order, duplicate + # basenames get skipped, so we assure this by prepending Nix profile paths + # (ordered in reverse of the $NIX_PROFILE variable) + # + # Note that at this point in evaluation, there is nothing whatsoever on the + # fish_function_path. That means we don't have most fish builtins, e.g., `eval`. + + + # additional profiles are expected in order of precedence, which means the reverse of the + # NIX_PROFILES variable (same as config.environment.profiles) + set -l __nix_profile_paths (string split ' ' $NIX_PROFILES)[-1..1] + + set -p __extra_completionsdir \ + $__nix_profile_paths"/etc/fish/completions" \ + $__nix_profile_paths"/share/fish/vendor_completions.d" + set -p __extra_functionsdir \ + $__nix_profile_paths"/etc/fish/functions" \ + $__nix_profile_paths"/share/fish/vendor_functions.d" + set -p __extra_confdir \ + $__nix_profile_paths"/etc/fish/conf.d" \ + $__nix_profile_paths"/share/fish/vendor_conf.d" + end + ''; + + fish = stdenv.mkDerivation rec { + pname = "fish"; + version = "3.1.2"; + + src = fetchurl { + # There are differences between the release tarball and the tarball GitHub + # packages from the tag. Specifically, it comes with a file containing its + # version, which is used in `build_tools/git_version_gen.sh` to determine + # the shell's actual version (and what it displays when running `fish + # --version`), as well as the local documentation for all builtins (and + # maybe other things). + url = "https://github.com/fish-shell/fish-shell/releases/download/${version}/${pname}-${version}.tar.gz"; + sha256 = "1vblmb3x2k2cb0db5jdyflppnlqsm7i6jjaidyhmvaaw7ch2gffm"; + }; + + # We don't have access to the codesign executable, so we patch this out. + # For more information, see: https://github.com/fish-shell/fish-shell/issues/6952 + patches = lib.optional stdenv.isDarwin ./dont-codesign-on-mac.diff; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + ncurses + libiconv + pcre2 + ]; + + cmakeFlags = [ + "-DCMAKE_INSTALL_DOCDIR=${placeholder "out"}/share/doc/fish" + ]; + + preConfigure = '' + patchShebangs ./build_tools/git_version_gen.sh + ''; + + # Required binaries during execution + # Python: Autocompletion generated from manpages and config editing + propagatedBuildInputs = [ + coreutils + gnugrep + gnused + python3 + groff + gettext + ] ++ lib.optional (!stdenv.isDarwin) man-db; + + postInstall = with lib; '' + sed -r "s|command grep|command ${gnugrep}/bin/grep|" \ + -i "$out/share/fish/functions/grep.fish" + sed -i "s|which |${which}/bin/which |" \ + "$out/share/fish/functions/type.fish" + sed -e "s|\|cut|\|${coreutils}/bin/cut|" \ + -i "$out/share/fish/functions/fish_prompt.fish" + sed -e "s|gettext |${gettext}/bin/gettext |" \ + -e "s|which |${which}/bin/which |" \ + -i "$out/share/fish/functions/_.fish" + sed -e "s|uname|${coreutils}/bin/uname|" \ + -i "$out/share/fish/functions/__fish_pwd.fish" \ + "$out/share/fish/functions/prompt_pwd.fish" + sed -e "s|sed |${gnused}/bin/sed |" \ + -i "$out/share/fish/functions/alias.fish" \ + "$out/share/fish/functions/prompt_pwd.fish" + sed -i "s|nroff |${groff}/bin/nroff |" \ + "$out/share/fish/functions/__fish_print_help.fish" + sed -e "s|clear;|${getBin ncurses}/bin/clear;|" \ + -i "$out/share/fish/functions/fish_default_key_bindings.fish" + sed -e "s|python3|${getBin python3}/bin/python3|" \ + -i $out/share/fish/functions/{__fish_config_interactive.fish,fish_config.fish,fish_update_completions.fish} + sed -i "s|/usr/local/sbin /sbin /usr/sbin||" \ + $out/share/fish/completions/{sudo.fish,doas.fish} + sed -e "s| awk | ${gawk}/bin/awk |" \ + -i $out/share/fish/functions/{__fish_print_packages.fish,__fish_print_addresses.fish,__fish_describe_command.fish,__fish_complete_man.fish,__fish_complete_convert_options.fish} \ + $out/share/fish/completions/{cwebp,adb,ezjail-admin,grunt,helm,heroku,lsusb,make,p4,psql,rmmod,vim-addons}.fish + + cat > $out/share/fish/functions/__fish_anypython.fish <<EOF + function __fish_anypython + echo ${python3.interpreter} + return 0 + end + EOF + + '' + optionalString stdenv.isLinux '' + sed -e "s| ul| ${utillinux}/bin/ul|" \ + -i "$out/share/fish/functions/__fish_print_help.fish" + for cur in $out/share/fish/functions/*.fish; do + sed -e "s|/usr/bin/getent|${getent}/bin/getent|" \ + -i "$cur" + done + + '' + optionalString (!stdenv.isDarwin) '' + sed -i "s|Popen(\['manpath'|Popen(\['${man-db}/bin/manpath'|" \ + "$out/share/fish/tools/create_manpage_completions.py" + sed -i "s|command manpath|command ${man-db}/bin/manpath|" \ + "$out/share/fish/functions/man.fish" + '' + optionalString useOperatingSystemEtc '' + tee -a $out/etc/fish/config.fish < ${etcConfigAppendix} + '' + '' + tee -a $out/share/fish/__fish_build_paths.fish < ${fishPreInitHooks} + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Smart and user-friendly command line shell"; + homepage = "http://fishshell.com/"; + license = licenses.gpl2; + platforms = platforms.unix; + maintainers = with maintainers; [ ocharles cole-h ]; + }; + + passthru = { + shellPath = "/bin/fish"; + tests = { + nixos = nixosTests.fish; + + # Test the fish_config tool by checking the generated splash page. + # Since the webserver requires a port to run, it is not started. + fishConfig = + let fishScript = writeText "test.fish" '' + set -x __fish_bin_dir ${fish}/bin + echo $__fish_bin_dir + cp -r ${fish}/share/fish/tools/web_config/* . + chmod -R +w * + + # if we don't set `delete=False`, the file will get cleaned up + # automatically (leading the test to fail because there's no + # tempfile to check) + sed -e "s@, mode='w'@, mode='w', delete=False@" -i webconfig.py + + # we delete everything after the fileurl is assigned + sed -e '/fileurl =/q' -i webconfig.py + echo "print(fileurl)" >> webconfig.py + + # and check whether the message appears on the page + cat (${python3}/bin/python ./webconfig.py \ + | tail -n1 | sed -ne 's|.*\(/build/.*\)|\1|p' \ + ) | grep 'a href="http://localhost.*Start the Fish Web config' + + # cannot test the http server because it needs a localhost port + ''; + in + runCommand "test-web-config" { } '' + HOME=$(mktemp -d) + ${fish}/bin/fish ${fishScript} && touch $out + ''; + }; + }; + }; +in +fish diff --git a/infra/libkookie/nixpkgs/pkgs/shells/fish/dont-codesign-on-mac.diff b/infra/libkookie/nixpkgs/pkgs/shells/fish/dont-codesign-on-mac.diff new file mode 100644 index 000000000000..c61350b0549f --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/fish/dont-codesign-on-mac.diff @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d220a032..786b60e6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -183,7 +183,6 @@ ENDFUNCTION(CODESIGN_ON_MAC target) + # Define a function to link dependencies. + FUNCTION(FISH_LINK_DEPS_AND_SIGN target) + TARGET_LINK_LIBRARIES(${target} fishlib) +- CODESIGN_ON_MAC(${target}) + ENDFUNCTION(FISH_LINK_DEPS_AND_SIGN) + + # Define libfish.a. diff --git a/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/default.nix new file mode 100644 index 000000000000..ef157f323923 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchFromGitHub, gnused, bash, coreutils }: + +stdenv.mkDerivation { + pname = "fish-foreign-env"; + version = "git-20200209"; + + src = fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-foreign-env"; + rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc"; + sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs"; + }; + + installPhase = '' + mkdir -p $out/share/fish-foreign-env/functions/ + cp functions/* $out/share/fish-foreign-env/functions/ + sed -e "s|sed|${gnused}/bin/sed|" \ + -e "s|bash|${bash}/bin/bash|" \ + -e "s|\| tr|\| ${coreutils}/bin/tr|" \ + -i $out/share/fish-foreign-env/functions/* + ''; + + patches = [ ./suppress-harmless-warnings.patch ]; + + meta = with stdenv.lib; { + description = "A foreign environment interface for Fish shell"; + license = licenses.mit; + maintainers = with maintainers; [ jgillich ]; + platforms = with platforms; unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch b/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch new file mode 100644 index 000000000000..6eed35152120 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/fish/fish-foreign-env/suppress-harmless-warnings.patch @@ -0,0 +1,23 @@ +diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish +index 34a25e3..3d94135 100644 +--- a/functions/fenv.apply.fish ++++ b/functions/fenv.apply.fish +@@ -27,11 +27,17 @@ function fenv.apply + for variable in $variables + set key (echo $variable | sed 's/=.*//') + set value (echo $variable | sed 's/[^=]*=//') ++ set ignore PATH _ + + if test "$key" = 'PATH' + set value (echo $value | tr ':' '\n') + end + +- set -g -x $key $value ++ if contains $key $ignore ++ set -g -x $key $value 2>/dev/null ++ else ++ set -g -x $key $value ++ end ++ + end + end diff --git a/infra/libkookie/nixpkgs/pkgs/shells/ion/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/ion/default.nix new file mode 100644 index 000000000000..f84f150bc559 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/ion/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "ion"; + version = "unstable-2020-03-22"; + + src = fetchFromGitHub { + owner = "redox-os"; + repo = "ion"; + rev = "1fbd29a6d539faa6eb0f3186a361e208d0a0bc05"; + sha256 = "0r5c87cs8jlc9kpb6bi2aypldw1lngf6gzjirf13gi7iy4q08ik7"; + }; + + cargoSha256 = "1ph3r3vspy700mb8pica8478v9arqz07k2nzpbrdkdkqgfcwlgcg"; + + meta = with stdenv.lib; { + description = "Modern system shell with simple (and powerful) syntax"; + homepage = "https://gitlab.redox-os.org/redox-os/ion"; + license = licenses.mit; + maintainers = with maintainers; [ dywedir ]; + }; + + passthru = { + shellPath = "/bin/ion"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/jush/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/jush/default.nix new file mode 100644 index 000000000000..9894c90bb69e --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/jush/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, editline }: + +stdenv.mkDerivation rec { + pname = "jush"; + version = "0.1"; + + src = fetchFromGitHub { + owner = "troglobit"; + repo = pname; + rev = "v${version}"; + sha256 = "1azvghrh31gawd798a254ml4id642qvbva64zzg30pjszh1087n8"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + + buildInputs = [ editline ]; + + passthru.shellPath = "/bin/jush"; + + meta = with stdenv.lib; { + description = "just a useless shell"; + homepage = "https://github.com/troglobit/jush"; + license = licenses.isc; + platforms = platforms.all; + maintainers = with maintainers; [ dtzWill ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/ksh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/ksh/default.nix new file mode 100644 index 000000000000..e27732226f55 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/ksh/default.nix @@ -0,0 +1,43 @@ +{ stdenv, meson, ninja, fetchFromGitHub, which, python, fetchpatch +, libiconv }: + +stdenv.mkDerivation rec { + pname = "ksh"; + version = "2020.0.0"; + + src = fetchFromGitHub { + owner = "att"; + repo = "ast"; + rev = version; + sha256 = "0cdxz0nhpq03gb9rd76fn0x1yzs2c8q289b7vcxnzlsrz1imz65j"; + }; + + patches = [ + (fetchpatch { + url = "https://github.com/att/ast/commit/11983a71f5e29df578b7e2184400728b4e3f451d.patch"; + sha256 = "1n9558c4v2qpgpjb1vafs29n3qn3z0770wr1ayc0xjf5z5j4g3kv"; + }) + ]; + + nativeBuildInputs = [ meson ninja which python ]; + + buildInputs = [ libiconv ]; + + meta = with stdenv.lib; { + description = "KornShell Command And Programming Language"; + longDescription = '' + The KornShell language was designed and developed by David G. Korn at + AT&T Bell Laboratories. It is an interactive command language that + provides access to the UNIX system and to many other systems, on the + many different computers and workstations on which it is implemented. + ''; + homepage = "https://github.com/att/ast"; + license = licenses.cpl10; + maintainers = with maintainers; [ ]; + platforms = platforms.all; + }; + + passthru = { + shellPath = "/bin/ksh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/liquidprompt/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/liquidprompt/default.nix new file mode 100644 index 000000000000..783c07d16009 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/liquidprompt/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "liquidprompt"; + version = "1.12.0"; + + src = fetchFromGitHub { + owner = "nojhan"; + repo = pname; + rev = "v${version}"; + sha256 = "0ibp1bz9s4bp3y5anivg5gp31q78024w39v7hbfw05qy25ax5h60"; + }; + + installPhase = '' + install -D -m 0444 liquidprompt $out/bin/liquidprompt + install -D -m 0444 liquidpromptrc-dist $out/share/doc/liquidprompt/liquidpromptrc-dist + install -D -m 0444 liquid.theme $out/share/doc/liquidprompt/liquid.theme + + install -D -m 0444 liquidprompt.plugin.zsh \ + $out/share/zsh/plugins/liquidprompt/liquidprompt.plugin.zsh + install -D -m 0444 liquidprompt \ + $out/share/zsh/plugins/liquidprompt/liquidprompt + ''; + + meta = with stdenv.lib; { + description = "A full-featured & carefully designed adaptive prompt for Bash & Zsh"; + homepage = "https://github.com/nojhan/liquidprompt"; + license = licenses.agpl3; + platforms = platforms.all; + maintainers = with maintainers; [ gerschtli ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/mksh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/mksh/default.nix new file mode 100644 index 000000000000..7abf75c70f49 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/mksh/default.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "mksh"; + version = "59b"; + + src = fetchurl { + urls = [ + "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R${version}.tgz" + "http://pub.allbsd.org/MirOS/dist/mir/mksh/mksh-R${version}.tgz" + ]; + sha256 = "1rp0farbylypyiaald2hw5avg5w3m8x7cjnxxyyihzvfb2lx2zlh"; + }; + + dontConfigure = true; + + buildPhase = ''sh ./Build.sh -r''; + + installPhase = '' + install -D -m 755 mksh $out/bin/mksh + install -D -m 644 mksh.1 $out/share/man/man1/mksh.1 + install -D -m 644 dot.mkshrc $out/share/mksh/mkshrc + ''; + + meta = with stdenv.lib; { + description = "MirBSD Korn Shell"; + longDescription = '' + The MirBSD Korn Shell is a DFSG-free and OSD-compliant (and OSI + approved) successor to pdksh, developed as part of the MirOS + Project as native Bourne/POSIX/Korn shell for MirOS BSD, but + also to be readily available under other UNIX(R)-like operating + systems. + ''; + homepage = "https://www.mirbsd.org/mksh.htm"; + license = licenses.bsd3; + maintainers = with maintainers; [ AndersonTorres joachifm ]; + platforms = platforms.unix; + }; + + passthru = { + shellPath = "/bin/mksh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/mrsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/mrsh/default.nix new file mode 100644 index 000000000000..bbd56e510b7d --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/mrsh/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, readline }: + +stdenv.mkDerivation rec { + pname = "mrsh"; + version = "2020-01-08"; + + src = fetchFromGitHub { + owner = "emersion"; + repo = "mrsh"; + rev = "ef21854fc9ce172fb1f7f580b19a89d030d67c65"; + sha256 = "1iyxmwl61p2x9v9b22416n4lnrlwjqyxybq35x8bcbjxkwypp943"; + }; + + nativeBuildInputs = [ meson ninja pkgconfig ]; + buildInputs = [ readline ]; + + meta = with stdenv.lib; { + description = "A minimal POSIX shell"; + homepage = "https://mrsh.sh"; + license = licenses.mit; + maintainers = with maintainers; [ matthiasbeyer ]; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/nushell/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/nushell/default.nix new file mode 100644 index 000000000000..c3e6c5b67539 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/nushell/default.nix @@ -0,0 +1,62 @@ +{ stdenv +, lib +, fetchFromGitHub +, rustPlatform +, openssl +, zlib +, pkg-config +, python3 +, xorg +, libiconv +, AppKit +, Security +, withStableFeatures ? true +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell"; + version = "0.21.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = version; + sha256 = "19bpxx9pi3cl5y7h5qg4a2pmvwqavm1vciyvsq96kxkc7rq2xwvl"; + }; + + cargoSha256 = "1ghbzahz8lbk11sjy2kis12w22rjr92aaw451rmc86pk2lsxn0dx"; + + nativeBuildInputs = [ pkg-config ] + ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ]; + + buildInputs = [ openssl ] + ++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ] + ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ] + ++ lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ]; + + cargoBuildFlags = lib.optional withStableFeatures "--features stable"; + + # Remove after https://github.com/NixOS/nixpkgs/pull/97000 lands into master + preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' + unset SDKROOT + ''; + + checkPhase = '' + runHook preCheck + echo "Running cargo test" + HOME=$TMPDIR cargo test + runHook postCheck + ''; + + meta = with lib; { + description = "A modern shell written in Rust"; + homepage = "https://www.nushell.sh/"; + license = licenses.mit; + maintainers = with maintainers; [ filalex77 johntitor marsam ]; + platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]; + }; + + passthru = { + shellPath = "/bin/nu"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/oh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/oh/default.nix new file mode 100644 index 000000000000..3ae8a7c600aa --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/oh/default.nix @@ -0,0 +1,23 @@ +{ stdenv, buildGoPackage, fetchgit, lib }: + +buildGoPackage rec { + pname = "oh"; + version = "20160522-${stdenv.lib.strings.substring 0 7 rev}"; + rev = "0daaf4081475fb9d6b3801c85019bdd57b2ee9b4"; + + goPackagePath = "github.com/michaelmacinnis/oh"; + + src = fetchgit { + inherit rev; + url = "https://github.com/michaelmacinnis/oh"; + sha256 = "0ajidzs0aisbw74nri9ks6sx6644nmwkisc9mvxm3f89zmnlsgwr"; + }; + + goDeps = ./deps.nix; + + meta = with lib;{ + homepage = "https://github.com/michaelmacinnis/oh"; + description = "A Unix shell"; + license = stdenv.lib.licenses.mit; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/oh/deps.nix b/infra/libkookie/nixpkgs/pkgs/shells/oh/deps.nix new file mode 100644 index 000000000000..b4b98f10c3aa --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/oh/deps.nix @@ -0,0 +1,29 @@ +[ + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "d9157a9621b69ad1d8d77a1933590c416593f24f"; + sha256 = "1asdbp7rj1j1m1aar1a022wpcwbml6zih6cpbxaw7b2m8v8is931"; + }; + } + { + goPackagePath = "github.com/michaelmacinnis/adapted"; + fetch = { + type = "git"; + url = "https://github.com/michaelmacinnis/adapted"; + rev = "0dd5fa34d6f9d74c7c0deed1fc224f9a87e02978"; + sha256 = "16n3a87m33pqx4qih713q3gw2j6ksj1q3ngjax6bpn5b11rqvikv"; + }; + } + { + goPackagePath = "github.com/peterh/liner"; + fetch = { + type = "git"; + url = "https://github.com/peterh/liner"; + rev = "ad1edfd30321d8f006ccf05f1e0524adeb943060"; + sha256 = "0c24d9j1gnq7r982h1l2isp3d37379qw155hr8ihx9i2mhpfz317"; + }; + } +] diff --git a/infra/libkookie/nixpkgs/pkgs/shells/oil/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/oil/default.nix new file mode 100644 index 000000000000..94fd062e45ca --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/oil/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchurl, readline }: + +stdenv.mkDerivation rec { + pname = "oil"; + version = "0.8.1"; + + src = fetchurl { + url = "https://www.oilshell.org/download/oil-${version}.tar.xz"; + sha256 = "0mhzys1siry848v7swr1iv2wp329ksw0gpz1qd82fmlakml5brc1"; + }; + + postPatch = '' + patchShebangs build + ''; + + preInstall = '' + mkdir -p $out/bin + ''; + + buildInputs = [ readline ]; + configureFlags = [ "--with-readline" ]; + + # Stripping breaks the bundles by removing the zip file from the end. + dontStrip = true; + + meta = { + description = "A new unix shell"; + homepage = "https://www.oilshell.org/"; + + license = with lib.licenses; [ + psfl # Includes a portion of the python interpreter and standard library + asl20 # Licence for Oil itself + ]; + + maintainers = with lib.maintainers; [ lheckemann alva ]; + }; + + passthru = { + shellPath = "/bin/osh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/pash/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/pash/default.nix new file mode 100644 index 000000000000..c646c1c3f9bd --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/pash/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, buildDotnetPackage }: + +buildDotnetPackage { + baseName = "pash"; + version = "git-2016-07-06"; + + src = fetchFromGitHub { + owner = "Pash-Project"; + repo = "Pash"; + rev = "8d6a48f5ed70d64f9b49e6849b3ee35b887dc254"; + sha256 = "0c4wa8qi1zs01p9ck171jkw0n1rsymsrhpsb42gl7warwhpmv59f"; + }; + + preConfigure = "rm -rvf $src/Source/PashConsole/bin/*"; + + outputFiles = [ "Source/PashConsole/bin/Release/*" ]; + + meta = with stdenv.lib; { + description = "An open source implementation of Windows PowerShell"; + homepage = "https://github.com/Pash-Project/Pash"; + maintainers = [ maintainers.fornever maintainers.vrthra ]; + platforms = platforms.all; + license = with licenses; [ bsd3 gpl3 ]; + }; + + passthru = { + shellPath = "/bin/pash"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/powershell/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/powershell/default.nix new file mode 100644 index 000000000000..3d412a30afb2 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/powershell/default.nix @@ -0,0 +1,73 @@ +{ stdenv, lib, autoPatchelfHook, fetchzip, libunwind, libuuid, icu, curl +, darwin, makeWrapper, less, openssl_1_1, pam, lttng-ust }: + +let platformString = if stdenv.isDarwin then "osx" + else if stdenv.isLinux then "linux" + else throw "unsupported platform"; + platformSha = if stdenv.isDarwin then "0zv02h3njphrs8kgmicy7w40mmhmigdfl38f2dpwrs6z67f8vrm2" + else if stdenv.isLinux then "1zgdah397az0n3db6132h4bql0xzri7j98q5wg3s57sp4irlwx9w" + else throw "unsupported platform"; + platformLdLibraryPath = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH" + else if stdenv.isLinux then "LD_LIBRARY_PATH" + else throw "unsupported platform"; + libraries = [ libunwind libuuid icu curl openssl_1_1 ] ++ + (if stdenv.isLinux then [ pam lttng-ust ] else [ darwin.Libsystem ]); +in +stdenv.mkDerivation rec { + pname = "powershell"; + version = "7.0.3"; + + src = fetchzip { + url = "https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-${platformString}-x64.tar.gz"; + sha256 = platformSha; + stripRoot = false; + }; + + buildInputs = [ less ] ++ libraries; + nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + + installPhase = + let + ext = stdenv.hostPlatform.extensions.sharedLibrary; + in '' + pslibs=$out/share/powershell + mkdir -p $pslibs + + cp -r * $pslibs + + rm -f $pslibs/libcrypto${ext}.1.0.0 + rm -f $pslibs/libssl${ext}.1.0.0 + + ls $pslibs + '' + lib.optionalString (!stdenv.isDarwin) '' + patchelf --replace-needed libcrypto${ext}.1.0.0 libcrypto${ext}.1.1 $pslibs/libmi.so + patchelf --replace-needed libssl${ext}.1.0.0 libssl${ext}.1.1 $pslibs/libmi.so + '' + '' + + mkdir -p $out/bin + + makeWrapper $pslibs/pwsh $out/bin/pwsh \ + --prefix ${platformLdLibraryPath} : "${stdenv.lib.makeLibraryPath libraries}" \ + --set TERM xterm --set POWERSHELL_TELEMETRY_OPTOUT 1 --set DOTNET_CLI_TELEMETRY_OPTOUT 1 + ''; + + dontStrip = true; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/pwsh --help > /dev/null + ''; + + meta = with lib; { + description = "Powerful cross-platform (Windows, Linux, and macOS) shell and scripting language based on .NET"; + homepage = "https://github.com/PowerShell/PowerShell"; + maintainers = with maintainers; [ yrashk srgom ]; + platforms = [ "x86_64-darwin" "x86_64-linux" ]; + license = with licenses; [ mit ]; + }; + + passthru = { + shellPath = "/bin/pwsh"; + }; + +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/rc/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/rc/default.nix new file mode 100644 index 000000000000..cd5ed860b2e6 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/rc/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl, autoreconfHook +, ncurses #acinclude.m4 wants headers for tgetent(). +, historySupport ? false +, readline ? null +}: + +stdenv.mkDerivation rec { + pname = "rc"; + version = "1.7.4"; + + src = fetchurl { + url = "http://static.tobold.org/rc/rc-${version}.tar.gz"; + sha256 = "1n5zz6d6z4z6s3fwa0pscqqawy561k4xfnmi91i626hcvls67ljy"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ ncurses ] + ++ stdenv.lib.optionals (readline != null) [ readline ]; + + configureFlags = [ + "--enable-def-interp=${stdenv.shell}" #183 + ] ++ stdenv.lib.optionals historySupport [ "--with-history" ] + ++ stdenv.lib.optionals (readline != null) [ "--with-edit=readline" ]; + + prePatch = '' + substituteInPlace configure.ac \ + --replace "date -I" "echo 2015-05-13" #reproducible-build + ''; + + passthru = { + shellPath = "/bin/rc"; + }; + + meta = with stdenv.lib; { + description = "The Plan 9 shell"; + longDescription = "Byron Rakitzis' UNIX reimplementation of Tom Duff's Plan 9 shell."; + homepage = "http://tobold.org/article/rc"; + license = with licenses; zlib; + maintainers = with maintainers; [ ramkromberg ]; + platforms = with platforms; all; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/rush/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/rush/default.nix new file mode 100644 index 000000000000..f9e15d4a0b47 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/rush/default.nix @@ -0,0 +1,41 @@ +{ fetchurl, stdenv }: + +stdenv.mkDerivation rec { + pname = "rush"; + version = "2.1"; + + src = fetchurl { + url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz"; + sha256 = "17i4mggr3rnfz0xbhqvd86jqva40c535fhlwkb2l4hjcbpg8blcf"; + }; + + doCheck = true; + + meta = { + description = "Restricted User Shell"; + + longDescription = + '' GNU Rush is a Restricted User Shell, designed for sites + providing limited remote access to their resources, such as + svn or git repositories, scp, or the like. Using a + sophisticated configuration file, Rush gives you complete + control over the command lines that users execute, as well as + over the usage of system resources, such as virtual memory, + CPU time, etc. + + In particular, it allows remote programs to be run in a chrooted + environment, which is important with such programs as + sftp-server or scp, that lack this ability. + ''; + + homepage = "https://www.gnu.org/software/rush/"; + license = stdenv.lib.licenses.gpl3Plus; + + maintainers = [ stdenv.lib.maintainers.bjg ]; + platforms = stdenv.lib.platforms.all; + }; + + passthru = { + shellPath = "/bin/rush"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/tcsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/tcsh/default.nix new file mode 100644 index 000000000000..87cbf8c59f36 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/tcsh/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchurl, fetchpatch +, ncurses }: + +with stdenv.lib; +stdenv.mkDerivation rec { + pname = "tcsh"; + version = "6.22.02"; + + src = fetchurl { + urls = [ + "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${pname}-${version}.tar.gz" + "ftp://ftp.astron.com/pub/tcsh/${pname}-${version}.tar.gz" + "ftp://ftp.funet.fi/pub/unix/shells/tcsh/${pname}-${version}.tar.gz" + ]; + sha256 = "0nw8prz1n0lmr82wnpyhrzmki630afn7p9cfgr3vl00vr9c72a7d"; + }; + + buildInputs = [ ncurses ]; + + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl + (fetchpatch { + name = "sysmalloc.patch"; + url = "https://git.alpinelinux.org/aports/plain/community/tcsh/001-sysmalloc.patch?id=184585c046cdd56512f1a76e426dd799b368f8cf"; + sha256 = "1qc6ydxhdfizsbkaxhpn3wib8sfphrw10xnnsxx2prvzg9g2zp67"; + }); + + meta = { + description = "An enhanced version of the Berkeley UNIX C shell (csh)"; + longDescription = '' + tcsh is an enhanced but completely compatible version of the + Berkeley UNIX C shell, csh. It is a command language interpreter + usable both as an interactive login shell and a shell script + command processor. + It includes: + - command-line editor + - programmable word completion + - spelling correction + - history mechanism + - job control + ''; + homepage = "https://www.tcsh.org/"; + license = licenses.bsd2; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = platforms.linux ++ platforms.darwin; + }; + + passthru = { + shellPath = "/bin/tcsh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/xonsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/xonsh/default.nix new file mode 100644 index 000000000000..8ff2b4d270ee --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/xonsh/default.nix @@ -0,0 +1,58 @@ +{ stdenv +, fetchFromGitHub +, python3Packages +, glibcLocales +, coreutils +, git +}: + +python3Packages.buildPythonApplication rec { + pname = "xonsh"; + version = "0.9.23"; + + # fetch from github because the pypi package ships incomplete tests + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xonsh"; + rev = version; + sha256 = "1by13ryq9ldc9wln3fk5mm6zvjp4aim57ikw49v0dfmz8irnpglp"; + }; + + LC_ALL = "en_US.UTF-8"; + + postPatch = '' + sed -ie "s|/bin/ls|${coreutils}/bin/ls|" tests/test_execer.py + sed -ie "s|SHELL=xonsh|SHELL=$out/bin/xonsh|" tests/test_integrations.py + + sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' tests/test_integrations.py + sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' scripts/xon.sh + find scripts -name 'xonsh*' -exec sed -i -e "s|env -S|env|" {} \; + find -name "*.xsh" | xargs sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' + patchShebangs . + ''; + + doCheck = !stdenv.isDarwin; + + checkPhase = '' + HOME=$TMPDIR pytest -k 'not test_repath_backslash and not test_os and not test_man_completion and not test_builtins and not test_main and not test_ptk_highlight and not test_pyghooks' + HOME=$TMPDIR pytest -k 'test_builtins or test_main' --reruns 5 + HOME=$TMPDIR pytest -k 'test_ptk_highlight' + ''; + + checkInputs = [ python3Packages.pytest python3Packages.pytest-rerunfailures glibcLocales git ]; + + propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ]; + + meta = with stdenv.lib; { + description = "A Python-ish, BASHwards-compatible shell"; + homepage = "https://xon.sh/"; + changelog = "https://github.com/xonsh/xonsh/releases/tag/${version}"; + license = licenses.bsd3; + maintainers = with maintainers; [ spwhitt vrthra ]; + platforms = platforms.all; + }; + + passthru = { + shellPath = "/bin/xonsh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/antibody/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/antibody/default.nix new file mode 100644 index 000000000000..325bae4f9cce --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/antibody/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "antibody"; + version = "6.1.1"; + + src = fetchFromGitHub { + owner = "getantibody"; + repo = "antibody"; + rev = "v${version}"; + sha256 = "0icag53svzdm7yvzp855fp0f7q0g0jkfmjaa1sj6mmb01c1xgzi1"; + }; + + vendorSha256 = "0z8fma3v2dph8nv3q4lmv43s6p5sc338xb7kcmnpwcc0iw7b4vyj"; + + doCheck = false; + + buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ]; + + meta = with lib; { + description = "The fastest shell plugin manager"; + homepage = "https://github.com/getantibody/antibody"; + license = licenses.mit; + maintainers = with maintainers; [ filalex77 worldofpeace ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/antigen/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/antigen/default.nix new file mode 100644 index 000000000000..5603e5edf598 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/antigen/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "2.2.3"; + pname = "antigen"; + + src = fetchurl { + url = "https://github.com/zsh-users/antigen/releases/download/v${version}/antigen.zsh"; + sha256 = "1bmp3qf14509swpxin4j9f98n05pdilzapjm0jdzbv0dy3hn20ix"; + }; + + phases = "installPhase"; + + installPhase = '' + outdir=$out/share/antigen + mkdir -p $outdir + cp $src $outdir/antigen.zsh + ''; + + meta = { + description = "The plugin manager for zsh"; + homepage = "http://antigen.sharats.me"; + license = stdenv.lib.licenses.mit; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/default.nix new file mode 100644 index 000000000000..56c76289e857 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/default.nix @@ -0,0 +1,92 @@ +{ stdenv, fetchurl, ncurses, pcre, buildPackages }: + +let + version = "5.8"; + + documentation = fetchurl { + url = "mirror://sourceforge/zsh/zsh-${version}-doc.tar.xz"; + sha256 = "1i6wdzq6rfjx5yjrpzan1jf50hk2pfzy5qib9mb7cnnbjfar6klv"; + }; +in + +stdenv.mkDerivation { + pname = "zsh"; + inherit version; + + src = fetchurl { + url = "mirror://sourceforge/zsh/zsh-${version}.tar.xz"; + sha256 = "09yyaadq738zlrnlh1hd3ycj1mv3q5hh4xl1ank70mjnqm6bbi6w"; + }; + + buildInputs = [ ncurses pcre ]; + + configureFlags = [ + "--enable-maildir-support" + "--enable-multibyte" + "--with-tcsetpgrp" + "--enable-pcre" + "--enable-zprofile=${placeholder "out"}/etc/zprofile" + ]; + + # the zsh/zpty module is not available on hydra + # so skip groups Y Z + checkFlags = map (T: "TESTNUM=${T}") (stdenv.lib.stringToCharacters "ABCDEVW"); + + # XXX: think/discuss about this, also with respect to nixos vs nix-on-X + postInstall = '' + mkdir -p $out/share/info + tar xf ${documentation} -C $out/share + ln -s $out/share/zsh-*/Doc/zsh.info* $out/share/info/ + + mkdir -p $out/etc/ + cat > $out/etc/zprofile <<EOF +if test -e /etc/NIXOS; then + if test -r /etc/zprofile; then + . /etc/zprofile + else + emulate bash + alias shopt=false + . /etc/profile + unalias shopt + emulate zsh + fi + if test -r /etc/zprofile.local; then + . /etc/zprofile.local + fi +else + # on non-nixos we just source the global /etc/zprofile as if we did + # not use the configure flag + if test -r /etc/zprofile; then + . /etc/zprofile + fi +fi +EOF + ${if stdenv.hostPlatform == stdenv.buildPlatform then '' + $out/bin/zsh -c "zcompile $out/etc/zprofile" + '' else '' + ${stdenv.lib.getBin buildPackages.zsh}/bin/zsh -c "zcompile $out/etc/zprofile" + ''} + mv $out/etc/zprofile $out/etc/zprofile_zwc_is_used + ''; + # XXX: patch zsh to take zwc if newer _or equal_ + + meta = { + description = "The Z shell"; + longDescription = '' + Zsh is a UNIX command interpreter (shell) usable as an interactive login + shell and as a shell script command processor. Of the standard shells, + zsh most closely resembles ksh but includes many enhancements. Zsh has + command line editing, builtin spelling correction, programmable command + completion, shell functions (with autoloading), a history mechanism, and + a host of other features. + ''; + license = "MIT-like"; + homepage = "https://www.zsh.org/"; + maintainers = with stdenv.lib.maintainers; [ pSub ]; + platforms = stdenv.lib.platforms.unix; + }; + + passthru = { + shellPath = "/bin/zsh"; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/fzf-zsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/fzf-zsh/default.nix new file mode 100644 index 000000000000..075707f425c4 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/fzf-zsh/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchFromGitHub, fzf }: + +stdenv.mkDerivation rec { + pname = "fzf-zsh-unstable"; + version = "2019-09-09"; + + src = fetchFromGitHub { + owner = "Wyntau"; + repo = "fzf-zsh"; + rev = "829d7e40cc437dce8a6e234e259bbd4065e87124"; + sha256 = "1irjmxhcg1fm4g8p3psjqk7sz5qhj5kw73pyhv91njvpdhn9l26z"; + }; + + postPatch = '' + substituteInPlace fzf-zsh.plugin.zsh \ + --replace \ + 'fzf_path="$( cd "$fzf_zsh_path/../fzf/" && pwd )"' \ + "fzf_path=${fzf}" \ + --replace \ + '$fzf_path/shell' \ + '${fzf}/share/fzf' + ''; + + dontBuild = true; + + installPhase = '' + install -Dm0644 fzf-zsh.plugin.zsh $out/share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/wyntau/fzf-zsh"; + description = "wrap fzf to use in oh-my-zsh"; + license = licenses.mit; + maintainers = with maintainers; [ ma27 ]; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/gradle-completion/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/gradle-completion/default.nix new file mode 100644 index 000000000000..72667d862a89 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/gradle-completion/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "gradle-completion"; + version = "1.4.1"; + + src = fetchFromGitHub { + owner = "gradle"; + repo = "gradle-completion"; + rev = "v${version}"; + sha256 = "15b0692i3h8h7b95465b2aw9qf5qjmjag5n62347l8yl7zbhv3l2"; + }; + + # we just move two files into $out, + # this shouldn't bother Hydra. + preferLocalBuild = true; + + dontBuild = true; + installPhase = '' + runHook preInstall + + mkdir -p $out + install -Dm0644 ./_gradle $out/share/zsh/site-functions/_gradle + install -Dm0644 ./gradle-completion.bash $out/share/bash-completion/completions/gradle + + runHook postInstall + ''; + + meta = with stdenv.lib; { + description = "Gradle tab completion for bash and zsh"; + homepage = "https://github.com/gradle/gradle-completion"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/grml-zsh-config/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/grml-zsh-config/default.nix new file mode 100644 index 000000000000..756c01d6e346 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/grml-zsh-config/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, lib +, zsh, coreutils, inetutils, procps, txt2tags }: + +with lib; + +stdenv.mkDerivation rec { + pname = "grml-zsh-config"; + version = "0.17.4"; + + src = fetchFromGitHub { + owner = "grml"; + repo = "grml-etc-core"; + rev = "v${version}"; + sha256 = "09c3f7s2r0cb8g9kgh3xhc8dhr1656g1q9s9i3s5imvknwqii6as"; + }; + + buildInputs = [ zsh coreutils txt2tags procps ] + ++ optional stdenv.isLinux inetutils; + + buildPhase = '' + cd doc + make + cd .. + ''; + + installPhase = '' + install -D -m644 etc/zsh/keephack $out/etc/zsh/keephack + install -D -m644 etc/zsh/zshrc $out/etc/zsh/zshrc + + install -D -m644 doc/grmlzshrc.5 $out/share/man/man5/grmlzshrc.5 + ln -s grmlzshrc.5.gz $out/share/man/man5/grml-zsh-config.5.gz + ''; + + meta = with stdenv.lib; { + description = "grml's zsh setup"; + homepage = "https://grml.org/zsh/"; + license = licenses.gpl2; + platforms = platforms.unix; + maintainers = with maintainers; [ msteen rvolosatovs ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix new file mode 100644 index 000000000000..37614dac0a32 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + pname = "lambda-mod-zsh-theme-unstable"; + version = "2020-10-03"; + + src = fetchFromGitHub { + owner = "halfo"; + repo = "lambda-mod-zsh-theme"; + rev = "78347ea9709935f265e558b6345919d12323fbff"; + sha256 = "0fvxnvgbcvwii7ghvpj5l43frllq71wwjvfg7cqfmic727z001dh"; + }; + + installPhase = '' + install -Dm0644 lambda-mod.zsh-theme $out/share/zsh/themes/lambda-mod.zsh-theme + ''; + + meta = with stdenv.lib; { + description = "A ZSH theme optimized for people who use Git & Unicode-compatible fonts and terminals"; + homepage = "https://github.com/halfo/lambda-mod-zsh-theme/"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ ma27 ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/nix-zsh-completions/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/nix-zsh-completions/default.nix new file mode 100644 index 000000000000..623d562b16e0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/nix-zsh-completions/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchFromGitHub }: + +let + version = "0.4.4"; +in + +stdenv.mkDerivation { + pname = "nix-zsh-completions"; + inherit version; + + src = fetchFromGitHub { + owner = "spwhitt"; + repo = "nix-zsh-completions"; + rev = version; + sha256 = "1n9whlys95k4wc57cnz3n07p7zpkv796qkmn68a50ygkx6h3afqf"; + }; + + installPhase = '' + mkdir -p $out/share/zsh/{site-functions,plugins/nix} + cp _* $out/share/zsh/site-functions + cp *.zsh $out/share/zsh/plugins/nix + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/spwhitt/nix-zsh-completions"; + description = "ZSH completions for Nix, NixOS, and NixOps"; + license = licenses.bsd3; + platforms = platforms.all; + maintainers = with maintainers; [ spwhitt olejorgenb hedning ma27 ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/default.nix new file mode 100644 index 000000000000..73fd6ceeb061 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/default.nix @@ -0,0 +1,83 @@ +# This script was inspired by the ArchLinux User Repository package: +# +# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=oh-my-zsh-git +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + version = "2020-10-15"; + pname = "oh-my-zsh"; + rev = "5b717ab3e4bfb627a936d7c04367a39867734d63"; + + src = fetchFromGitHub { + inherit rev; + owner = "ohmyzsh"; + repo = "ohmyzsh"; + sha256 = "0qm0mdvcvf5s6ypbq7z1x286sdv6ii2yfqvv1dss7zqjbg5j08gz"; + }; + + installPhase = '' + outdir=$out/share/oh-my-zsh + template=templates/zshrc.zsh-template + + mkdir -p $outdir + cp -r * $outdir + cd $outdir + + rm LICENSE.txt + rm -rf .git* + + chmod -R +w templates + + # Change the path to oh-my-zsh dir and disable auto-updating. + sed -i -e "s#ZSH=\$HOME/.oh-my-zsh#ZSH=$outdir#" \ + -e 's/\# \(DISABLE_AUTO_UPDATE="true"\)/\1/' \ + $template + + chmod +w oh-my-zsh.sh + + # Both functions expect oh-my-zsh to be in ~/.oh-my-zsh and try to + # modify the directory. + cat >> oh-my-zsh.sh <<- EOF + + # Undefine functions that don't work on Nix. + unfunction uninstall_oh_my_zsh + unfunction upgrade_oh_my_zsh + EOF + + # Look for .zsh_variables, .zsh_aliases, and .zsh_funcs, and source + # them, if found. + cat >> $template <<- EOF + + # Load the variables. + if [ -f ~/.zsh_variables ]; then + . ~/.zsh_variables + fi + + # Load the functions. + if [ -f ~/.zsh_funcs ]; then + . ~/.zsh_funcs + fi + + # Load the aliases. + if [ -f ~/.zsh_aliases ]; then + . ~/.zsh_aliases + fi + EOF + ''; + + meta = with stdenv.lib; { + description = "A framework for managing your zsh configuration"; + longDescription = '' + Oh My Zsh is a framework for managing your zsh configuration. + + To copy the Oh My Zsh configuration file to your home directory, run + the following command: + + $ cp -v $(nix-env -q --out-path oh-my-zsh | cut -d' ' -f3)/share/oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc + ''; + homepage = "https://ohmyz.sh/"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ scolobb nequissimus ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/update.sh b/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/update.sh new file mode 100755 index 000000000000..738c0810737a --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/oh-my-zsh/update.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl common-updater-scripts jq + +set -eu -o pipefail + +oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion oh-my-zsh" | tr -d '"')" +latestSha="$(curl -L -s https://api.github.com/repos/ohmyzsh/ohmyzsh/commits\?sha\=master\&since\=${oldVersion} | jq -r '.[0].sha')" + +if [ ! "null" = "${latestSha}" ]; then + latestDate="$(curl -L -s https://api.github.com/repos/ohmyzsh/ohmyzsh/commits/${latestSha} | jq '.commit.author.date' | sed 's|"\(.*\)T.*|\1|g')" + update-source-version oh-my-zsh "${latestSha}" --version-key=rev + update-source-version oh-my-zsh "${latestDate}" --ignore-same-hash + nixpkgs="$(git rev-parse --show-toplevel)" + default_nix="$nixpkgs/pkgs/shells/zsh/oh-my-zsh/default.nix" + git add "${default_nix}" + git commit -m "oh-my-zsh: ${oldVersion} -> ${latestDate}" +else + echo "oh-my-zsh is already up-to-date" +fi diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/pure-prompt/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/pure-prompt/default.nix new file mode 100644 index 000000000000..bfcd3be5e9cf --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/pure-prompt/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + pname = "pure-prompt"; + version = "1.13.0"; + + src = fetchFromGitHub { + owner = "sindresorhus"; + repo = "pure"; + rev = "v${version}"; + sha256 = "16q9v4c8lagp4vxm7qhagilqnwf1g4pbds56x5wfj4cwc0x2gclw"; + }; + + installPhase = '' + OUTDIR="$out/share/zsh/site-functions" + mkdir -p "$OUTDIR" + cp pure.zsh "$OUTDIR/prompt_pure_setup" + cp async.zsh "$OUTDIR/async" + ''; + + meta = { + description = "Pretty, minimal and fast ZSH prompt"; + homepage = "https://github.com/sindresorhus/pure"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ pacien pablovsky ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/spaceship-prompt/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/spaceship-prompt/default.nix new file mode 100644 index 000000000000..7db8cdb33492 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/spaceship-prompt/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "spaceship-prompt"; + version = "3.11.2"; + + src = fetchFromGitHub { + owner = "denysdovhan"; + repo = "spaceship-prompt"; + sha256 = "1q7m9mmg82n4fddfz01y95d5n34xnzhrnn1lli0vih39sgmzim9b"; + rev = "v${version}"; + }; + + installPhase = '' + install -D -m644 LICENSE.md "$out/share/licenses/spaceship-prompt/LICENSE" + install -D -m644 README.md "$out/share/doc/spaceship-prompt/README.md" + find docs -type f -exec install -D -m644 {} "$out/share/doc/spaceship-prompt/{}" \; + find lib -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \; + find scripts -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \; + find sections -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \; + install -D -m644 spaceship.zsh "$out/lib/spaceship-prompt/spaceship.zsh" + install -d "$out/share/zsh/themes/" + ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/themes/spaceship.zsh-theme" + install -d "$out/share/zsh/site-functions/" + ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/site-functions/prompt_spaceship_setup" + ''; + + meta = with stdenv.lib; { + description = "Zsh prompt for Astronauts"; + homepage = "https://github.com/denysdovhan/spaceship-prompt/"; + license = licenses.mit; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ nyanloutre ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zplug/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zplug/default.nix new file mode 100644 index 000000000000..d35eb345dda9 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zplug/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "zplug"; + version = "2.4.2"; + + src = fetchFromGitHub { + owner = "zplug"; + repo = pname; + rev = version; + sha256 = "0hci1pbs3k5icwfyfw5pzcgigbh9vavprxxvakg1xm19n8zb61b3"; + }; + + dontConfigure = true; + dontBuild = true; + dontPatch = true; + + installPhase = '' + mkdir -p $out + cp -r $src/* $out/ + ''; + + meta = with lib; { + description = "A next-generation plugin manager for zsh"; + homepage = "https://github.com/zplug/zplug"; + license = licenses.mit; + platforms = platforms.all; + maintainers = [ maintainers.s1341 ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-autosuggestions/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-autosuggestions/default.nix new file mode 100644 index 000000000000..58e560d2fa4d --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-autosuggestions/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, zsh }: + +# To make use of this derivation, use the `programs.zsh.enableAutoSuggestions` option + +stdenv.mkDerivation rec { + pname = "zsh-autosuggestions"; + version = "0.6.4"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-autosuggestions"; + rev = "v${version}"; + sha256 = "0h52p2waggzfshvy1wvhj4hf06fmzd44bv6j18k3l9rcx6aixzn6"; + }; + + buildInputs = [ zsh ]; + + installPhase = '' + install -D zsh-autosuggestions.zsh \ + $out/share/zsh-autosuggestions/zsh-autosuggestions.zsh + ''; + + meta = with stdenv.lib; { + description = "Fish shell autosuggestions for Zsh"; + homepage = "https://github.com/zsh-users/zsh-autosuggestions"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = [ maintainers.loskutov ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-bd/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-bd/default.nix new file mode 100644 index 000000000000..b5b66af6ca38 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-bd/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchFromGitHub}: + +stdenv.mkDerivation rec { + pname = "zsh-bd"; + version = "2018-07-04"; + + src = fetchFromGitHub { + owner = "Tarrasch"; + repo = pname; + rev = "d4a55e661b4c9ef6ae4568c6abeff48bdf1b1af7"; + sha256 = "020f8nq86g96cps64hwrskppbh2dapfw2m9np1qbs5pgh16z4fcb"; + }; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/share/zsh-bd + cp {.,$out/share/zsh-bd}/bd.zsh + cd $out/share/zsh-bd + ln -s bd{,.plugin}.zsh + ''; + + meta = { + description = "Jump back to a specific directory, without doing `cd ../../..` "; + homepage = "https://github.com/Tarrasch/zsh-bd"; + license = stdenv.lib.licenses.free; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.olejorgenb ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-command-time/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-command-time/default.nix new file mode 100644 index 000000000000..3ef210a02818 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-command-time/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub }: + +# To make use of this plugin, need to add +# programs.zsh.interactiveShellInit = '' +# source ${pkgs.zsh-command-time}/share/zsh/plugins/command-time/command-time.plugin.zsh +# ZSH_COMMAND_TIME_COLOR="yellow" +# ZSH_COMMAND_TIME_MIN_SECONDS=3 +# ZSH_COMMAND_TIME_ECHO=1 +# ''; + +stdenv.mkDerivation { + version = "2018-04-30"; + pname = "zsh-command-time"; + + src = fetchFromGitHub { + owner = "popstas"; + repo = "zsh-command-time"; + rev = "afb4a4c9ae7ce64ca9d4f334a79a25e46daad0aa"; + sha256 = "1bvyjgz6bhgg1nwr56r50p6fblgah6yiql55pgm5abnn2h876fjq"; + }; + + phases = [ "installPhase" ]; + + installPhase = '' + install -Dm0444 $src/command-time.plugin.zsh --target-directory=$out/share/zsh/plugins/command-time + ''; + + meta = with stdenv.lib; { + description = "Plugin that output time: xx after long commands"; + homepage = "https://github.com/popstas/zsh-command-time"; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-completions/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-completions/default.nix new file mode 100644 index 000000000000..89a91ad0508e --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-completions/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub}: + +stdenv.mkDerivation rec { + pname = "zsh-completions"; + version = "0.32.0"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = pname; + rev = version; + sha256 = "12l9wrx0aysyj62kgp5limglz0nq73w8c415wcshxnxmhyk6sw6d"; + }; + + installPhase= '' + install -D --target-directory=$out/share/zsh/site-functions src/* + ''; + + meta = { + description = "Additional completion definitions for zsh"; + homepage = "https://github.com/zsh-users/zsh-completions"; + license = stdenv.lib.licenses.free; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.olejorgenb ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/default.nix new file mode 100644 index 000000000000..735d6a2b7619 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub, perl }: + +let + version = "1.4"; + name = "deer-${version}"; +in stdenv.mkDerivation { + inherit name; + + src = fetchFromGitHub { + owner = "Vifon"; + repo = "deer"; + rev = "v${version}"; + sha256 = "1xnbnbi0zk2xsyn8dqsmyxqlfnl36pb1wwibnlp0dxixw6sfymyl"; + }; + + prePatch = '' + substituteInPlace deer \ + --replace " perl " " ${perl}/bin/perl " + ''; + + patches = [ ./realpath.patch ]; + + installPhase = '' + mkdir -p $out/share/zsh/site-functions/ + cp deer $out/share/zsh/site-functions/ + ''; + + meta = with stdenv.lib; { + description = "Ranger-like file navigation for zsh"; + homepage = "https://github.com/Vifon/deer"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.vyp ]; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/realpath.patch b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/realpath.patch new file mode 100644 index 000000000000..03850d7e5c12 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-deer/realpath.patch @@ -0,0 +1,28 @@ +From ceadb2f11119143af4f590ea6b05a531483219b5 Mon Sep 17 00:00:00 2001 +From: xd1le <elisp.vim@gmail.com> +Date: Wed, 30 Aug 2017 17:27:20 +1000 +Subject: [PATCH] use realpath instead of python to calculate relative path + +--- + deer | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/deer b/deer +index 3d89dea..804a871 100644 +--- a/deer ++++ b/deer +@@ -259,10 +259,7 @@ deer-get-relative() + { + local TMP + TMP=${1:-${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]} +- TMP="`python -c ' +-import sys, os +-print(os.path.relpath(sys.argv[1], sys.argv[2])) +-' $TMP ${DEER_STARTDIR:-$PWD}`" ++ TMP="`realpath --relative-to=${DEER_STARTDIR:-$PWD} $TMP`" + print -R $TMP:q + } + +-- +2.14.1 + diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix new file mode 100644 index 000000000000..452419bf8b09 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix @@ -0,0 +1,30 @@ +{ stdenvNoCC, lib, fetchFromGitHub }: + +stdenvNoCC.mkDerivation rec { + pname = "zsh-fast-syntax-highlighting"; + version = "1.54"; + + src = fetchFromGitHub { + owner = "zdharma"; + repo = "fast-syntax-highlighting"; + rev = "v${version}"; + sha256 = "019hda2pj8lf7px4h1z07b9l6icxx4b2a072jw36lz9bh6jahp32"; + }; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + plugindir="$out/share/zsh/site-functions" + + mkdir -p "$plugindir" + cp -r -- {,_,-}fast-* chroma themes "$plugindir"/ + ''; + + meta = with lib; { + description = "Syntax-highlighting for Zshell"; + homepage = "https://github.com/zdharma/fast-syntax-highlighting"; + license = licenses.bsd3; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-git-prompt/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-git-prompt/default.nix new file mode 100644 index 000000000000..6aadf3163d34 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-git-prompt/default.nix @@ -0,0 +1,70 @@ +# zsh-git-prompt -- Informative git prompt for zsh +# +# Usage: to enable this plugin for all users, you could +# add it to configuration.nix like this: +# +# programs.zsh.interactiveShellInit = '' +# source ${pkgs.zsh-git-prompt}/share/zsh-git-prompt/zshrc.sh +# ''; +# +# Or you can install it globally but only enable it in individual +# users' ~/.zshrc files: +# +# source /run/current-system/sw/share/zsh-git-prompt/zshrc.sh +# +# Or if installed locally: +# +# source ~/.nix-profile/share/zsh-git-prompt/zshrc.sh +# +# Either way, you then have to set a prompt that incorporates +# git_super_status, for example: +# +# PROMPT='%B%m%~%b$(git_super_status) %# ' +# +# More details are in share/doc/zsh-git-prompt/README.md, once +# installed. +# +{ fetchFromGitHub +, python +, git +, lib +, haskellPackages +}: + +haskellPackages.callPackage + ({ mkDerivation, base, HUnit, parsec, process, QuickCheck, stdenv }: + mkDerivation rec { + pname = "zsh-git-prompt"; + version = "0.4z"; # While we await a real 0.5 release. + src = fetchFromGitHub { + owner = "starcraftman"; + repo = "zsh-git-prompt"; + rev = "11b83ba3b85d14c66cf2ab79faefab6d838da28e"; + sha256 = "04aylsjfb03ckw219plkzpyiq4j9g66bjxa5pa56h1p7df6pjssb"; + }; + prePatch = '' + substituteInPlace zshrc.sh \ + --replace ':-"python"' ':-"haskell"' \ + --replace 'python ' '${python.interpreter} ' \ + --replace 'git ' '${git}/bin/git ' + ''; + preCompileBuildDriver = "cd src"; + postInstall = '' + cd .. + gpshare=$out/share/${pname} + gpdoc=$out/share/doc/${pname} + mkdir -p $gpshare/src $gpdoc + cp README.md $gpdoc + cp zshrc.sh gitstatus.py $gpshare + mv $out/bin $gpshare/src/.bin + ''; + isLibrary = false; + isExecutable = true; + libraryHaskellDepends = [ base parsec process QuickCheck ]; + executableHaskellDepends = libraryHaskellDepends; + testHaskellDepends = [HUnit] ++ libraryHaskellDepends; + homepage = "https://github.com/olivierverdier/zsh-git-prompt#readme"; + description = "Informative git prompt for zsh"; + license = stdenv.lib.licenses.mit; + maintainers = [lib.maintainers.league]; + }) {} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history-substring-search/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history-substring-search/default.nix new file mode 100644 index 000000000000..9890993eed64 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history-substring-search/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "zsh-history-substring-search"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-history-substring-search"; + rev = "v${version}"; + sha256 = "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y"; + }; + + installPhase = '' + install -D zsh-history-substring-search.zsh \ + "$out/share/zsh-history-substring-search/zsh-history-substring-search.zsh" + ''; + + meta = with lib; { + description = "Fish shell history-substring-search for Zsh"; + homepage = "https://github.com/zsh-users/zsh-history-substring-search"; + license = licenses.bsd3; + maintainers = with maintainers; [ qyliss ]; + platforms = platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history/default.nix new file mode 100644 index 000000000000..3d48467a2465 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-history/default.nix @@ -0,0 +1,37 @@ +{ lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests }: + +buildGoModule rec { + pname = "zsh-history"; + version = "2019-12-10"; + + src = fetchFromGitHub { + owner = "b4b4r07"; + repo = "history"; + rev = "8da016bd91b0c2eb53c9980f00eee6abdbb097e2"; + sha256 = "13n643ik1zjvpk8h9458yd9ffahhbdnigmbrbmpn7b7g23wqqsi3"; + }; + + nativeBuildInputs = [ installShellFiles ]; + + vendorSha256 = "13rc1afds5xg30faqz35haha4kxg73b5nvjirbrkc6kna0vhb54z"; + + doCheck = false; + + postInstall = '' + install -d $out/share + cp -r "$NIX_BUILD_TOP/source/misc/"* "$out/share" + installShellCompletion --zsh --name _history $out/share/zsh/completions/_history + ''; + + meta = with lib; { + description = "A CLI to provide enhanced history for your ZSH shell"; + license = licenses.mit; + homepage = "https://github.com/b4b4r07/history"; + platforms = platforms.unix; + maintainers = with maintainers; [ kampka ]; + }; + + passthru.tests = { + zsh-history-shell-integration = nixosTests.zsh-history; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-nix-shell/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-nix-shell/default.nix new file mode 100644 index 000000000000..6db78f1c0f56 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-nix-shell/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, pkgs }: + +# To make use of this derivation, use +# `programs.zsh.interactiveShellInit = "source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh";` + +stdenv.mkDerivation rec { + pname = "zsh-nix-shell"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v${version}"; + sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx"; + }; + + installPhase = '' + install -D nix-shell.plugin.zsh --target-directory=$out/share/zsh-nix-shell + install -D scripts/* --target-directory=$out/share/zsh-nix-shell/scripts + ''; + + meta = with stdenv.lib; { + description = "zsh plugin that lets you use zsh in nix-shell shell"; + homepage = src.meta.homepage; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = with maintainers; [ aw ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/default.nix new file mode 100644 index 000000000000..5d81ceaba1b2 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchFromGitHub, substituteAll, pkgs }: + +# To make use of this derivation, use +# `programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";` + +stdenv.mkDerivation rec { + pname = "powerlevel10k"; + version = "1.12.0"; + + src = fetchFromGitHub { + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "v${version}"; + sha256 = "08zg4in70h3kray6lazszzy26gvil9w2cr6xmkbgjsv3k6w3k0jg"; + }; + + patches = [ + (substituteAll { + src = ./gitstatusd.patch; + gitstatusdPath = "${pkgs.gitAndTools.gitstatus}/bin/gitstatusd"; + }) + ]; + + installPhase = '' + install -D powerlevel10k.zsh-theme --target-directory=$out/share/zsh-powerlevel10k + install -D config/* --target-directory=$out/share/zsh-powerlevel10k/config + install -D internal/* --target-directory=$out/share/zsh-powerlevel10k/internal + cp -R gitstatus $out/share/zsh-powerlevel10k/gitstatus + ''; + + meta = { + description = "A fast reimplementation of Powerlevel9k ZSH theme"; + homepage = "https://github.com/romkatv/powerlevel10k"; + license = stdenv.lib.licenses.mit; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.hexa ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch new file mode 100644 index 000000000000..3d1c1eaa36d4 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch @@ -0,0 +1,13 @@ +diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh +index b469072..eb1e3be 100644 +--- a/gitstatus/gitstatus.plugin.zsh ++++ b/gitstatus/gitstatus.plugin.zsh +@@ -44,6 +44,8 @@ + + [[ -o 'interactive' ]] || 'return' + ++GITSTATUS_DAEMON=@gitstatusdPath@ ++ + # Temporarily change options. + 'builtin' 'local' '-a' '_gitstatus_opts' + [[ ! -o 'aliases' ]] || _gitstatus_opts+=('aliases') diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel9k/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel9k/default.nix new file mode 100644 index 000000000000..676f9458675b --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-powerlevel9k/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub }: + +# To make use of this derivation, use +# `programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme";` + +stdenv.mkDerivation { + pname = "powerlevel9k"; + version = "2017-11-10"; + src = fetchFromGitHub { + owner = "bhilburn"; + repo = "powerlevel9k"; + rev = "87acc51acab3ed4fd33cda2386abed6f98c80720"; + sha256 = "0v1dqg9hvycdkcvklg2njff97xwr8rah0nyldv4xm39r77f4yfvq"; + }; + + installPhase= '' + install -D powerlevel9k.zsh-theme --target-directory=$out/share/zsh-powerlevel9k + install -D functions/* --target-directory=$out/share/zsh-powerlevel9k/functions + ''; + + meta = { + description = "A beautiful theme for zsh"; + homepage = "https://github.com/bhilburn/powerlevel9k"; + license = stdenv.lib.licenses.mit; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.pierrechevalier83 ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-prezto/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-prezto/default.nix new file mode 100644 index 000000000000..dffecf617b17 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-prezto/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "zsh-prezto"; + version = "2020-05-20"; + src = fetchFromGitHub { + owner = "sorin-ionescu"; + repo = "prezto"; + rev = "793f239a5e38ef2c4b76a4955bb734520303e8c4"; + sha256 = "0xhdl1g0rvlikq6qxh6cwp6wsrgmw4l1rmmq5xpc7wl6dyh35yri"; + fetchSubmodules = true; + }; + buildPhase = '' + sed -i '/\''${ZDOTDIR:\-\$HOME}\/.zpreztorc" ]]/i\ + if [[ -s "/etc/zpreztorc" ]]; then\ + source "/etc/zpreztorc"\ + fi' init.zsh + sed -i -e "s|\''${ZDOTDIR:\-\$HOME}/.zprezto/|$out/|g" init.zsh + for i in runcoms/*; do + sed -i -e "s|\''${ZDOTDIR:\-\$HOME}/.zprezto/|$out/|g" $i + done + ''; + installPhase = '' + mkdir -p $out + cp ./* $out/ -R + ''; + meta = with stdenv.lib; { + description = "Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes"; + homepage = "https://github.com/sorin-ionescu/prezto"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + platforms = with platforms; unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix new file mode 100644 index 000000000000..906352b8b3e0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, zsh }: + +# To make use of this derivation, use the `programs.zsh.enableSyntaxHighlighting` option + +stdenv.mkDerivation rec { + version = "0.7.1"; + pname = "zsh-syntax-highlighting"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-syntax-highlighting"; + rev = version; + sha256 = "03r6hpb5fy4yaakqm3lbf4xcvd408r44jgpv4lnzl9asp4sb9qc0"; + }; + + buildInputs = [ zsh ]; + + installFlags = [ "PREFIX=$(out)" ]; + + meta = with stdenv.lib; { + description = "Fish shell like syntax highlighting for Zsh"; + homepage = "https://github.com/zsh-users/zsh-syntax-highlighting"; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = [ maintainers.loskutov ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-you-should-use/default.nix b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-you-should-use/default.nix new file mode 100644 index 000000000000..603757c3332b --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/shells/zsh/zsh-you-should-use/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "zsh-you-should-use"; + version = "1.7.3"; + + src = fetchFromGitHub { + owner = "MichaelAquilina"; + repo = pname; + rev = version; + sha256 = "1dz48rd66priqhxx7byndqhbmlwxi1nfw8ik25k0z5k7k754brgy"; + }; + + dontBuild = true; + + installPhase = '' + install -D you-should-use.plugin.zsh $out/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/MichaelAquilina/zsh-you-should-use"; + license = licenses.gpl3; + description = "ZSH plugin that reminds you to use existing aliases for commands you just typed"; + maintainers = with maintainers; [ ma27 ]; + }; +} |