[TASK] Add build in current dir
This commit is contained in:
parent
97c029f623
commit
67ea1f0f39
52
Makefile
52
Makefile
@ -6,34 +6,56 @@ SHELL := $(shell which bash)
|
|||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
|
|
||||||
.PHONY: sync
|
|
||||||
sync:
|
|
||||||
sudo rsync -a --exclude='hardware-configuration.nix' nixos/ /etc/nixos/
|
|
||||||
sudo nixos-rebuild switch --flake /etc/nixos#cesium
|
|
||||||
sudo cp /etc/nixos/flake.lock nixos/flake.lock 2>/dev/null || true
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: sync-dry-run
|
|
||||||
sync-dry-run:
|
|
||||||
sudo rsync -a --dry-run --verbose --exclude='hardware-configuration.nix' nixos/ /etc/nixos/
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: add-pre-commit-hook
|
.PHONY: add-pre-commit-hook
|
||||||
add-pre-commit-hook:
|
add-pre-commit-hook:
|
||||||
printf '#!/bin/sh\nmake test\n' > .git/hooks/pre-commit
|
printf '#!/bin/sh\nmake test\n' > .git/hooks/pre-commit
|
||||||
chmod +x .git/hooks/pre-commit
|
chmod +x .git/hooks/pre-commit
|
||||||
|
|
||||||
|
#
|
||||||
|
# uses etc
|
||||||
|
#
|
||||||
|
|
||||||
|
.PHONY: sync-etc
|
||||||
|
sync-etc:
|
||||||
|
sudo rsync -a --exclude='hardware-configuration.nix' nixos/ /etc/nixos/
|
||||||
|
sudo nixos-rebuild switch --flake /etc/nixos#cesium
|
||||||
|
sudo cp /etc/nixos/flake.lock nixos/flake.lock 2>/dev/null || true
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: upgrade-etc
|
||||||
|
upgrade-etc:
|
||||||
|
sudo nix flake update /etc/nixos --commit-lock-file
|
||||||
|
sudo nixos-rebuild switch --flake /etc/nixos#cesium
|
||||||
|
sudo cp /etc/nixos/flake.lock nixos/flake.lock 2>/dev/null || true
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: sync-etc-dry-run
|
||||||
|
sync-etc-dry-run:
|
||||||
|
sudo rsync -a --dry-run --verbose --exclude='hardware-configuration.nix' nixos/ /etc/nixos/
|
||||||
|
|
||||||
|
#
|
||||||
|
# uses ./nixos
|
||||||
|
#
|
||||||
|
|
||||||
|
.PHONY: rebuild
|
||||||
|
rebuild:
|
||||||
|
sudo nixos-rebuild switch --flake path:$(CURDIR)/nixos
|
||||||
|
|
||||||
|
|
||||||
.PHONY: upgrade
|
.PHONY: upgrade
|
||||||
upgrade:
|
upgrade:
|
||||||
sudo nix flake update /etc/nixos
|
sudo nix flake update $(CURDIR)/nixos --commit-lock-file
|
||||||
sudo nixos-rebuild switch --flake /etc/nixos#cesium
|
sudo nixos-rebuild switch --flake path:$(CURDIR)/nixos
|
||||||
sudo cp /etc/nixos/flake.lock nixos/flake.lock 2>/dev/null || true
|
|
||||||
|
#
|
||||||
|
# for both
|
||||||
|
#
|
||||||
|
|
||||||
.PHONY: cleanup
|
.PHONY: cleanup
|
||||||
cleanup:
|
cleanup:
|
||||||
sudo nix-store --optimise && sudo nix-collect-garbage -d
|
sudo nix-store --optimise && sudo nix-collect-garbage -d
|
||||||
|
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
echo "Find nix files"
|
echo "Find nix files"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user