Skip to content

Instantly share code, notes, and snippets.

@Mic92
Forked from abbradar/shell.nix
Created March 25, 2018 09:03
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Mic92/b59054188c595e5652cacf50485583e0 to your computer and use it in GitHub Desktop.
Save Mic92/b59054188c595e5652cacf50485583e0 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
];
multiPkgs = null;
extraOutputsToInstall = [ "dev" ];
profile = ''
export hardeningDisable=all
'';
};
in fhs.env
@SebTM
Copy link

SebTM commented Jan 27, 2022

Build is failing with python 2, after switching to python 3 it's working again, maybe you can adjust? :)

@Mic92
Copy link
Author

Mic92 commented Jan 28, 2022

This file is maintained here now: https://github.com/nix-community/nix-environments/blob/master/envs/openwrt/shell.nix
Please make a PR if necessary.

@SebTM
Copy link

SebTM commented Jan 31, 2022

Thanks for pointing out, I got across from the WIki where this Gist was still referenced. As I've updated the page before, I changed the reference to the link above. Will also make the PR there 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment