Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 18 additions & 35 deletions flake.lock

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

10 changes: 4 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
description = "The open source wallet for ada, built to grow with the Cardano blockchain";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin";
cardano-wallet-unpatched.url = "github:cardano-foundation/cardano-wallet/v2025-03-31";
cardano-wallet-unpatched.flake = false; # otherwise, +10k quadratic dependencies in flake.lock…
cardano-node-override.url = "github:IntersectMBO/cardano-node/10.5.1";
cardano-node-override.url = "github:IntersectMBO/cardano-node/10.5.3";
cardano-node-override.flake = false;
cardano-playground.url = "github:input-output-hk/cardano-playground/56ebfef5595c43014029b039ade01b0ef06233e0";
cardano-playground.url = "github:input-output-hk/cardano-playground/c0715c2b04628ce1946803b0a829b3e1445b5c4d";
cardano-playground.flake = false; # otherwise, +9k dependencies in flake.lock…
cardano-shell.url = "github:input-output-hk/cardano-shell/79f48aa3aa8007a1597cbedc22031eab1f05decd";
cardano-shell.flake = false;
tullia.url = "github:input-output-hk/tullia";
tullia.flake = false; # otherwie, +1k dependencies in flake.lock…
flake-compat.url = "github:input-output-hk/flake-compat";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
nix-bundle-exe.url = "github:3noch/nix-bundle-exe";
nix-bundle-exe.flake = false;
Expand Down
6 changes: 3 additions & 3 deletions nix/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ let
regenerateDevCerts
] ++ (with pkgs; [
nix bash binutils coreutils curl gnutar
git python3 curl jq
git python310 curl jq
nodePackages.node-gyp nodePackages.node-pre-gyp
gnumake
pkgconfig
libusb
pkg-config
libusb1
] ++ (if (pkgs.stdenv.hostPlatform.system == "x86_64-darwin") || (pkgs.stdenv.hostPlatform.system == "aarch64-darwin") then [
internal.darwin-launcher
darwin.apple_sdk.frameworks.CoreServices
Expand Down
18 changes: 6 additions & 12 deletions nix/internal/any-darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ in rec {
name = "daedalus-node_modules";
src = srcLockfiles;
nativeBuildInputs = [ yarn nodejs ]
++ (with pkgs; [ python3 perl pkgconfig jq darwin.cctools xcbuild ]);
++ (with pkgs; [ python310 perl pkg-config jq darwin.cctools xcbuild ]);
buildInputs = (with pkgs.darwin; [
apple_sdk.frameworks.CoreServices
apple_sdk.frameworks.AppKit
Expand Down Expand Up @@ -142,7 +142,7 @@ in rec {

cd $out
mkdir -p ${exeName}-lib
mv *.dylib ${exeName}-lib/
mv *.dylib *.so ${exeName}-lib/
otool -L ${exeName} \
| { grep -E '^\s*@executable_path' || true ; } \
| sed -r 's/^\s*//g ; s/ \(.*//g' \
Expand All @@ -153,7 +153,7 @@ in rec {
codesign -f -s - ${exeName} || true

cd ${exeName}-lib
ls *.dylib | while IFS= read -r dylib ; do
ls *.dylib *.so | while IFS= read -r dylib ; do
otool -L "$dylib" \
| { grep -E '^\s*@executable_path' || true ; } \
| sed -r 's/^\s*//g ; s/ \(.*//g' \
Expand Down Expand Up @@ -218,7 +218,7 @@ in rec {
name = pname;
src = srcWithoutNix;
nativeBuildInputs = [ yarn nodejs ]
++ (with pkgs; [ python3 perl pkgconfig darwin.cctools xcbuild jq ]);
++ (with pkgs; [ python310 perl pkg-config darwin.cctools xcbuild jq ]);
buildInputs = (with pkgs.darwin; [
apple_sdk.frameworks.CoreServices
apple_sdk.frameworks.AppKit
Expand Down Expand Up @@ -271,7 +271,6 @@ in rec {
for f in \
"usb/build/Release/usb_bindings.node" \
"node-hid/build/Release/HID.node" \
"usb-detection/build/Release/detection.node" \
; do
cp node_modules/"$f" "$pathtoapp"/Contents/Resources/app/build/
done
Expand Down Expand Up @@ -304,6 +303,8 @@ in rec {
${if (cluster != "selfnode") then ''
cp installers/{genesis-byron.json,genesis-shelley.json,genesis-alonzo.json} "$dataDir"/
cp installers/genesis-conway.json "$dataDir"/ || true
cp installers/checkpoints.json "$dataDir"/ || true
cp installers/peer-snapshot.json "$dataDir"/ || true
'' else ''
cp installers/{signing.key,delegation.cert} "$dataDir"/
cp -f ${./../../utils/cardano/selfnode}/token-metadata.json "$dir"/
Expand All @@ -322,13 +323,6 @@ in rec {
${bundleNodeJsNativeModule} "$dir/$f"
done

# TODO: why is/was this "reverse" symlink needed? does it make sense?
(
cd "$dataDir"/app/node_modules/usb-detection/build/Release/
rm detection.node
ln -sfn ../../../../../../MacOS/detection.node
)

mv "$dir"/${lib.escapeShellArg launcherConfigs.${cluster}.installerConfig.spacedName} "$dir"/Frontend
chmod +x "$dir"/Frontend

Expand Down
65 changes: 36 additions & 29 deletions nix/internal/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ rec {
config.packageOverrides = super: {
# XXX: non-root users need to be able to use sd-device/device-monitor.c to detect Ledger:
# FIXME: find the correct (minimal) place to override this:
systemd = super.systemd.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches ++ [./libsystemd--device-monitor.patch];
});
# TODO: is it still needed?
# systemd = super.systemd.overrideAttrs (oldAttrs: {
# patches = oldAttrs.patches ++ [./libsystemd--device-monitor.patch];
# });
};
};

Expand Down Expand Up @@ -130,32 +131,38 @@ rec {
# };

nodejs = let
base = pkgs.nodejs-18_x;
in if !(pkgs.lib.hasInfix "-darwin" targetSystem) then base else base.overrideAttrs (drv: {
# XXX: we don’t want `bypass-xcodebuild.diff` or `bypass-darwin-xcrun-node16.patch`, rather we supply
# the pure `xcbuild` – without that, `blake2` doesn’t build,
# cf. <https://github.com/NixOS/nixpkgs/blob/29ae6a1f3d7a8886b3772df4dc42a13817875c7d/pkgs/development/web/nodejs/bypass-xcodebuild.diff>
patches = pkgs.lib.filter (patch: !(
pkgs.lib.hasInfix "bypass-xcodebuild" patch ||
pkgs.lib.hasInfix "bypass-darwin-xcrun" patch
)) drv.patches;
});

yarn = (pkgs.yarn.override { inherit nodejs; }).overrideAttrs (drv: {
# XXX: otherwise, unable to run our package.json scripts in Nix sandbox (patchShebangs doesn’t catch this)
postFixup = (drv.postFixup or "") + ''
sed -r 's,#!/bin/sh,#!${pkgs.bash}/bin/sh,g' -i $out/libexec/yarn/lib/cli.js
'';
});

yarn2nix = let
# Nixpkgs master @ 2022-07-18
# Why → newer `yarn2nix` uses `deep-equal` to see if anything changed in the lockfile, we need that.
source = pkgs.fetchzip {
url = "https://github.com/NixOS/nixpkgs/archive/e4d49de45a3b5dbcb881656b4e3986e666141ea9.tar.gz";
hash = "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=";
};
subdir = builtins.path { path = source + "/pkgs/development/tools/yarn2nix-moretea/yarn2nix"; };
base = pkgs.nodejs_24;
in if !(pkgs.lib.hasInfix "-darwin" targetSystem) then base else base
# FIXME: is this still needed?
# .overrideAttrs (drv: {
# # XXX: we don’t want `bypass-xcodebuild.diff` or `bypass-darwin-xcrun-node16.patch`, rather we supply
# # the pure `xcbuild` – without that, `blake2` doesn’t build,
# # cf. <https://github.com/NixOS/nixpkgs/blob/29ae6a1f3d7a8886b3772df4dc42a13817875c7d/pkgs/development/web/nodejs/bypass-xcodebuild.diff>
# patches = pkgs.lib.filter (patch: !(
# pkgs.lib.hasInfix "bypass-xcodebuild" patch ||
# pkgs.lib.hasInfix "bypass-darwin-xcrun" patch
# )) drv.patches;
# })
;

yarn =
(pkgs.yarn.override { inherit nodejs; }).overrideAttrs (drv: {
# XXX: otherwise, unable to run our package.json scripts in Nix sandbox (patchShebangs doesn’t catch this)
postFixup = (drv.postFixup or "") + ''
sed -r 's,#!/bin/sh,#!${pkgs.bash}/bin/sh,g' -i $out/libexec/yarn/lib/cli.js
'';
})
;

yarn2nix =
let
# # Nixpkgs master @ 2022-07-18
# # Why → newer `yarn2nix` uses `deep-equal` to see if anything changed in the lockfile, we need that.
# source = pkgs.fetchzip {
# url = "https://github.com/NixOS/nixpkgs/archive/e4d49de45a3b5dbcb881656b4e3986e666141ea9.tar.gz";
# hash = "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=";
# };
subdir = builtins.path { path = pkgs.path + "/pkgs/development/tools/yarn2nix-moretea"; };
in
import subdir {
inherit pkgs nodejs yarn;
Expand Down
1 change: 0 additions & 1 deletion nix/internal/runtime-nodejs-deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"unicode-properties",
"unicode-trie",
"usb",
"usb-detection",
"util-deprecate",
"varuint-bitcoin",
"whatwg-url",
Expand Down
Loading