Skip to content

Commit c3ff12c

Browse files
authored
CI(vira.hs): Migrate to subflakes config (#465)
1 parent 3ab2a07 commit c3ff12c

File tree

8 files changed

+28
-91
lines changed

8 files changed

+28
-91
lines changed

flake.nix

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -24,82 +24,6 @@
2424
}
2525
];
2626
};
27-
28-
# CI spec
29-
# https://omnix.page/om/ci.html
30-
ci.default =
31-
let
32-
exampleLock = builtins.fromJSON (builtins.readFile ./example/flake.lock);
33-
nixpkgs = "github:nixos/nixpkgs/" + exampleLock.nodes.nixpkgs.locked.rev;
34-
flake-parts = "github:hercules-ci/flake-parts/" + exampleLock.nodes.flake-parts.locked.rev;
35-
haskell-flake = ./.;
36-
haskell-parsers = ./nix/haskell-parsers;
37-
haskell-template = "github:srid/haskell-template/554b7c565396cf2d49a248e7e1dc0e0b46883b10";
38-
in
39-
{
40-
dev = {
41-
dir = "dev";
42-
overrideInputs = { inherit haskell-flake; };
43-
};
44-
45-
doc = {
46-
dir = "doc";
47-
overrideInputs = { inherit haskell-flake; };
48-
};
49-
50-
example = {
51-
dir = "example";
52-
overrideInputs = { inherit haskell-flake; };
53-
};
54-
55-
# Tests
56-
haskell-parsers-test = {
57-
dir = "./nix/haskell-parsers/test";
58-
overrideInputs = { inherit haskell-parsers; };
59-
};
60-
61-
test-simple = {
62-
dir = "test/simple";
63-
overrideInputs = {
64-
inherit nixpkgs flake-parts haskell-flake;
65-
};
66-
};
67-
68-
test-cabal2nix = {
69-
dir = "test/cabal2nix";
70-
overrideInputs = {
71-
inherit nixpkgs flake-parts haskell-flake;
72-
};
73-
};
74-
75-
test-with-subdir = {
76-
dir = "test/with-subdir";
77-
overrideInputs = {
78-
inherit nixpkgs flake-parts haskell-flake;
79-
};
80-
};
81-
82-
test-project-module = {
83-
dir = "test/project-module";
84-
overrideInputs = {
85-
inherit nixpkgs flake-parts haskell-flake;
86-
};
87-
};
88-
89-
test-settings-defaults = {
90-
dir = "test/settings-defaults";
91-
overrideInputs = {
92-
inherit nixpkgs flake-parts haskell-flake haskell-template;
93-
};
94-
};
95-
96-
test-otherOverlays = {
97-
dir = "test/otherOverlays";
98-
overrideInputs = {
99-
inherit nixpkgs flake-parts haskell-flake;
100-
};
101-
};
102-
};
10327
};
10428
};
10529
}

test/cabal2nix/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# pinning), we must specify revisions for *all* inputs to ensure
99
# reproducibility.
1010
inputs = {
11-
nixpkgs = { };
12-
flake-parts = { };
11+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
12+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
1313
haskell-flake = { };
1414
};
1515

test/otherOverlays/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# pinning), we must specify revisions for *all* inputs to ensure
44
# reproducibility.
55
inputs = {
6-
nixpkgs = { };
7-
flake-parts = { };
6+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
7+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
88
haskell-flake = { };
99

1010
haskell-multi-nix.url = "github:srid/haskell-multi-nix/d6ac6ccab559f886d1fc7da8cab44b99cb0c2c3d";

test/project-module/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# pinning), we must specify revisions for *all* inputs to ensure
44
# reproducibility.
55
inputs = {
6-
nixpkgs = { };
7-
flake-parts = { };
6+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
7+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
88
haskell-flake = { };
99

1010
haskell-multi-nix.url = "github:srid/haskell-multi-nix/d6ac6ccab559f886d1fc7da8cab44b99cb0c2c3d";

test/settings-defaults/flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# pinning), we must specify revisions for *all* inputs to ensure
44
# reproducibility.
55
inputs = {
6-
nixpkgs = { };
7-
flake-parts = { };
6+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
7+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
88
haskell-flake = { };
9-
haskell-template = { };
9+
haskell-template.url = "github:srid/haskell-template/554b7c565396cf2d49a248e7e1dc0e0b46883b10";
1010
};
1111
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
1212
flake-parts.lib.mkFlake { inherit inputs; } {

test/simple/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# pinning), we must specify revisions for *all* inputs to ensure
44
# reproducibility.
55
inputs = {
6-
nixpkgs = { };
7-
flake-parts = { };
6+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
7+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
88
haskell-flake = { };
99

1010
haskell-multi-nix.url = "github:srid/haskell-multi-nix/7aed736571714ec12105ec110358998d70d59e34";

test/with-subdir/flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# pinning), we must specify revisions for *all* inputs to ensure
44
# reproducibility.
55
inputs = {
6-
nixpkgs = { };
7-
flake-parts = { };
6+
nixpkgs.url = "github:nixos/nixpkgs/870493f9a8cb0b074ae5b411b2f232015db19a65";
7+
flake-parts.url = "github:hercules-ci/flake-parts/758cf7296bee11f1706a574c77d072b8a7baa881";
88
haskell-flake = { };
99
};
1010
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:

vira.hs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
-- CI configuration <https://vira.nixos.asia/>
22
\ctx pipeline ->
3-
let
3+
let
44
isMaster = ctx.branch == "master"
5+
hf = [("haskell-flake", ".")]
56
in pipeline
6-
{ signoff.enable = True
7+
{ build.flakes =
8+
[ "./dev" { overrideInputs = hf }
9+
, "./doc" { overrideInputs = hf }
10+
, "./example" { overrideInputs = hf }
11+
, "./nix/haskell-parsers/test" { overrideInputs = [("haskell-parsers", "path:./nix/haskell-parsers")] }
12+
, "./test/simple" { overrideInputs = hf }
13+
, "./test/cabal2nix" { overrideInputs = hf }
14+
, "./test/with-subdir" { overrideInputs = hf }
15+
, "./test/project-module" { overrideInputs = hf }
16+
, "./test/settings-defaults" { overrideInputs = hf }
17+
, "./test/otherOverlays" { overrideInputs = hf }
18+
]
19+
, signoff.enable = True
720
, cache.url = if isMaster then Just "https://cache.nixos.asia/oss" else Nothing
821
}

0 commit comments

Comments
 (0)