fix: uniquely identiy the format-module

this has the positive side effect that the nixos-generate
binary now also works on configurations
that already import one of the nixos modules

That means, we can use the same cli interface regardless if
the config was pre-produced or is produced by the cli on the fly

fix: #181
This commit is contained in:
David Arnold 2022-10-23 16:06:11 -05:00
parent d53f2d9aff
commit 20c21b9880
No known key found for this signature in database
GPG Key ID: 0318D822BAC965CC

View File

@ -8,7 +8,14 @@
, flakeAttr ? null
}:
let
module = import ./format-module.nix;
module = rec {
# ensures that this module has the same key as
# the fromat-module that ships with 'nixos-generatores.nixosModules.*'.
# Thereby, it will be deduplicated by the module system.
_file = ./format-module.nix;
key = _file;
imports = [ ./format-module.nix];
};
# Will only get evaluated when used, so no worries
flake = builtins.getFlake flakeUri;