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