Skip to content

Instantly share code, notes, and snippets.

@dtzWill
Created January 8, 2019 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtzWill/59c1e5ab4af627a27a3a3af8197d9c95 to your computer and use it in GitHub Desktop.
Save dtzWill/59c1e5ab4af627a27a3a3af8197d9c95 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }:
rec {
optslist = ./options.json;
fzfopts = pkgs.writeShellScriptBin "fzfopts" ''
cat ${optslist} | ${pkgs.jq}/bin/jq "keys[]" -r | fzf \
--reverse \
--prompt="NixOS Options> " \
--preview="echo -e \"{1}\n\"; nixos-option {1}" \
--preview-window=wrap
'';
gfzfopts = pkgs.writeShellScriptBin "gfzfopts" ''
termite -e "zsh -ic ${fzfopts}/bin/fzfopts"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment