mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 18:24:59 +03:00
93e10d0aea
* WIP: eval target * rename nixos-build to nixos-generate * rename target to format * allow to pass arbitrary format paths * add --help option * add --list option * port the rest of the formats * add short options * be more precise with the file selection * use new trick I learned * support the --run option for the no-gui version: ./nixos-generate --run -f vm-no-gui * document * fixup! port the rest of the formats * fix kexec-bundle
25 lines
518 B
Nix
25 lines
518 B
Nix
{ nixpkgs ? <nixpkgs>
|
|
, configuration ?
|
|
import "${toString nixpkgs}/nixos/lib/from-env.nix" "NIXOS_CONFIG" <nixos-config>
|
|
, formatConfig
|
|
, system ? builtins.currentSystem
|
|
}:
|
|
let
|
|
module = { lib, ... }: {
|
|
options = {
|
|
formatAttr = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Declare the default attribute to build";
|
|
};
|
|
};
|
|
};
|
|
in
|
|
import "${toString nixpkgs}/nixos/lib/eval-config.nix" {
|
|
inherit system;
|
|
modules = [
|
|
module
|
|
formatConfig
|
|
configuration
|
|
];
|
|
}
|