aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-15 22:03:02 -0600
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-15 22:03:02 -0600
commit69a5a1909e3481ddeb41d4c96f3c145413a383d0 (patch)
tree22852a056647d9e31e9248f739703e7023da48ac
parentc4f485441a92135bf0d2829a92e7ba4f0219b0d5 (diff)
cleanup makefile
-rw-r--r--Makefile29
-rw-r--r--macos.local/.flake/flake.lock69
2 files changed, 74 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
diff --git a/macos.local/.flake/flake.lock b/macos.local/.flake/flake.lock
new file mode 100644
index 0000000..500d06d
--- /dev/null
+++ b/macos.local/.flake/flake.lock
@@ -0,0 +1,69 @@
+{
+ "nodes": {
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1734093295,
+ "narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nix-darwin": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1733570843,
+ "narHash": "sha256-sQJAxY1TYWD1UyibN/FnN97paTFuwBw3Vp3DNCyKsMk=",
+ "owner": "LnL7",
+ "repo": "nix-darwin",
+ "rev": "a35b08d09efda83625bef267eb24347b446c80b8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "LnL7",
+ "repo": "nix-darwin",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1734126203,
+ "narHash": "sha256-0XovF7BYP50rTD2v4r55tR5MuBLet7q4xIz6Rgh3BBU=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "71a6392e367b08525ee710a93af2e80083b5b3e2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "home-manager": "home-manager",
+ "nix-darwin": "nix-darwin",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}