1
0
Fork 0

Merge pull request 'justfile: add recipe `run-vm`' (!64) from run-vm into main

Reviewed-on: Drift/pvv-nixos-config#64
Reviewed-by: Oystein Kristoffer Tveit <oysteikt@pvv.ntnu.no>
This commit is contained in:
Peder Bergebakken Sundt 2024-08-15 21:14:29 +02:00
commit c780f7954c
3 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
result*
/configuration.nix
/.direnv/
*.qcow2

View File

@ -139,4 +139,12 @@
acceptTerms = true;
defaults.email = "drift@pvv.ntnu.no";
};
# Let's not spam LetsEncrypt in `nixos-rebuild build-vm` mode:
virtualisation.vmVariant = {
security.acme.defaults.server = "https://127.0.0.1";
security.acme.preliminarySelfsigned = true;
users.users.root.initialPassword = "root";
};
}

View File

@ -10,6 +10,10 @@ check:
build-machine machine=`just _a_machine`:
{{nom}} build .#nixosConfigurations.{{ machine }}.config.system.build.toplevel
run-vm machine=`just _a_machine`:
nixos-rebuild build-vm --flake .#{{ machine }}
QEMU_NET_OPTS="hostfwd=tcp::8080-:80,hostfwd=tcp::8081-:443,hostfwd=tcp::2222-:22" ./result/bin/run-*-vm
@update-inputs:
nix eval .#inputs --apply builtins.attrNames --json \
| jq '.[]' -r \