fix: wireguard config file permission issue
This commit is contained in:
parent
1c2b263904
commit
945f767d08
6 changed files with 33 additions and 24 deletions
|
|
@ -41,6 +41,9 @@
|
|||
## 🌐 VPN
|
||||
|
||||
- Wireguard (You need put your own `wg0.conf` file)
|
||||
.
|
||||
|
||||
> NOTE: If import `wireguard.nix` without config file, the Build will fail.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
22
flake.nix
22
flake.nix
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nix-index-database,
|
||||
...
|
||||
|
|
@ -48,6 +47,11 @@
|
|||
let
|
||||
system = "x86_64-linux";
|
||||
nix-version = "25.05";
|
||||
username = "danny";
|
||||
git-config = {
|
||||
username = "DACHXY";
|
||||
email = "danny10132024@gmail.com";
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
|
|
@ -57,7 +61,13 @@
|
|||
./system/dev/dn-pre7780
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs system nix-version;
|
||||
inherit
|
||||
inputs
|
||||
system
|
||||
nix-version
|
||||
username
|
||||
git-config
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -67,7 +77,13 @@
|
|||
./system/dev/dn-lap
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs system nix-version;
|
||||
inherit
|
||||
inputs
|
||||
system
|
||||
nix-version
|
||||
username
|
||||
git-config
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ git-config }:
|
||||
{ git-config, ... }:
|
||||
let
|
||||
userName = git-config.username;
|
||||
email = git-config.email;
|
||||
|
|
|
|||
|
|
@ -3,16 +3,13 @@
|
|||
system,
|
||||
inputs,
|
||||
nix-version,
|
||||
git-config,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cursor-size = "24";
|
||||
username = "danny";
|
||||
git-config = {
|
||||
username = "DACHXY";
|
||||
email = "danny10132024@gmail.com";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -3,16 +3,13 @@
|
|||
inputs,
|
||||
system,
|
||||
nix-version,
|
||||
git-config,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cursor-size = "32";
|
||||
username = "danny";
|
||||
git-config = {
|
||||
username = "DACHXY";
|
||||
email = "danny10132024@gmail.com";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
{ ... }:
|
||||
{ lib, ... }:
|
||||
let
|
||||
configPath = "/etc/wireguard/wg0.conf";
|
||||
in
|
||||
{
|
||||
networking.firewall = {
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
networking.wg-quick.interfaces.wg0 =
|
||||
if builtins.pathExists configPath then
|
||||
{
|
||||
configFile = configPath;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
wg-quick.interfaces.wg0.configFile = configPath;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue