nixos configurations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
628 B

4 months ago
4 months ago
  1. #!/usr/bin/env bash
  2. # Change into script dir.
  3. cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null || exit
  4. nixosDir=$(pwd)
  5. # Get short hostname to work with host specific configurations.
  6. host=$(hostname -s)
  7. if [[ -n $nixHostOverride ]]; then
  8. host=$nixHostOverride
  9. fi
  10. # Confirm host configuration is available; If not, we should not continue.
  11. if ! grep -q "nixosConfigurations.$host " flake.nix; then
  12. host="default"
  13. fi
  14. # Install NixOS.
  15. # shellcheck disable=SC2068
  16. nix --extra-experimental-features 'nix-command flakes' run 'github:nix-community/disko#disko-install' -- --impure --flake "path:$nixosDir/#$host" $@