-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (50 loc) · 1.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.PHONY: system
system:
ifeq ($(shell uname -s), Darwin)
darwin-rebuild switch --flake .
# TODO: add full macos equivalent
# relaunch skhd
sudo launchctl bootout gui/$(shell id -u) ~/Library/LaunchAgents/org.nixos.skhd.plist && sudo launchctl bootstrap gui/$(shell id -u) ~/Library/LaunchAgents/org.nixos.skhd.plist
else
sudo nixos-rebuild switch --flake .
@echo "Checking for bad systemd user units..."
systemctl --user list-unit-files | awk '{print $1}' | while read unit; do systemctl --user status "$unit" 2>&1 | grep -q 'bad-setting' && echo "Bad setting in $unit" || true; done
endif
# if using home-manager externally to config
# home-manager switch
# buggy, be careful to only run this for bootstrapping.
.PHONY: init
init:
nix run home-manager/master -- init --switch
.PHONY: docs
docs: README.norg
nvim --headless -c "edit README.norg" -c "Neorg export to-file README.md" -c "q"
.PHONY: bleed
bleed:
nix flake lock --update-input nixpkgs-bleeding
.PHONY: update
update:
nix flake update
# TODO: make this work on macos
.PHONY: diff
diff:
nix run nixpkgs\#nvd -- diff /run/booted-system /run/current-system
# `nix flake check` only works on nixos because of
# https://github.com/NixOS/nix/issues/4265
# The above command basically insists on checking things it does not have to.
# Here is excerpt from `nix flake check --help`:
# Evaluation checks
# · checks.system.name
# · defaultPackage.system
# · devShell.system
# · devShells.system.name
# · nixosConfigurations.name.config.system.build.toplevel
# · packages.system.name
# It would be cool to disable nixosConfigurations, but oh well. Maybe one day :).
.PHONY: check
check:
nix flake check
nix run nixpkgs#deadnix -- -f # check for dead code, fails if any
.PHONY: check-all
check-all:
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix flake check --impure --all-systems