45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
let
|
|
svc = config.system.service;
|
|
in
|
|
{
|
|
defaultProfile.packages = with pkgs; [
|
|
# Levitate enable us to mass-reinstall the system on the fly.
|
|
(levitate.override {
|
|
config = {
|
|
imports = [
|
|
"${modulesPath}/network"
|
|
"${modulesPath}/ssh"
|
|
"${modulesPath}/hardware.nix"
|
|
"${modulesPath}/kernel"
|
|
"${modulesPath}/outputs/tftpboot.nix"
|
|
"${modulesPath}/outputs.nix"
|
|
];
|
|
nixpkgs.buildPlatform = builtins.currentSystem;
|
|
services = {
|
|
# In this situation, we fallback to the appro VLAN.
|
|
# TODO: add support for the admin VLAN.
|
|
# Simplest DHCPv4 we can find.
|
|
dhcpv4 = svc.network.dhcp.client.build {
|
|
interface = config.hardware.networkInterfaces.lan;
|
|
};
|
|
inherit (config.services) sshd;
|
|
defaultroute4 = svc.network.route.build {
|
|
via = "$(output ${config.services.dhcpv4} router)";
|
|
target = "default";
|
|
dependencies = [ config.services.dhcpv4 ];
|
|
};
|
|
};
|
|
|
|
defaultProfile.packages = [ mtdutils ];
|
|
# Only keep root, which should inherit from DGN access control's root permissions.
|
|
users.root = config.users.root;
|
|
};
|
|
})
|
|
];
|
|
}
|