-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjustfile
72 lines (60 loc) · 2.67 KB
/
justfile
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
_default:
just --list
build profile:
nix build --json --no-link --print-build-logs ".#{{ profile }}"
check:
nix flake check
darwin-build profile="aarch64":
just build "darwinConfigurations.{{ profile }}.config.system.build.toplevel"
darwin-switch profile="aarch64":
darwin-rebuild switch --flake ".#{{ profile }}"
darwin-test profile="aarch64":
darwin-rebuild check --flake ".#{{ profile }}"
home-manager-build profile="aarch64-darwin":
just build "homeConfigurations.{{ profile }}.activationPackage"
home-manager-switch profile="aarch64-darwin":
nix run nixpkgs#home-manager switch --flake ".#{{ profile }}"
nixos-bootstrap destination username publickey:
ssh \
-o PubkeyAuthentication=no \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
{{destination}} " \
parted /dev/nvme0n1 -- mklabel gpt; \
parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB; \
parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100\%; \
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB; \
parted /dev/nvme0n1 -- set 3 esp on; \
sleep 1; \
mkfs.ext4 -L nixos /dev/nvme0n1p1; \
mkswap -L swap /dev/nvme0n1p2; \
mkfs.fat -F 32 -n boot /dev/nvme0n1p3; \
sleep 1; \
mount /dev/disk/by-label/nixos /mnt; \
mkdir -p /mnt/boot; \
mount /dev/disk/by-label/boot /mnt/boot; \
nixos-generate-config --root /mnt; \
sed --in-place '/system\.stateVersion = .*/a \
nix.extraOptions = \"experimental-features = nix-command flakes\";\n \
security.sudo.enable = true;\n \
security.sudo.wheelNeedsPassword = false;\n \
services.openssh.enable = true;\n \
services.openssh.settings.PasswordAuthentication = false;\n \
services.openssh.settings.PermitRootLogin = \"no\";\n \
users.mutableUsers = false;\n \
users.users.{{username}}.extraGroups = [ \"wheel\" ];\n \
users.users.{{username}}.initialPassword = \"{{username}}\";\n \
users.users.{{username}}.home = \"/home/{{username}}\";\n \
users.users.{{username}}.isNormalUser = true;\n \
users.users.{{username}}.openssh.authorizedKeys.keys = [ \"{{publickey}}\" ];\n \
' /mnt/etc/nixos/configuration.nix; \
nixos-install --no-root-passwd; \
reboot;"
nixos-build profile="x86_64":
just build "nixosConfigurations.{{ profile }}.config.system.build.toplevel"
nixos-test profile="x86_64":
nixos-rebuild test --flake ".#{{ profile }}"
nixos-switch profile="x86_64":
nixos-rebuild switch --flake ".#{{ profile }}"
update:
nix flake update