Skip to content

Commit

Permalink
readme: show inputsFrom use
Browse files Browse the repository at this point in the history
  • Loading branch information
srid authored Apr 8, 2023
1 parent 6000244 commit f1c0b93
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ A `flake-parts` module for finding your way to the project root directory
imports = [
inputs.flake-root.flakeModule
];
perSystem = { pkgs, lib, config, ... }: {
flake-root.projectRootFile = "flake.nix"; # Not necessary, as flake.nix is the default
};
perSystem = { pkgs, lib, config, ... }: {
flake-root.projectRootFile = "flake.nix"; # Not necessary, as flake.nix is the default
devShells.default = pkgs.mkShell {
inputsFrom = [ config.flake-root.devShell ]; # Provides $FLAKE_ROOT in dev shell
};
};
};
}
```

Now you have access to the program that returns the absolute path to the project root via `${lib.getExe config.flake-root.package}`. There is also `config.flake-root.devShell` which exposes a `shellHook` providing the `$FLAKE_ROOT` environment variable.
Expand Down

0 comments on commit f1c0b93

Please sign in to comment.