update examples so they build again
This commit is contained in:
parent
00c8ea66ea
commit
23ccfec5fb
2 changed files with 22 additions and 30 deletions
|
@ -13,14 +13,12 @@
|
||||||
secrets = import ./extneder-secrets.nix;
|
secrets = import ./extneder-secrets.nix;
|
||||||
inherit
|
inherit
|
||||||
(pkgs.liminix.networking)
|
(pkgs.liminix.networking)
|
||||||
address
|
|
||||||
udhcpc
|
|
||||||
interface
|
|
||||||
route
|
route
|
||||||
;
|
;
|
||||||
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
||||||
inherit (pkgs.pseudofile) dir symlink;
|
inherit (pkgs.pseudofile) dir symlink;
|
||||||
inherit (pkgs) writeText dropbear ifwait serviceFns;
|
inherit (pkgs) writeText dropbear ifwait serviceFns;
|
||||||
|
svc = config.system.service;
|
||||||
in rec {
|
in rec {
|
||||||
boot = {
|
boot = {
|
||||||
tftp = {
|
tftp = {
|
||||||
|
@ -32,6 +30,7 @@ in rec {
|
||||||
imports = [
|
imports = [
|
||||||
../modules/standard.nix
|
../modules/standard.nix
|
||||||
../modules/wlan.nix
|
../modules/wlan.nix
|
||||||
|
../modules/network
|
||||||
];
|
];
|
||||||
|
|
||||||
hostname = "arhcive";
|
hostname = "arhcive";
|
||||||
|
@ -62,10 +61,11 @@ in rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dhcpc =
|
services.dhcpc =
|
||||||
let iface = config.hardware.networkInterfaces.lan;
|
let iface = config.hardware.networkInterfaces.lan;
|
||||||
in (udhcpc iface {
|
in svc.network.dhcp.client.build {
|
||||||
|
interface = iface;
|
||||||
dependencies = [ config.services.hostname ];
|
dependencies = [ config.services.hostname ];
|
||||||
}) // { inherit (iface) device; };
|
};
|
||||||
|
|
||||||
services.sshd = longrun {
|
services.sshd = longrun {
|
||||||
name = "sshd";
|
name = "sshd";
|
||||||
|
|
|
@ -14,15 +14,13 @@
|
||||||
inherit
|
inherit
|
||||||
(pkgs.liminix.networking)
|
(pkgs.liminix.networking)
|
||||||
address
|
address
|
||||||
udhcpc
|
|
||||||
hostapd
|
|
||||||
interface
|
interface
|
||||||
route
|
route
|
||||||
;
|
;
|
||||||
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
||||||
inherit (pkgs.pseudofile) dir symlink;
|
inherit (pkgs.pseudofile) dir symlink;
|
||||||
inherit (pkgs) dropbear ifwait serviceFns
|
inherit (pkgs) dropbear ifwait serviceFns;
|
||||||
;
|
svc = config.system.service;
|
||||||
in rec {
|
in rec {
|
||||||
boot = {
|
boot = {
|
||||||
tftp = {
|
tftp = {
|
||||||
|
@ -33,6 +31,9 @@ in rec {
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../modules/wlan.nix
|
../modules/wlan.nix
|
||||||
|
../modules/network
|
||||||
|
../modules/hostapd
|
||||||
|
../modules/bridge
|
||||||
../modules/standard.nix
|
../modules/standard.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -71,7 +72,8 @@ in rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.hostap = hostapd (config.hardware.networkInterfaces.wlan) {
|
services.hostap = svc.hostapd.build {
|
||||||
|
interface = config.hardware.networkInterfaces.wlan;
|
||||||
params = {
|
params = {
|
||||||
country_code = "GB";
|
country_code = "GB";
|
||||||
hw_mode = "g";
|
hw_mode = "g";
|
||||||
|
@ -91,28 +93,18 @@ in rec {
|
||||||
device = "int";
|
device = "int";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dhcpc = (udhcpc services.int {
|
services.dhcpc = svc.network.dhcp.client.build {
|
||||||
|
interface = services.int;
|
||||||
dependencies = [ config.services.hostname ];
|
dependencies = [ config.services.hostname ];
|
||||||
}) // { device = "int"; };
|
};
|
||||||
|
|
||||||
services.bridge = let
|
services.bridge = svc.bridge.members.build {
|
||||||
primary = services.int;
|
primary = services.int;
|
||||||
addif = dev:
|
members = with config.hardware.networkInterfaces; [
|
||||||
oneshot {
|
lan
|
||||||
name = "add-${dev.device}-to-bridge";
|
wlan
|
||||||
up = "${ifwait}/bin/ifwait -v ${dev.device} running && ip link set dev ${dev.device} master ${primary.device}";
|
];
|
||||||
down = "ip link set dev ${dev} nomaster";
|
};
|
||||||
dependencies = [primary dev];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
bundle {
|
|
||||||
name = "bridge-members";
|
|
||||||
contents = with config.hardware.networkInterfaces;
|
|
||||||
map addif [
|
|
||||||
lan
|
|
||||||
wlan
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.sshd = longrun {
|
services.sshd = longrun {
|
||||||
name = "sshd";
|
name = "sshd";
|
||||||
|
|
Loading…
Reference in a new issue