add image generation
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
16a2f66612
commit
55b7e407f1
37
flake.lock
generated
37
flake.lock
generated
@ -267,6 +267,42 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixlib": {
|
||||
"locked": {
|
||||
"lastModified": 1712450863,
|
||||
"narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "3c62b6a12571c9a7f65ab037173ee153d539905f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-generators": {
|
||||
"inputs": {
|
||||
"nixlib": "nixlib",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1716210724,
|
||||
"narHash": "sha256-iqQa3omRcHGpWb1ds75jS9ruA5R39FTmAkeR3J+ve1w=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "d14b286322c7f4f897ca4b1726ce38cb68596c94",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1717248095,
|
||||
@ -403,6 +439,7 @@
|
||||
"hyprland-contrib": "hyprland-contrib",
|
||||
"nix": "nix",
|
||||
"nix-index-database": "nix-index-database",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixos-modules": "nixos-modules",
|
||||
"nixpkgs": "nixpkgs",
|
||||
|
@ -74,6 +74,10 @@
|
||||
url = "github:Mic92/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-modules = {
|
||||
url = "github:SuperSandro2000/nixos-modules";
|
||||
|
@ -3,8 +3,15 @@ let
|
||||
inherit (inputs.nixpkgs.lib) mapAttrs;
|
||||
|
||||
getCfg = _: cfg: cfg.config.system.build.toplevel;
|
||||
getFormat =
|
||||
_: cfg: format:
|
||||
cfg.config.formats.${format};
|
||||
imageWrapper = format: mapAttrs getFormat outputs.nixosConfigurations format;
|
||||
in
|
||||
{
|
||||
inherit (outputs) formatter devShells;
|
||||
hosts = mapAttrs getCfg outputs.nixosConfigurations;
|
||||
install-isos = imageWrapper "install-iso";
|
||||
isos = imageWrapper "iso";
|
||||
qcow = imageWrapper "qcow";
|
||||
}
|
||||
|
11
modules/generators.nix
Normal file
11
modules/generators.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ inputs.nixos-generators.nixosModules.all-formats ];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user