diff --git a/flake.nix b/flake.nix index 6118bde487d..57b642e936e 100644 --- a/flake.nix +++ b/flake.nix @@ -206,6 +206,10 @@ nodePackages = cardano-node-runtime.packages.${system}; nodeProject = cardano-node-runtime.project.${system}; + nodeConfigs = lib.fileset.toSource { + root = ./configs; + fileset = ./configs; + }; walletProject = (import ./nix/haskell.nix CHaP @@ -319,7 +323,7 @@ in lib.optionalAttrs buildPlatform.isLinux { linux64.release = import ./nix/release-package.nix { - inherit pkgs; + inherit pkgs nodeConfigs; walletLib = lib; exes = linuxReleaseExes; platform = "linux64"; @@ -337,7 +341,7 @@ }; in { release = import ./nix/release-package.nix { - inherit pkgs; + inherit pkgs nodeConfigs; walletLib = lib; exes = [ windowsPackages.cardano-wallet @@ -364,7 +368,7 @@ // lib.optionalAttrs buildPlatform.isMacOS { macos-intel = lib.optionalAttrs buildPlatform.isx86_64 { release = import ./nix/release-package.nix { - inherit pkgs; + inherit pkgs nodeConfigs; walletLib = lib; exes = let macOsPkgs = mkPackages project; in [ macOsPkgs.cardano-wallet @@ -379,7 +383,7 @@ }; macos-silicon = lib.optionalAttrs buildPlatform.isAarch64 { release = import ./nix/release-package.nix { - inherit pkgs; + inherit pkgs nodeConfigs; walletLib = lib; exes = let macOsPkgs = mkPackages project; in [ macOsPkgs.cardano-wallet diff --git a/nix/lib.nix b/nix/lib.nix index bdab847f849..91306eef956 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -7,7 +7,7 @@ lib rec { # Imports from nixpkgs.lib inherit (lib) filterAttrsRecursive recursiveUpdate collect - optionalAttrs mapAttrs isDerivation; + optionalAttrs mapAttrs isDerivation fileset; /* Convert versions string from Cabal (YYYY.M.D) to git tag format (vYYYY-MM-DD). diff --git a/nix/release-package.nix b/nix/release-package.nix index 37734b61188..ad4223a54c5 100644 --- a/nix/release-package.nix +++ b/nix/release-package.nix @@ -10,6 +10,7 @@ , walletLib , platform , exes +, nodeConfigs , format }: @@ -71,6 +72,7 @@ pkgs.stdenv.mkDerivation { cp --no-preserve=timestamps --update=none --recursive \ ${lib.concatMapStringsSep " " (exe: "${exe}/bin/*") exes} \ $name + chmod -R +w $name '' + lib.optionalString isMacOS '' @@ -79,6 +81,10 @@ pkgs.stdenv.mkDerivation { for a in *; do /usr/bin/codesign -f -s - $a; done ) + '' + '' + # Add configuration files + mkdir -p $name/configs + cp --recursive ${nodeConfigs}/cardano/* $name/configs '' + lib.optionalString (isLinux || isMacOS) '' mkdir -p $name/auto-completion/{bash,zsh,fish} cp ${exe}/share/bash-completion/completions/* $name/auto-completion/bash/$exeName.sh