Created
April 25, 2022 02:16
-
-
Save kotatsuyaki/baaa4b8f65f89ab6dc94376522439be2 to your computer and use it in GitHub Desktop.
Package Ubuntu binary in Nix with autoPatchelfHook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; | |
utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, utils }: | |
utils.lib.eachDefaultSystem (system: | |
let | |
pkgs = import nixpkgs { inherit system; }; | |
in | |
{ | |
defaultPackage = pkgs.stdenv.mkDerivation rec { | |
name = "proj"; | |
version = "0.1"; | |
src = ./.; | |
nativeBuildInputs = with pkgs; [ | |
autoPatchelfHook | |
]; | |
buildInputs = with pkgs; [ | |
glfw3 | |
stdenv.cc.cc | |
dbus | |
]; | |
installPhase = '' | |
mkdir -p $out/bin | |
install -m755 proj $out/bin/proj | |
''; | |
}; | |
devShell = with pkgs; mkShell { | |
buildInputs = with pkgs; [ rnix-lsp ]; | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment