summary refs log tree commit diff
path: root/modules/users/Rory.nix
blob: a1007fc6ba3aa2782ce0b9149b34e650809c00b7 (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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
{ lib, pkgs, ... }:

{
  users.users.Rory = {
    isNormalUser = true;
    extraGroups = [
      "wheel"
      "libvirtd"
      "ocp"
    ];
    packages = with pkgs; [
      lnav
      age
      git
      lsd
      duf
      (btop.override { rocmSupport = true; })
      htop
      kitty.terminfo
      tmux
      jq
      dig

      # - zsh
      zsh
      zsh-powerlevel10k
      zsh-nix-shell
      zsh-you-should-use
      zsh-syntax-highlighting
      zsh-completions

      wireguard-tools
    ];
    openssh.authorizedKeys.keys = [
      #"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT+53Hy3wbIlNVIomK2RroaimMWrTlUkndjHt1dFuyh root@pfSense-arcane-home.localdomain"
      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILF2IuNu//0DP/wKMuDvBgVT3YBS2uULsipbdrhJCTM7 thearcanebrony@tab-linux-desktop"
      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN/kNkY/E5b6rvCQLMaSbpLQ/xoyywIwVVu9uo2j/B6p Rory@RoryNix"
    ];
    useDefaultShell = true;
    shell = pkgs.zsh;
  };
  programs.zsh.enable = true;
  environment.shells = with pkgs; [ zsh ];

  home-manager.users.Rory = {
    home.preferXdgDirectories = true;
    home.sessionVariables = {
      EDITOR = "nvim";
      SYSTEMD_EDITOR = "nvim";
      GIT_EDITOR = "nvim";
      QT_QPA_PLATFORMTHEME = "xdgdesktopportal";
      GTK_USE_PORTAL = "1";
      _JAVA_AWT_WM_NONREPARENTING = "1";
      WINEDEBUG = "-all";
      CHOKIDAR_USEPOLLING = "true";
      MSBUILDLIVELOGGER = "auto";
      DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER = "1";
      DOTNET_CLI_TELEMETRY_OPTOUT = "1";
      NIXPKGS_ALLOW_UNFREE = "1";
      MOZ_USE_XINPUT2 = "1";
    };
    programs = {
      git = {
        enable = true;
        userName = "Rory&";
        userEmail = "root@rory.gay";
        extraConfig = {
          safe = {
            directory = "/";
          };
        };
      };
      zsh = {
        enable = true;
        #enableAutosuggestions = true;
        autosuggestion.enable = true;
        enableVteIntegration = true;
        autocd = true;

        initExtraFirst = ''
          export EDITOR=nvim
          export SYSTEMD_EDITOR=$EDITOR
          export GIT_EDITOR=$EDITOR
          export QT_QPA_PLATFORMTHEME=xdgdesktopportal
          export GTK_USE_PORTAL=1
          export _JAVA_AWT_WM_NONREPARENTING=1
          export WINEDEBUG=-all
          export DOTPROFILE_LOADED='yes'
          export CHOKIDAR_USEPOLLING=true
          export MSBUILDLIVELOGGER=auto
          export DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER=1
          export DOTNET_CLI_TELEMETRY_OPTOUT=1
          function mkkey() {
            echo "Making key for $1"
            ssh-keygen -t ed25519 -C "$HOST -> $1" -f ~/.ssh/id_ed25519_$1
            (
              echo "Host $1"
              echo "  IdentityFile ~/.ssh/id_ed25519_$1"
            ) >> ~/.ssh/config
            echo 'Done! Public key:'
            cat ~/.ssh/id_ed25519_$1.pub
          }

          export DISABLE_AUTO_UPDATE=true
          COMPLETION_WAITING_DOTS="true"
        '';
        initExtra = ''
          alias mv='mv -v'
          alias pre='npx prettier -w'
          alias git-commit='git commit --signoff --sign'
          alias npm='NODE_OPTIONS=--openssl-legacy-provider npm'
          alias npx='NODE_OPTIONS=--openssl-legacy-provider npx'
          alias yarn='NODE_OPTIONS=--openssl-legacy-provider npx -y yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config'
          alias node='NODE_OPTIONS=--openssl-legacy-provider node'
          # - dotnet
          alias drun='dotnet watch run --no-hot-reload --property WarningLevel=0'
          alias dbuild='dotnet watch build --no-hot-reload --property WarningLevel=0'
          alias ls='lsd -lAhF --color=always --icon=always'
          alias transfetch='neofetch --kitty ~/trans_witch.jpg'
          alias gc='git-commit'
          [ -f "$HOME/.profile" ] && . $HOME/.profile
        '';
        #alias knconfig='cp .config ../$(date ''+%Y%m%d_%k%M%S\'').config -v; make CC=clang LLVM=1 nconfig'
        oh-my-zsh = {
          enable = true;
          plugins = [
            "git"
            "sudo"
          ];
        };

        plugins = [
          {
            name = "powerlevel10k";
            src = pkgs.zsh-powerlevel10k;
            file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
          }
          {
            name = "powerlevel10k-config";
            src = lib.cleanSource ./Rory;
            file = "p10k.zsh";
          }
          {
            name = "zsh-syntax-highlighting";
            src = pkgs.zsh-syntax-highlighting;
            file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh";
          }
          {
            name = "zsh-autosuggestions";
            src = pkgs.zsh-autosuggestions;
            file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
          }
        ];

        localVariables = {
          POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = [
            "os_icon"
            "dir"
            "vcs"
            "prompt_char"
          ];
          POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS = [
            "status"
            "command_execution_time"
            "background_jobs"
            "direnv"
            "virtualenv"
            "pyenv"
            "nodeenv"
            "context"
            "nix_shell"
            "vi_mode"
            "load"
            "disk_usage"
            "ram"
          ];
          POWERLEVEL9K_MODE = "nerdfont-complete";
          POWERLEVEL9K_ICON_PADDING = "none";
          POWERLEVEL9K_PROMPT_ADD_NEWLINE = "false";
          POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR = "\uE0B1";
          POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR = "\uE0B3";
          POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR = "\uE0B0";
          POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR = "\uE0B2";
          POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL = "\uE0B0";
          POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL = "\uE0B2";
          POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE = true;
        };
      };
      neovim = {
        defaultEditor = true;
        viAlias = true;
        vimAlias = true;
        vimdiffAlias = true;
        coc = {
          enable = true;

        };
      };
    };

    programs.neovim.plugins = with pkgs.vimPlugins; [
      pkgs.vimPlugins.nvim-tree-lua
      {
        plugin = pkgs.vimPlugins.vim-startify;
        config = "let g:startify_change_to_vcs_root = 0";
      }
    ];

    home.stateVersion = "22.11";
  };
}