mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-08-16 15:40:26 +03:00
fix: format module identity
This commit is contained in:
parent
50aeec40f2
commit
1f311a13e1
@ -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;
|
||||
|
@ -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
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user