Skip to content

Commit

Permalink
feat: add devshell aliases and vars
Browse files Browse the repository at this point in the history
  • Loading branch information
arichtman committed Nov 16, 2024
1 parent 5b7d334 commit 2c7dbfc
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 32 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
use flake .
watch_file shells/myshell/*
7 changes: 7 additions & 0 deletions modules/home/default-home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
ls = "exa";
ll = "exa -las new";
cls = "clear";
dea = "direnv allow";
der = "diren reload";
vi = "hx";
vim = "hx";
nano = "hx";
Expand All @@ -39,8 +41,13 @@
gb = "git branch";
gd = "git diff";
gf = "git fetch";
grc = "git rebase --continue";
gra = "git rebase --abort";
grpo = "git remote prune origin";
gau = "git add --update";
gCnv = "git commit --no-verify";
gCam = "git commit --amend";
gCC = "git commit --amend --no-verify";
gbl = "git blame -wCCC";
nfu = "nix flake update --commit-lock-file";
sci = "step certificate inspect";
Expand Down
78 changes: 46 additions & 32 deletions shells/myshell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,50 @@
pkgs,
mkShell,
...
}:
mkShell {
meta.platforms = ["aarch64-darwin" "x86_64-linux" "x86_64-darwin"];
packages = with pkgs; [
# Minimal development stuff
git
ripgrep
jq
yq
helix
pre-commit
deploy-rs
statix
deadnix
# Kubernetes stuff
kubectl
kubectx
kubernetes-helm
# Cilium
cilium-cli
hubble
# Certificates and secrets
xkcdpass
step-cli
openssl
# Flake tooling
snowfallorg.thaw
}: let
# Ref: https://github.com/direnv/direnv/issues/73#issuecomment-2478178424
mkScript = name: text: pkgs.writeShellScriptBin name text;
scripts = [
(mkScript "k" ''kubectl "$@"'')
];
shellHook = ''
pre-commit install --install-hooks
echo "Entering the nix Z O N E"
'';
}
devEnvVars = {
myvar = "myval";
};
in
mkShell (
devEnvVars
// {
meta.platforms = ["aarch64-darwin" "x86_64-linux" "x86_64-darwin"];
packages = with pkgs;
[
# Minimal development stuff
git
ripgrep
jq
yq
helix
pre-commit
deploy-rs
statix
deadnix
# Kubernetes stuff
kubectl
kubectx
kubernetes-helm
# Cilium
cilium-cli
hubble
# Certificates and secrets
xkcdpass
step-cli
openssl
# Flake tooling
snowfallorg.thaw
]
++ scripts;
shellHook = ''
pre-commit install --install-hooks
echo "Entering the nix Z O N E"
'';
}
)

0 comments on commit 2c7dbfc

Please sign in to comment.