cerulean/nix/snow/flake/outputs/nixosConfigurations.nix

36 lines
1.1 KiB
Nix
Raw Normal View History

2026-03-17 22:45:46 +10:00
{lib, ...}: let
2026-03-15 01:10:36 +10:00
inherit
2026-03-17 22:45:46 +10:00
(lib)
mkOption
types
literalExpression
2026-03-15 01:10:36 +10:00
;
in {
2026-03-17 22:45:46 +10:00
options = {
outputs.nixosConfigurations = mkOption {
type = types.lazyAttrsOf types.raw;
default = {};
description = ''
Instantiated NixOS configurations. Used by `nixos-rebuild`.
2026-03-17 20:37:59 +10:00
2026-03-17 22:45:46 +10:00
`nixosConfigurations` is for specific machines. If you want to expose
reusable configurations, add them to [`nixosModules`](#opt-flake.nixosModules)
in the form of modules (no `lib.nixosSystem`), so that you can reference
them in this or another flake's `nixosConfigurations`.
'';
example = literalExpression ''
{
my-machine = inputs.nixpkgs.lib.nixosSystem {
# system is not needed with freshly generated hardware-configuration.nix
# system = "x86_64-linux"; # or set nixpkgs.hostPlatform in a module.
modules = [
./my-machine/nixos-configuration.nix
config.nixosModules.my-module
];
2026-03-17 20:37:59 +10:00
};
}
2026-03-17 22:45:46 +10:00
'';
};
};
2026-03-15 01:10:36 +10:00
}