I hate ai
This commit is contained in:
58
flake.nix
58
flake.nix
@@ -1,19 +1,49 @@
|
|||||||
{
|
{ inputs = {
|
||||||
inputs = {
|
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/25.11";
|
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/23.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { flake-utils, nixpkgs, ... }:
|
||||||
{ self, nixpkgs }:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
{
|
let
|
||||||
packages.x86_64-linux.default =
|
pkgs = nixpkgs.legacyPackages."${system}";
|
||||||
(nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
|
|
||||||
modules = [
|
base = { lib, modulesPath, ... }: {
|
||||||
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
|
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
|
||||||
./module.nix
|
|
||||||
];
|
# https://github.com/utmapp/UTM/issues/2353
|
||||||
}).config.system.build.vm;
|
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}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user