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}"; })
|
(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
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