2022-10-07 00:24:35 +01:00
|
|
|
{
|
2024-03-22 21:55:44 +00:00
|
|
|
deviceName ? null
|
|
|
|
, device ? (import ./devices/${deviceName} )
|
2023-01-29 09:23:09 +00:00
|
|
|
, liminix-config ? <liminix-config>
|
2023-02-05 22:38:21 +00:00
|
|
|
, nixpkgs ? <nixpkgs>
|
2023-02-20 17:46:07 +00:00
|
|
|
, borderVmConf ? ./bordervm.conf.nix
|
2022-09-19 23:51:38 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
overlay = import ./overlay.nix;
|
2023-02-05 22:38:21 +00:00
|
|
|
pkgs = import nixpkgs (device.system // {
|
2024-08-23 19:36:34 +02:00
|
|
|
overlays = [ overlay ];
|
2023-02-20 17:46:07 +00: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 17:46:07 +00:00
|
|
|
];
|
|
|
|
};
|
2023-01-29 10:00:13 +00:00
|
|
|
});
|
2023-02-10 23:10:44 +00: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 17:22:27 +00: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 17:22:27 +00:00
|
|
|
device.module
|
|
|
|
liminix-config
|
|
|
|
];
|
2023-11-09 19:29:36 +00:00
|
|
|
};
|
2024-04-21 20:34:39 +02:00
|
|
|
|
2023-11-09 19:29:36 +00:00
|
|
|
config = eval.config;
|
2022-10-05 21:52:30 +01:00
|
|
|
|
2023-02-15 21:21:52 +00:00
|
|
|
borderVm = ((import <nixpkgs/nixos/lib/eval-config.nix>) {
|
|
|
|
system = builtins.currentSystem;
|
|
|
|
modules = [
|
2024-05-22 18:44:12 +01:00
|
|
|
{
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
go-l2tp = final.callPackage ./pkgs/go-l2tp {};
|
|
|
|
tufted = final.callPackage ./pkgs/tufted {};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
2023-02-15 21:21:52 +00:00
|
|
|
(import ./bordervm-configuration.nix)
|
2023-02-20 17:46:07 +00:00
|
|
|
borderVmConf
|
2023-02-15 21:21:52 +00:00
|
|
|
];
|
2023-02-14 22:08:52 +00:00
|
|
|
}).config.system;
|
2022-10-03 22:28:15 +01:00
|
|
|
in {
|
2024-04-21 20:34:39 +02:00
|
|
|
inherit evalModules;
|
|
|
|
|
2023-07-13 19:24:59 +01:00
|
|
|
outputs = config.system.outputs // {
|
|
|
|
default = config.system.outputs.${config.hardware.defaultOutput};
|
2023-11-09 19:29:36 +00: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-10 23:10:44 +00:00
|
|
|
};
|
2022-10-03 22:28:15 +01:00
|
|
|
|
2022-09-25 13:18:26 +01: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-06 23:19:35 +00:00
|
|
|
inherit pkgs;
|
2023-02-08 00:03:37 +00:00
|
|
|
|
2024-05-12 23:44:52 +02:00
|
|
|
deployEnv = pkgs.mkShell {
|
|
|
|
packages = with pkgs.pkgsBuildBuild; [
|
|
|
|
tufted
|
|
|
|
min-copy-closure
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-08 18:10:11 +00:00
|
|
|
buildEnv = pkgs.mkShell {
|
|
|
|
packages = with pkgs.pkgsBuildBuild; [
|
|
|
|
tufted
|
|
|
|
routeros.routeros
|
|
|
|
routeros.ros-exec-script
|
2023-09-20 18:33:08 +01:00
|
|
|
run-liminix-vm
|
2023-02-14 22:08:52 +00:00
|
|
|
borderVm.build.vm
|
|
|
|
go-l2tp
|
2023-05-11 23:53:25 +01:00
|
|
|
min-copy-closure
|
2023-07-04 22:58:51 +01:00
|
|
|
fennelrepl
|
2024-01-23 11:56:34 +00:00
|
|
|
lzma
|
2024-04-06 12:30:41 +01:00
|
|
|
lua
|
2023-02-08 18:10:11 +00:00
|
|
|
];
|
|
|
|
};
|
2022-09-20 18:54:27 +01:00
|
|
|
}
|