liminix

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

default.nix (4166B)


      1 {
      2   callPackage
      3 , lib
      4 }:
      5 let
      6   typeChecked = caller: type: value:
      7     let
      8       inherit (lib) types mergeDefinitions;
      9       defs = [{ file = caller; inherit value; }];
     10       type' = types.submodule { options = type; };
     11     in (mergeDefinitions [] type' defs).mergedValue;
     12 in {
     13   liminix = {
     14     builders =  {
     15       squashfs = callPackage ./liminix-tools/builders/squashfs.nix {};
     16       dtb = callPackage ./kernel/dtb.nix {};
     17       uimage = callPackage ./kernel/uimage.nix {};
     18       kernel = callPackage ./kernel {};
     19     };
     20     callService = path : parameters :
     21       let pkg = callPackage path {};
     22           checkTypes = t : p : typeChecked (builtins.toString path) t p;
     23       in {
     24         inherit parameters;
     25         build = { dependencies ? [], ... } @ args :
     26           let
     27             s = pkg (checkTypes parameters
     28               (builtins.removeAttrs args ["dependencies"]));
     29           in s.overrideAttrs (o: {
     30             dependencies = (builtins.map (d: d.name) dependencies) ++ o.dependencies;
     31             buildInputs = dependencies ++ o.buildInputs;
     32           });
     33       };
     34     lib = {
     35       types =
     36         let inherit (lib) types isDerivation;
     37         in  rec {
     38           service = types.package // {
     39             name = "service";
     40             description = "s6-rc service";
     41             check = x: isDerivation x && x ? serviceType;
     42           };
     43           interface = service;
     44           serviceDefn = types.attrs // {
     45             name = "service-defn";
     46             description = "parametrisable s6-rc service definition";
     47             check = x: lib.isAttrs x && x ? parameters && x ? build;
     48           };
     49         };
     50       inherit typeChecked;
     51     };
     52     networking =  callPackage ./liminix-tools/networking {};
     53     services = callPackage ./liminix-tools/services {};
     54   };
     55 
     56   # please keep the rest of this list alphabetised :-)
     57 
     58   anoia = callPackage ./anoia {};
     59   fennel = callPackage ./fennel {};
     60   fennelrepl = callPackage ./fennelrepl {};
     61   firewallgen = callPackage ./firewallgen {};
     62   firmware-utils = callPackage ./firmware-utils {};
     63   gen_init_cpio = callPackage ./gen_init_cpio {};
     64   go-l2tp = callPackage ./go-l2tp {};
     65   hi = callPackage ./hi {};
     66   ifwait = callPackage ./ifwait {};
     67   initramfs-peek = callPackage ./initramfs-peek {};
     68   kernel-backport = callPackage ./kernel-backport {};
     69   kmodloader = callPackage ./kmodloader {};
     70   levitate = callPackage ./levitate {};
     71   libubootenv = callPackage ./libubootenv {};
     72   linotify = callPackage ./linotify {};
     73 
     74   # we need to build real lzma instead of using xz, because the lzma
     75   # decoder in u-boot doesn't understand streaming lzma archives
     76   # ("Stream with EOS marker is not supported") and xz can't create
     77   # non-streaming ones.  See
     78   # https://sourceforge.net/p/squashfs/mailman/message/26599379/
     79   lzma = callPackage ./lzma {};
     80 
     81   mac80211 = callPackage ./mac80211 {};
     82   zyxel-bootconfig = callPackage ./zyxel-bootconfig {};
     83   min-collect-garbage = callPackage ./min-collect-garbage {};
     84   min-copy-closure = callPackage ./min-copy-closure {};
     85   netlink-lua = callPackage ./netlink-lua {};
     86   odhcp-script = callPackage ./odhcp-script {};
     87   odhcp6c = callPackage ./odhcp6c {};
     88   openwrt = callPackage ./openwrt {};
     89   ppp = callPackage ./ppp {};
     90   pppoe = callPackage ./pppoe {};
     91   preinit = callPackage ./preinit {};
     92   pseudofile = callPackage ./pseudofile {};
     93   routeros = callPackage ./routeros {};
     94   run-liminix-vm = callPackage ./run-liminix-vm {};
     95   s6-init-bin =  callPackage ./s6-init-bin {};
     96   s6-rc-database = callPackage ./s6-rc-database {};
     97 
     98   # schnapps is written by Turris and provides a high-level interface
     99   # to btrfs snapshots. It may be useful on the Turris Omnia to
    100   # install Liminix while retaining the ability to rollback to the
    101   # vendor OS, or even to derisk Liminix updates on that device
    102   schnapps = callPackage ./schnapps {};
    103 
    104   serviceFns = callPackage ./service-fns {};
    105   swconfig = callPackage ./swconfig {};
    106   systemconfig = callPackage ./systemconfig {};
    107   tufted = callPackage ./tufted {};
    108   writeAshScript = callPackage ./write-ash-script {};
    109   writeFennel = callPackage ./write-fennel {};
    110   writeFennelScript = callPackage ./write-fennel-script {};
    111 }