Skip to content

Commit

Permalink
Add configs to release-package.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino authored and HeinrichApfelmus committed Jul 17, 2024
1 parent 472181c commit 2fcc777
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,11 @@ pkgs.stdenv.mkDerivation {
cp --no-preserve=timestamps --update=none --recursive \
${lib.concatMapStringsSep " " (exe: "${exe}/bin/*") exes} \
$name
# add configuration files
mkdir -p $name/configs
cp --recursive ${nodeConfigs}/cardano/* $name/configs
chmod -R +w $name
'' + lib.optionalString isMacOS ''
Expand Down

0 comments on commit 2fcc777

Please sign in to comment.