Skip to content

Commit fd9c3f5

Browse files
Baltolirv-auditor
andauthored
Clean up nix code (#664)
* Clean up nix code * Set Version: 0.1.72 * Set Version: 0.1.73 --------- Co-authored-by: devops <[email protected]>
1 parent 2ef1bfc commit fd9c3f5

File tree

4 files changed

+39
-47
lines changed

4 files changed

+39
-47
lines changed

flake.lock

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+37-41
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
flake-utils.follows = "k-framework/flake-utils";
88
rv-utils.follows = "k-framework/rv-utils";
99
pyk.url = "github:runtimeverification/k/v7.1.38?dir=pyk";
10-
nixpkgs-pyk.follows = "pyk/nixpkgs";
1110
poetry2nix.follows = "pyk/poetry2nix";
1211
};
1312

1413
outputs =
15-
{ self, k-framework, nixpkgs, flake-utils, rv-utils, pyk, ... }@inputs:
14+
{ self, k-framework, nixpkgs, flake-utils, rv-utils, pyk, poetry2nix }:
1615
let
1716
overlay = (final: prev:
1817
let
@@ -23,26 +22,15 @@
2322
] ./.);
2423

2524
version = self.rev or "dirty";
26-
27-
nixpkgs-pyk = import inputs.nixpkgs-pyk {
28-
system = prev.system;
29-
overlays = [ pyk.overlay ];
30-
};
31-
32-
python310-pyk = nixpkgs-pyk.python310;
33-
34-
poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { pkgs = nixpkgs-pyk; };
3525
in {
36-
pyk = pyk.packages.${prev.system}.pyk;
37-
3826
kwasm = prev.stdenv.mkDerivation {
3927
pname = "kwasm";
4028
inherit src version;
4129

42-
buildInputs = with final; [
30+
buildInputs = with prev; [
4331
k-framework.packages.${system}.k
4432
final.kwasm-pyk
45-
python310-pyk
33+
python310
4634
];
4735

4836
nativeBuildInputs = [ prev.makeWrapper ];
@@ -69,29 +57,33 @@
6957
'';
7058
};
7159

72-
kwasm-pyk = poetry2nix.mkPoetryApplication {
73-
python = nixpkgs-pyk.python310;
60+
kwasm-pyk = prev.poetry2nix.mkPoetryApplication {
61+
python = prev.python310;
7462
projectDir = ./pykwasm;
75-
overrides = poetry2nix.overrides.withDefaults
76-
(finalPython: prevPython: {
77-
pyk = nixpkgs-pyk.pyk-python310;
78-
pygments = prevPython.pygments.overridePythonAttrs ( old: {
79-
buildInputs = (old.buildInputs or [ ])
80-
++ [ prevPython.hatchling ];
81-
});
82-
xdg-base-dirs = prevPython.xdg-base-dirs.overridePythonAttrs
83-
(old: {
84-
propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
85-
++ [ finalPython.poetry ];
86-
});
87-
py-wasm = prevPython.py-wasm.overridePythonAttrs
88-
(
89-
old: {
90-
buildInputs = (old.buildInputs or [ ]) ++ [ prevPython.setuptools ];
91-
}
92-
);
63+
64+
overrides = prev.poetry2nix.overrides.withDefaults
65+
(finalPython: prevPython: {
66+
pyk = prev.pyk-python310;
67+
68+
pygments = prevPython.pygments.overridePythonAttrs
69+
(old: {
70+
buildInputs = (old.buildInputs or [ ])
71+
++ [ prevPython.hatchling ];
72+
});
73+
74+
xdg-base-dirs = prevPython.xdg-base-dirs.overridePythonAttrs
75+
(old: {
76+
propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
77+
++ [ finalPython.poetry ];
78+
});
79+
80+
py-wasm = prevPython.py-wasm.overridePythonAttrs
81+
(old: {
82+
buildInputs = (old.buildInputs or [ ])
83+
++ [ prevPython.setuptools ];
84+
});
9385
});
94-
groups = [ ];
86+
9587
checkGroups = [ ];
9688
};
9789

@@ -108,11 +100,11 @@
108100
git
109101
];
110102

111-
patchPhase = ''
103+
patchPhase = with final; ''
112104
substituteInPlace Makefile \
113-
--replace-fail '$(TEST)' '${final.kwasm}/bin/kwasm' \
114-
--replace-fail '$(KDIST)' '${nixpkgs-pyk.pyk-python310}/bin/kdist' \
115-
--replace-fail '$(SOURCE_DIR)' '${final.kwasm}/wasm-semantics/source'
105+
--replace-fail '$(TEST)' '${kwasm}/bin/kwasm' \
106+
--replace-fail '$(KDIST)' '${pyk-python310}/bin/kdist' \
107+
--replace-fail '$(SOURCE_DIR)' '${kwasm}/wasm-semantics/source'
116108
'';
117109

118110
buildPhase = ''
@@ -137,7 +129,11 @@
137129
let
138130
pkgs = import nixpkgs {
139131
inherit system;
140-
overlays = [ overlay ];
132+
overlays = [
133+
poetry2nix.overlays.default
134+
pyk.overlay
135+
overlay
136+
];
141137
};
142138
in {
143139
packages = rec {

package/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.72
1+
0.1.73

pykwasm/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pykwasm"
7-
version = "0.1.72"
7+
version = "0.1.73"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

0 commit comments

Comments
 (0)