generify the vpn setup

This commit is contained in:
Lillian Violet 2024-12-23 19:22:28 +01:00
parent 8c454565d8
commit c72c30a4be
8 changed files with 68 additions and 79 deletions

View file

@ -1,16 +1,13 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
outputs,
lib,
pkgs,
config,
...
}: {
# You can import other NixOS modules here
imports = [
# Import home-manager's NixOS module
inputs.home-manager.nixosModules.home-manager
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
@ -21,37 +18,20 @@
# You can also split up your configuration and import pieces of it here:
# ./users.nix
../../../disko/EDI
outputs.nixosModules.vpn-ip
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
../../../disko/EDI
];
environment.systemPackages = with pkgs; [
];
networking = {
hostName = "EDI";
wireguard.enable = true;
wg-quick.interfaces = {
wg0 = {
autostart = true;
address = ["10.0.0.3/24" "fdc9:281f:04d7:9ee9::3/64"];
dns = ["10.0.0.1" "fdc9:281f:04d7:9ee9::1"];
listenPort = 51821;
privateKeyFile = config.sops.secrets."wg-private-key".path;
peers = [
{
publicKey = "A02sO7uLdgflhPIRd0cbJONIaPP4z8HTxDkmX4NegFg=";
endpoint = "84.87.146.85:51821";
allowedIPs = ["0.0.0.0/0" "::/0"];
persistentKeepalive = 25;
}
];
};
};
services.vpn-ip = {
ip = "3";
};
networking.hostName = "EDI";
boot = {
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix