fix micro

This commit is contained in:
Peder Bergebakken Sundt 2024-07-10 00:31:00 +02:00
parent 0c8ff82772
commit 8b67ff20b2
4 changed files with 31 additions and 42 deletions

View File

@ -11,6 +11,8 @@
(ifExists ./hardware-configuration.nix )
];
nixpkgs.overlays = [ (import ./overlay.nix) ];
nixpkgs.config.permittedInsecurePackages = [
pkgs.pulsar.name
pkgs.zotero.name

27
overlay.nix Normal file
View File

@ -0,0 +1,27 @@
final: prev:
let
inherit (final) lib;
in
rec {
# https://github.com/bugaevc/wl-clipboard/issues/185
wl-clipboard-timeout = prev.symlinkJoin {
inherit (prev.wl-clipboard) name;
paths = [
(prev.writeShellScriptBin "wl-copy" ''
timeout 0.3s ${lib.getExe' prev.wl-clipboard "wl-copy"} "$@"
'')
(prev.writeShellScriptBin "wl-paste" ''
timeout 0.3s ${lib.getExe' prev.wl-clipboard "wl-paste"} "$@"
'')
prev.wl-clipboard
];
};
micro = prev.micro.override {
wl-clipboard = wl-clipboard-timeout;
};
}

View File

@ -1,23 +1,5 @@
{ pkgs, lib, ... }:
let
# https://github.com/bugaevc/wl-clipboard/issues/185
wl-clipboard' = pkgs.symlinkJoin {
inherit (pkgs.wl-clipboard) name;
paths = [
(pkgs.writeShellScriptBin "wl-copy" ''
timeout 0.25s ${lib.getExe' pkgs.wl-clipboard "wl-copy"} "$@"
'')
(pkgs.writeShellScriptBin "wl-paste" ''
timeout 0.25s ${lib.getExe' pkgs.wl-clipboard "wl-paste"} "$@"
'')
pkgs.wl-clipboard
];
};
in
{
imports = [
@ -38,7 +20,7 @@ in
];
home.packages = with pkgs; [
wl-clipboard'
wl-clipboard-timeout
discord
element-desktop

View File

@ -1,27 +1,5 @@
{ pkgs, lib, ... }:
let
# https://github.com/bugaevc/wl-clipboard/issues/185
wl-clipboard' = pkgs.symlinkJoin {
inherit (pkgs.wl-clipboard) name;
paths = [
(pkgs.writeShellScriptBin "wl-copy" ''
timeout 0.25s ${lib.getExe' pkgs.wl-clipboard "wl-copy"} "$@"
'')
(pkgs.writeShellScriptBin "wl-paste" ''
timeout 0.25s ${lib.getExe' pkgs.wl-clipboard "wl-paste"} "$@"
'')
pkgs.wl-clipboard
];
};
micro' = pkgs.micro.override {
wl-clipboard = wl-clipboard';
};
in
{
# TODO: upstream this
imports = [ ../modules/micro.nix ];
@ -32,7 +10,7 @@ in
home.sessionVariables.EDITOR = "micro";
home.packages = with pkgs; [
micro'
micro
aspell
aspellDicts.en
aspellDicts.nb