liminix

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

default.nix (1864B)


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