mullvad: Add fzf helper
This commit is contained in:
parent
ecdbe9b936
commit
293312b447
|
@ -53,20 +53,10 @@ in
|
|||
(name: lib.nameValuePair "wireguard/${name}" { source = "${relayConfigFiles}/${name}"; })
|
||||
(lib.attrNames relayConfigs));
|
||||
|
||||
systemPackages = lib.singleton (pkgs.stdenv.mkDerivation {
|
||||
name = "mullvad-on-demand";
|
||||
|
||||
src = ./mullvad.sh;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -D $src $out/bin/mullvad
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
systemPackages = lib.singleton (pkgs.runCommandNoCC "mullvad-on-demand" { } ''
|
||||
install -D ${./mullvad.sh} $out/bin/mullvad
|
||||
install -D ${./mullvad-fzf.sh} $out/bin/mullvad-fzf
|
||||
'');
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
2
modules/mullvad/mullvad-fzf.sh
Executable file
2
modules/mullvad/mullvad-fzf.sh
Executable 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)
|
Loading…
Reference in a new issue