liminix-fork/default.nix
Daniel Barlow bbd699d7b1 add module for device-specific config
in principle this module declares the config that's defined in
devices/foo/default.nix
2023-03-03 20:04:39 +00:00

60 lines
1.4 KiB
Nix

{
device
, liminix-config ? <liminix-config>
, nixpkgs ? <nixpkgs>
, borderVmConf ? ./bordervm.conf.nix
}:
let
overlay = import ./overlay.nix;
pkgs = import nixpkgs (device.system // {
overlays = [overlay];
config = {
allowUnsupportedSystem = true; # mipsel
permittedInsecurePackages = [
"python-2.7.18.6" # kernel backports needs python <3
];
};
});
config = (pkgs.lib.evalModules {
modules = [
{ _module.args = { inherit pkgs; lib = pkgs.lib; }; }
./modules/hardware.nix
./modules/base.nix
device.module
liminix-config
./modules/s6
./modules/users.nix
./modules/outputs.nix
];
}).config;
borderVm = ((import <nixpkgs/nixos/lib/eval-config.nix>) {
system = builtins.currentSystem;
modules = [
({ ... } : { nixpkgs.overlays = [ overlay ]; })
(import ./bordervm-configuration.nix)
borderVmConf
];
}).config.system;
in {
outputs = config.outputs // {
default = config.outputs.${config.device.defaultOutput};
};
# this is just here as a convenience, so that we can get a
# cross-compiling nix-shell for any package we're customizing
inherit pkgs;
buildEnv = pkgs.mkShell {
packages = with pkgs.pkgsBuildBuild; [
tufted
routeros.routeros
routeros.ros-exec-script
mips-vm
borderVm.build.vm
go-l2tp
];
};
}