From 39cc7e81edc35f34fa8e242277bd69f51d84566f Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 22 May 2020 20:16:53 +0200 Subject: urlwatch module: use users.users.{name} istead of a list --- krebs/3modules/urlwatch.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix index 43535b08f..0b7a71db5 100644 --- a/krebs/3modules/urlwatch.nix +++ b/krebs/3modules/urlwatch.nix @@ -189,8 +189,8 @@ let ''; }; }; - users.extraUsers = singleton { - inherit (user) name uid; + users.users.${user.name} = { + inherit (user) uid; home = cfg.dataDir; createHome = true; }; -- cgit v1.2.3 From 5cdfea58e13c968d4324363c8111305446279cef Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 25 May 2020 15:27:41 +0200 Subject: ma urlwatch: generalize lidl --- makefu/2configs/urlwatch/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/makefu/2configs/urlwatch/default.nix b/makefu/2configs/urlwatch/default.nix index f93d47caa..c90b83ea9 100644 --- a/makefu/2configs/urlwatch/default.nix +++ b/makefu/2configs/urlwatch/default.nix @@ -5,11 +5,15 @@ let url = "https://github.com/${name}/releases.atom"; filter = "grepi:( Date: Mon, 25 May 2020 15:27:59 +0200 Subject: =?UTF-8?q?ma=20urlwatch:=20remove=20mauernutfr=C3=A4se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- makefu/2configs/urlwatch/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/makefu/2configs/urlwatch/default.nix b/makefu/2configs/urlwatch/default.nix index c90b83ea9..b07a1e807 100644 --- a/makefu/2configs/urlwatch/default.nix +++ b/makefu/2configs/urlwatch/default.nix @@ -46,7 +46,6 @@ in { # shopping ( lidl https://www.lidl.de/de/parkside-nass-trockensauger-pnts-1500-d5/p303117 ) - ( lidl https://www.lidl.de/de/parkside-mauernutfraese-pmnf-1350-d4/p294989 ) # TODO: dymo cups ] ++ map grss [ -- cgit v1.2.3 From 5d47f5d33d29b4ef95d3788bcb581f0ebf41e9ba Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 28 May 2020 16:06:05 +0200 Subject: ma omo.r: enable home-manager zsh config --- makefu/1systems/omo/config.nix | 13 ++++++++++--- makefu/1systems/omo/hw/omo.nix | 19 ++++++++++--------- makefu/1systems/omo/source.nix | 1 + 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index cfe0d0a3f..34bd42592 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -11,19 +11,26 @@ in { ./hw/omo.nix #./hw/tsp.nix - { environment.systemPackages = with pkgs;[ tmux picocom ];} + + + + + + + + # + { environment.systemPackages = [ pkgs.esniper ]; } - # # # @@ -108,7 +115,7 @@ in { ]; makefu.full-populate = true; nixpkgs.config.allowUnfree = true; - krebs.rtorrent = (builtins.trace (builtins.toJSON config.services.telegraf.extraConfig)) { + krebs.rtorrent = { downloadDir = lib.mkForce "/media/cryptX/torrent"; extraConfig = '' upload_rate = 500 diff --git a/makefu/1systems/omo/hw/omo.nix b/makefu/1systems/omo/hw/omo.nix index 87af2a314..586ad98c4 100644 --- a/makefu/1systems/omo/hw/omo.nix +++ b/makefu/1systems/omo/hw/omo.nix @@ -80,18 +80,19 @@ in { boot = { initrd.luks = { devices = let - usbkey = name: device: { - inherit name device keyFile; + usbkey = device: { + inherit device keyFile; keyFileSize = 4096; allowDiscards = true; }; - in [ - (usbkey "luksroot" rootPartition) - (usbkey "crypt0" cryptDisk0) - (usbkey "crypt1" cryptDisk1) - (usbkey "crypt2" cryptDisk2) - (usbkey "crypt3" cryptDisk3) - ]; + in + { + luksroot = usbkey rootPartition; + crypt0 = usbkey cryptDisk0; + crypt1 = usbkey cryptDisk1; + crypt2 = usbkey cryptDisk2; + crypt3 = usbkey cryptDisk3; + }; }; loader.grub.device = lib.mkForce rootDisk; diff --git a/makefu/1systems/omo/source.nix b/makefu/1systems/omo/source.nix index 05c17377f..b56e855fc 100644 --- a/makefu/1systems/omo/source.nix +++ b/makefu/1systems/omo/source.nix @@ -2,4 +2,5 @@ name="omo"; torrent = true; unstable = true; + home-manager = true; } -- cgit v1.2.3 From fa5f65ee7695b5742ec83b852e6e5a7f749a3428 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 1 Jun 2020 14:41:20 +0200 Subject: ma awesomecfg: start essentials on startup closes #36 --- makefu/5pkgs/awesomecfg/full.cfg | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg index 83dd79b4d..2abfe503d 100644 --- a/makefu/5pkgs/awesomecfg/full.cfg +++ b/makefu/5pkgs/awesomecfg/full.cfg @@ -243,7 +243,7 @@ awful.screen.connect_for_each_screen(function(s) set_wallpaper(s) -- Each screen has its own tag table. - awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, awful.layout.layouts[1]) + awful.tag({ "tmp", "ssh", "www", "im", "mail","work","net","misc","remote" }, s, awful.layout.layouts[1]) -- Create a promptbox for each screen s.mypromptbox = awful.widget.prompt() @@ -486,14 +486,12 @@ awful.rules.rules = { focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons } }, - { rule = { class = "MPlayer" }, - properties = { floating = true } }, + --{ rule = { class = "MPlayer" }, + -- properties = { floating = true } }, { rule = { class = "pinentry" }, properties = { floating = true } }, - { rule = { class = "gimp" }, - properties = { floating = true } }, - { rule = { class = "Anamnesis" }, - properties = { floating = true } }, + --{ rule = { class = "gimp" }, + -- properties = { floating = true } }, -- Set Firefox to always map on tags number 2 of screen 1. -- { rule = { class = "Firefox" }, -- properties = { tag = tags[1][2] } }, @@ -571,16 +569,12 @@ local os = { -- {{{ autostart do - local cmds = - { - -- "@networkmanagerapplet@/bin/nm-applet", - -- "@blueman@/bin/blueman-applet", - -- "@clipit@/bin/clipit" - } - - for _,i in pairs(cmds) do - awful.util.spawn(i) - end + awful.spawn("urxvt", { tag = tags[1] }) # dev shell + awful.spawn("urxvt -e mosh makefu@gum.i", { tag = tags[2] }) + awful.spawn("firefox", { tag = tags[3] }) + awful.spawn("telegram-desktop", { tag = tags[4] }) + awful.spawn("signal-desktop", { tag = tags[4] }) + awful.spawn("urxvt -e mutt", { tag = tags[5] }) end -- }}} -- cgit v1.2.3 From bed170dd8a8ca5ba4c9109fc858dc658f90df68c Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 5 Jun 2020 10:31:17 +0200 Subject: pkgs.kpaste: paste either stdin or file from parameter --- krebs/5pkgs/simple/kpaste/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix index 217cb8a44..02f482316 100644 --- a/krebs/5pkgs/simple/kpaste/default.nix +++ b/krebs/5pkgs/simple/kpaste/default.nix @@ -1,6 +1,6 @@ { curl, gnused, writeDashBin }: writeDashBin "kpaste" '' - ${curl}/bin/curl -sS http://p.r --data-binary @- | - ${gnused}/bin/sed '$ {p;s/\/krebsco.de/}' + ${curl}/bin/curl -sS http://p.r --data-binary @"''${1:--}" | + ${gnused}/bin/sed '$ {p;s/\/krebsco.de/}' '' -- cgit v1.2.3 From 360e823a9a187dd61d1c7f3f712a8edc9e7879d9 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 5 Jun 2020 10:39:43 +0200 Subject: pkgs.kpaste: replace internal host with https external host --- krebs/5pkgs/simple/kpaste/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix index 02f482316..9820c931d 100644 --- a/krebs/5pkgs/simple/kpaste/default.nix +++ b/krebs/5pkgs/simple/kpaste/default.nix @@ -2,5 +2,5 @@ writeDashBin "kpaste" '' ${curl}/bin/curl -sS http://p.r --data-binary @"''${1:--}" | - ${gnused}/bin/sed '$ {p;s/\/krebsco.de/}' + ${gnused}/bin/sed '$ {p;s|http://p.r|https://p.krebsco.de|}' '' -- cgit v1.2.3 From edd2cf0ec1f81722c4c8c9797a830c98c953bd5a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:03:56 +0200 Subject: l vim: new colorscheme --- lass/2configs/vim.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lass/2configs/vim.nix b/lass/2configs/vim.nix index f55886e2e..0e4ac5394 100644 --- a/lass/2configs/vim.nix +++ b/lass/2configs/vim.nix @@ -127,7 +127,6 @@ let extra-runtimepath = concatMapStringsSep "," (pkg: "${pkg.rtp}") [ pkgs.vimPlugins.ack-vim - pkgs.vimPlugins.Gundo pkgs.vimPlugins.undotree pkgs.vimPlugins.vim-go pkgs.vimPlugins.fzf-vim @@ -155,26 +154,26 @@ let let colors_name = ${toJSON name} - hi Normal ctermbg=235 - hi Comment ctermfg=242 - hi Constant ctermfg=062 - hi Identifier ctermfg=068 + hi Normal ctermbg=016 + hi Comment ctermfg=255 + hi Constant ctermfg=229 + hi Identifier ctermfg=123 hi Function ctermfg=041 hi Statement ctermfg=167 hi PreProc ctermfg=167 - hi Type ctermfg=041 + hi Type ctermfg=046 hi Delimiter ctermfg=251 - hi Special ctermfg=062 + hi Special ctermfg=146 - hi Garbage ctermbg=088 - hi TabStop ctermbg=016 - hi NBSP ctermbg=094 + hi Garbage ctermbg=124 + hi TabStop ctermbg=020 + hi NBSP ctermbg=056 hi NarrowNBSP ctermbg=097 hi Todo ctermfg=174 ctermbg=NONE - hi NixCode ctermfg=148 + hi NixCode ctermfg=190 hi NixData ctermfg=149 - hi NixQuote ctermfg=150 + hi NixQuote ctermfg=119 hi diffNewFile ctermfg=207 hi diffFile ctermfg=207 -- cgit v1.2.3 From 2ea46cb5b4d99e3b3f61be1d6dc2f51577eaf1fc Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:05:33 +0200 Subject: krops: v1.19.0 -> v1.21.0 --- submodules/krops | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/krops b/submodules/krops index f1b7112ac..55aa2c77c 160000 --- a/submodules/krops +++ b/submodules/krops @@ -1 +1 @@ -Subproject commit f1b7112ac3cbe090e96f2c82c525b6db69b82034 +Subproject commit 55aa2c77ce8183f3d2b24f54efa33ab6a42e1e02 -- cgit v1.2.3 From 586ff0a72d4d3c97a6042fe47dc0c441e7288a27 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:06:25 +0200 Subject: l hass: allow from wiregrill --- lass/2configs/hass/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix index 639ba3d3f..a48c61a69 100644 --- a/lass/2configs/hass/default.nix +++ b/lass/2configs/hass/default.nix @@ -14,6 +14,7 @@ with import ./lib.nix { inherit lib; }; { predicate = "-i docker0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto { predicate = "-i int0 -p tcp --dport 8123"; target = "ACCEPT"; } # hass { predicate = "-i retiolum -p tcp --dport 8123"; target = "ACCEPT"; } # hass + { predicate = "-i wiregrill -p tcp --dport 8123"; target = "ACCEPT"; } # hass ]; services.home-assistant = { -- cgit v1.2.3 From 4242c2ad0eff7a9bfaae456050232e745a2ac05c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:06:54 +0200 Subject: l hass: lower dark sensitivity --- lass/2configs/hass/lib.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/hass/lib.nix b/lass/2configs/hass/lib.nix index 555cfae28..9281a19ec 100644 --- a/lass/2configs/hass/lib.nix +++ b/lass/2configs/hass/lib.nix @@ -99,7 +99,7 @@ rec { conditions = [ { condition = "template"; - value_template = "{{ trigger.to_state.attributes.illuminance < 13000 }}"; + value_template = "{{ trigger.to_state.attributes.illuminance < 7500 }}"; } { condition = "template"; -- cgit v1.2.3 From e425c80236046bfd74f1ed61b9cc3856fb17d50a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:08:22 +0200 Subject: l pass: krebs.per-user -> users.users.*.packages --- lass/2configs/pass.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/pass.nix b/lass/2configs/pass.nix index 156ebcae7..6b2a0142a 100644 --- a/lass/2configs/pass.nix +++ b/lass/2configs/pass.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - krebs.per-user.lass.packages = with pkgs; [ + users.users.lass.packages = with pkgs; [ (pass.withExtensions (ext: [ ext.pass-otp ])) gnupg ]; -- cgit v1.2.3 From 0f01f2899f68b8e142610994da529b5893f2a5f6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Jun 2020 13:09:08 +0200 Subject: l: readd morpheus.r --- krebs/3modules/lass/default.nix | 36 ++++++++++++++++++++++++++++ lass/1systems/morpheus/config.nix | 25 ++++++++++++++++++++ lass/1systems/morpheus/physical.nix | 47 +++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 lass/1systems/morpheus/config.nix create mode 100644 lass/1systems/morpheus/physical.nix diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 9c2c0e94c..2a75cc1bb 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -565,6 +565,42 @@ in { ci = false; syncthing.id = "PWKVXPB-JCNO6E4-KVIQ7CK-6FSOWHM-AWORMDU-HVVYLKW-44DQTYW-XZT7DQJ"; }; + morpheus = { + cores = 1; + nets = { + retiolum = { + ip4.addr = "10.243.0.19"; + ip6.addr = r6 "012f"; + aliases = [ + "morpheus.r" + ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIICCgKCAgEAptrlSKQKsBH2QMQxllZR94S/fXneajpJifRjXR5bi+7ME2ThdQXY + T7yWiKaUuBJThWged9PdPltLUEMmv+ubQqpWHZq442VWSS36r1yMSGpUeKK+oYMN + /Sfu+1yC4m2uXno95wpJZIcDfbbn26jT6ldJ4Yd97zyrXKljvcdrz3wZzQq0tojh + S5Q59x/aQMJbnQpnlFnMIEVgULuFPW16+vPGsXIPdYNggaF1avcBaFl8i3M0EZVz + Swn4hArDynDJhR7M0QdlwOpOh7O+1iOnmXqqei3LxMVHb+YtzfHgxOPxggUsy7CR + bj9uBR9loGwgmZwaxXd1Vfbw8kn/feOb9FcW73u+SZyzwEA9HFRV0jGQe3P9mGfI + Bwe02DOTVXEB8jTAGCw5T3bXLIOX8kqdlCECuAWFfrt8H+GjZDuGUWRcMn32orMz + sMvkab95ZOHK6Q31mrhILOIOdyZWKPZIabL3HF6CZtu52h6MDHbmGS0w0OJYhj2+ + VnT9ZBoaeooVg8QOE43rCXvmL5vzhLKrj4s/53wTGG5SpzLs9Q9rrJVgAnz4YQ7j + 3Ov5q3Zxyr+vO6O7Pb5X49vCQw/jzK41S0/15GEmKcoxXemzeZCpX1mbeeTUtLvA + U7OJwldrElzictBJ1gT94L4BDvoGZVqAkXJCJPamfsWaiw6SsMqtTfECAwEAAQ== + -----END RSA PUBLIC KEY----- + ''; + }; + wiregrill = { + ip6.addr = w6 "012f"; + aliases = [ + "morpheus.w" + ]; + wireguard.pubkey = "BdiIHJjJQThmZD8DehxPGA+bboBHjljedwaRaV5yyDY="; + }; + }; + ssh.privkey.path = ; + ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHXS60mmNWMdMRvaPxGn91Cm/hm7zY8xn5rkI4n2KG/f "; + }; hilum = { cores = 1; nets = { diff --git a/lass/1systems/morpheus/config.nix b/lass/1systems/morpheus/config.nix new file mode 100644 index 000000000..c3a8ea6c8 --- /dev/null +++ b/lass/1systems/morpheus/config.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: +with import ; +{ + imports = [ + + + ]; + + krebs.build.host = config.krebs.hosts.morpheus; + + networking.wireless.enable = false; + networking.networkmanager.enable = true; + + services.logind.lidSwitch = "ignore"; + services.logind.lidSwitchDocked = "ignore"; + + environment.systemPackages = with pkgs; [ + gitAndTools.hub + nix-review + firefox + ]; + + services.openssh.forwardX11 = true; + programs.x2goserver.enable = true; +} diff --git a/lass/1systems/morpheus/physical.nix b/lass/1systems/morpheus/physical.nix new file mode 100644 index 000000000..3fb03cda4 --- /dev/null +++ b/lass/1systems/morpheus/physical.nix @@ -0,0 +1,47 @@ +{ + imports = [ + ./config.nix + + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.efiSupport = true; + boot.loader.grub.efiInstallAsRemovable = true; + boot.loader.grub.device = "nodev"; + + networking.hostId = "06442b9a"; + + fileSystems."/" = { + device = "/dev/pool/root"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1F60-17C6"; + fsType = "vfat"; + }; + + fileSystems."/home" = { + device = "/dev/pool/home"; + fsType = "btrfs"; + }; + + fileSystems."/tmp" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["nosuid" "nodev" "noatime"]; + }; + boot.initrd.luks = { + cryptoModules = [ "aes" "sha512" "sha1" "xts" ]; + devices = [{ + name = "luksroot"; + device = "/dev/nvme0n1p3"; + }]; + }; + + services.udev.extraRules = '' + SUBSYSTEM=="net", ATTR{address}=="f8:59:71:a9:05:65", NAME="wl0" + SUBSYSTEM=="net", ATTR{address}=="54:e1:ad:4f:06:83", NAME="et0" + ''; +} -- cgit v1.2.3 From 47ea2f1d631516451b4eb920cc799cfd8f006ad6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 8 Jun 2020 20:27:25 +0200 Subject: nixpkgs: 48723f4 -> e2bb73c --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 8fd800964..cee3c5ec8 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels", - "rev": "48723f48ab92381f0afd50143f38e45cf3080405", - "date": "2020-05-22T11:40:20+02:00", - "sha256": "0h3b3l867j3ybdgimfn76lw7w6yjhszd5x02pq5827l659ihcf53", + "rev": "e2bb73ce5f786b83e984b80199112f86b8a6cc9d", + "date": "2020-06-07T23:11:12+02:00", + "sha256": "0mpcdwhippvgsj3kj8vw35dgz94dnzgxgsfqqzcfpmvnzjc23vk7", "fetchSubmodules": false } -- cgit v1.2.3 From bde301139df5474a72f79122f81feab1d6387a07 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 16 Jun 2020 19:58:40 +0200 Subject: fzfmenu: move to krebs --- krebs/5pkgs/simple/fzfmenu/default.nix | 55 ++++++++++++++++++++++++++++++++++ lass/5pkgs/fzfmenu/default.nix | 55 ---------------------------------- 2 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 krebs/5pkgs/simple/fzfmenu/default.nix delete mode 100644 lass/5pkgs/fzfmenu/default.nix diff --git a/krebs/5pkgs/simple/fzfmenu/default.nix b/krebs/5pkgs/simple/fzfmenu/default.nix new file mode 100644 index 000000000..64e95d233 --- /dev/null +++ b/krebs/5pkgs/simple/fzfmenu/default.nix @@ -0,0 +1,55 @@ +{ pkgs, ... }: + +pkgs.writeDashBin "fzfmenu" '' + set -efu + PROMPT=">" + for i in "$@" + do + case $i in + -p) + PROMPT="$2" + shift + shift + break + ;; + -l) + # no reason to filter number of lines + LINES="$2" + shift + shift + break + ;; + -i) + # we do this anyway + shift + break + ;; + *) + echo "Unknown option $1" >&2 + shift + ;; + esac + done + INPUT=$(${pkgs.coreutils}/bin/cat) + OUTPUT="$(${pkgs.coreutils}/bin/mktemp)" + if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell + ${pkgs.rxvt_unicode}/bin/urxvt \ + -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 + ${pkgs.coreutils}/bin/tail -1 "$OUTPUT" + ${pkgs.coreutils}/bin/rm "$OUTPUT" +'' diff --git a/lass/5pkgs/fzfmenu/default.nix b/lass/5pkgs/fzfmenu/default.nix deleted file mode 100644 index 64e95d233..000000000 --- a/lass/5pkgs/fzfmenu/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ pkgs, ... }: - -pkgs.writeDashBin "fzfmenu" '' - set -efu - PROMPT=">" - for i in "$@" - do - case $i in - -p) - PROMPT="$2" - shift - shift - break - ;; - -l) - # no reason to filter number of lines - LINES="$2" - shift - shift - break - ;; - -i) - # we do this anyway - shift - break - ;; - *) - echo "Unknown option $1" >&2 - shift - ;; - esac - done - INPUT=$(${pkgs.coreutils}/bin/cat) - OUTPUT="$(${pkgs.coreutils}/bin/mktemp)" - if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell - ${pkgs.rxvt_unicode}/bin/urxvt \ - -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 - ${pkgs.coreutils}/bin/tail -1 "$OUTPUT" - ${pkgs.coreutils}/bin/rm "$OUTPUT" -'' -- cgit v1.2.3