1
0
mirror of https://github.com/kmein/niveum synced 2026-03-17 02:31:09 +01:00

chore: nixfmt

This commit is contained in:
Kierán Meinhardt
2020-06-10 17:37:25 +02:00
parent 2c3957735b
commit d8a4d4eedf
90 changed files with 1461 additions and 985 deletions

View File

@@ -19,7 +19,7 @@ stdenv.mkDerivation {
wrapProgram $out/bin/daybook --prefix PATH ":" ${pandoc}/bin ;
'';
meta = with stdenv.lib; {
homepage = https://github.com/kmein/daybook;
homepage = "https://github.com/kmein/daybook";
description = "A diary writing utility in sh";
license = licenses.mit;
platforms = platforms.linux;

View File

@@ -1,18 +1,20 @@
{ pkgs, lib, ... }:
let
kpaste = pkgs.callPackage <stockholm/krebs/5pkgs/simple/kpaste> {};
wrapScript = { packages ? [], name, script }: pkgs.writers.writeDashBin name ''
PATH=$PATH:${lib.makeBinPath (packages ++ [pkgs.coreutils pkgs.findutils])}
${script} "$@"
'';
kpaste = pkgs.callPackage <stockholm/krebs/5pkgs/simple/kpaste> { };
wrapScript = { packages ? [ ], name, script }:
pkgs.writers.writeDashBin name ''
PATH=$PATH:${
lib.makeBinPath (packages ++ [ pkgs.coreutils pkgs.findutils ])
}
${script} "$@"
'';
voidrice = pkgs.fetchFromGitHub {
owner = "LukeSmithxyz";
repo = "voidrice";
rev = "dff66cd1efb36afd54dd6dcf2fdaa9475d5646c1";
sha256 = "19f33ins2kzgiw72d62j8zz9ai3j8m4qqfqmagxkg9yhxqkdqry7";
};
in
{
in {
instaget = wrapScript {
packages = [ pkgs.jq pkgs.curl pkgs.gnugrep ];
script = ./instaget.sh;
@@ -90,7 +92,8 @@ in
};
linkhandler = wrapScript {
packages = [ pkgs.utillinux pkgs.mpv pkgs.curl pkgs.gnused pkgs.sxiv pkgs.ts ];
packages =
[ pkgs.utillinux pkgs.mpv pkgs.curl pkgs.gnused pkgs.sxiv pkgs.ts ];
script = "${voidrice}/.local/bin/linkhandler";
name = "linkhandler";
};
@@ -124,6 +127,6 @@ in
packages = [ pkgs.xclip pkgs.scrot kpaste pkgs.libnotify pkgs.dmenu ];
};
bvg = pkgs.callPackage ./bvg.nix {};
nav = pkgs.callPackage ./nav.nix {};
bvg = pkgs.callPackage ./bvg.nix { };
nav = pkgs.callPackage ./nav.nix { };
}

View File

@@ -22,8 +22,13 @@ let
};
in writeShellScriptBin "depp" ''
if [ $# -gt 0 ]; then
git ${lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)} "$@"
git ${
lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)
} "$@"
else
printf "${lib.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)}\n"
printf "${
lib.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)
}\n"
fi
''

View File

@@ -4,33 +4,35 @@ let
cfg = eval.config;
eval = lib.evalModules {
modules = [ {
modules = [{
_file = toString ./klem.nix;
imports = [ (args.config or {}) ];
imports = [ (args.config or { }) ];
options = {
clipboardSelection = lib.mkOption {
default = "clipboard";
type = lib.types.enum ["primary" "secondary" "clipboard"];
type = lib.types.enum [ "primary" "secondary" "clipboard" ];
};
scripts = lib.mkOption {
default = {
pastebin = "${pkgs.curl}/bin/curl -fSs -F 'f:1=<-' ix.io";
shorten = ''${pkgs.curl}/bin/curl -fSs -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://0x0.st'';
shorten = ''
${pkgs.curl}/bin/curl -fSs -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://0x0.st'';
"replace p.r" = "${pkgs.gnused}/bin/sed 's/\\<r\\>/krebsco.de/'";
};
type = lib.types.attrs;
};
};
} ];
}];
};
scriptCase = option: script: ''
'${option}') ${toString script} ;;
'';
in
pkgs.writers.writeDashBin "klem" ''
in pkgs.writers.writeDashBin "klem" ''
${pkgs.xclip}/bin/xclip -selection ${cfg.clipboardSelection} -out \
| case $(echo "${lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)}" | ${pkgs.dmenu}/bin/dmenu -i -p klem) in
| case $(echo "${
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)
}" | ${pkgs.dmenu}/bin/dmenu -i -p klem) in
${lib.concatStringsSep "\n" (lib.mapAttrsToList scriptCase cfg.scripts)}
*) ${pkgs.coreutils}/bin/cat ;;
esac \