aboutsummaryrefslogtreecommitdiff
path: root/mun.nix
blob: c600319155f1639083b6c42e64c053a7b88f2770 (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
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
{ config, lib, pkgs, ... }:

{
  imports = [
    ./modules/i3wm/original/default.nix
  ];
  home = {
    username = "mun";
    homeDirectory = "/home/mun";
    stateVersion = "25.11";

    packages = with pkgs; [
      pay-respects
      zathura
      ripgrep
      fd
      git
      lazygit
      tree-sitter
      gcr
    ];

    sessionVariables = {
      EDITOR = "nvim";
      VISUAL = "nvim";
    };
  };


  xdg = {
    enable = true;

    mimeApps = {
      enable = true;
      defaultApplications = {
        "text/plain" = [ "nvim.desktop" ];
        "text/markdown" = [ "nvim.desktop" ];
        "text/x-markdown" = [ "nvim.desktop" ];
      };
    };
  };

  programs = {
    ssh = {
      enable = true;
      forwardAgent = true;
      addKeysToAgent = "yes";
    };

    zsh = {
      enable = true;
      syntaxHighlighting.enable = true;

      shellAliases = {
        ll = "ls -l";
        rebuild = "sudo nixos-rebuild switch";
        edit = "sudo vi /etc/nixos/configuration.nix";
      };

      history.size = 10000;

      oh-my-zsh = {
        enable = true;
        plugins = [ "git" ];
        theme = "simple";
      };

      initContent = ''
        export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
        fastfetch
      '';
    };

    rofi = {
      enable = true;
      location = "center";
      cycle = true;
      theme = "purple";
      terminal = "${pkgs.kitty}/bin/kitty";
      modes = [ "drun" "ssh" "emoji" "calc" ];
      plugins = with pkgs; [ rofi-emoji rofi-calc ];
    };

    nnn = {
      enable = true;
      package = pkgs.nnn.override { withNerdIcons = true; };
    };

    neovim = {
      enable = true;
      defaultEditor = true;
      viAlias = true;
      vimAlias = true;
      withNodeJs = true;

      # +ANT FIX 
      plugins = []; # disable HM plugin processing

      extraLuaConfig = ''
        -- LazyVim bootstrap
        local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
        if not vim.loop.fs_stat(lazypath) then
          vim.fn.system({
            "git", "clone", "--filter=blob:none",
            "https://github.com/folke/lazy.nvim.git",
            "--branch=stable", lazypath,
          })
        end
        vim.opt.rtp:prepend(lazypath)

        require("lazy").setup({
          spec = {
            { "LazyVim/LazyVim", import = "lazyvim.plugins" },
            { import = "lazyvim.plugins.extras.lang.tex" },
            { import = "lazyvim.plugins.extras.lang.markdown" },
            { import = "lazyvim.plugins.extras.ui.mini-animate" },
            { import = "lazyvim.plugins.extras.lang.typescript" },
            { import = "lazyvim.plugins.extras.lang.python" },
            { import = "lazyvim.plugins.extras.lang.rust" },
            { import = "lazyvim.plugins.extras.lang.nix" },

            {
              "lervag/vimtex",
              lazy = false,
              init = function()
                vim.g.vimtex_view_method = "zathura"
              end
            },

            {
              "MeanderingProgrammer/render-markdown.nvim",
              opts = {
                enabled = true,
                file_types = { "markdown", "rmd" },
                colorscheme = "default",
              },
              dependencies = {
                "nvim-treesitter/nvim-treesitter",
                "nvim-tree/nvim-web-devicons",
              },
            },

            { "mracos/mermaid.vim", ft = { "mermaid" } },
          },

          defaults = { lazy = false, version = false },
          checker = { enabled = true },

          performance = {
            rtp = {
              disabled_plugins = {
                "gzip", "tarPlugin", "tohtml",
                "tutor", "zipPlugin",
              },
            },
          },
        })

        -- LaTeX wrapping
        vim.api.nvim_create_autocmd("FileType", {
          pattern = "tex",
          callback = function()
            vim.opt_local.wrap = true
            vim.opt_local.linebreak = true
            vim.opt_local.breakindent = true
            vim.opt_local.breakindentopt = "shift:2"
            vim.opt_local.textwidth = 0
          end,
        })

        -- Disable diagnostics in markdown
        vim.api.nvim_create_autocmd("FileType", {
          pattern = "markdown",
          callback = function()
            vim.diagnostic.disable(0)
          end,
        })

        -- Nix LSP
        local lspconfig = require("lspconfig")
        lspconfig.nil_ls.setup({ cmd = { "nil" } })

        vim.opt.clipboard = "unnamedplus"
      '';
    };

    
  };

  

  services = {
    gnome-keyring.enable = true;
  };
    

    

    
}