Skip to content

Commit 280ee29

Browse files
committed
Support macOS for development
1 parent 9476e37 commit 280ee29

File tree

4 files changed

+49
-9
lines changed

4 files changed

+49
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ node_modules
1010
public
1111
dist
1212
dist-newstyle
13+
.direnv
1314

1415
build
1516

flake.lock

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
safe-coloured-text.flake = false;
1212
sydtest.url = "github:NorfairKing/sydtest";
1313
sydtest.flake = false;
14+
flake-utils.url = "github:numtide/flake-utils";
1415
};
1516

1617
outputs =
@@ -21,9 +22,10 @@
2122
, safe-coloured-text
2223
, sydtest
2324
, autodocodec
25+
, flake-utils
2426
}:
27+
flake-utils.lib.eachDefaultSystem (system:
2528
let
26-
system = "x86_64-linux";
2729
pkgsFor = nixpkgs: import nixpkgs {
2830
inherit system;
2931
overlays = [
@@ -38,9 +40,9 @@
3840

3941
in
4042
{
41-
overlays.${system} = import ./nix/overlay.nix;
42-
packages.${system}.default = pkgs.openapi3-code-generator;
43-
checks.${system} =
43+
overlays = import ./nix/overlay.nix;
44+
packages.default = pkgs.openapi3-code-generator;
45+
checks =
4446
let tests = import ./nix/tests.nix { inherit pkgs; };
4547
in
4648
{
@@ -88,7 +90,7 @@
8890
};
8991
};
9092
};
91-
devShells.${system}.default = pkgs.haskellPackages.shellFor {
93+
devShells.default = pkgs.haskellPackages.shellFor {
9294
name = "openapi-code-generator-shell";
9395
packages = (p:
9496
[ p.openapi3-code-generator ]
@@ -98,6 +100,7 @@
98100
buildInputs = (with pkgs; [
99101
zlib
100102
cabal-install
103+
stack
101104
]) ++ (with pre-commit-hooks.packages.${system};
102105
[
103106
hlint
@@ -108,5 +111,5 @@
108111
]);
109112
shellHook = self.checks.${system}.pre-commit.shellHook;
110113
};
111-
};
114+
});
112115
}

update_golden_and_example.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/usr/bin/env bash
22

3-
nix build .\#checks.x86_64-linux.testGoldenGenerate
3+
system=$(nix eval --impure --raw --expr 'builtins.currentSystem')
4+
5+
nix build .\#checks.${system}.testGoldenGenerate
46
rm -rf testing/golden-output
57
mkdir -p testing/golden-output
68
cp -R result/* testing/golden-output
79
chmod -R 764 testing/golden-output
810

911

10-
nix build .\#checks.x86_64-linux.exampleGenerate
12+
nix build .\#checks.${system}.exampleGenerate
1113
rm -rf example/generatedCode
1214
mkdir -p example/generatedCode
1315
cp -R result/* example/generatedCode

0 commit comments

Comments
 (0)