home/editor: add system clipboard support

This commit is contained in:
Max Headroom 2022-03-02 22:41:19 +01:00
parent 7b5e4d52d1
commit 2a5d4d6790

View file

@ -1,5 +1,10 @@
{ inputs, lib, pkgs, ... }:
let
package = inputs.helix.defaultPackage.${pkgs.system};
clipboardProvider = pkgs.wl-clipboard;
hx = {
config = {
theme = "custom";
@ -21,9 +26,20 @@ let
json = pkgs.writeText "helix-${name}.json" (builtins.toJSON value);
in pkgs.runCommandNoCC "helix-${name}.toml" {} "${pkgs.remarshal}/bin/remarshal --if json --of toml -i ${json} -o $out";
path = lib.makeBinPath [ clipboardProvider ];
# weird double-wrapping because nix-cargo-integration isn't overridable
finalPackage = pkgs.runCommandNoCC package.name {
nativeBuildInputs = [
pkgs.makeWrapper
];
} ''
makeWrapper ${package}/bin/hx $out/bin/hx \
--prefix PATH : ${path}
'';
in {
home.packages = [
inputs.helix.defaultPackage.${pkgs.system}
finalPackage
];
xdg.configFile = {