add 'amnezia' alias to start AmneziaVPN
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
for_config/*
|
||||
home-manager/modules/custom/*
|
||||
nixos/configuration.nix
|
||||
nixos/configuration.nix.bak
|
||||
nixos/my.nix
|
||||
home-manager/modules/custom/config.nix
|
||||
@@ -61,6 +61,11 @@
|
||||
home-rr = "home-manager switch";
|
||||
cnfg = "sudo nvim /nixos/configuration.nix";
|
||||
rr = "sudo nixos-rebuild switch";
|
||||
|
||||
amnezia = ''
|
||||
(pgrep -x "AmneziaVPN-service" > /dev/null 2>&1 || sudo AmneziaVPN-service > /dev/null 2>&1 &) &
|
||||
AmneziaVPN > /dev/null 2>&1 &
|
||||
''; # i don't know any good ways for it.
|
||||
};
|
||||
|
||||
initContent = ''
|
||||
|
||||
+8
-10
@@ -10,16 +10,13 @@
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
environment.systemPackages = with pkgs; [ kitty amnezia-vpn ];
|
||||
|
||||
systemd.services.amnezia-vpn = {
|
||||
description = "AmneziaVPN Service";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.amnezia-vpn}/bin/AmneziaVPN-service";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
security.sudo.extraRules = [{
|
||||
users = [ "ALL" ];
|
||||
commands = [{
|
||||
command = "/run/current-system/sw/bin/AmneziaVPN-service";
|
||||
options = [ "NOPASSWD" ];
|
||||
}];
|
||||
}];
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
@@ -55,6 +52,7 @@
|
||||
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
kernelModules = [ "tun" ]; # for VPN
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
|
||||
Reference in New Issue
Block a user