mullvad: Add fzf helper

This commit is contained in:
Simon Bruder 2022-09-30 12:22:28 +02:00
parent ecdbe9b936
commit 293312b447
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 6 additions and 14 deletions

View file

@ -53,20 +53,10 @@ in
(name: lib.nameValuePair "wireguard/${name}" { source = "${relayConfigFiles}/${name}"; }) (name: lib.nameValuePair "wireguard/${name}" { source = "${relayConfigFiles}/${name}"; })
(lib.attrNames relayConfigs)); (lib.attrNames relayConfigs));
systemPackages = lib.singleton (pkgs.stdenv.mkDerivation { systemPackages = lib.singleton (pkgs.runCommandNoCC "mullvad-on-demand" { } ''
name = "mullvad-on-demand"; install -D ${./mullvad.sh} $out/bin/mullvad
install -D ${./mullvad-fzf.sh} $out/bin/mullvad-fzf
src = ./mullvad.sh; '');
dontUnpack = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -D $src $out/bin/mullvad
runHook postInstall
'';
});
}; };
}; };
} }

2
modules/mullvad/mullvad-fzf.sh Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
mullvad $(find /etc/wireguard -name "mlv-*.conf" -printf "%f\n" | sed 's/mlv-\(.*\)\.conf/\1/' | fzf)