Skip to content

Commit

Permalink
Minor nix cleanup (#696)
Browse files Browse the repository at this point in the history
* Minor nix cleanup

* Set Version: 0.1.104

* fix poetry2nix version used

* Set Version: 0.1.105

---------

Co-authored-by: devops <[email protected]>
  • Loading branch information
goodlyrottenapple and devops authored Sep 9, 2024
1 parent 296ae4a commit fd23f08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 51 deletions.
65 changes: 16 additions & 49 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
poetry2nix.follows = "k-framework/poetry2nix";
};

outputs =
{ self, k-framework, nixpkgs, flake-utils, rv-utils, poetry2nix }:
outputs = { self, k-framework, nixpkgs, flake-utils, rv-utils, ... }@inputs:
let
overlay = (final: prev:
let
Expand All @@ -19,18 +18,14 @@
"flake.lock"
./.gitignore
] ./.);

poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { pkgs = prev; };
version = self.rev or "dirty";
in {
kwasm = prev.stdenv.mkDerivation {
pname = "kwasm";
inherit src version;

buildInputs = with prev; [
k
final.kwasm-pyk
python310
];
buildInputs = with prev; [ k final.kwasm-pyk python310 ];

nativeBuildInputs = [ prev.makeWrapper ];

Expand All @@ -46,41 +41,22 @@
cp -r ./kdist-*/* $out/
mkdir -p $out/bin
makeWrapper ${final.kwasm-pyk}/bin/kwasm $out/bin/kwasm \
--prefix PATH : ${
prev.lib.makeBinPath [
prev.which
prev.k
]
} \
--prefix PATH : ${prev.lib.makeBinPath [ prev.which prev.k ]} \
--set KDIST_DIR $out
'';
};

kwasm-pyk = prev.poetry2nix.mkPoetryApplication {
kwasm-pyk = poetry2nix.mkPoetryApplication {
python = prev.python310;
projectDir = ./pykwasm;

overrides = prev.poetry2nix.overrides.withDefaults
overrides = poetry2nix.overrides.withDefaults
(finalPython: prevPython: {
pyk = prev.pyk-python310;

pygments = prevPython.pygments.overridePythonAttrs
(old: {
buildInputs = (old.buildInputs or [ ])
++ [ prevPython.hatchling ];
});

xdg-base-dirs = prevPython.xdg-base-dirs.overridePythonAttrs
(old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
++ [ finalPython.poetry ];
});

py-wasm = prevPython.py-wasm.overridePythonAttrs
(old: {
buildInputs = (old.buildInputs or [ ])
++ [ prevPython.setuptools ];
});
kframework = prev.pyk-python310;
py-wasm = prevPython.py-wasm.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ])
++ [ prevPython.setuptools ];
});
});

checkGroups = [ ];
Expand All @@ -92,12 +68,7 @@
pname = "kwasm-test";
src = final.kwasm.src;

buildInputs = with final; [
kwasm
kwasm-pyk
which
git
];
buildInputs = with final; [ kwasm kwasm-pyk which git ];

patchPhase = with final; ''
substituteInPlace Makefile \
Expand Down Expand Up @@ -128,18 +99,14 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [
poetry2nix.overlays.default
k-framework.overlay
overlay
];
overlays = [ k-framework.overlay overlay ];
};
in {
packages = rec {
inherit (pkgs) kwasm kwasm-pyk kwasm-test;
default = kwasm;
};
}) // {
overlays.default = overlay;
};
}) // {
overlays.default = overlay;
};
}
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.104
0.1.105
2 changes: 1 addition & 1 deletion pykwasm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pykwasm"
version = "0.1.104"
version = "0.1.105"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down

0 comments on commit fd23f08

Please sign in to comment.