File tree Expand file tree Collapse file tree
packages/wl-clipboard-wsl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8989 utils = pkgs . callPackage ./utils { } ;
9090 staticUtils = pkgs . pkgsStatic . callPackage ./utils { } ;
9191 docs = pkgs . callPackage ./docs { } ;
92+ wl-clipboard-wsl = pkgs . callPackage ./packages/wl-clipboard-wsl { } ;
9293 } ) ;
9394
9495 devShells = forAllSystems ( pkgs : {
Original file line number Diff line number Diff line change 1+ { config
2+ , lib
3+ , pkgs
4+ , ...
5+ } :
6+ let
7+ cfg = config . wsl . clipboard ;
8+ in
9+ {
10+ options . wsl . clipboard = {
11+ enable = lib . mkEnableOption "wl-copy/wl-paste integration via Windows clipboard" ;
12+
13+ package = lib . mkOption {
14+ type = lib . types . package ;
15+ default = pkgs . callPackage ../packages/wl-clipboard-wsl { } ;
16+ description = "Package providing wl-copy and wl-paste wrappers for WSL clipboard interop." ;
17+ } ;
18+ } ;
19+
20+ config = lib . mkIf ( config . wsl . enable && cfg . enable ) {
21+ environment . systemPackages = [ cfg . package ] ;
22+ } ;
23+ }
Original file line number Diff line number Diff line change 11{ lib , ... } : {
22 imports = [
33 ./build-tarball.nix
4+ ./clipboard.nix
45 ./docker-desktop.nix
56 ./interop.nix
67 ./recovery.nix
Original file line number Diff line number Diff line change 1+ { pkgs , ... } :
2+ let
3+ wl-copy = pkgs . writeShellScriptBin "wl-copy" ''
4+ printf '%s' "$(cat)" | ${ pkgs . dos2unix } /bin/unix2dos | /mnt/c/windows/system32/clip.exe
5+ '' ;
6+
7+ wl-paste = pkgs . writeShellScriptBin "wl-paste" ''
8+ /mnt/c/windows/system32/windowspowershell/v1.0/powershell.exe -command Get-Clipboard | ${ pkgs . dos2unix } /bin/dos2unix
9+ '' ;
10+ in
11+ pkgs . symlinkJoin {
12+ name = "wl-clipboard-wsl" ;
13+ paths = [
14+ wl-copy
15+ wl-paste
16+ ] ;
17+ }
You can’t perform that action at this time.
0 commit comments