Allow configuring networkd
This commit is contained in:
parent
6a5ec8d5de
commit
fa295f3b1a
4 changed files with 57 additions and 0 deletions
|
@ -70,6 +70,33 @@ in {
|
||||||
linux.programs = {
|
linux.programs = {
|
||||||
grub.enable = true;
|
grub.enable = true;
|
||||||
|
|
||||||
|
systemd-networkd = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
networks =
|
||||||
|
let device = "enp0s31f6";
|
||||||
|
in {
|
||||||
|
${device} = {
|
||||||
|
Match = {
|
||||||
|
Name = device;
|
||||||
|
};
|
||||||
|
|
||||||
|
Network = {
|
||||||
|
Address = "2a01:4f8:10b:2644::2/64";
|
||||||
|
Gateway = [
|
||||||
|
"94.130.48.193"
|
||||||
|
"fe80::1"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
Address = {
|
||||||
|
Address = "94.130.48.251";
|
||||||
|
Peer = "94.130.48.193/32";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
docker = {
|
docker = {
|
||||||
services = {
|
services = {
|
||||||
anki-sync.enable = true;
|
anki-sync.enable = true;
|
||||||
|
|
13
scripts/Arch/Software/systemd-networkd/main.fish
Normal file
13
scripts/Arch/Software/systemd-networkd/main.fish
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/env fish
|
||||||
|
begin
|
||||||
|
set -l dir (status dirname)
|
||||||
|
source "$dir/../../../lib/software.fish"
|
||||||
|
inherit "$dir/../../../Common/Software/systemd-networkd/main.fish"
|
||||||
|
|
||||||
|
function configureSW -V dir
|
||||||
|
systemctl enable systemd-networkd
|
||||||
|
configureSWBase $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
runInstaller $argv
|
||||||
|
end
|
|
@ -71,6 +71,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
||||||
end
|
end
|
||||||
|
|
||||||
and source "$dir/../../Common/Software/bash/main.fish" $argv
|
and source "$dir/../../Common/Software/bash/main.fish" $argv
|
||||||
|
and source "$dir/../Software/systemd-networkd/main.fish" $argv
|
||||||
and source "$dir/../Software/btrfs/main.fish" $argv
|
and source "$dir/../Software/btrfs/main.fish" $argv
|
||||||
and source "$dir/../../Common/Software/nuke-usb/main.fish" $argv
|
and source "$dir/../../Common/Software/nuke-usb/main.fish" $argv
|
||||||
and source "$dir/../Software/sudo/main.fish" $argv
|
and source "$dir/../Software/sudo/main.fish" $argv
|
||||||
|
|
16
scripts/Common/Software/systemd-networkd/main.fish
Normal file
16
scripts/Common/Software/systemd-networkd/main.fish
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/env fish
|
||||||
|
begin
|
||||||
|
set -l dir (status dirname)
|
||||||
|
source "$dir/../../../lib/software.fish"
|
||||||
|
|
||||||
|
function configureSW -V dir
|
||||||
|
source "$dir/../../../lib/settings.fish"
|
||||||
|
set config (getProgramConfig $argv --json)
|
||||||
|
|
||||||
|
for name in (echo "$config" | jq '.networkFiles | keys[]' --raw-output0 | string split0 || true)
|
||||||
|
echo "$config" | NAME=$name jq '.networkFiles[env.NAME]' | sudo tee "/etc/systemd/network/10-$name.network" >/dev/null
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
runInstaller $argv
|
||||||
|
end
|
Loading…
Reference in a new issue