Skip to content

Commit 76e4185

Browse files
committed
test import theirs
1 parent 7271da1 commit 76e4185

File tree

7 files changed

+187
-6
lines changed

7 files changed

+187
-6
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
- run: nix flake update den
4545
- run: nix run .#write-flake
4646
- run: nix flake metadata
47-
- run: nix flake check
47+
- run: nix flake check -L

templates/examples/flake.lock

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

templates/examples/flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@
4343
nixpkgs-lib.follows = "nixpkgs";
4444
nixpkgs-stable.url = "github:nixos/nixpkgs/release-25.05";
4545
systems.url = "github:nix-systems/default";
46+
theirs = {
47+
inputs = {
48+
den.follows = "den";
49+
flake-aspects.follows = "flake-aspects";
50+
flake-parts.follows = "flake-parts";
51+
import-tree.follows = "import-tree";
52+
nixpkgs.follows = "nixpkgs";
53+
};
54+
url = "path:./modules/_example/ci/_theirs";
55+
};
4656
};
4757

4858
}

templates/examples/modules/_example/ci/_theirs/flake.lock

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6+
flake-parts.url = "github:hercules-ci/flake-parts";
7+
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
8+
9+
import-tree.url = "github:vic/import-tree";
10+
flake-aspects.url = "github:vic/flake-aspects";
11+
den.url = "github:vic/den";
12+
};
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This flake is for testing by ci/namespace.nix
2+
{ inputs, ... }:
3+
{
4+
systems = [
5+
"x86_64-linux"
6+
"aarch64-darwin"
7+
];
8+
imports = [
9+
inputs.den.flakeModule
10+
(inputs.den.namespace "sim" true)
11+
];
12+
13+
sim.a._.b._.c._.d = {
14+
nixos.sims = [ "theirs abcd" ];
15+
};
16+
17+
sim.ul._.a._.tion = {
18+
nixos.sims = [ "theirs simulation" ];
19+
};
20+
21+
}

templates/examples/modules/_example/ci/namespace.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ in
1717
# enable <angle/bracket> syntax for finding aspects.
1818
_module.args.__findFile = den.lib.__findFile;
1919

20+
# example "external" flake to import some aspects from.
21+
flake-file.inputs.theirs = {
22+
url = "path:./modules/_example/ci/_theirs";
23+
inputs.nixpkgs.follows = "nixpkgs";
24+
inputs.flake-parts.follows = "flake-parts";
25+
inputs.import-tree.follows = "import-tree";
26+
inputs.flake-aspects.follows = "flake-aspects";
27+
inputs.den.follows = "den";
28+
};
29+
2030
imports = [
2131
# create a local namespace and output at flake.denful.eg
2232
(inputs.den.namespace "eg" true)
@@ -34,6 +44,7 @@ in
3444
inputA
3545
inputB
3646
exposeToFlake
47+
inputs.theirs # from actual external flake
3748
]
3849
)
3950
];
@@ -71,10 +82,11 @@ in
7182
"inputB simulation"
7283
"local namespace"
7384
"local simulation"
85+
"theirs simulation"
7486
];
7587
actual = lib.sort (a: b: a < b) rockhopper.config.sims;
7688
in
77-
expected == actual
89+
expected == (builtins.trace actual actual)
7890
);
7991

8092
};

0 commit comments

Comments
 (0)