From 69a5a1909e3481ddeb41d4c96f3c145413a383d0 Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Sun, 15 Dec 2024 22:03:02 -0600 Subject: cleanup makefile --- Makefile | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3