shell.nix: migrate to Just as command runner

This commit is contained in:
Gabriel Arazas 2025-02-01 22:15:37 +08:00
parent e167545d09
commit 2865c94f52
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 27 additions and 37 deletions

26
Justfile Normal file
View File

@ -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

View File

@ -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

View File

@ -7,6 +7,7 @@ in pkgs.mkShell {
# My internal applications.
run-workflow-in-vm
just
age
asciidoctor
disko