aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 5 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 87445c1..b707efb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,7 @@
.PHONY: install update macos-update macos-install nixos-update nixos-install fonts
# Determine the current system from its hostname.
-# My university network changes my hostname on my laptop. I use the disgusting system_profiler pipeline to get the real hostname
-# if the uname command fails
+# My university network changes my hostname on my laptop. I use the disgusting system_profiler pipeline to get the real hostname if the uname command fails
SYSTEM := $(shell uname -n)
ifeq ($(wildcard src/$(project)/*),)
SYSTEM = $(shell system_profiler SPSoftwareDataType | grep "Computer Name" | xargs | sed 's/Computer Name: //' | sed 's/$$/.local/')
@@ -33,14 +32,11 @@ endif
# update by default, install first
all: update
update: install $(UPDATE_TARGET)
+ cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake
# install configs and any additional targets
install: $(CONFIGS) $(INSTALL_TARGET)
-# ignored files
-%.tar.gz:
- :
-
# install encrypted org configs
$(DSTDIR)/%: $(SRCDIR)/%.org.gpg
mkdir -p $(dir $@)
@@ -58,33 +54,18 @@ $(DSTDIR)/%: $(SRCDIR)/%
mkdir -p $(dir $@)
cp $< $@
-# install fonts
-fonts: $(DSTDIR)/$(FONTSDIR)/.ComputerModern $(DSTDIR)/$(FONTSDIR)/.SauceCodePro
- -fc-cache -f
-$(DSTDIR)/$(FONTSDIR)/.ComputerModern: $(SRCDIR)/$(FONTSDIR)/ComputerModern.tar.gz
- mkdir -p $(DSTDIR)/$(FONTSDIR)
- tar xf $(SRCDIR)/$(FONTSDIR)/ComputerModern.tar.gz -C $(DSTDIR)/$(FONTSDIR)
- touch $(DSTDIR)/$(FONTSDIR)/.ComputerModern
-$(DSTDIR)/$(FONTSDIR)/.SauceCodePro: $(SRCDIR)/$(FONTSDIR)/SauceCodePro.tar.gz
- mkdir -p $(DSTDIR)/$(FONTSDIR)
- tar xf $(SRCDIR)/$(FONTSDIR)/SauceCodePro.tar.gz -C $(DSTDIR)/$(FONTSDIR)
- touch $(DSTDIR)/$(FONTSDIR)/.SauceCodePro
-
-# macos update just runs brew upgrade
macos-update: install
- brew upgrade
+ nix flake update --flake $(DSTDIR)/.flake
+ darwin-rebuild switch --flake $(DSTDIR)/.flake
-# macos install tells System Events to update the wallpaper
+# macos install tells System Events to update the wallpaper after installation
macos-install: $(CONFIGS)
darwin-rebuild switch --flake $(DSTDIR)/.flake
osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"/$$HOME/.wallpaper\" as POSIX file"
-# nixos update backs up the flake lock file
nixos-update: install
nix flake update $(DSTDIR)/.flake
- cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake
sudo nixos-rebuild switch --flake $(DSTDIR)/.flake
-# nixos install runs nixos-rebuild switch to install everything declaratively
nixos-install: $(CONFIGS)
sudo nixos-rebuild switch --flake $(DSTDIR)/.flake