From 2865c94f523e7c8fdeb88685dcbffd7589e461a1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 1 Feb 2025 22:15:37 +0800 Subject: [PATCH] shell.nix: migrate to Just as command runner --- Justfile | 26 ++++++++++++++++++++++++++ Makefile | 37 ------------------------------------- shell.nix | 1 + 3 files changed, 27 insertions(+), 37 deletions(-) create mode 100644 Justfile delete mode 100644 Makefile diff --git a/Justfile b/Justfile new file mode 100644 index 00000000..641419ef --- /dev/null +++ b/Justfile @@ -0,0 +1,26 @@ +default: + just --list + +update: + git checkout -- flake.lock + nix flake update --commit-lock-file + +# Build a package from `pkgs/` folder. +pkg-build PKG: + nix-build pkgs -A {{PKG}} + +# Build Firefox addons. +pkg-build-firefox-addons: + mozilla-addons-to-nix ./pkgs/firefox-addons/firefox-addons.json ./pkgs/firefox-addons/default.nix + +# Live server for project website. +docs-serve: + hugo -s ./docs serve + +# Build the project website. +docs-build: + hugo -s ./docs/ + +# Deploy NixOS system. +deploy-nixos HOST: + deploy '.#nixos-${HOST}' --skip-checks diff --git a/Makefile b/Makefile deleted file mode 100644 index bc311aa4..00000000 --- a/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -ROOT := /mnt -HOST := ni - -.PHONY: install -install: - nixos-install --flake ".#${HOST}" --root ${ROOT} - -.PHONY: switch -switch: - nixos-rebuild --flake ".#${HOST}" switch - -.PHONY: test -test: - nixos-rebuild --flake ".#${HOST}" dry-activate - -.PHONY: update -update: - git checkout -- flake.lock - nix flake update --commit-lock-file - -.PHONY: update_with_forked_inputs -update_with_forked_inputs: - nix flake lock \ - --override-input guix-overlay git+file:///home/foo-dogsquared/library/projects/software/nix-overlay-guix/ \ - --override-input dotfiles git+file:///home/foo-dogsquared/library/dotfiles/ - -.PHONY: docs-serve -docs-serve: - nix develop '.#docs' --impure -c hugo -s ./docs serve - -.PHONY: docs-build -docs-build: - nix develop '.#docs' --impure -c hugo -s ./docs/ - -.PHONY: deploy -deploy: - nix develop --impure -c deploy '.#nixos-${HOST}' --skip-checks diff --git a/shell.nix b/shell.nix index 2902c8fd..d37b6223 100644 --- a/shell.nix +++ b/shell.nix @@ -7,6 +7,7 @@ in pkgs.mkShell { # My internal applications. run-workflow-in-vm + just age asciidoctor disko