home/editor: add system clipboard support
This commit is contained in:
parent
7b5e4d52d1
commit
2a5d4d6790
1 changed files with 17 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
||||||
{ inputs, lib, pkgs, ... }:
|
{ inputs, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
|
||||||
|
package = inputs.helix.defaultPackage.${pkgs.system};
|
||||||
|
|
||||||
|
clipboardProvider = pkgs.wl-clipboard;
|
||||||
|
|
||||||
hx = {
|
hx = {
|
||||||
config = {
|
config = {
|
||||||
theme = "custom";
|
theme = "custom";
|
||||||
|
@ -21,9 +26,20 @@ let
|
||||||
json = pkgs.writeText "helix-${name}.json" (builtins.toJSON value);
|
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";
|
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 {
|
in {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
inputs.helix.defaultPackage.${pkgs.system}
|
finalPackage
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
|
|
Loading…
Reference in a new issue