Skip to content

Commit 7faa2f2

Browse files
authored
Require explicit importing of flake-root (#12)
To avoid import conflicts.
1 parent 5c4bbee commit 7faa2f2

File tree

6 files changed

+14
-33
lines changed

6 files changed

+14
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Once you are in the dev shell, you can run any of these scripts prefixed with th
3838

3939
The scripts will be run *always* from the project root directory[^flake-root] regardless of the current working directory.
4040

41-
[^flake-root]: "Project root directory" is determined by traversing the directory up until we find the unique file that exists only at the root. This unique file is `flake.nix` by default, which can be overridden using the [flake-root](https://github.com/srid/flake-root) module; i.e.; `flake-root.projectRootFile = "stack.yaml";`
41+
[^flake-root]: "Project root directory" is determined by traversing the directory up until we find the unique file that exists only at the root. This unique file is `flake.nix` by default, which can be overridden using the [flake-root](https://github.com/srid/flake-root) module that this module mandatorily requires; i.e.; `flake-root.projectRootFile = "stack.yaml";`
4242

4343
## Examples
4444

example/flake.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/flake.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
inputs = {
33
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
44
flake-parts.url = "github:hercules-ci/flake-parts";
5-
mission-control.url = "github:Platonic-Systems/mission-control";
5+
flake-root.url = "github:srid/flake-root";
6+
mission-control.url = "github:Platonic-Systems/mission-control/explicit-flake-root";
67
};
78
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
89
flake-parts.lib.mkFlake { inherit inputs; } {
910
systems = nixpkgs.lib.systems.flakeExposed;
1011
imports = [
12+
inputs.flake-root.flakeModule
1113
inputs.mission-control.flakeModule
1214
];
1315
perSystem = { pkgs, lib, config, ... }: {

flake.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
description = "A `flake-parts` module for your Nix devshell scripts";
33
inputs = {
44
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5-
flake-root.url = "github:srid/flake-root";
65
};
7-
outputs = { self, nixpkgs, flake-root, ... }: {
8-
flakeModule = import ./nix/flake-module.nix { inherit flake-root; };
6+
outputs = { self, nixpkgs, ... }: {
7+
flakeModule = ./nix/flake-module.nix;
98
templates.default.path = (nixpkgs.lib.cleanSourceWith {
109
src = ./example;
1110
filter = path: type: baseNameOf path == "flake.nix";

nix/flake-module.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{ flake-root }:
21
{ self, lib, flake-parts-lib, ... }:
32
let
43
inherit (flake-parts-lib)
@@ -8,10 +7,6 @@ let
87
types;
98
in
109
{
11-
_file = __curPos.file;
12-
imports = [
13-
flake-root.flakeModule
14-
];
1510
options = {
1611
perSystem = mkPerSystemOption
1712
({ config, self', inputs', pkgs, system, ... }:

0 commit comments

Comments
 (0)