2022-10-07 01:24:35 +02:00
|
|
|
{
|
2024-03-22 22:55:44 +01:00
|
|
|
deviceName ? null
|
|
|
|
, device ? (import ./devices/${deviceName} )
|
2023-01-29 10:23:09 +01:00
|
|
|
, liminix-config ? <liminix-config>
|
2023-02-05 23:38:21 +01:00
|
|
|
, nixpkgs ? <nixpkgs>
|
2023-02-20 18:46:07 +01:00
|
|
|
, borderVmConf ? ./bordervm.conf.nix
|
2022-09-20 00:51:38 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
overlay = import ./overlay.nix;
|
2023-02-05 23:38:21 +01:00
|
|
|
pkgs = import nixpkgs (device.system // {
|
2024-08-23 19:36:34 +02:00
|
|
|
overlays = [ overlay ];
|
2023-02-20 18:46:07 +01:00
|
|
|
config = {
|
|
|
|
allowUnsupportedSystem = true; # mipsel
|
|
|
|
permittedInsecurePackages = [
|
2024-05-12 23:45:07 +02:00
|
|
|
"python-2.7.18.8" # kernel backports needs python <3
|
2023-02-20 18:46:07 +01:00
|
|
|
];
|
|
|
|
};
|
2023-01-29 11:00:13 +01:00
|
|
|
});
|
2023-02-11 00:10:44 +01:00
|
|
|
|
2024-04-21 20:34:39 +02:00
|
|
|
evalModules = (import ./lib/eval-config.nix {
|
|
|
|
inherit nixpkgs pkgs;
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
});
|
|
|
|
|
|
|
|
eval = evalModules {
|
2023-02-16 18:22:27 +01:00
|
|
|
modules = [
|
2024-08-23 19:36:34 +02:00
|
|
|
{
|
2024-09-18 09:10:07 +02:00
|
|
|
nixpkgs = {
|
2024-09-18 17:04:51 +02:00
|
|
|
source = nixpkgs;
|
2024-09-18 09:10:07 +02:00
|
|
|
overlays = [ overlay ];
|
|
|
|
config.permittedInsecurePackages = [
|
|
|
|
"python-2.7.18.8"
|
|
|
|
];
|
|
|
|
};
|
2024-08-23 19:36:34 +02:00
|
|
|
}
|
2023-02-16 18:22:27 +01:00
|
|
|
device.module
|
|
|
|
liminix-config
|
|
|
|
];
|
2023-11-09 20:29:36 +01:00
|
|
|
};
|
2024-04-21 20:34:39 +02:00
|
|
|
|
2023-11-09 20:29:36 +01:00
|
|
|
config = eval.config;
|
2022-10-05 22:52:30 +02:00
|
|
|
|
2023-02-15 22:21:52 +01:00
|
|
|
borderVm = ((import <nixpkgs/nixos/lib/eval-config.nix>) {
|
|
|
|
system = builtins.currentSystem;
|
|
|
|
modules = [
|
2024-05-22 19:44:12 +02:00
|
|
|
{
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
go-l2tp = final.callPackage ./pkgs/go-l2tp {};
|
|
|
|
tufted = final.callPackage ./pkgs/tufted {};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
2023-02-15 22:21:52 +01:00
|
|
|
(import ./bordervm-configuration.nix)
|
2023-02-20 18:46:07 +01:00
|
|
|
borderVmConf
|
2023-02-15 22:21:52 +01:00
|
|
|
];
|
2023-02-14 23:08:52 +01:00
|
|
|
}).config.system;
|
2022-10-03 23:28:15 +02:00
|
|
|
in {
|
2024-09-30 16:39:58 +02:00
|
|
|
inherit evalModules config;
|
2024-04-21 20:34:39 +02:00
|
|
|
|
2023-07-13 20:24:59 +02:00
|
|
|
outputs = config.system.outputs // {
|
|
|
|
default = config.system.outputs.${config.hardware.defaultOutput};
|
2023-11-09 20:29:36 +01:00
|
|
|
optionsJson =
|
|
|
|
let o = import ./doc/extract-options.nix {
|
|
|
|
inherit pkgs eval;
|
|
|
|
lib = pkgs.lib;
|
|
|
|
};
|
|
|
|
in pkgs.writeText "options.json" (builtins.toJSON o);
|
2023-02-11 00:10:44 +01:00
|
|
|
};
|
2022-10-03 23:28:15 +02:00
|
|
|
|
2022-09-25 14:18:26 +02:00
|
|
|
# this is just here as a convenience, so that we can get a
|
|
|
|
# cross-compiling nix-shell for any package we're customizing
|
2023-02-07 00:19:35 +01:00
|
|
|
inherit pkgs;
|
2023-02-08 01:03:37 +01:00
|
|
|
|
2024-05-12 23:44:52 +02:00
|
|
|
deployEnv = pkgs.mkShell {
|
|
|
|
packages = with pkgs.pkgsBuildBuild; [
|
|
|
|
tufted
|
|
|
|
min-copy-closure
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-08 19:10:11 +01:00
|
|
|
buildEnv = pkgs.mkShell {
|
|
|
|
packages = with pkgs.pkgsBuildBuild; [
|
|
|
|
tufted
|
|
|
|
routeros.routeros
|
|
|
|
routeros.ros-exec-script
|
2023-09-20 19:33:08 +02:00
|
|
|
run-liminix-vm
|
2023-02-14 23:08:52 +01:00
|
|
|
borderVm.build.vm
|
|
|
|
go-l2tp
|
2023-05-12 00:53:25 +02:00
|
|
|
min-copy-closure
|
2023-07-04 23:58:51 +02:00
|
|
|
fennelrepl
|
2024-01-23 12:56:34 +01:00
|
|
|
lzma
|
2024-04-06 13:30:41 +02:00
|
|
|
lua
|
2023-02-08 19:10:11 +01:00
|
|
|
];
|
|
|
|
};
|
2022-09-20 19:54:27 +02:00
|
|
|
}
|