it work now

This commit is contained in:
2026-04-22 19:48:16 +02:00
parent f3cf6f89ee
commit a865111b3b
3 changed files with 62 additions and 51 deletions

View File

@@ -1,31 +1,40 @@
{ inputs = {
{
inputs = {
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
nixpkgs.url = "github:NixOS/nixpkgs/25.11";
};
outputs = { flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{ flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages."${system}";
modulesPath = "${pkgs.path}/nixos/modules";
base = { lib, modulesPath, ... }: {
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
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" ];
# https://github.com/utmapp/UTM/issues/2353
networking.nameservers = lib.mkIf pkgs.stdenv.isDarwin [ "8.8.8.8" ];
virtualisation = {
graphics = false;
virtualisation = {
graphics = false;
host = { inherit pkgs; };
host = { inherit pkgs; };
};
};
};
machine = nixpkgs.lib.nixosSystem {
system = builtins.replaceStrings [ "darwin" ] [ "linux" ] system;
modules = [ base ./module.nix ];
modules = [
base
./module.nix
];
};
program = pkgs.writeShellScript "run-vm.sh" ''
@@ -37,13 +46,16 @@
'';
in
{ packages = { inherit machine; };
{
packages = { inherit (machine.config.system.build) vm; };
apps.default = {
type = "app";
defaultPackage = machine.config.system.build.vm;
program = "${program}";
};
}
apps.default = {
type = "app";
program = "${program}";
};
}
);
}