aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKenny Ballou <kb@devnulllabs.io>2022-02-10 10:48:46 -0700
committerKenny Ballou <kb@devnulllabs.io>2022-03-14 11:14:48 -0600
commit0139d8098bc9e88090784c4f88820d42e6d117e5 (patch)
treeff3dcaaa1204250f886b3d51d1d54650ed25444b /Makefile
parent1e161dbf25f1a127ac6e0677b473a2b2987536d6 (diff)
downloaddotfiles-0139d8098bc9e88090784c4f88820d42e6d117e5.tar.gz
dotfiles-0139d8098bc9e88090784c4f88820d42e6d117e5.tar.xz
not so initial guix home/system initial addition
As of today, I've been using guix system and home for about 3 weeks. The configuration is constantly evolving as I use it. Unlike the home-manager conversion of past, guix home adoption is happening much more slowly. Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 44 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 03929d2e..e1b4ac27 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,59 @@
NIX_FILES = $(shell find . name -name '*.nix' -type f)
MAX_AGE=14d
+CHANNEL_FILE=./config/guix/channels.scm
+HOSTS=h4x daeva eligos baal
+SYSTEMS=$(patsubst %,systems/%,$(HOSTS))
+HOMES=$(patsubst %,homes/%,$(HOSTS))
+HOSTNAME=$(shell hostname)
.PHONY: all
all: build
+.PHONY: list
+list:
+ @LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
+
+.PHONY: pull
+pull:
+ guix time-machine -C $(CHANNEL_FILE) -- pull
+
.PHONY: news
news:
- nix-shell --run "home-manager news"
+ guix time-machine -C $(CHANNEL_FILE) -- pull --news
+
+.PHONY: reconfigure-home
+reconfigure-home:
+ guix time-machine -C $(CHANNEL_FILE) -- home reconfigure homes/$(HOSTNAME).scm
+
+.PHONY: rollback-home
+ guix time-machine -C $(CHANNEL_FILE) -- home roll-back homes/$(HOSTNAME).scm
+
+.PHONY: reconfigure-system
+reconfigure-system:
+ sudo -E guix time-machine -C $(CHANNEL_FILE) -- system reconfigure systems/$(HOSTNAME).scm
-.PHONY: build
-build:
- nix-shell --run "home-manager build"
+.PHONY: rollback-system
+rollback-system:
+ sudo -E guix time-machine -C $(CHANNEL_FILE) -- system roll-back systems/$(HOSTNAME).scm
-.PHONY: switch
-switch:
- nix-shell --run "home-manager switch"
+.PHONY: lint
+lint:
+ guix lint --load-path=./ ./
.PHONY: clean
clean:
-rm -rv result
-nix-collect-garbage --delete-older-than $(MAX_AGE)
+
+.PHONY: all-systems
+all-systems: $(SYSTEMS)
+
+.PHONY: all-homes
+all-homes: $(HOMES)
+
+$(HOMES):
+ guix time-machine -C $(CHANNEL_FILE) -- home build $@.scm
+
+.PHONY: $(SYSTEMS)
+$(SYSTEMS):
+ guix time-machine -C $(CHANNEL_FILE) -- system build $@.scm