Skip to content

Commit

Permalink
[ADP-3388] Add configs to release-package.nix (#4686)
Browse files Browse the repository at this point in the history
- [x] Include  node configurations in the OS specific release packages

ADP-3388
  • Loading branch information
HeinrichApfelmus authored Jul 17, 2024
2 parents 9f29038 + 520ed0c commit 930818b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 8 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand All @@ -337,7 +341,7 @@
};
in {
release = import ./nix/release-package.nix {
inherit pkgs;
inherit pkgs nodeConfigs;
walletLib = lib;
exes = [
windowsPackages.cardano-wallet
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nix/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 6 additions & 0 deletions nix/release-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
, walletLib
, platform
, exes
, nodeConfigs
, format
}:

Expand Down Expand Up @@ -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 ''
Expand All @@ -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
Expand Down

0 comments on commit 930818b

Please sign in to comment.