Let's hope WSL is not against company policy
If you are looking at this, you know who you are Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
28
packages/wsl-wl-clipboard/default.nix
Normal file
28
packages/wsl-wl-clipboard/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ pkgs, ... }:
|
||||
# FIXME: https://github.com/nix-community/NixOS-WSL/issues/700
|
||||
let
|
||||
wl-copy = pkgs.writeShellScriptBin "wl-copy" ''
|
||||
printf '%s' "$(cat)" | ${pkgs.dos2unix}/bin/unix2dos | clip.exe
|
||||
'';
|
||||
|
||||
wl-paste = pkgs.writeShellScriptBin "wl-paste" ''
|
||||
powershell.exe -command Get-Clipboard | ${pkgs.dos2unix}/bin/dos2unix
|
||||
'';
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "wsl-wl-clipboard";
|
||||
version = "1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [
|
||||
wl-copy
|
||||
wl-paste
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${wl-copy}/bin/wl-copy $out/bin/wl-copy
|
||||
ln -s ${wl-paste}/bin/wl-paste $out/bin/wl-paste
|
||||
'';
|
||||
}
|
Reference in New Issue
Block a user