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/* 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
+5
View File
@@ -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
View File
@@ -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"