Compare commits
6 commits
8b01238502
...
b5b5d13199
Author | SHA1 | Date | |
---|---|---|---|
b5b5d13199 | |||
f42f1ac777 | |||
49879123a4 | |||
88fc280dd5 | |||
31da52f412 | |||
726dd5da4a |
8 changed files with 91 additions and 2 deletions
|
@ -57,6 +57,7 @@ let
|
|||
[ "logo-ls" "logo-ls" ]
|
||||
[ "lutris" "Lutris" ]
|
||||
[ "minegrub-theme" "Minegrub Theme" ]
|
||||
[ "networkmanager" "NetworkManager" ]
|
||||
[ "nginx" "nginx" ]
|
||||
[ "nodejs-n" "n" ]
|
||||
[ "nuke-usb" "nuke-usb" ]
|
||||
|
@ -97,6 +98,7 @@ in
|
|||
./programs/nextcloud.nix
|
||||
./programs/oh-my-posh.nix
|
||||
./programs/rclone.nix
|
||||
./programs/systemd-networkd.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
|
|
26
lib/modules/programs/systemd-networkd.nix
Normal file
26
lib/modules/programs/systemd-networkd.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
valhalla = {
|
||||
linux.programs.systemd-networkd = {
|
||||
enable = mkEnableOption "systemd-networkd";
|
||||
|
||||
networks = mkOption {
|
||||
type = types.attrsOf types.attrs;
|
||||
description = "The networks to configure.";
|
||||
};
|
||||
|
||||
networkFiles = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
description = "The files for configuring the networks.";
|
||||
default = builtins.mapAttrs
|
||||
(name: network: lib.generators.toINI { listsAsDuplicateKeys = true; } network)
|
||||
config.valhalla.linux.programs.systemd-networkd.networks;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -114,6 +114,7 @@ in {
|
|||
"vim"
|
||||
])) // (optionalAttrs desktopExperience (mkPrograms [
|
||||
"icedtea"
|
||||
"networkmanager"
|
||||
"plasma"
|
||||
"sddm"
|
||||
"waydroid"
|
||||
|
|
|
@ -70,6 +70,33 @@ in {
|
|||
linux.programs = {
|
||||
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 = {
|
||||
services = {
|
||||
anki-sync.enable = true;
|
||||
|
|
|
@ -36,7 +36,6 @@ begin
|
|||
base \
|
||||
linux \
|
||||
linux-firmware \
|
||||
networkmanager \
|
||||
man-db \
|
||||
man-pages \
|
||||
texinfo
|
||||
|
@ -63,7 +62,11 @@ begin
|
|||
end
|
||||
|
||||
and genfstab -U "$mountDir" >>"$mountDir/etc/fstab"
|
||||
and arch-chroot "$mountDir" systemctl enable NetworkManager
|
||||
|
||||
and if isProgramEnabled "networkmanager"
|
||||
and pacstrap -K "$mountDir" networkmanager
|
||||
arch-chroot "$mountDir" systemctl enable NetworkManager
|
||||
end
|
||||
|
||||
and if set -q timezone
|
||||
arch-chroot "$mountDir" ln -sf "/usr/share/zoneinfo/$timezone" /etc/localtime
|
||||
|
|
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
|
||||
|
||||
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/../../Common/Software/nuke-usb/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