56 lines
1.6 KiB
Nix
56 lines
1.6 KiB
Nix
# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan.lahfa@dgnum.eu>
|
|
#
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
{
|
|
config,
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
let
|
|
svc = config.system.service;
|
|
parentConfig = config;
|
|
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"
|
|
(
|
|
{ config, ... }:
|
|
{
|
|
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 = parentConfig.hardware.networkInterfaces.lan;
|
|
};
|
|
inherit (parentConfig.services) sshd;
|
|
defaultroute4 = svc.network.route.build {
|
|
via = "$(output ${config.services.dhcpv4} router)";
|
|
target = "default";
|
|
dependencies = [ config.services.dhcpv4 ];
|
|
};
|
|
};
|
|
}
|
|
)
|
|
];
|
|
hostname = "${parentConfig.hostname}-live";
|
|
nixpkgs.buildPlatform = builtins.currentSystem;
|
|
|
|
defaultProfile.packages = [ mtdutils ];
|
|
# Only keep root, which should inherit from DGN access control's root permissions.
|
|
users.root = config.users.root;
|
|
};
|
|
})
|
|
];
|
|
}
|