add 'amnezia' alias to start AmneziaVPN

This commit is contained in:
2025-11-15 03:43:40 +03:00
parent a0c6017738
commit 733d17fe9c
3 changed files with 15 additions and 11 deletions
+2 -1
View File
@@ -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
+5
View File
@@ -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
View File
@@ -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"