From d7e811d568f6d713a16961991efd6bf0047844f3 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Fri, 27 Dec 2024 16:57:40 +0000 Subject: [PATCH] Backport 0.4 nixpgks to 24.11 (#111) * Upgrade to nixpkgs 24.11 * Remove unusable Holo template * Don't build Holo template in CI --- .github/workflows/build.yaml | 1 - flake.lock | 20 +++++++++--------- flake.nix | 18 ++++++----------- templates/holo/flake.nix | 39 ------------------------------------ 4 files changed, 16 insertions(+), 62 deletions(-) delete mode 100644 templates/holo/flake.nix diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c822053..29b0031 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -125,7 +125,6 @@ jobs: templates: - default - custom - - holo - rust-stable fail-fast: false diff --git a/flake.lock b/flake.lock index b5b8f26..620a5ce 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1734324364, - "narHash": "sha256-omYTR59TdH0AumP1cfh49fBnWZ52HjfdNfaLzCMZBx0=", + "lastModified": 1734808813, + "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", "owner": "ipetkov", "repo": "crane", - "rev": "60d7623f1320470bf2fdb92fd2dca1e9a27b98ce", + "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", "type": "github" }, "original": { @@ -103,16 +103,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1717179513, - "narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=", + "lastModified": 1734875076, + "narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0", + "rev": "1807c2b91223227ad5599d7067a61665c52d1295", "type": "github" }, "original": { "owner": "nixos", - "ref": "24.05", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -148,11 +148,11 @@ ] }, "locked": { - "lastModified": 1734489114, - "narHash": "sha256-dKBBZr2pw7KDI/7GeiN5qPccqqtvnK2jqAMcMo4rVvU=", + "lastModified": 1734834660, + "narHash": "sha256-bm8V+Cu8rWJA+vKQnc94mXTpSDgvedyoDKxTVi/uJfw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b2e385f8e5c1d7c0d9ce738d650955c2e94555ae", + "rev": "b070e6030118680977bc2388868c4b3963872134", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 37014c4..34c15b8 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ # specify all input dependencies needed to create the outputs of the flake inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=24.05"; + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11"; # utility to iterate over multiple target platforms flake-parts.url = "github:hercules-ci/flake-parts"; @@ -87,6 +87,10 @@ # Crane doesn't know which version to select from a workspace, so we tell it where to look crateInfo = craneLib.crateNameFromCargoToml { cargoToml = inputs.holochain + "/crates/holochain/Cargo.toml"; }; + + # On intel macs, the default SDK is still 10.12 and Holochain won't build against that because we're + # using a newer Go version. So override with the newest SDK available for x86_64-darwin. + apple_sdk = if system == "x86_64-darwin" then [ pkgs.apple-sdk_10_15 ] else [ ]; in craneLib.buildPackage { pname = "holochain"; @@ -101,7 +105,7 @@ buildInputs = [ pkgs.go pkgs.perl - ]; + ] ++ (pkgs.lib.optionals pkgs.stdenv.isDarwin apple_sdk); # Build Holochain, CLI and local services (bootstrap + signal server) binaries. # Pass extra arguments like feature flags to build command. cargoExtraArgs = "--bin holochain --bin hc --bin hc-sandbox --bin hcterm --bin hc-run-local-services " + cargoExtraArgs; @@ -287,12 +291,6 @@ echo "Lair keystore : not installed" fi - if command -v "holo-dev-server" > /dev/null; then - echo "Holo dev server : $(holo-dev-server --version)" - else - echo "Holo dev server : not installed" - fi - if command -v "holochain" > /dev/null; then echo "Holochain : $(holochain --version) (${builtins.substring 0 7 inputs.holochain.rev})" @@ -351,10 +349,6 @@ path = ./templates/default; description = "Holonix default template"; }; - holo = { - path = ./templates/holo; - description = "Holonix template for Holo-enabled app development"; - }; custom-holochain = { path = ./templates/custom-holochain; description = "Holonix template for custom Holochain build"; diff --git a/templates/holo/flake.nix b/templates/holo/flake.nix deleted file mode 100644 index 0b3303c..0000000 --- a/templates/holo/flake.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - description = "Flake for Holo-enabled Holochain app development"; - - inputs = { - holonix.url = "github:holochain/holonix?ref=main-0.4"; - - nixpkgs.follows = "holonix/nixpkgs"; - flake-parts.follows = "holonix/flake-parts"; - - hds-releases.url = "github:holo-host/hds-releases?ref=2024-07-16-220445"; - }; - - outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - systems = builtins.attrNames inputs.holonix.devShells; - perSystem = { inputs', pkgs, ... }: { - formatter = pkgs.nixpkgs-fmt; - - devShells.default = pkgs.mkShell { - packages = (with inputs'.holonix.packages; [ - holochain - lair-keystore - hc-launch - hc-scaffold - hn-introspect - rust # For Rust development, with the WASM target included for zome builds - inputs'.hds-releases.packages.holo-dev-server-bin - ]) ++ (with pkgs; [ - nodejs_20 # For UI development - binaryen # For WASM optimisation - # Add any other packages you need here - ]); - - shellHook = '' - export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] ' - ''; - }; - }; - }; -}