mirror of
https://github.com/davegallant/nix-config
synced 2025-08-06 11:23:40 +00:00
Switch to a Makefile
This commit is contained in:
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
SHELL := bash
|
||||
.SHELLFLAGS := -eu -o pipefail -c
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
HOSTAME ?= $(shell hostname)
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
SWITCH_CMD := sudo nixos-rebuild -I nixos-config="machines/$(HOSTNAME)/configuration.nix" switch --flake '.\#'
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
SWITCH_CMD := exec darwin-rebuild switch --flake .
|
||||
endif
|
||||
|
||||
switch:
|
||||
$(SWITCH_CMD)
|
||||
|
||||
update:
|
||||
nix flake update
|
Reference in New Issue
Block a user