generify the vpn setup
This commit is contained in:
parent
8c454565d8
commit
c72c30a4be
8 changed files with 68 additions and 79 deletions
|
@ -2,14 +2,15 @@
|
|||
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
# You can import other NixOS modules here
|
||||
imports = [
|
||||
# Import home-manager's NixOS module
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
outputs.nixosModules.vpn-ip
|
||||
# If you want to use modules your own flake exports (from modules/nixos):
|
||||
# outputs.nixosModules.example
|
||||
|
||||
|
@ -31,6 +32,12 @@
|
|||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
services.vpn-ip = {
|
||||
ip = "2";
|
||||
};
|
||||
|
||||
networking.hostName = "GLaDOS";
|
||||
|
||||
services.xserver.videoDrivers = ["amdgpu"];
|
||||
hardware = {
|
||||
# Add vulkan support to GPU
|
||||
|
@ -74,31 +81,6 @@
|
|||
|
||||
users.users.lillian.extraGroups = ["gamemode"];
|
||||
|
||||
networking = {
|
||||
# virtualisation.waydroid.enable = false;
|
||||
hostName = "GLaDOS";
|
||||
|
||||
wireguard.enable = true;
|
||||
|
||||
wg-quick.interfaces = {
|
||||
wg0 = {
|
||||
autostart = true;
|
||||
address = ["10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue