Merge remote-tracking branch 'tv/master'

This commit is contained in:
makefu 2020-06-26 13:12:45 +02:00
commit 237a56464d
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
6 changed files with 128 additions and 65 deletions

View File

@ -4,9 +4,9 @@ stdenv.mkDerivation {
name = "dic"; name = "dic";
src = fetchgit { src = fetchgit {
url = http://cgit.ni.krebsco.de/dic; url = https://cgit.ni.krebsco.de/dic;
rev = "refs/tags/v1.1.0"; rev = "refs/tags/v1.1.1";
sha256 = "1xzn20b9kfz96nvjli8grpi11v80jbl0dmifksmirwcj5v81ndav"; sha256 = "1gbj967a5hj53fdkkxijqgwnl9hb8kskz0cmpjq7v65ffz3v6vag";
}; };
phases = [ phases = [

View File

@ -1,22 +1,74 @@
{ pkgs, ... }: with import <stockholm/lib>;
{ pkgs, ... }@args:
let
# config cannot be declared in the input attribute set because that would
# cause callPackage to inject the wrong config. Instead, get it from ...
# via args.
config = args.config or {};
cfg = eval.config;
eval = evalModules {
modules = singleton {
_file = toString ./profile.nix;
imports = singleton config;
options = {
appName = mkOption {
default = "fzfmenu";
type = types.label;
};
defaultPrompt = mkOption {
default = ">";
type = types.str;
};
printQuery = mkOption {
default = true;
type = types.bool;
};
reverse = mkOption {
default = true;
type = types.bool;
};
windowTitle = mkOption {
default = "fzfmenu";
type = types.str;
};
};
};
};
in
pkgs.writeDashBin "fzfmenu" '' pkgs.writeDashBin "fzfmenu" ''
set -efu set -efu
PROMPT=">"
for i in "$@" # Spawn terminal if called without one, like e.g. from a window manager.
do if [ -z ''${TERM+x} ]; then
exec 3<&0
exec 4>&1
export FZFMENU_INPUT_FD=3
export FZFMENU_OUTPUT_FD=4
exec ${pkgs.rxvt_unicode}/bin/urxvt \
-name ${cfg.appName} \
-title ${shell.escape cfg.windowTitle} \
-e "$0" "$@"
else
exec 0<&''${FZFMENU_INPUT_FD-0}
exec 1>&''${FZFMENU_OUTPUT_FD-1}
fi
PROMPT=${shell.escape cfg.defaultPrompt}
for i in "$@"; do
case $i in case $i in
-p) -p)
PROMPT="$2" PROMPT=$2
shift shift 2
shift
break break
;; ;;
-l) -l)
# no reason to filter number of lines # no reason to filter number of lines
LINES="$2" LINES=$2
shift shift 2
shift
break break
;; ;;
-i) -i)
@ -30,26 +82,16 @@ pkgs.writeDashBin "fzfmenu" ''
;; ;;
esac esac
done done
INPUT=$(${pkgs.coreutils}/bin/cat)
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)" if test -n "''${FZFMENU_FZF_DEFAULT_OPTS-}"; then
if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell FZF_DEFAULT_OPTS=''${FZFMENU_FZF_DEFAULT_OPTS-}
${pkgs.rxvt_unicode}/bin/urxvt \ export FZF_DEFAULT_OPTS
-name fzfmenu -title fzfmenu \
-e ${pkgs.dash}/bin/dash -c \
"echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
--history=/dev/null \
--print-query \
--prompt=\"$PROMPT\" \
--reverse \
> \"$OUTPUT\"" 2>/dev/null
else
echo "$INPUT" | ${pkgs.fzf}/bin/fzf \
--history=/dev/null \
--print-query \
--prompt="$PROMPT" \
--reverse \
> "$OUTPUT"
fi fi
${pkgs.coreutils}/bin/tail -1 "$OUTPUT"
${pkgs.coreutils}/bin/rm "$OUTPUT" ${pkgs.fzf}/bin/fzf \
--history=/dev/null \
--prompt="$PROMPT" \
${optionalString cfg.reverse "--reverse"} \
${optionalString cfg.printQuery "--print-query"} \
${optionalString cfg.printQuery "| ${pkgs.coreutils}/bin/tail -1"}
'' ''

View File

@ -0,0 +1,23 @@
{ buildGoModule, fetchFromGitHub, lib }:
buildGoModule rec {
pname = "red";
version = "g${lib.substring 0 7 src.rev}";
src = fetchFromGitHub {
owner = "antonmedv";
repo = "red";
rev = "0bfb499760f391d09c6addec2527b0f77eaacdd6";
sha256 = "0i8f8ih3z97zzbkjkwy4y8z75izm1fscq0rr1g77q7z3kz1lrgrx";
};
modSha256 = "0640x6p5hi7yp001cw13z5a17bi9vgd3gij5fxa1y06d3848cv7l";
meta = {
description = "Terminal log analysis tools";
homepage = https://github.com/analysis/red;
license = lib.licenses.mit;
maintainers = [ lib.maintainers.tv ];
platforms = lib.platforms.linux;
};
}

@ -1 +1 @@
Subproject commit 55aa2c77ce8183f3d2b24f54efa33ab6a42e1e02 Subproject commit 3e731035ed44659624e6d00bbb35570f2b8811fd

View File

@ -12,7 +12,7 @@ with import <stockholm/lib>;
initrd = { initrd = {
availableKernelModules = [ "ahci" ]; availableKernelModules = [ "ahci" ];
luks.cryptoModules = [ "aes" "sha512" "xts" ]; luks.cryptoModules = [ "aes" "sha512" "xts" ];
luks.devices.luksroot.devices = "/dev/sda2"; luks.devices.luksroot.device = "/dev/sda2";
}; };
}; };
@ -71,10 +71,10 @@ with import <stockholm/lib>;
}; };
desktopManager.xfce.enable = true; desktopManager.xfce.enable = true;
displayManager.auto = {
enable = true; displayManager.lightdm.autoLogin.enable = true;
user = "dv"; displayManager.lightdm.autoLogin.user = "dv";
}; displayManager.lightdm.enable = true;
}; };
users.users.dv = { users.users.dv = {

View File

@ -108,13 +108,11 @@ with import <stockholm/lib>;
twoFingerScroll = true; twoFingerScroll = true;
}; };
services.xserver.desktopManager.plasma5 = { services.xserver.desktopManager.plasma5.enable = true;
enable = true;
}; services.xserver.displayManager.lightdm.autoLogin.enable = true;
services.xserver.displayManager.auto = { services.xserver.displayManager.lightdm.autoLogin.user = "vv";
enable = true; services.xserver.displayManager.lightdm.enable = true;
user = "vv";
};
users.users.vv = { users.users.vv = {
inherit (config.krebs.users.vv) home uid; inherit (config.krebs.users.vv) home uid;