Merge pull request #351 from yunfachi/flakeModules
Replace hardcoded paths with `flakeModules`
This commit is contained in:
commit
71a3a77326
3 changed files with 9 additions and 26 deletions
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./modules/apps.nix
|
|
||||||
./modules/checks.nix
|
|
||||||
./modules/debug.nix
|
|
||||||
./modules/devShells.nix
|
|
||||||
./modules/flake.nix
|
|
||||||
./modules/formatter.nix
|
|
||||||
./modules/legacyPackages.nix
|
|
||||||
./modules/moduleWithSystem.nix
|
|
||||||
./modules/nixosConfigurations.nix
|
|
||||||
./modules/nixosModules.nix
|
|
||||||
./modules/nixpkgs.nix
|
|
||||||
./modules/overlays.nix
|
|
||||||
./modules/packages.nix
|
|
||||||
./modules/perSystem.nix
|
|
||||||
./modules/transposition.nix
|
|
||||||
./modules/withSystem.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
let
|
let
|
||||||
lib = import ./lib.nix {
|
lib = import ./lib.nix {
|
||||||
inherit (nixpkgs-lib) lib;
|
inherit (nixpkgs-lib) lib;
|
||||||
|
inherit builtinModules extraModules;
|
||||||
# Extra info for version check message
|
# Extra info for version check message
|
||||||
revInfo =
|
revInfo =
|
||||||
if nixpkgs-lib?rev
|
if nixpkgs-lib?rev
|
||||||
|
|
@ -45,8 +46,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
flakeModules = {
|
builtinModules = {
|
||||||
# Built-in modules
|
|
||||||
apps = ./modules/apps.nix;
|
apps = ./modules/apps.nix;
|
||||||
checks = ./modules/checks.nix;
|
checks = ./modules/checks.nix;
|
||||||
debug = ./modules/debug.nix;
|
debug = ./modules/debug.nix;
|
||||||
|
|
@ -63,8 +63,8 @@
|
||||||
perSystem = ./modules/perSystem.nix;
|
perSystem = ./modules/perSystem.nix;
|
||||||
transposition = ./modules/transposition.nix;
|
transposition = ./modules/transposition.nix;
|
||||||
withSystem = ./modules/withSystem.nix;
|
withSystem = ./modules/withSystem.nix;
|
||||||
|
};
|
||||||
# Extras
|
extraModules = {
|
||||||
easyOverlay = ./extras/easyOverlay.nix;
|
easyOverlay = ./extras/easyOverlay.nix;
|
||||||
flakeModules = ./extras/flakeModules.nix;
|
flakeModules = ./extras/flakeModules.nix;
|
||||||
modules = ./extras/modules.nix;
|
modules = ./extras/modules.nix;
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
bundlers = ./extras/bundlers.nix;
|
bundlers = ./extras/bundlers.nix;
|
||||||
touchup = ./extras/touchup.nix;
|
touchup = ./extras/touchup.nix;
|
||||||
};
|
};
|
||||||
|
flakeModules = builtinModules // extraModules;
|
||||||
in
|
in
|
||||||
lib.mkFlake { inherit inputs; } {
|
lib.mkFlake { inherit inputs; } {
|
||||||
systems = [ ];
|
systems = [ ];
|
||||||
|
|
|
||||||
6
lib.nix
6
lib.nix
|
|
@ -1,4 +1,6 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, builtinModules
|
||||||
|
, extraModules
|
||||||
# Optionally a string with extra version info to be included in the error message
|
# Optionally a string with extra version info to be included in the error message
|
||||||
# in case is lib is out of date. Empty or starts with space.
|
# in case is lib is out of date. Empty or starts with space.
|
||||||
, revInfo ? ""
|
, revInfo ? ""
|
||||||
|
|
@ -139,7 +141,7 @@ let
|
||||||
inherit self flake-parts-lib moduleLocation;
|
inherit self flake-parts-lib moduleLocation;
|
||||||
inputs = args.inputs or /* legacy, warned above */ self.inputs;
|
inputs = args.inputs or /* legacy, warned above */ self.inputs;
|
||||||
} // specialArgs;
|
} // specialArgs;
|
||||||
modules = [ ./all-modules.nix (lib.setDefaultModuleLocation errorLocation module) ];
|
modules = builtins.attrValues builtinModules ++ [ (lib.setDefaultModuleLocation errorLocation module) ];
|
||||||
class = "flake";
|
class = "flake";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -294,7 +296,7 @@ let
|
||||||
_class = "flake";
|
_class = "flake";
|
||||||
imports = [
|
imports = [
|
||||||
module
|
module
|
||||||
./extras/modules.nix
|
extraModules.modules
|
||||||
];
|
];
|
||||||
flake.modules.flake.${name} = module;
|
flake.modules.flake.${name} = module;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue