Skip to content

Commit

Permalink
Setup just runner and create recipe to simplify regular tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
alapshin committed Nov 23, 2023
1 parent 54143f3 commit e942359
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -euo pipefail

nix shell nixpkgs#sops --command ci/build.sh check
nix shell nixpkgs#sops nixpkgs#just --command "ust check"
33 changes: 33 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
secrets := "secrets/accounts.json"
export SOPS_AGE_FILE := env("SOPS_AGE_FILE", join(env('XDG_CONFIG_HOME'), "sops/age/keys.txt"))

default: rebuild

check:
nix flake check

update:
nix flake update

reset:
#!/usr/bin/env bash
for f in {{secrets}}; do
git restore "${f}"
done;
encrypt:
#!/usr/bin/env bash
for f in {{secrets}}; do
sops --encrypt --in-place "${f}"
done;

decrypt:
#!/usr/bin/env bash
for f in {{secrets}}; do
sops --decrypt --in-place "${f}"
done;
rebuild: decrypt && reset
-sudo nixos-rebuild switch --flake ".#"

1 change: 1 addition & 0 deletions users/alapshin/home/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, ...
}: {
home.packages = with pkgs; [
just
zeal
# hadolint
];
Expand Down

0 comments on commit e942359

Please sign in to comment.