fix: format module identity

This commit is contained in:
David Arnold 2022-10-27 13:14:41 -05:00
parent 50aeec40f2
commit 1f311a13e1
No known key found for this signature in database
GPG Key ID: 0318D822BAC965CC
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,11 @@
{ lib, ... }: {
{ lib, ... }: rec {
_file = ./format-module.nix;
# This deliberate key makes sure this module will be deduplicated
# regardless of the accessor path: either via flake's nixosModule
# or as part of the nixos-generate command. These two store paths
# of the module may differ and hence don't serve as a key
key = "github:nix-community/nixos-generators/format-module.nix";
options = {
filename = lib.mkOption {
type = lib.types.str;

View File

@ -8,14 +8,7 @@
, flakeAttr ? null
}:
let
module = rec {
# ensures that this module has the same key as
# the format-module that ships with 'nixos-generators.nixosModules.*'.
# Thereby, it will be deduplicated by the module system.
_file = ./format-module.nix;
key = _file;
imports = [ ./format-module.nix];
};
module = import ./format-module.nix;
# Will only get evaluated when used, so no worries
flake = builtins.getFlake flakeUri;
@ -29,7 +22,7 @@ in
import "${toString nixpkgs}/nixos/lib/eval-config.nix" {
inherit system;
modules = [
(import ./format-module.nix)
module
formatConfig
configuration
];