it builds now!

This commit is contained in:
2026-04-22 19:04:29 +02:00
parent 5948d4ec05
commit be53b62967
3 changed files with 41 additions and 94 deletions

View File

@@ -1,49 +1,19 @@
{ inputs = {
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/25.11";
};
outputs = { flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
outputs =
{ self, nixpkgs }:
{
packages.x86_64-linux.default =
(nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
base = { lib, modulesPath, ... }: {
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
# https://github.com/utmapp/UTM/issues/2353
networking.nameservers = lib.mkIf pkgs.stdenv.isDarwin [ "8.8.8.8" ];
virtualisation = {
graphics = false;
host = { inherit pkgs; };
};
};
machine = nixpkgs.lib.nixosSystem {
system = builtins.replaceStrings [ "darwin" ] [ "linux" ] system;
modules = [ base ./module.nix ];
};
program = pkgs.writeShellScript "run-vm.sh" ''
export NIX_DISK_IMAGE=$(mktemp -u -t nixos.qcow2)
trap "rm -f $NIX_DISK_IMAGE" EXIT
${machine.config.system.build.vm}/bin/run-nixos-vm
'';
in
{ packages = { inherit machine; };
apps.default = {
type = "app";
program = "${program}";
};
}
);
modules = [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
./module.nix
];
}).config.system.build.vm;
};
}