From bfc1bb2da9be6bcb2c44892914cb309d17e37550 Mon Sep 17 00:00:00 2001 From: Zuckerberg Date: Sun, 18 Feb 2024 17:30:52 -0700 Subject: [PATCH] Use a makefile for utility snippets --- Makefile | 15 +++++++++++++++ common/default.nix | 1 + lockfile-update.sh | 4 ---- secrets/rekey.sh | 5 ----- update.sh | 6 ------ 5 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 Makefile delete mode 100755 lockfile-update.sh delete mode 100755 secrets/rekey.sh delete mode 100755 update.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..72d0ebd --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +# Lockfile utils +update-lockfile: + nix flake update --commit-lock-file +update-lockfile-without-commit: + nix flake update + +# Agenix utils +edit-secret: + cd secrets && agenix -e $(filter-out $@,$(MAKECMDGOALS)) +rekey-secrets: + cd secrets && agenix -r + +# NixOS utils +clean-old-nixos-profiles: + doas nix-collect-garbage -d diff --git a/common/default.nix b/common/default.nix index 018c3e8..dc6cc3a 100644 --- a/common/default.nix +++ b/common/default.nix @@ -61,6 +61,7 @@ lm_sensors picocom lf + gnumake ]; nixpkgs.config.allowUnfree = true; diff --git a/lockfile-update.sh b/lockfile-update.sh deleted file mode 100755 index 0035676..0000000 --- a/lockfile-update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash -p bash - -nix flake update --commit-lock-file \ No newline at end of file diff --git a/secrets/rekey.sh b/secrets/rekey.sh deleted file mode 100755 index 5341233..0000000 --- a/secrets/rekey.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -e - -agenix -r -git commit . -m "Rekey secrets" \ No newline at end of file diff --git a/update.sh b/update.sh deleted file mode 100755 index 700a22a..0000000 --- a/update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash -p bash - -git pull -nix flake update # intentionally ignore the lockfile -sudo nixos-rebuild switch --flake . \ No newline at end of file