aboutsummaryrefslogtreecommitdiffstats
path: root/home/nushell.nix
blob: 0d1f072d769fb491a3a6d803b88f11c0e6e0c1ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ pkgs, ... }:

{
  programs.nushell = {
    enable = true;
    shellAliases = {
      browser = "${pkgs.chawan}/bin/cha";
      cat = "${pkgs.gat}/bin/gat";
      fj = "${pkgs.forgejo-cli}/bin/fj --host git.relesoft.io";
      gmail = "${pkgs.himalaya}/himalaya envelope list --account gmail --folder gmail/Inbox 'not flag Seen'";
      grep = "${pkgs.ripgrep}/bin/rg";
      http = "${pkgs.xh}/bin/xh";
      journalctl = "${pkgs.systemd}/bin/journalctl --output=short-iso";
      llm = "${pkgs.tenere}/bin/tenere";
      lt = "${pkgs.eza}/bin/eza --tree --level=2 --long --icons --git";
      relesoft = "${pkgs.himalaya}/himalaya envelope list --account relesoft --folder relesoft/Inbox 'not flag Seen'";
      stocks = "${pkgs.ticker}/bin/ticker --config /home/petri/.config/ticker/config.yaml";
      weather = "${pkgs.wthrr}/bin/wthrr --forecast d";
      wifi = "${pkgs.impala}/bin/impala";
      youtube = "${pkgs.pipe-viewer}/bin/pipe-viewer";
    };
    extraConfig = ''
      def ns [] {
        ${pkgs.nix-search-tv}/bin/nix-search-tv print | ${pkgs.fzf}/bin/fzf --preview "${pkgs.nix-search-tv}/bin/nix-search-tv preview {}" --scheme history
      }

      def doc [file: path] {
        ${pkgs.asciidoctor}/bin/asciidoctor --backend xhtml5 --out-file - $file |
        ${pkgs.chawan}/bin/cha -T application/xhtml+xml
      }

      def share [file: path] {
        ${pkgs.curl}/bin/curl -X PUT --data-binary @$file https://bin.tammi.cc
      }

      def import [file: path] {
        ${pkgs.grim}/bin/grim -g (${pkgs.slurp}/bin/slurp) $file
      }

      def readdoc [...args] {
        ${pkgs.reader}/bin/reader $args --markdown-output | ${pkgs.moor}/bin/moor --wrap --lang markdown
      }
    '';
    settings = {
      show_banner = false;
      completions = {
        case_sensitive = false;
        quick = true;
        partial = true;
        algorithm = "fuzzy";
      };
    };
  };
}