Skip to content

Commit

Permalink
enable completions
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Aug 6, 2023
1 parent 74750e0 commit bd750f9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions spaghetto/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@

src = spago-fod;

nativeBuildInputs = [ tools.nodejs ];
meta = {
description = "PureScript package manager and build tool";
};

nativeBuildInputs = [ tools.nodejs pkgs.installShellFiles ];

installPhase = ''
PACKAGE=$out/node_modules/spago
Expand All @@ -131,9 +135,17 @@
chmod +x $BIN
patchShebangs $BIN
SPAGO=$out/bin/spago
mkdir -p $out/bin
ln -s $BIN $out/bin/spago
ln -s $BIN $SPAGO
BASH_COMPLETIONS=$out/share/bash-completion/completions/
mkdir -p $BASH_COMPLETIONS
$SPAGO --bash-completion-script $SPAGO > $BASH_COMPLETIONS/spago
'';

# TODO https://discourse.nixos.org/t/adding-bash-completion-for-a-package/3947/2
};

bundle-spago = pkgs.writeShellScriptBin "bundle-spago" ''
Expand Down Expand Up @@ -174,6 +186,10 @@
])
;
};

devShells.spago = pkgs.devshell.mkShell {
commands = [{ package = packages.spago; category = "tools"; }];
};
in
{
inherit devShells packages;
Expand Down

0 comments on commit bd750f9

Please sign in to comment.