main
 1#!/usr/bin/env just --justfile
 2
 3set shell := ["bash", "-cu"]
 4
 5default_hostname := `hostname`
 6current_username := `whoami`
 7
 8# Build a system profile
 9build hostname=default_hostname *flags:
10    nh os build -f ./default.nix nixosConfigurations.{{hostname}} \
11        --hostname={{hostname}} {{flags}}
12
13# Build a system profile, make it boot default
14build-boot hostname=default_hostname *flags:
15    nh os boot -f ./default.nix nixosConfigurations.{{hostname}} \
16        --hostname={{hostname}} {{flags}}
17
18# Build and activate a system profile, make it boot default
19build-switch hostname=default_hostname *flags:
20    nh os switch -f ./default.nix nixosConfigurations.{{hostname}} \
21        --hostname={{hostname}} {{flags}}
22
23# Build and activate standlaone home manager profile for current user
24build-home *flags:
25    nh home switch -f ./default.nix 'homeConfigurations.{{current_username}}@{{default_hostname}}' \
26        {{flags}}
27
28# Build a system profile to a vm
29build-vm hostname=default_hostname *flags:
30    nh os build-vm -f ./default.nix nixosConfigurations.{{hostname}} \
31        --hostname={{hostname}} {{flags}}
32
33# Build custom nixos installer for specific arch
34build-installer arch="x86_64":
35    nix build .#nixosConfigurations.nixos-live-{{arch}}.config.system.build.isoImage
36
37# Write flake-files config into "flake.nix"
38write-flake:
39    nix run .#write-flake
40    nix flake lock