mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
remove specialArgs niveum and niveumLib, add overlay
This commit is contained in:
@@ -1,32 +1,36 @@
|
||||
# klem < klemm < klemmbrett ~ clipboard
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
dmenu,
|
||||
curl,
|
||||
gnused,
|
||||
coreutils,
|
||||
xclip,
|
||||
libnotify,
|
||||
writers,
|
||||
options ? { },
|
||||
...
|
||||
} @ args: let
|
||||
cfg = eval.config;
|
||||
|
||||
}: let
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
{
|
||||
_file = toString ./klem.nix;
|
||||
imports = [(args.config or {})];
|
||||
imports = [options];
|
||||
options = {
|
||||
selection = lib.mkOption {
|
||||
default = "clipboard";
|
||||
type = lib.types.enum ["primary" "secondary" "clipboard"];
|
||||
};
|
||||
dmenu = lib.mkOption {
|
||||
default = "${pkgs.dmenu}/bin/dmenu -i -p klem";
|
||||
default = "${dmenu}/bin/dmenu -i -p klem";
|
||||
type = lib.types.path;
|
||||
};
|
||||
scripts = lib.mkOption {
|
||||
default = {
|
||||
pastebin = "${pkgs.curl}/bin/curl -fSs -F 'f:1=<-' ix.io";
|
||||
pastebin = "${curl}/bin/curl -fSs -F 'f:1=<-' ix.io";
|
||||
shorten = ''
|
||||
${pkgs.curl}/bin/curl -fSs -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://0x0.st
|
||||
${curl}/bin/curl -fSs -F "shorten=$(${coreutils}/bin/cat)" https://0x0.st
|
||||
'';
|
||||
"replace p.r" = "${pkgs.gnused}/bin/sed 's/\\<r\\>/krebsco.de/'";
|
||||
"replace p.r" = "${gnused}/bin/sed 's/\\<r\\>/krebsco.de/'";
|
||||
};
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
@@ -35,21 +39,21 @@
|
||||
];
|
||||
};
|
||||
|
||||
scriptCase = option: script: ''
|
||||
'${option}') ${toString script} ;;
|
||||
'';
|
||||
cfg = eval.config;
|
||||
in
|
||||
pkgs.writers.writeDashBin "klem" ''
|
||||
writers.writeDashBin "klem" ''
|
||||
set -efu
|
||||
|
||||
${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -out \
|
||||
${xclip}/bin/xclip -selection ${cfg.selection} -out \
|
||||
| case $(echo "${
|
||||
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)
|
||||
}" | ${cfg.dmenu}) in
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList scriptCase cfg.scripts)}
|
||||
*) ${pkgs.coreutils}/bin/cat ;;
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList (option: script: ''
|
||||
'${option}') ${toString script} ;;
|
||||
'') cfg.scripts)}
|
||||
*) ${coreutils}/bin/cat ;;
|
||||
esac \
|
||||
| ${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
| ${xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
|
||||
${pkgs.libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
|
||||
${libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
|
||||
''
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
stdenv,
|
||||
pandoc,
|
||||
lib,
|
||||
fetchgit,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "pandoc-doc";
|
||||
version = pandoc.version;
|
||||
src = fetchgit {
|
||||
url = "https://github.com/jgm/pandoc";
|
||||
rev = pandoc.version;
|
||||
hash = "sha256-4VDfRUr6TyF4oZsCve9t6FlEN0AqzYdlYXRny+SAcsY=";
|
||||
};
|
||||
buildPhase = ''
|
||||
mkdir -p $out/man/man1
|
||||
${pandoc}/bin/pandoc -V section=1 --standalone --write=man $src/MANUAL.txt -o $out/man/man1/pandoc.1
|
||||
'';
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
writers,
|
||||
gnused,
|
||||
pari,
|
||||
dmenu,
|
||||
xclip,
|
||||
}:
|
||||
writers.writeDashBin "=" ''
|
||||
# https://github.com/onespaceman/menu-calc
|
||||
|
||||
answer=$(echo "$@" | ${pari}/bin/gp -q | ${gnused}/bin/sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
||||
|
||||
action=$(printf "copy\nclear" | ${dmenu}/bin/dmenu -p "= $answer")
|
||||
|
||||
case $action in
|
||||
"clear") $0 ;;
|
||||
"copy") printf %s "$answer" | ${xclip}/bin/xclip -selection clipboard;;
|
||||
"") ;;
|
||||
*) $0 "$answer $action" ;;
|
||||
esac
|
||||
''
|
||||
@@ -6,7 +6,7 @@
|
||||
coreutils,
|
||||
noteDirectory ? "~/state/obsidian",
|
||||
currentDates ? false,
|
||||
niveumPackages,
|
||||
obsidian-vim
|
||||
}:
|
||||
writers.writeDashBin "notemenu" ''
|
||||
set -efu
|
||||
@@ -24,6 +24,6 @@ writers.writeDashBin "notemenu" ''
|
||||
} | rofi -dmenu -i -p 'notes')
|
||||
if test "$note_file"
|
||||
then
|
||||
alacritty --working-directory ${noteDirectory} -e ${niveumPackages.obsidian-vim}/bin/nvim "$note_file"
|
||||
alacritty --working-directory ${noteDirectory} -e ${obsidian-vim}/bin/nvim "$note_file"
|
||||
fi
|
||||
''
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
vimPlugins,
|
||||
fetchFromGitHub,
|
||||
vimUtils,
|
||||
niveumPackages,
|
||||
writeText,
|
||||
stylixColors ? null,
|
||||
colorscheme ? null,
|
||||
@@ -44,8 +43,8 @@
|
||||
|
||||
goyo
|
||||
limelight-vim
|
||||
niveumPackages.vimPlugins-mdwa-nvim
|
||||
niveumPackages.vimPlugins-vim-ernest
|
||||
vimPlugins.mdwa-nvim
|
||||
vimPlugins.vim-ernest
|
||||
|
||||
fzf-vim
|
||||
fzfWrapper
|
||||
@@ -53,20 +52,20 @@
|
||||
undotree
|
||||
tabular
|
||||
# vimwiki
|
||||
niveumPackages.vimPlugins-vim-colors-paramount
|
||||
vimPlugins.vim-colors-paramount
|
||||
nvim-lspconfig
|
||||
vim-commentary
|
||||
vim-css-color
|
||||
vim-eunuch
|
||||
niveumPackages.vimPlugins-vim-fetch
|
||||
vimPlugins.vim-fetch
|
||||
vim-fugitive
|
||||
vim-gitgutter
|
||||
vim-repeat
|
||||
vim-sensible
|
||||
vim-surround
|
||||
(vimUtils.buildVimPlugin {
|
||||
(let version = "1.1.0"; pname = "vim-dim"; in vimUtils.buildVimPlugin {
|
||||
pname = "vim-dim";
|
||||
version = "1.1.0";
|
||||
version = version;
|
||||
src = fetchFromGitHub {
|
||||
owner = "jeffkreeftmeijer";
|
||||
repo = pname;
|
||||
@@ -82,8 +81,8 @@
|
||||
emmet-vim
|
||||
vim-elixir
|
||||
haskell-vim
|
||||
niveumPackages.vimPlugins-icalendar-vim
|
||||
niveumPackages.vimPlugins-jq-vim
|
||||
vimPlugins.icalendar-vim
|
||||
vimPlugins.jq-vim
|
||||
rust-vim
|
||||
typescript-vim
|
||||
vim-javascript
|
||||
@@ -92,8 +91,8 @@
|
||||
vimtex
|
||||
vim-pandoc
|
||||
vim-pandoc-syntax
|
||||
niveumPackages.vimPlugins-vim-256noir
|
||||
niveumPackages.vimPlugins-typst-vim
|
||||
vimPlugins.vim-256noir
|
||||
vimPlugins.typst-vim
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user