-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
82 lines (64 loc) · 2.46 KB
/
Taskfile.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
version: "3"
env:
# Trim domain suffix from hostname
HOSTNAME:
sh: hostname -s
# MacOS hostname is flapping, so forcefully set the proper one
HOSTNAME_HACK: '{{ .HOSTNAME | replace "Mac" "Bobbery" }}'
tasks:
default: task --list
hostname: echo $HOSTNAME_HACK
# Nix -----------------------------------------------------------------------
nix:install:
desc: Install Nix
cmd: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
nix:uninstall:
desc: Uninstall Nix
cmd: /nix/nix-installer uninstall
# https://docs.determinate.systems/flakehub/faq/#upgrade-nix
nix:upgrade:
desc: Upgrade Nix
cmd: sudo nix upgrade-nix --nix-store-paths-url https://releases.nixos.org/nix/nix-2.18.1/fallback-paths.nix
nix:update:
aliases: [ up ]
desc: Update Nix flake inputs
cmd: nix flake update
nix:gc:
aliases: [ gc ]
desc: Remove unused objects from the Nix store
cmds:
- nix-collect-garbage --delete-old
- sudo nix-collect-garbage --delete-old
nix:repl:
desc: Launch a repl for this Nix flake
cmds:
- echo 'To load flake config, type `:lf .#` in the repl'
- nix repl
# NixOS ---------------------------------------------------------------------
nixos:switch:
desc: Compile and activate NixOS config
cmd: nixos-rebuid switch --use-remote-sudo --flake .#$HOSTNAME_HACK
nixos:switch:tec:
aliases: [ tec ]
desc: Compile and activate NixOS config (tec)
cmds:
- rsync --recursive --delete --exclude='.git*' --filter='dir-merge,- .gitignore' $PWD/* [email protected]:~/nix-config
- ssh [email protected] 'nixos-rebuild switch --use-remote-sudo --flake ~/nix-config#tec'
# Darwin --------------------------------------------------------------------
darwin:install:
desc: Install nix-darwin
cmds:
- nix build .#darwinConfigurations.$HOSTNAME_HACK.system
- ./result/sw/bin/darwin-rebuild switch --flake .#$HOSTNAME_HACK
darwin:switch:
aliases: [ mac ]
desc: Compile and activate nix-darwin config
cmd: /run/current-system/sw/bin/darwin-rebuild switch --flake .#$HOSTNAME_HACK
# Home ----------------------------------------------------------------------
home:install:
desc: Install Home Manager
cmd: nix run .#homeConfigurations.$HOSTNAME_HACK.activationPackage
home:switch:
aliases: [ home ]
desc: Compile and activate Home Manager config
cmd: home-manager switch --flake .#$HOSTNAME_HACK