move create-devenv alias to an exec alias

This commit is contained in:
cswimr 2025-01-13 15:43:30 -06:00
parent 375441b5d2
commit 1d6bdf6187
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -96,6 +96,15 @@ def _edit(args):
return ["$EDITOR", *args]
return ["$VISUAL", *args]
@aliases.register
def _create_devenv(args):
if not args:
template = "simple"
else:
template = args[0]
run(["nix", "flake", "init", "--template", f"github:cswimr/dev-flakes#{template}"], cwd=Path.cwd(), exit_on_error=False)
run(["direnv", "allow"], cwd=Path.cwd())
alias_dictionary = {
"ff": "fastfetch",
@ -118,7 +127,6 @@ alias_dictionary = {
"lsa": "eza -lah --time-style=long-iso --icons=auto --hyperlink",
"tree": "eza --tree --git-ignore --time-style=long-iso --icons=auto --hyperlink",
"create-devenv": "nix flake init --template github:cachix/devenv and direnv allow",
"nixpkgs-update": "nix run --option extra-substituters 'https://nix-community.cachix.org/' --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' github:ryantm/nixpkgs-update --",
"nixrc": "edit /etc/nixos",