Files
nix/hosts/common/configs/user/console/nix-develop/default.nix
Nikolaos Karaolidis 6b366fc24a Re-add flake-utils
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-01-15 11:07:26 +00:00

39 lines
784 B
Nix

{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
lib,
inputs,
system,
...
}:
{
home-manager.users.${user}.programs.zsh = {
shellAliases.nd = "nix-develop";
initExtra =
let
devShells = lib.strings.concatStringsSep " " (
lib.attrsets.mapAttrsToList (key: _: key) inputs.self.devShells.${system}
);
in
''
nix-develop() {
if [ -z "$1" ]; then
echo "Usage: nix-develop <shell>"
return 1
fi
nix develop self#"$1" -c "$SHELL"
}
_nix-develop_completion() {
local shells=(${devShells})
compadd -- $shells
}
compdef _nix-develop_completion nix-develop
'';
};
}