diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2022-04-04 20:51:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-04 20:51:53 +0200 |
| commit | 4d69ef6284117266782776485a845db7597bcee5 (patch) | |
| tree | 8fd4f2c5dbba7ce02ec5570ef477b7a22d9654ce | |
| parent | fix: remove redundant `rustc` from buildInputs (#1296) (diff) | |
| download | sl0ppij-4d69ef6284117266782776485a845db7597bcee5.tar.gz sl0ppij-4d69ef6284117266782776485a845db7597bcee5.tar.xz sl0ppij-4d69ef6284117266782776485a845db7597bcee5.zip | |
add: musl package to nix (#1297)
Build a musl package from the repo, by invoking:
```
nix build "github:zellij-org/zellij#zellij-musl"
```
makes it possible to build bundled applications, that don't need patches
to run:
```
nix bundle --bundler github:NixOS/bundlers#toDEB "github:zellij-org/zellij#zellij-musl"
```
This will build a `.deb` file, that can be installed with apt.
| -rw-r--r-- | nix/default.nix | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/nix/default.nix b/nix/default.nix index bee39780..e672693f 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -17,6 +17,10 @@ flake-utils.lib.eachSystem [ overlays = [(import rust-overlay)]; pkgs = import nixpkgs {inherit system overlays;}; + pkgsMusl = import nixpkgs { + inherit system overlays; + crossSystem = {config = "x86_64-unknown-linux-musl";}; + }; crate2nixPkgs = import nixpkgs { inherit system; @@ -141,6 +145,19 @@ in rec { meta ; }; + # musl cross-compilation - static binary + packages.zellij-musl = (pkgsMusl.makeRustPlatform {inherit rustc cargo;}).buildRustPackage { + inherit + src + name + cargoLock + postInstall + buildInputs + nativeBuildInputs + desktopItems + meta + ; + }; defaultPackage = packages.zellij; @@ -157,10 +174,11 @@ in rec { name = "fmt-shell"; nativeBuildInputs = fmtInputs; }; - e2eShell = pkgs.mkShell { + e2eShell = pkgs.pkgsMusl.mkShell { name = "e2e-shell"; nativeBuildInputs = [ pkgs.cargo-make + pkgs.pkgsMusl.cargo ]; }; }; |
