Merge pull request #163441 from maralorn/nom-zsh-completion
This commit is contained in:
commit
f262cec4ab
2 changed files with 22 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
filepath,
|
filepath,
|
||||||
generic-optics,
|
generic-optics,
|
||||||
HUnit,
|
HUnit,
|
||||||
|
installShellFiles,
|
||||||
lib,
|
lib,
|
||||||
lock-file,
|
lock-file,
|
||||||
MemoTrie,
|
MemoTrie,
|
||||||
|
@ -140,11 +141,18 @@ mkDerivation {
|
||||||
maintainers = with lib.maintainers; [maralorn];
|
maintainers = with lib.maintainers; [maralorn];
|
||||||
passthru.updateScript = ./update.sh;
|
passthru.updateScript = ./update.sh;
|
||||||
testTarget = "unit-tests";
|
testTarget = "unit-tests";
|
||||||
|
buildTools = [installShellFiles];
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
cat > $out/bin/nom-build << EOF
|
cat > $out/bin/nom-build << EOF
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
${expect}/bin/unbuffer nix-build "\$@" 2>&1 | exec $out/bin/nom
|
${expect}/bin/unbuffer nix-build "\$@" 2>&1 | exec $out/bin/nom
|
||||||
EOF
|
EOF
|
||||||
chmod a+x $out/bin/nom-build
|
chmod a+x $out/bin/nom-build
|
||||||
|
installShellCompletion --zsh --name _nom-build ${
|
||||||
|
builtins.toFile "completion.zsh" ''
|
||||||
|
#compdef nom-build
|
||||||
|
compdef nom-build=nix-build
|
||||||
|
''
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,16 +21,29 @@ cat > "$derivation_file" << EOF
|
||||||
# This file has been autogenerate with cabal2nix.
|
# This file has been autogenerate with cabal2nix.
|
||||||
# Update via ./update.sh"
|
# Update via ./update.sh"
|
||||||
EOF
|
EOF
|
||||||
cabal2nix --extra-arguments expect --extra-arguments runtimeShell --maintainer maralorn "https://github.com/maralorn/nix-output-monitor/archive/refs/tags/${new_version}.tar.gz" | head -n-1 >> "$derivation_file"
|
|
||||||
|
cabal2nix \
|
||||||
|
--extra-arguments expect \
|
||||||
|
--extra-arguments runtimeShell\
|
||||||
|
--extra-arguments installShellFiles\
|
||||||
|
--maintainer maralorn \
|
||||||
|
"https://github.com/maralorn/nix-output-monitor/archive/refs/tags/${new_version}.tar.gz" \
|
||||||
|
| head -n-1 >> "$derivation_file"
|
||||||
|
|
||||||
cat >> "$derivation_file" << EOF
|
cat >> "$derivation_file" << EOF
|
||||||
passthru.updateScript = ./update.sh;
|
passthru.updateScript = ./update.sh;
|
||||||
testTarget = "unit-tests";
|
testTarget = "unit-tests";
|
||||||
|
buildTools = [ installShellFiles ];
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
cat > \$out/bin/nom-build << EOF
|
cat > \$out/bin/nom-build << EOF
|
||||||
#!\${runtimeShell}
|
#!\${runtimeShell}
|
||||||
\${expect}/bin/unbuffer nix-build "\\\$@" 2>&1 | exec \$out/bin/nom
|
\${expect}/bin/unbuffer nix-build "\\\$@" 2>&1 | exec \$out/bin/nom
|
||||||
EOF
|
EOF
|
||||||
chmod a+x \$out/bin/nom-build
|
chmod a+x \$out/bin/nom-build
|
||||||
|
installShellCompletion --zsh --name _nom-build \${builtins.toFile "completion.zsh" ''
|
||||||
|
#compdef nom-build
|
||||||
|
compdef nom-build=nix-build
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in a new issue