summaryrefslogtreecommitdiff
path: root/home.nix
blob: f556bccd45c22210924fcd528b065d67c9c91ee3 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
  # initial version
  home.stateVersion = "22.11";

  # ZSH with good config
  programs.zsh = {
    # ZSH on
    enable = true;

    # we want completion
    enableCompletion = true;

    # we want suggestions of already typed stuff
    autosuggestion.enable = true;

    # we want nice command highlighting
    syntaxHighlighting.enable = true;

    # better history
    history = {
      # save timestamps
      extended = true;

      # kill dupes over full history
      ignoreAllDups = true;

      # don't share history between sessions
      share = false;
    };

    # aliases
    shellAliases = {
      # system build/update/cleanup
      update = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot";
      upgrade = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot --upgrade";
      updatenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch";
      upgradenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch --upgrade";
      gc = "sudo nix-collect-garbage --delete-older-than 7d";
      verify = "sudo nix --extra-experimental-features nix-command store verify --all";
      optimize = "sudo nix --extra-experimental-features nix-command store optimise";

      # overwrite some tools
      cat = "bat";
      ls = "lsd";
      la = "lsd -ahl";

      # ssh around in the local network
      mac = "ssh mac.fritz.box";
      macroot = "ssh root@mac.fritz.box";
      mini = "ssh mini.fritz.box";
      miniroot = "ssh root@mini.fritz.box";
      neko = "ssh neko.fritz.box";
      nekoroot = "ssh root@neko.fritz.box";
    };
  };

  # nice prompt
  programs.oh-my-posh = {
    enable = true;
    useTheme = "kushal";
  };

  # nice cd
  programs.zoxide = {
    enable = true;
    options = [ "--cmd" "cd" ];
  };

  # integrate fuzzy search
  programs.fzf = {
    enable = true;
  };

  # enable keychain, we use the main user key
  programs.keychain = {
    enable = true;
    keys = [ "/home/cullmann/.ssh/id_ed25519" ];
  };

  # https://github.com/nix-community/nix-direnv
  programs.direnv = {
    enable = true;
    nix-direnv.enable = true;
  };
}