Compare commits
No commits in common. "mdebray/mac-personalisation" and "main" have entirely different histories.
mdebray/ma
...
main
8 changed files with 201 additions and 231 deletions
|
@ -135,21 +135,6 @@ rec {
|
||||||
../../modules/zyxel-dual-image
|
../../modules/zyxel-dual-image
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
|
||||||
hardware.wlanMacAddresses = {
|
|
||||||
wlan0 = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Mac address of wlan0 device";
|
|
||||||
};
|
|
||||||
wlan1 = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Mac address of wlan1 device";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = system.crossSystem;
|
nixpkgs.hostPlatform = system.crossSystem;
|
||||||
|
|
||||||
filesystem = dir {
|
filesystem = dir {
|
||||||
|
@ -223,12 +208,10 @@ rec {
|
||||||
wlan0 = link.build {
|
wlan0 = link.build {
|
||||||
ifname = "wlan0";
|
ifname = "wlan0";
|
||||||
dependencies = [ mac80211 ];
|
dependencies = [ mac80211 ];
|
||||||
mac = config.hardware.wlanMacAddresses.wlan0;
|
|
||||||
};
|
};
|
||||||
wlan1 = link.build {
|
wlan1 = link.build {
|
||||||
ifname = "wlan1";
|
ifname = "wlan1";
|
||||||
dependencies = [ mac80211 ];
|
dependencies = [ mac80211 ];
|
||||||
mac = config.hardware.wlanMacAddresses.wlan1;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -381,5 +364,4 @@ rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,13 +74,6 @@ in {
|
||||||
device will be renamed to the name provided.
|
device will be renamed to the name provided.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
mac = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
MAC address of the interface.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
devpath = mkOption {
|
devpath = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
{
|
{
|
||||||
ifname
|
ifname
|
||||||
, devpath ? null
|
, devpath ? null
|
||||||
, mac ? null
|
|
||||||
, mtu} :
|
, mtu} :
|
||||||
# if devpath is supplied, we rename the interface at that
|
# if devpath is supplied, we rename the interface at that
|
||||||
# path to have the specified name.
|
# path to have the specified name.
|
||||||
|
@ -25,7 +24,7 @@ in oneshot {
|
||||||
inherit name;
|
inherit name;
|
||||||
up = ''
|
up = ''
|
||||||
${rename}
|
${rename}
|
||||||
${liminix.networking.ifup name ifname mac}
|
${liminix.networking.ifup name ifname}
|
||||||
'';
|
'';
|
||||||
down = "ip link set down dev ${ifname}";
|
down = "ip link set down dev ${ifname}";
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ in
|
||||||
mv out $out
|
mv out $out
|
||||||
'';
|
'';
|
||||||
systemConfiguration =
|
systemConfiguration =
|
||||||
pkgs.systemconfig config.filesystem.contents config.hostname;
|
pkgs.systemconfig config.filesystem.contents;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ in oneshot rec {
|
||||||
up = ''
|
up = ''
|
||||||
ip link add link $(output ${primary} ifname) name ${ifname} type vlan id ${vid}
|
ip link add link $(output ${primary} ifname) name ${ifname} type vlan id ${vid}
|
||||||
${optionalString untagged.egress "bridge vlan add dev ${ifname} vid ${toString untagged.vid} pvid untagged master"}
|
${optionalString untagged.egress "bridge vlan add dev ${ifname} vid ${toString untagged.vid} pvid untagged master"}
|
||||||
${liminix.networking.ifup name ifname null}
|
${liminix.networking.ifup name ifname}
|
||||||
(in_outputs ${name}
|
(in_outputs ${name}
|
||||||
echo ${ifname} > ifname
|
echo ${ifname} > ifname
|
||||||
)
|
)
|
||||||
|
|
|
@ -74,7 +74,7 @@ let
|
||||||
../../modules/s6
|
../../modules/s6
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in systemconfig eval.config.filesystem.contents eval.config.hostname;
|
in systemconfig eval.config.filesystem.contents;
|
||||||
in writeScriptBin "levitate" ''
|
in writeScriptBin "levitate" ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
destdir=${newRoot}
|
destdir=${newRoot}
|
||||||
|
|
|
@ -3,13 +3,9 @@
|
||||||
, serviceFns
|
, serviceFns
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
ifup = name : ifname : mac: ''
|
ifup = name : ifname : ''
|
||||||
. ${serviceFns}
|
. ${serviceFns}
|
||||||
${ifwait}/bin/ifwait -v ${ifname} present
|
${ifwait}/bin/ifwait -v ${ifname} present
|
||||||
${if (mac == null) then "" else ''
|
|
||||||
ip link set down dev ${ifname}
|
|
||||||
ip link set dev ${ifname} address ${mac}
|
|
||||||
''}
|
|
||||||
ip link set up dev ${ifname}
|
ip link set up dev ${ifname}
|
||||||
(in_outputs ${name}
|
(in_outputs ${name}
|
||||||
echo ${ifname} > ifname
|
echo ${ifname} > ifname
|
||||||
|
|
|
@ -62,10 +62,10 @@ let
|
||||||
${(builtins.concatStringsSep "\n" (visit "." attrset))}
|
${(builtins.concatStringsSep "\n" (visit "." attrset))}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in attrset: hostname:
|
in attrset:
|
||||||
let makedevs = activateScript attrset;
|
let makedevs = activateScript attrset;
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name="${hostname}-system-configuration";
|
name="make-stuff";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
CFLAGS = "-Os";
|
CFLAGS = "-Os";
|
||||||
|
|
Loading…
Add table
Reference in a new issue