Skip to content

Commit a823583

Browse files
committed
testing relative imports
1 parent 6d58642 commit a823583

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/devshell-flake.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
inputs.systems.url = "github:nix-systems/default";
44
inputs.devshell.url = "github:numtide/devshell";
55

6+
inputs.source.url = "path:./source";
7+
inputs.source.flake = false;
8+
69
inputs.devshell_toml.url = "path:./devshell.toml";
710
inputs.devshell_toml.flake = false;
811

@@ -17,6 +20,9 @@
1720
let
1821
ins = inputs // inputs.config.inputs;
1922

23+
devshell_toml =
24+
if builtins.pathExists ins.source then "${ins.source}/devshell.toml" else ins.devshell_toml;
25+
2026
nixpkgs = ins.nixpkgs or ins.devshell.inputs.nixpkgs;
2127
perSystem = nixpkgs.lib.genAttrs (import ins.systems);
2228

@@ -38,7 +44,7 @@
3844
_module.args = {
3945
inputs = ins;
4046
};
41-
imports = [ (pkgs.devshell.importTOML ins.devshell_toml) ];
47+
imports = [ (pkgs.devshell.importTOML devshell_toml) ];
4248
};
4349
in
4450
{

templates/advanced/flake.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ inputs.nixpkgs.follows = "nixpkgs"
77

88

99
# Allow devshell.toml to load relative imports
10-
[inputs.devshell_toml]
11-
url = "path:./devshell.toml"
10+
[inputs.source]
11+
url = "path:./"
1212
flake = false
1313

1414
# Custom exposed systems

0 commit comments

Comments
 (0)