Improved justfile script env caching

This commit is contained in:
2026-04-07 13:05:41 +01:00
parent c4d74f74b8
commit 2ce738fc0e
7 changed files with 19 additions and 9 deletions
+1
View File
@@ -0,0 +1 @@
use flake
+1
View File
@@ -1 +1,2 @@
nix.conf nix.conf
.direnv
+11
View File
@@ -56,6 +56,17 @@
avatar = "/var/lib/AccountsService/icons/cianh"; avatar = "/var/lib/AccountsService/icons/cianh";
}; };
in { in {
# A temporary devshell for running system management functions
devShells."x86_64-linux".default = let
pkgs = import nixpkgs {system = "x86_64-linux";};
in
pkgs.mkShell {
packages = [
pkgs.babashka
(pkgs.python3.withPackages (ps: with ps; [typer rich]))
];
};
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = { nixosConfigurations = {
+3 -3
View File
@@ -99,12 +99,12 @@ cleanup days="":
# Open the editor (nvim, yazi, or heh) for a target # Open the editor (nvim, yazi, or heh) for a target
edit target: edit target:
@scripts/edit.py "{{target}}" @direnv exec . scripts/edit.py "{{target}}"
# Edit packages.nix for a specific system/user (run 'just packages help' for flags) # Edit packages.nix for a specific system/user (run 'just packages help' for flags)
packages *flags: packages *flags:
@scripts/packages.bb {{flags}} @direnv exec . scripts/packages.bb {{flags}}
# Bootstrap a fresh system from the repo # Bootstrap a fresh system from the repo
bootstrap: bootstrap:
@scripts/bootstrap.py @direnv exec . scripts/bootstrap.py
+1 -2
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env nix-shell #!/usr/bin/env python3
#!nix-shell -i python3 -p "python3.withPackages(ps: with ps; [ typer rich ])"
import os import os
import sys import sys
import subprocess import subprocess
+1 -2
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env nix-shell #!/usr/bin/env python3
#!nix-shell -i python3 -p "python3.withPackages(ps: with ps; [ typer rich ])"
import typer import typer
import subprocess import subprocess
from pathlib import Path from pathlib import Path
+1 -2
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env nix-shell #!/usr/bin/env bb
#!nix-shell -i bb -p babashka
(require '[babashka.cli :as cli] (require '[babashka.cli :as cli]
'[babashka.process :refer [shell]] '[babashka.process :refer [shell]]