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
|
||||
];
|
||||
|
||||
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;
|
||||
|
||||
filesystem = dir {
|
||||
|
@ -223,12 +208,10 @@ rec {
|
|||
wlan0 = link.build {
|
||||
ifname = "wlan0";
|
||||
dependencies = [ mac80211 ];
|
||||
mac = config.hardware.wlanMacAddresses.wlan0;
|
||||
};
|
||||
wlan1 = link.build {
|
||||
ifname = "wlan1";
|
||||
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.
|
||||
'';
|
||||
};
|
||||
mac = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
MAC address of the interface.
|
||||
'';
|
||||
};
|
||||
devpath = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
{
|
||||
ifname
|
||||
, devpath ? null
|
||||
, mac ? null
|
||||
, mtu} :
|
||||
# if devpath is supplied, we rename the interface at that
|
||||
# path to have the specified name.
|
||||
|
@ -25,7 +24,7 @@ in oneshot {
|
|||
inherit name;
|
||||
up = ''
|
||||
${rename}
|
||||
${liminix.networking.ifup name ifname mac}
|
||||
${liminix.networking.ifup name ifname}
|
||||
'';
|
||||
down = "ip link set down dev ${ifname}";
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ in
|
|||
mv out $out
|
||||
'';
|
||||
systemConfiguration =
|
||||
pkgs.systemconfig config.filesystem.contents config.hostname;
|
||||
pkgs.systemconfig config.filesystem.contents;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ in oneshot rec {
|
|||
up = ''
|
||||
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"}
|
||||
${liminix.networking.ifup name ifname null}
|
||||
${liminix.networking.ifup name ifname}
|
||||
(in_outputs ${name}
|
||||
echo ${ifname} > ifname
|
||||
)
|
||||
|
|
|
@ -74,7 +74,7 @@ let
|
|||
../../modules/s6
|
||||
];
|
||||
};
|
||||
in systemconfig eval.config.filesystem.contents eval.config.hostname;
|
||||
in systemconfig eval.config.filesystem.contents;
|
||||
in writeScriptBin "levitate" ''
|
||||
#!/bin/sh
|
||||
destdir=${newRoot}
|
||||
|
|
|
@ -3,13 +3,9 @@
|
|||
, serviceFns
|
||||
}:
|
||||
{
|
||||
ifup = name : ifname : mac: ''
|
||||
ifup = name : ifname : ''
|
||||
. ${serviceFns}
|
||||
${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}
|
||||
(in_outputs ${name}
|
||||
echo ${ifname} > ifname
|
||||
|
|
|
@ -62,10 +62,10 @@ let
|
|||
${(builtins.concatStringsSep "\n" (visit "." attrset))}
|
||||
}
|
||||
'';
|
||||
in attrset: hostname:
|
||||
in attrset:
|
||||
let makedevs = activateScript attrset;
|
||||
in stdenv.mkDerivation {
|
||||
name="${hostname}-system-configuration";
|
||||
name="make-stuff";
|
||||
src = ./.;
|
||||
|
||||
CFLAGS = "-Os";
|
||||
|
|
Loading…
Add table
Reference in a new issue