configure remote wake on lan and ipv6
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
lanIface = "enp5s0";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
#../ai.nix
|
||||
@@ -16,7 +13,7 @@ in
|
||||
../options.nix
|
||||
../packages.nix
|
||||
../sops-desktop.nix
|
||||
../sshd.nix
|
||||
../ssh.nix
|
||||
../sudo-nopasswd.nix
|
||||
../wakeonlan.nix
|
||||
|
||||
@@ -36,7 +33,10 @@ in
|
||||
../desktop/nvidia.nix
|
||||
];
|
||||
|
||||
my.lanInterface = "enp5s0";
|
||||
my.laninterface = "enp5s0";
|
||||
my.ipv4address = "192.168.0.2";
|
||||
my.ipv4netmask = 24;
|
||||
my.ipv4gateway = "192.168.0.254";
|
||||
|
||||
sops = {
|
||||
secrets = {
|
||||
@@ -51,17 +51,17 @@ in
|
||||
networking = {
|
||||
#useNetworkd = true;
|
||||
#useHostResolvConf = false;
|
||||
interfaces.${config.my.lanInterface} = {
|
||||
interfaces.${config.my.laninterface} = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "192.168.0.2";
|
||||
prefixLength = 24;
|
||||
address = config.my.ipv4address;
|
||||
prefixLength = config.my.ipv4netmask;
|
||||
}
|
||||
];
|
||||
};
|
||||
defaultGateway = {
|
||||
address = "192.168.0.254";
|
||||
interface = "${config.my.lanInterface}";
|
||||
address = config.my.ipv4gateway;
|
||||
interface = config.my.laninterface;
|
||||
};
|
||||
nameservers = [
|
||||
#"9.9.9.9"
|
||||
@@ -105,5 +105,27 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets."home-nix/myipv6address" = { };
|
||||
|
||||
systemd.services.ipv6-setup = {
|
||||
description = "Configure IPv6";
|
||||
after = [
|
||||
"network.target"
|
||||
"sops-nix.service"
|
||||
];
|
||||
wants = [ "sops-nix.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writeShellScript "setup-ipv6" ''
|
||||
${pkgs.iproute2}/bin/ip -6 addr add $(cat ${
|
||||
config.sops.secrets."home-nix/myipv6address".path
|
||||
})/64 dev ${config.my.laninterface} || true
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.tor-browser ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user