Makefile: Add cached & no-nixconf targets.

This commit is contained in:
Dmitry Voronin 2024-12-09 10:13:04 +03:00
parent 50fabe73f8
commit 9878e47921
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -13,10 +13,8 @@ android:
boot: fix-ulimit fix-unlock
nixos-rebuild boot $(options) --flake $(flake)
boot-no-nixconf: fix-ulimit fix-unlock
mv /etc/nix/nix.conf /etc/nix/nix.conf_; \
nixos-rebuild boot $(options) --flake $(flake); \
mv /etc/nix/nix.conf_ /etc/nix/nix.conf
cached:
$(eval options := $(subst eval-cache false,eval-cache true,$(options)))
check:
nix flake check --show-trace
@ -30,6 +28,10 @@ fix-ulimit:
fix-unlock:
pkill nixos-rebuild || true
# HACK: Bring back the nix config.
fix-nixconf:
mv /etc/nix/nix.conf_ /etc/nix/nix.conf
gc:
nix-collect-garbage -d
# nix-store --gc
@ -60,6 +62,9 @@ install-hm:
live:
nix build -o live $(options) $(flake)#nixosConfigurations.live.config.system.build.isoImage
no-nixconf:
mv /etc/nix/nix.conf /etc/nix/nix.conf_ || true
reboot: boot
reboot