Skip to content

Commit

Permalink
Merge branch 'nixify' into tedi/podman
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Jul 12, 2024
2 parents 555fcb3 + 41bd2dc commit ca0da34
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,8 @@ lerna-debug.log
# contains several libraries that get shipped
yarn.lock
package.json
package-lock.json
package-lock.json

# Nix
# ignores the default result symlink created when building with nix
result
15 changes: 15 additions & 0 deletions enclave-manager/local/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/kurtosis-tech/kurtosis/enclave-manager/local

go 1.20
replace (
github.com/kurtosis-tech/kurtosis/enclave-manager => ../server
github.com/kurtosis-tech/kurtosis/contexts-config-store => ../../contexts-config-store
github.com/kurtosis-tech/kurtosis/kurtosis_version => ../../kurtosis_version
)

require (
github.com/kurtosis-tech/kurtosis/enclave-manager v0.0.0-20230828153722-32770ca96513
github.com/sirupsen/logrus v1.9.3
)

require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
15 changes: 15 additions & 0 deletions enclave-manager/local/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, unstable, flake-utils, ... }:
outputs = { self, nixpkgs, unstable, flake-utils, ... }:
let utils = flake-utils;
in utils.lib.eachDefaultSystem (system:
let
Expand All @@ -17,17 +17,24 @@
inherit pkgs system;
nodejs = pkgs.nodejs_20;
};
in {
in
{
formatter = pkgs.nixpkgs-fmt;

packages = rec {
default = kurtosis;
kurtosis = unstable_pkgs.callPackage ./package.nix { };
};

devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs;
let
openapi-codegen-go =
import ./nix-pkgs/openapi-codegen.nix { inherit pkgs; };
grpc-tools-node =
import ./nix-pkgs/grpc-tools-node.nix { inherit pkgs; };
in [
in
[
goreleaser
go_1_20
gopls
Expand Down
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use (
./core/launcher
./core/server
./enclave-manager/api/golang
./enclave-manager/local
./enclave-manager/server
./engine/launcher
./engine/server
Expand Down
54 changes: 54 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ lib
, buildGoModule
, writeTextFile
}:

buildGoModule rec {
pname = "kurtosis";
version = "0.89.11";

src = ./.;

proxyVendor = true;
vendorHash = "sha256-GaEIitoRiuYxtS7cDKobFyIlraDNQjcvbRvzG3nUKFU=";

postPatch =
let
kurtosisVersion = writeTextFile {
name = "kurtosis_verion.go";
text = ''
package kurtosis_version
const (
KurtosisVersion = "${version}"
)
'';
};
in
''
ln -s ${kurtosisVersion} kurtosis_version/kurtosis_version.go
'';

# disable checks temporarily since they connect to the internet
# namely user_support_constants_test.go
doCheck = false;

# keep this for future reference
preCheck = ''
# some tests in commands use XDG home related environment variables
export HOME=/tmp
'';

postInstall = ''
mv $out/bin/cli $out/bin/kurtosis
mv $out/bin/files_artifacts_expander $out/bin/files-artifacts-expander
mv $out/bin/api_container $out/bin/api-container
'';

meta = with lib; {
description = "A platform for launching an ephemeral Ethereum backend";
mainProgram = "kurtosis";
homepage = "https://github.com/kurtosis-tech/kurtosis";
license = licenses.asl20;
};
}

0 comments on commit ca0da34

Please sign in to comment.