liminix-fork/vanilla-configuration.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

2022-09-25 12:22:15 +02:00
{ config, pkgs, ... } :
let
inherit (pkgs.liminix.services) oneshot longrun bundle target;
inherit (pkgs) writeText;
2023-08-28 16:10:53 +02:00
svc = config.system.service;
in rec {
imports = [
./modules/tftpboot.nix
./modules/wlan.nix
2023-08-28 16:10:53 +02:00
./modules/network
2023-07-23 00:22:45 +02:00
./modules/ntp
./modules/vlan
];
services.dhcpv4 =
2023-08-28 16:10:53 +02:00
let iface = svc.network.link.build { ifname = "eth1"; };
in svc.network.dhcp.client.build { interface = iface; };
services.defaultroute4 = svc.network.route.build {
via = "$(output ${services.dhcpv4} address)";
2022-09-26 13:55:10 +02:00
target = "default";
dependencies = [ services.dhcpv4 ];
};
services.packet_forwarding =
let
iface = services.dhcpv4;
filename = "/proc/sys/net/ipv4/conf/$(output ${iface} ifname)/forwarding";
in oneshot {
2022-09-26 13:55:10 +02:00
name = "let-the-ip-flow";
up = "echo 1 > ${filename}";
down = "echo 0 > ${filename}";
dependencies = [iface];
};
2023-08-05 15:16:54 +02:00
services.ntp = config.system.service.ntp.build {
2023-07-23 00:22:45 +02:00
pools = { "pool.ntp.org" = ["iburst"] ; };
};
boot.tftp = {
serverip = "192.168.8.148";
ipaddr = "192.168.8.251";
};
defaultProfile.packages = [ pkgs.hello ] ;
}