Merge pull request #129924 from Ma27/flake-modules-pos
flake/lib.nixosSystem: add `_file`-keys for error-location if needed
This commit is contained in:
commit
b4c4784f7e
1 changed files with 13 additions and 1 deletions
14
flake.nix
14
flake.nix
|
@ -47,8 +47,20 @@
|
|||
})
|
||||
];
|
||||
})).config;
|
||||
|
||||
moduleDeclarationFile =
|
||||
(builtins.unsafeGetAttrPos "modules" args).file;
|
||||
|
||||
# Add the invoking file as error message location for modules
|
||||
# that don't have their own locations; presumably inline modules.
|
||||
addModuleDeclarationFile =
|
||||
m: {
|
||||
_file = moduleDeclarationFile;
|
||||
imports = [ m ];
|
||||
};
|
||||
|
||||
in
|
||||
modules ++ [
|
||||
map addModuleDeclarationFile modules ++ [
|
||||
{
|
||||
system.nixos.versionSuffix =
|
||||
".${final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}";
|
||||
|
|
Loading…
Reference in a new issue