Skip to content
Open
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
16 changes: 9 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,21 @@
};
};

# Cross-compilation packages
x86_64-linux = pkgs.stdenv.mkDerivation {
# Cross-compilation packages (statically linked with musl for portability)
x86_64-linux = pkgs.pkgsStatic.stdenv.mkDerivation {
pname = "try";
version = builtins.replaceStrings ["\n"] [""] (builtins.readFile ./VERSION);

src = inputs.self;

nativeBuildInputs = with pkgs; [
nativeBuildInputs = with pkgs.pkgsStatic; [
gcc
gnumake
];

# Force static linking for portable binary
buildPhase = ''
make
make LDFLAGS="-static"
'';

installPhase = ''
Expand All @@ -116,19 +117,20 @@
};
};

aarch64-linux = pkgs.pkgsCross.aarch64-multiplatform.stdenv.mkDerivation {
aarch64-linux = pkgs.pkgsCross.aarch64-multiplatform-musl.stdenv.mkDerivation {
pname = "try";
version = builtins.replaceStrings ["\n"] [""] (builtins.readFile ./VERSION);

src = inputs.self;

nativeBuildInputs = with pkgs.pkgsCross.aarch64-multiplatform; [
nativeBuildInputs = with pkgs.pkgsCross.aarch64-multiplatform-musl; [
gcc
gnumake
];

# Force static linking for portable binary
buildPhase = ''
make
make LDFLAGS="-static"
'';

installPhase = ''
Expand Down