Given the following flake it outputs the generated image to result/nixos.qcow2
. How can I tell it to copy that file out of the nix store and somewhere else upon completion?
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager.url = "github:nix-community/home-manager/release-24.05";
unstablepkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, unstablepkgs, home-manager, nixos-generators, ... }: let
system = "x86_64-linux";
unstable = import unstablepkgs {
inherit system;
config.allowUnfree = true;
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
packages.x86_64-darwin = {
default = nixos-generators.nixosGenerate {
inherit system;
modules = [
./hardware-configuration.nix
./configuration.nix
];
format = "qcow";
specialArgs = {
inherit pkgs unstable home-manager;
diskSize = 100 * 1024;
};
};
};
};
}