nixfmt-rfc-style
There is nothing in this commit except for the changes made by nix-shell -p nixfmt-rfc-style --run "nixfmt ." If this has mucked up your open branches then sorry about that. You can probably nixfmt them to match before merging
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
{
|
||||
liminix
|
||||
, lib
|
||||
liminix,
|
||||
lib,
|
||||
}:
|
||||
{
|
||||
ifname
|
||||
, devpath ? null
|
||||
, mtu} :
|
||||
ifname,
|
||||
devpath ? null,
|
||||
mtu,
|
||||
}:
|
||||
# if devpath is supplied, we rename the interface at that
|
||||
# path to have the specified name.
|
||||
let
|
||||
inherit (liminix.services) oneshot;
|
||||
name = "${ifname}.link";
|
||||
rename = if devpath != null
|
||||
then ''
|
||||
oldname=$(cd /sys${devpath} && cd net/ && echo *)
|
||||
ip link set ''${oldname} name ${ifname}
|
||||
''
|
||||
else "";
|
||||
in oneshot {
|
||||
rename =
|
||||
if devpath != null then
|
||||
''
|
||||
oldname=$(cd /sys${devpath} && cd net/ && echo *)
|
||||
ip link set ''${oldname} name ${ifname}
|
||||
''
|
||||
else
|
||||
"";
|
||||
in
|
||||
oneshot {
|
||||
inherit name;
|
||||
up = ''
|
||||
${rename}
|
||||
|
Reference in New Issue
Block a user