liminix

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

default.nix (1777B)


      1 {
      2   device
      3 , liminix-config ? <liminix-config>
      4 , nixpkgs ? <nixpkgs>
      5 , borderVmConf ? ./bordervm.conf.nix
      6 }:
      7 
      8 let
      9   overlay = import ./overlay.nix;
     10   pkgs = import nixpkgs (device.system // {
     11     overlays = [overlay];
     12     config = {
     13       allowUnsupportedSystem = true; # mipsel
     14       permittedInsecurePackages = [
     15         "python-2.7.18.6"       # kernel backports needs python <3
     16         "python-2.7.18.7"
     17       ];
     18     };
     19   });
     20 
     21   eval = pkgs.lib.evalModules {
     22     modules = [
     23       { _module.args = { inherit pkgs; inherit (pkgs) lim; }; }
     24       ./modules/hardware.nix
     25       ./modules/base.nix
     26       ./modules/busybox.nix
     27       ./modules/hostname.nix
     28       device.module
     29       liminix-config
     30       ./modules/s6
     31       ./modules/users.nix
     32       ./modules/outputs.nix
     33     ];
     34   };
     35   config = eval.config;
     36 
     37   borderVm = ((import <nixpkgs/nixos/lib/eval-config.nix>) {
     38     system = builtins.currentSystem;
     39     modules = [
     40       ({  ... } : { nixpkgs.overlays = [ overlay ]; })
     41       (import ./bordervm-configuration.nix)
     42       borderVmConf
     43     ];
     44   }).config.system;
     45 in {
     46   outputs = config.system.outputs // {
     47     default = config.system.outputs.${config.hardware.defaultOutput};
     48     optionsJson =
     49       let o = import ./doc/extract-options.nix {
     50             inherit pkgs eval;
     51             lib = pkgs.lib;
     52           };
     53       in pkgs.writeText "options.json" (builtins.toJSON o);
     54   };
     55 
     56   # this is just here as a convenience, so that we can get a
     57   # cross-compiling nix-shell for any package we're customizing
     58   inherit pkgs;
     59 
     60   buildEnv = pkgs.mkShell {
     61     packages = with pkgs.pkgsBuildBuild; [
     62       tufted
     63       routeros.routeros
     64       routeros.ros-exec-script
     65       run-liminix-vm
     66       borderVm.build.vm
     67       go-l2tp
     68       min-copy-closure
     69       fennelrepl
     70     ];
     71   };
     72 }