feat(flake/inputs): recursively import all files instead of manual
importing
This commit is contained in:
parent
faca496c63
commit
e1e3a9c404
2 changed files with 8 additions and 3 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Essentially, `flake.nix` is like `Cargo.toml` in Rust or `package.json` in Node.js, but for an entire operating system.
|
||||
*/
|
||||
{ inputs, ... }:
|
||||
{ inputs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.flake-file.flakeModules.default
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
flake-file.inputs = import ./inputs;
|
||||
flake-file.inputs = import ./inputs { inherit lib; };
|
||||
flake-file.outputs = "inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } ./flake";
|
||||
flake-file.description = "A very basic flake";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{ lib, ... }:
|
||||
# Flake inputs
|
||||
|
||||
/**
|
||||
|
|
@ -14,4 +15,8 @@
|
|||
> Then accessing inputs in repl, remove {class}, so instead of calling e.g. `flake.inputs.core.nixpkgs`,
|
||||
> you call `flake.inputs.nixpkgs`.
|
||||
*/
|
||||
(import ./core.nix) // (import ./home.nix)
|
||||
lib.foldl' (acc: value: acc // value) { } (
|
||||
map (file: import ./${file}) (
|
||||
builtins.filter (name: name != "default.nix") (builtins.attrNames (builtins.readDir ./.))
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue