Skip to content

Commit

Permalink
add binutils, curl, nnn, socat
Browse files Browse the repository at this point in the history
  • Loading branch information
elohmeier committed Aug 23, 2022
1 parent 47e77c0 commit 5df79b5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ Please see the [releases page](https://github.com/elohmeier/static-binaries/rele

## List of Tools

- [binutils](https://www.gnu.org/software/binutils/)
- [curl](https://curl.se/)
- [Nmap](https://nmap.org/)
- [nnn](https://github.com/jarun/nnn)
- [Python 2](https://www.python.org/)
- [socat](http://www.dest-unreach.org/socat)
- [tcpdump](https://www.tcpdump.org/)

29 changes: 27 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,51 @@
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
defaultPackage = forAllSystems (system: (with import nixpkgs { inherit system; }; (
defaultPackage = forAllSystems (system: (with import nixpkgs
{
inherit system;
config.packageOverrides = (pkgs: {
# remove when https://github.com/NixOS/nixpkgs/pull/187914 is merged
nnn = pkgs.nnn.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [ pkgs.musl-fts ];
NIX_CFLAGS_COMPILE = "-I${pkgs.musl-fts}/include";
NIX_LDFLAGS = "-lfts";
});
});
};
let
releaseNotes = writeText "release.txt" ''
- binutils v${binutils.version}
- curl v${curl.version}
- nmap v${nmap.version}
- nnn v${nnn.version}
- python2 v${python2.version}
- socat v${socat.version}
- tcpdump v${tcpdump.version}
'';
in
runCommand "static-binaries" { } ''
mkdir -p $out/bin
cp ${pkgsCross.musl32.pkgsStatic.binutils}/bin/objdump $out/bin/objdump-x86
cp ${pkgsCross.musl32.pkgsStatic.binutils}/bin/strings $out/bin/string-x86
cp ${pkgsCross.musl32.pkgsStatic.curl}/bin/curl $out/bin/curl-x86
cp ${pkgsCross.musl32.pkgsStatic.nmap}/bin/nmap $out/bin/nmap-x86
cp ${pkgsCross.musl32.pkgsStatic.nnn}/bin/.nnn-wrapped $out/bin/nnn-x86
cp ${pkgsCross.musl32.pkgsStatic.python2}/bin/python2.7 $out/bin/python2.7-x86
cp ${pkgsCross.musl32.pkgsStatic.socat}/bin/socat $out/bin/socat-x86
cp ${pkgsCross.musl32.pkgsStatic.tcpdump}/bin/tcpdump $out/bin/tcpdump-x86
cp ${pkgsCross.musl64.pkgsStatic.binutils}/bin/objdump $out/bin/objdump-x64
cp ${pkgsCross.musl64.pkgsStatic.binutils}/bin/strings $out/bin/string-x64
cp ${pkgsCross.musl64.pkgsStatic.curl}/bin/curl $out/bin/curl-x64
cp ${pkgsCross.musl64.pkgsStatic.nmap}/bin/nmap $out/bin/nmap-x64
cp ${pkgsCross.musl64.pkgsStatic.nnn}/bin/.nnn-wrapped $out/bin/nnn-x64
cp ${pkgsCross.musl64.pkgsStatic.python2}/bin/python2.7 $out/bin/python2.7-x64
cp ${pkgsCross.musl64.pkgsStatic.socat}/bin/socat $out/bin/socat-x64
cp ${pkgsCross.musl64.pkgsStatic.tcpdump}/bin/tcpdump $out/bin/tcpdump-x64
cp ${releaseNotes} $out/release.txt
''
)
));
};
}

0 comments on commit 5df79b5

Please sign in to comment.