From a7cdc4d20d4cd07d2fe555c8a82feac55c0fc04a Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 28 Aug 2025 13:35:52 +0200 Subject: [PATCH] Add some documentation to the readme and justfile --- README.md | 5 ++++- justfile | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31f5291..802719f 100644 --- a/README.md +++ b/README.md @@ -56,4 +56,7 @@ The secrets are managed in sops files within the hosts folders, there is only on ``nix-shell -p sops --run "sops ./nixos/hosts//secrets/sops.yaml"`` -This requires your system to have the keyfile available for sops to use, by default sops looks in the sops/age folder in your user folder for a keys.txt file with the private key. You can change this behaviour by setting the **\$SOPS_AGE_KEY_FILE** environment variable, or setting the **\$SOPS_AGE_KEY** environment variable to the key itself. \ No newline at end of file +This requires your system to have the keyfile available for sops to use, by default sops looks in the sops/age folder in your user folder for a keys.txt file with the private key. You can change this behaviour by setting the **\$SOPS_AGE_KEY_FILE** environment variable, or setting the **\$SOPS_AGE_KEY** environment variable to the key itself. + +### [Just](https://github.com/casey/just) +This repo uses just as a command runner for setting up and building the nixos files more easily. The programs needed to run all the commands are nix, just, and nom (nix output monitor). The commands you can use can be found in the justfile (named justfile in the root of this repo). This is purely for convenience, it doesn't add anything you could not manually do, it just automates a lot of steps. diff --git a/justfile b/justfile index 0406689..dba9460 100644 --- a/justfile +++ b/justfile @@ -1,22 +1,29 @@ +# Build the nixos configuration and switch to it build: sudo echo "sudo check..." && sudo nixos-rebuild --log-format internal-json -v switch --flake .# --show-trace |& nom --json +# Build the nixos configuration bot don't switch to it until a reboot boot: sudo echo "sudo check..." && sudo nixos-rebuild --log-format internal-json -v boot --flake .# --show-trace |& nom --json +# Run the nix flake in the nix repl run: nix-repl -f flake:nixpkgs +# Check the nix configuration for errors test: sudo echo "sudo check..." && sudo nix flake check --show-trace --log-format internal-json -v |& nom --json +# Update the flake lock update: nix flake update --log-format internal-json -v |& nom --json && zsh +# Clean your nix store and optimize it clean: sudo nix-collect-garbage sudo nix-store --optimise +# Set up the commit hook for testing before doing a commit setup: #!/run/current-system/sw/bin/bash -e if [ -s ./.git/hooks/pre-commit ]; then @@ -30,8 +37,8 @@ setup: else echo "just test" >> ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit fi - +# Make sure all the git actions of pulling, adding all files, committing, and pushing are done in one command push: git pull git add *