From 0fd3956bda64c9e068cd210234249d9f01378db4 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 4 Jun 2022 10:29:36 -0400 Subject: [PATCH] wireguard config but not enabled --- flake.nix | 1 + hosts/common.nix | 4 ++++ modules/editor/dotfiles.nix | 4 ++-- modules/services/wireguard.nix | 24 ++++++++++++++---------- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 33afdbe..eda39b4 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,7 @@ "$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF."; gitEmail = "7386960+nmasur@users.noreply.github.com"; mailServer = "noahmasur.com"; + dotfilesRepo = "https://github.com/nmasur/dotfiles"; gui = { colorscheme = (import ./modules/colorscheme/gruvbox); wallpaper = ./media/wallpaper/road.jpg; diff --git a/hosts/common.nix b/hosts/common.nix index 2cd1737..bc1a17b 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -17,6 +17,10 @@ description = "Path of dotfiles repository."; default = builtins.toPath "/home/${config.user}/dev/personal/dotfiles"; }; + dotfilesRepo = mkOption { + type = types.str; + description = "Link to dotfiles repository."; + }; }; config = { diff --git a/modules/editor/dotfiles.nix b/modules/editor/dotfiles.nix index cae425e..2d253e2 100644 --- a/modules/editor/dotfiles.nix +++ b/modules/editor/dotfiles.nix @@ -9,8 +9,8 @@ config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] '' if [ ! -d "${config.dotfilesPath}" ]; then - $DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname ${config.dotfilesPath}) - $DRY_RUN_CMD ${pkgs.git}/bin/git clone https://github.com/nmasur/dotfiles ${config.dotfilesPath} + $DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}") + $DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}" fi ''; diff --git a/modules/services/wireguard.nix b/modules/services/wireguard.nix index 1c4ac4c..34af565 100644 --- a/modules/services/wireguard.nix +++ b/modules/services/wireguard.nix @@ -1,14 +1,18 @@ { ... }: { - networking.wireguard.interfaces = { - wg0 = { - ips = [ "10.0.0.1/32" "fc00:bbbb:bbbb:bb01::3:7fea/128" ]; - privateKeyFile = "/private/wireguard-pk"; - peers = [{ - publicKey = "ABCDEFABCDEF"; - allowedIPs = [ "0.0.0.0/0" "::0/0" ]; - endpoint = "10.0.0.1:51820"; - persistentKeepalive = 25; - }]; + networking.wireguard = { + enable = true; + interfaces = { + wg0 = { + ips = [ "10.66.127.235/32" "fc00:bbbb:bbbb:bb01::3:7fea/128" ]; + generatePrivateKeyFile = true; + privateKeyFile = "/private/wireguard/wg0"; + peers = [{ + publicKey = "cVDIYPzNChIeANp+0jE12kWM5Ga1MbmNErT1Pmaf12A="; + allowedIPs = [ "0.0.0.0/0" "::0/0" ]; + endpoint = "89.46.62.197:51820"; + persistentKeepalive = 25; + }]; + }; }; }; }