flake := ".?submodules=1" user := env("USER", "alin") hostname := env("hostname", env("HOSTNAME", `hostname`)) export NH_FILE := "." test: nix flake check --all-systems {{ flake }} build *args: nh home switch --file . "homeConfigurations.{{ user }}@{{ hostname }}" {{ args }} run action="switch" *args: #!/usr/bin/env fish set --local os $(string split -- - $system)[-1] switch $os: case "darwin": nh darwin {{ action }} --file . darwinConfigurations.{{ hostname }} {{ args }} case "linux": nh os {{ action }} --file . nixosConfigurations.{{ hostname }} {{ args }} case *: echo "Couldn't find a supported os in \$system: $system" end