Dmitriy Pleshevskiy
b703b69513
- make: fix rollback command - flake.lock: add disko module. - flake.lock: add impermanence module. - disko: add configuration to create luks-btrfs schema. - host/asus: add new filesystem configuration (luks-btrfs) - host/asus: mount user from old partition. - host/asus: add impermanence module to store system configuration.
78 lines
1.7 KiB
Makefile
78 lines
1.7 KiB
Makefile
NIX_RUN := nix run .\#
|
|
NIX_LOCK := nix flake lock
|
|
|
|
DEPS_EDITOR := \
|
|
nixeovim
|
|
|
|
DEPS_SYSTEM := \
|
|
nixpkgs \
|
|
nixpkgs-unstable \
|
|
hardware \
|
|
home-manager \
|
|
agenix \
|
|
wired \
|
|
nil
|
|
|
|
MACHINES := \
|
|
home \
|
|
asus-gl553vd
|
|
|
|
VPS := \
|
|
istal \
|
|
tatos
|
|
|
|
.PHONY: help
|
|
help:
|
|
bat -p Makefile
|
|
|
|
################################################################################
|
|
# Hosts
|
|
################################################################################
|
|
|
|
define machine_rule
|
|
.PHONY: $(1)
|
|
$(1): ;
|
|
# systemctl --user reset-failed
|
|
sudo nix run $(NIX_ARGS) .#switch/$(1) -- $(BUILD_ARGS)
|
|
endef
|
|
|
|
define vps_rule
|
|
.PHONY: $(1)
|
|
$(1): ; nix run .#deploy/$(1) -- $(BUILD_ARGS)
|
|
|
|
endef
|
|
|
|
$(foreach machine,$(MACHINES),$(eval $(call machine_rule,$(machine))))
|
|
$(foreach vps,$(VPS),$(eval $(call vps_rule,$(vps))))
|
|
|
|
.PHONY: rollback
|
|
rollback:
|
|
sudo nixos-rebuild switch --rollback
|
|
|
|
################################################################################
|
|
# Editor
|
|
################################################################################
|
|
|
|
.PHONY: neovim
|
|
neovim:
|
|
nix profile upgrade $(or $(NEOVIM_INDEX),$(shell nix profile list --json | jq '.elements | to_entries[] | select(.value.attrPath | endswith(".neovim-dev")) | .key'))
|
|
|
|
.PHONY: init-neovim
|
|
init-neovim:
|
|
nix profile install .#neovim-dev
|
|
|
|
################################################################################
|
|
# Deps
|
|
################################################################################
|
|
|
|
.PHONY: deps-editor
|
|
deps-editor:
|
|
$(NIX_LOCK) $(foreach dep,$(DEPS_EDITOR),--update-input $(dep))
|
|
|
|
.PHONY: deps-system
|
|
deps-system:
|
|
$(NIX_LOCK) $(foreach dep,$(DEPS_SYSTEM),--update-input $(dep))
|
|
|
|
.PHONY: deps
|
|
deps: deps-editor deps-system ;
|
|
|