wireguard config but not enabled

This commit is contained in:
Noah Masur 2022-06-04 10:29:36 -04:00
parent aa8765b2a2
commit 0fd3956bda
4 changed files with 21 additions and 12 deletions

View File

@ -31,6 +31,7 @@
"$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF."; "$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF.";
gitEmail = "7386960+nmasur@users.noreply.github.com"; gitEmail = "7386960+nmasur@users.noreply.github.com";
mailServer = "noahmasur.com"; mailServer = "noahmasur.com";
dotfilesRepo = "https://github.com/nmasur/dotfiles";
gui = { gui = {
colorscheme = (import ./modules/colorscheme/gruvbox); colorscheme = (import ./modules/colorscheme/gruvbox);
wallpaper = ./media/wallpaper/road.jpg; wallpaper = ./media/wallpaper/road.jpg;

View File

@ -17,6 +17,10 @@
description = "Path of dotfiles repository."; description = "Path of dotfiles repository.";
default = builtins.toPath "/home/${config.user}/dev/personal/dotfiles"; default = builtins.toPath "/home/${config.user}/dev/personal/dotfiles";
}; };
dotfilesRepo = mkOption {
type = types.str;
description = "Link to dotfiles repository.";
};
}; };
config = { config = {

View File

@ -9,8 +9,8 @@
config.home-manager.users.${config.user}.lib.dag.entryAfter config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] '' [ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname ${config.dotfilesPath}) $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 ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
fi fi
''; '';

View File

@ -1,14 +1,18 @@
{ ... }: { { ... }: {
networking.wireguard.interfaces = { networking.wireguard = {
enable = true;
interfaces = {
wg0 = { wg0 = {
ips = [ "10.0.0.1/32" "fc00:bbbb:bbbb:bb01::3:7fea/128" ]; ips = [ "10.66.127.235/32" "fc00:bbbb:bbbb:bb01::3:7fea/128" ];
privateKeyFile = "/private/wireguard-pk"; generatePrivateKeyFile = true;
privateKeyFile = "/private/wireguard/wg0";
peers = [{ peers = [{
publicKey = "ABCDEFABCDEF"; publicKey = "cVDIYPzNChIeANp+0jE12kWM5Ga1MbmNErT1Pmaf12A=";
allowedIPs = [ "0.0.0.0/0" "::0/0" ]; allowedIPs = [ "0.0.0.0/0" "::0/0" ];
endpoint = "10.0.0.1:51820"; endpoint = "89.46.62.197:51820";
persistentKeepalive = 25; persistentKeepalive = 25;
}]; }];
}; };
}; };
};
} }