liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

overlay.nix (5065B)


      1 final: prev:
      2 let
      3   extraPkgs = import ./pkgs/default.nix {
      4     inherit (final) lib callPackage;
      5   };
      6   inherit (final) fetchpatch;
      7   lua_no_readline = prev.lua5_3.overrideAttrs(o: {
      8     name = "lua-tty";
      9     preBuild = ''
     10       makeFlagsArray+=(PLAT="posix" SYSLIBS="-Wl,-E -ldl"  CFLAGS="-O2 -fPIC -DLUA_USE_POSIX -DLUA_USE_DLOPEN")
     11     '';
     12     # lua in nixpkgs has a postInstall stanza that assumes only
     13     # one output, we need to override that if we're going to
     14     # convert to multi-output
     15     # outputs = ["bin" "man" "out"];
     16     makeFlags =
     17       builtins.filter (x: (builtins.match "(PLAT|MYLIBS).*" x) == null)
     18         o.makeFlags;
     19   });
     20 
     21   s6 = prev.s6.overrideAttrs(o:
     22     let
     23       patch = fetchpatch {
     24         # add "p" directive in s6-log
     25         url = "https://github.com/skarnet/s6/commit/ddc76841398dfd5e18b22943727ad74b880236d3.patch";
     26         hash = "sha256-fBtUinBdp5GqoxgF6fcR44Tu8hakxs/rOShhuZOgokc=";
     27       };
     28       patch_needed = builtins.compareVersions o.version "2.11.1.2" <= 0;
     29     in {
     30       configureFlags = (builtins.filter
     31         (x: (builtins.match ".*shared.*" x) == null)
     32         o.configureFlags) ++
     33       [
     34         "--disable-allstatic"
     35         "--disable-static"
     36         "--enable-shared"
     37       ];
     38       hardeningDisable = ["all"];
     39       stripAllList = [ "sbin" "bin" ];
     40       patches =
     41         (if o ? patches then o.patches else []) ++
     42         (if patch_needed then [ patch ] else []);
     43     });
     44   lua = let s = lua_no_readline.override { self = s; }; in s;
     45 in
     46 extraPkgs // {
     47   mtdutils = prev.mtdutils.overrideAttrs(o: {
     48     patches = (if o ? patches then o.patches else []) ++ [
     49       ./pkgs/mtdutils/0001-mkfs.jffs2-add-graft-option.patch
     50     ];
     51   });
     52 
     53   rsyncSmall =
     54     let r = prev.rsync.overrideAttrs(o: {
     55           configureFlags = o.configureFlags ++ [
     56             "--disable-openssl"
     57           ];
     58         });
     59     in r.override { openssl = null; };
     60 
     61   chrony =
     62     let chrony' = prev.chrony.overrideAttrs(o: {
     63           configureFlags = [
     64             "--chronyvardir=$(out)/var/lib/chrony"
     65             "--disable-readline"
     66             "--disable-editline"
     67           ];
     68         });
     69     in chrony'.override {
     70       gnutls = null;
     71       nss = null;
     72       nspr = null;
     73       readline = null;
     74       libedit = null;
     75       libcap = null;
     76       libseccomp = null;
     77       # should texinfo be in nativeBuildInputs instead of
     78       # buildInputs?
     79       texinfo = null;
     80 
     81     };
     82 
     83   strace = prev.strace.override { libunwind = null; };
     84 
     85   kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
     86     # For kexecboot we copy kexec into a ramdisk on the system being
     87     # upgraded from. This is more likely to work if kexec is
     88     # statically linked so doesn't have dependencies on store paths that
     89     # may not exist on that machine. (We can't nix-copy-closure as
     90     # the store may not be on a writable filesystem)
     91     LDFLAGS = "-static";
     92 
     93     patches = o.patches ++ [
     94       (fetchpatch {
     95         # merge user command line options into DTB chosen
     96         url = "https://patch-diff.githubusercontent.com/raw/horms/kexec-tools/pull/3.patch";
     97         hash = "sha256-MvlJhuex9dlawwNZJ1sJ33YPWn1/q4uKotqkC/4d2tk=";
     98       })
     99       pkgs/kexec-map-file.patch
    100     ];
    101   });
    102 
    103   luaFull = prev.lua;
    104   inherit lua;
    105 
    106   inherit s6;
    107   s6-linux-init = prev.s6-linux-init.override {
    108     skawarePackages = prev.skawarePackages // {
    109       inherit s6;
    110     };
    111   };
    112   s6-rc = prev.s6-rc.override {
    113     skawarePackages = prev.skawarePackages // {
    114       inherit s6;
    115     };
    116   };
    117 
    118   nftables = prev.nftables.overrideAttrs(o: {
    119     configureFlags = [
    120       "--disable-debug"
    121       "--disable-python"
    122       "--with-mini-gmp"
    123       "--without-cli"
    124     ];
    125   });
    126 
    127   dnsmasq =
    128     let d =  prev.dnsmasq.overrideAttrs(o: {
    129           preBuild =  ''
    130               makeFlagsArray=("COPTS=")
    131           '';
    132         });
    133     in d.override {
    134       dbusSupport = false;
    135       nettle = null;
    136     };
    137 
    138   hostapd =
    139     let
    140       config =  [
    141         "CONFIG_DRIVER_NL80211=y"
    142         "CONFIG_IAPP=y"
    143         "CONFIG_IEEE80211AC=y"
    144         "CONFIG_IEEE80211N=y"
    145         "CONFIG_IEEE80211W=y"
    146         "CONFIG_INTERNAL_LIBTOMMATH=y"
    147         "CONFIG_INTERNAL_LIBTOMMATH_FAST=y"
    148         "CONFIG_IPV6=y"
    149         "CONFIG_LIBNL32=y"
    150         "CONFIG_PKCS12=y"
    151         "CONFIG_RSN_PREAUTH=y"
    152         "CONFIG_TLS=internal"
    153       ];
    154       h = prev.hostapd.overrideAttrs(o: {
    155         extraConfig = "";
    156         configurePhase = ''
    157           cat > hostapd/defconfig <<EOF
    158           ${builtins.concatStringsSep "\n" config}
    159           EOF
    160           ${o.configurePhase}
    161         '';
    162       });
    163     in h.override { openssl = null; sqlite = null; };
    164 
    165   dropbear = prev.dropbear.overrideAttrs (o: {
    166     postPatch = ''
    167      (echo '#define DSS_PRIV_FILENAME "/run/dropbear/dropbear_dss_host_key"'
    168       echo '#define RSA_PRIV_FILENAME "/run/dropbear/dropbear_rsa_host_key"'
    169       echo '#define ECDSA_PRIV_FILENAME "/run/dropbear/dropbear_ecdsa_host_key"'
    170       echo '#define ED25519_PRIV_FILENAME "/run/dropbear/dropbear_ed25519_host_key"') > localoptions.h
    171     '';
    172   });
    173 
    174   pppBuild = prev.ppp;
    175 }