mullvad: Move script into system module
It doesn’t make sense to install the configuration files system-wide but the script only for the user.
This commit is contained in:
parent
e0efa77520
commit
c0efaa02ba
|
@ -47,9 +47,26 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.etc = builtins.listToAttrs
|
||||
(map
|
||||
(name: lib.nameValuePair "wireguard/${name}" { source = "${relayConfigFiles}/${name}"; })
|
||||
(lib.attrNames relayConfigs));
|
||||
environment = {
|
||||
etc = builtins.listToAttrs
|
||||
(map
|
||||
(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
|
||||
'';
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue