Skip to content

Instantly share code, notes, and snippets.

@cyber-murmel
Forked from Mic92/shell.nix
Created May 31, 2021 20:58
Show Gist options
  • Save cyber-murmel/00778d9830a7521c19bfa6cb2d7b88fa to your computer and use it in GitHub Desktop.
Save cyber-murmel/00778d9830a7521c19bfa6cb2d7b88fa to your computer and use it in GitHub Desktop.
Nix FHS env for OpenWrt
{ pkgs ? import <nixpkgs> {} }:
let
fixWrapper = pkgs.runCommand "fix-wrapper" {} ''
mkdir -p $out/bin
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i")
done
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i")
done
'';
fhs = pkgs.buildFHSUserEnv {
name = "openwrt-env";
targetPkgs = pkgs: with pkgs;
[ git
perl
gnumake
gcc
unzip
utillinux
python2
patch
wget
file
subversion
which
pkgconfig
openssl
fixWrapper
systemd
binutils
ncurses
zlib
zlib.static
glibc.static
iputils
];
multiPkgs = null;
extraOutputsToInstall = [ "dev" ];
profile = ''
export hardeningDisable=all
'';
};
in fhs.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment