Compare commits

..

No commits in common. "5830d76e3466c6fd38ee4008272c637a115c8e83" and "7b37393bc5e4622f9a8865eeecf8144685dc0045" have entirely different histories.

16 changed files with 195 additions and 204 deletions

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1662046976,
"narHash": "sha256-BrTReGRhkVm/Kmmf4zQrL+oYWy0sds/BDBgXNX1CL3c=",
"lastModified": 1652712410,
"narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=",
"owner": "ryantm",
"repo": "agenix",
"rev": "9f136ecfa5bf954538aed3245e4408cf87c85097",
"rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b",
"type": "github"
},
"original": {
@ -42,11 +42,11 @@
]
},
"locked": {
"lastModified": 1661882940,
"narHash": "sha256-4LaVFnV22WrOA0aolqqk9dXrM8crikcrLQt29G18F7M=",
"lastModified": 1657835815,
"narHash": "sha256-CnZszAYpNKydh6N7+xg+eRtWNVoAAGqc6bg+Lpgq1xc=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "80cec5115aae74accc4ccfb9f84306d7863f0632",
"rev": "54a24f042f93c79f5679f133faddedec61955cf2",
"type": "github"
},
"original": {
@ -88,11 +88,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1661212356,
"narHash": "sha256-+9P849WIb/zhAMWXrW9g0IRd7vFRj5a5acLTtOFyY48=",
"lastModified": 1645603310,
"narHash": "sha256-/CTQuJzFK8pO2d4S5uKhHwT+QiNfnbCKSx7O2tW0GXQ=",
"owner": "input-output-hk",
"repo": "deploy-rs",
"rev": "4da8eb9fc3e611adf4bbe8c8df5b1fc604c4f906",
"rev": "feb44f80c634c799a661bf27c5cb4a905640fe93",
"type": "github"
},
"original": {
@ -169,11 +169,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1662101031,
"narHash": "sha256-dTlT6J6+Rv6zno/VhJusBwgV7iFNRUdY4GgH7BUPWYk=",
"lastModified": 1660458418,
"narHash": "sha256-vBWAv4QhXa9VmyaJUsTfQmKs+uw83Pfv/FmN5GD3KkE=",
"owner": "nix-community",
"repo": "fenix",
"rev": "42e17909b3c69577303fd0c7ae138df3f4888de2",
"rev": "54253fb23a5871466ada5c0334b6e39a0bcdb4db",
"type": "github"
},
"original": {
@ -379,11 +379,11 @@
},
"latest": {
"locked": {
"lastModified": 1662019588,
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
"lastModified": 1660396586,
"narHash": "sha256-ePuWn7z/J5p2lO7YokOG1o01M0pDDVL3VrStaPpS5Ig=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
"rev": "e105167e98817ba9fe079c6c3c544c6ef188e276",
"type": "github"
},
"original": {
@ -415,11 +415,11 @@
},
"nixos": {
"locked": {
"lastModified": 1662025319,
"narHash": "sha256-ZJlBQ7jXynq4+Jg9+DgOe8FJG8sDIeFFYP3V3K98KUs=",
"lastModified": 1660406417,
"narHash": "sha256-ekKl2IWxAEjwrAtE//PgR95UcvqFK+FaT4kR5XFcdjQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b82ccafb54163ab9024e893e578d840577785fea",
"rev": "d816f474aa79d020a75cc3e69113759e32aabc2e",
"type": "github"
},
"original": {
@ -431,11 +431,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1662092548,
"narHash": "sha256-nmAbyJ5+DBXcNJ2Rcy/Gx84maqtLdr6xEe82+AXCaY8=",
"lastModified": 1660407119,
"narHash": "sha256-04lWO0pDbhAXFdL4v2VzzwgxrZ5IefKn+TmZPiPeKxg=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "786633331724f36967853b98d9100b5cfaa4d798",
"rev": "12620020f76b1b5d2b0e6fbbda831ed4f5fe56e1",
"type": "github"
},
"original": {
@ -446,11 +446,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1662019588,
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
"lastModified": 1660305968,
"narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
"rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d",
"type": "github"
},
"original": {
@ -567,11 +567,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1662066014,
"narHash": "sha256-DE4FsE2sxd9nFtG+8+lnv/IBbtf+6rAlKjIdfpWN488=",
"lastModified": 1660416638,
"narHash": "sha256-DllHrfAUUjg0tBYvj32jr4NQZrH0dC9sRiBPqN8C03w=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "93c52e41ec0d297c7512adf5936d8c464c820618",
"rev": "010f68cacfdddcc50234b54965e1326d7ad925ab",
"type": "github"
},
"original": {

View file

@ -74,12 +74,11 @@
nixos = {
imports = [ (digga.lib.importOverlays ./overlays) ];
overlays = [
# fenix.overlay breaks the cache, because it uses the system nixpkgs
(_: super: let pkgs = fenix.inputs.nixpkgs.legacyPackages.${super.system}; in fenix.overlay pkgs pkgs)
agenix.overlay
nvfetcher.overlay
./pkgs/default.nix
fenix.overlay
peerix.overlay
];
};

View file

@ -1,2 +1 @@
*.localhost localhost
*.notatld.localhost localhost

View file

@ -1,3 +0,0 @@
{ ... }: {
services.tailscale.enable = true;
}

View file

@ -1,7 +1,7 @@
{ profiles, ... }:
with profiles; rec {
base = [ users.root core dnscrypt ];
workstation = base ++ [ sway develop game profiles.workstation ssh flatpak torrents pwn tor rust virtualization java networkmanager pipewire flatpak peerix tailscale users.mae ];
workstation = base ++ [ sway develop game profiles.workstation ssh flatpak torrents pwn tor rust virtualization java networkmanager pipewire flatpak peerix users.mae ];
desktop = workstation ++ [ amd three_dee ];
lap = workstation ++ [ laptop bluetooth print ];
}

View file

@ -1,18 +0,0 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim.clangd;
in
with lib;
{
options.mae.nvim.clangd.enable = lib.mkEnableOption "Enable C/C++ language support(with clangd) in neovim";
config = mkIf cfg.enable {
mae.nvim.lsp.servers.clangd = {
enable = true;
script = ''
{
cmd = { "${pkgs.clang-tools}/bin/clangd" },
}
'';
};
};
}

View file

@ -5,14 +5,12 @@ let
in
{
imports = [
./nvim-lsp.nix
./js.nix
./go.nix
./rust.nix
./nix.nix
./clangd.nix
./web_dev.nix
./other_langs.nix
];
options.mae.nvim = {
enable = mkEnableOption "enable neovim";
};
@ -32,9 +30,6 @@ in
vim-sleuth
];
extraPackages = with pkgs; [
nodePackages.prettier
];
extraConfig = ''
set background=dark
set termguicolors
@ -43,8 +38,22 @@ in
set number
set autoindent
set shortmess+=c
set completeopt=menuone,noinsert,noselect
set shortmess+=c
'';
coc.pluginConfig = ''
nmap <silent> <F2> <Plug>(coc-rename)
nmap <silent> <F3> <Plug>(coc-codeaction-line)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
'';
};
};

View file

@ -4,16 +4,14 @@ let
in
with lib;
{
options.mae.nvim.go.enable = lib.mkEnableOption "Enable go language support in neovim";
config = mkIf cfg.enable {
mae.nvim.lsp.servers.gopls = {
enable = true;
script = ''
{
cmd = { "${pkgs.gopls}/bin/gopls" },
}
'';
options.mae.nvim.go = {
enable = mkEnableOption "Enable go support in nvim";
};
config.programs.neovim = mkIf cfg.enable {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
pkgs.go-fold-if-err-nil
coc-go
];
};
}

View file

@ -1,15 +0,0 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim.html;
in
with lib;
{
options.mae.nvim.html.enable = mkEnableOption "Enable html/css support in nvim";
config = mkIf cfg.nix.enable {
programs.neovim = {
plugins = with pkgs.vimPlugins; [
emmet-vim
];
};
};
}

View file

@ -1,41 +1,26 @@
{ lib, pkgs, config, ... }:
let
typescript-lsp = pkgs.nodePackages.typescript-language-server;
tsserver-path = "${pkgs.nodePackages.typescript}/lib/node_modules/typescript/lib";
cfg = config.mae.nvim;
in
with lib;
{
options.mae.nvim.js = {
tsserver.enable = mkEnableOption "Enable js/ts support in nvim with tsserver";
deno.enable = mkEnableOption "Enable deno support in nvim";
};
config = mkMerge [
(mkIf cfg.js.deno.enable
config = mkIf cfg.js.tsserver.enable {
programs.neovim = {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-tsserver
{
mae.nvim.lsp.servers.denols = {
enable = true;
script = ''
{
cmd = { "${pkgs.deno}/bin/deno", "lsp" },
single_file_support = false,
}
plugin = vim-jsdoc;
config = ''
let g:jsdoc_formatter = "tsdoc"
let g:typescript_indent_disable = 1
'';
};
}
)
(mkIf
cfg.js.tsserver.enable
{
mae.nvim.lsp.servers.tsserver = {
enable = true;
script = ''
{
cmd = { "${typescript-lsp}/bin/typescript-language-server", "--stdio", "--tsserver-path", "${tsserver-path}" }
}
'';
};
})
];
};
};
}

View file

@ -1,21 +0,0 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim;
in
with lib;
{
options.mae.nvim.nix.enable = mkEnableOption "Enable nix support in nvim";
config = mkIf cfg.nix.enable {
programs.neovim = {
plugins = with pkgs.vimPlugins; [
vim-nix
];
};
mae.nvim.lsp.servers.rnix = {
enable = true;
script = '' {
cmd = { "${pkgs.rnix-lsp}/bin/rnix-lsp" }
}'';
};
};
}

View file

@ -1,49 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.mae.nvim;
lspLangConfigType = types.submodule {
options = {
enable = mkEnableOption "Enable named lsp lang config";
script = mkOption {
type = types.lines;
default = "{}";
};
};
};
mkLspLangConfig = name: cfg: ''
require'lspconfig'["${name}"].setup(require'coq'.lsp_ensure_capabilities(${cfg.script}))
'';
mkLspLangConfigs = cfgs: lib.strings.concatStringsSep "\n" ((lib.attrsets.mapAttrsToList mkLspLangConfig cfgs));
in
{
options.mae.nvim.lsp = {
enable = mkEnableOption "Enable lsp support in nvim with nvim-lspconfig and cmp-nvim";
servers = mkOption {
type = types.attrsOf lspLangConfigType;
default = [ ];
};
};
config = mkIf cfg.lsp.enable {
programs.neovim = {
plugins = with pkgs.vimPlugins; [
{
plugin = coq_nvim;
config = ''
vim.g.coq_settings = {
xdg = true,
auto_start = true
}
'';
type = "lua";
}
{
plugin = nvim-lspconfig;
config = mkLspLangConfigs cfg.lsp.servers;
type = "lua";
}
];
};
};
}

View file

@ -0,0 +1,68 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim;
in
with lib;
{
imports = [
# Lua
({ ... }: {
options.mae.nvim.lua.enable = mkEnableOption "Enable lua support in nvim";
config.programs.neovim = mkIf cfg.lua.enable
{
coc.enable = true;
coc.settings.languageserver.lua = mkIf cfg.lua.enable {
command = "${pkgs.sumneko-lua-language-server}/bin/lua-language-server";
rootPatterns = [ ".git" ];
filetypes = [
"lua"
];
};
};
})
# Nix
({ ... }: {
options.mae.nvim.nix.enable = mkEnableOption "Enable nix support in nvim";
config.programs.neovim = mkIf cfg.nix.enable
{
plugins = with pkgs.vimPlugins; [
vim-nix
];
coc.enable = true;
coc.settings.languageserver.nix = mkIf cfg.nix.enable {
"command" = "${pkgs.rnix-lsp}/bin/rnix-lsp";
"filetypes" = [
"nix"
];
};
};
})
# Clangd
({ ... }: {
options.mae.nvim.clangd.enable = mkEnableOption "Enable clangd support in nvim";
config.programs.neovim = mkIf cfg.clangd.enable
{
plugins = with pkgs.vimPlugins; [
coc-clangd
];
coc.enable = true;
coc.settings = {
"clangd.checkUpdates" = false;
# Use whatever clangd is in path for dependency reasons I think I don't remember at this point
"clangd.path" = "clangd";
};
};
})
# Python
({ ... }: {
options.mae.nvim.python.enable = mkEnableOption "Enable python support in nvim";
config.programs.neovim = mkIf cfg.python.enable
{
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-pyright
];
};
})
];
}

View file

@ -1,22 +1,23 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim;
cfg = config.mae.nvim.rust;
in
with lib;
{
options.mae.nvim.rust.enable = lib.mkEnableOption "Enable rust language support in neovim";
config = mkIf cfg.rust.enable {
mae.nvim.lsp.servers.rust_analyzer = {
enable = true;
script = ''
{
cmd = { "${pkgs.rust-analyzer}/bin/rust-analyzer" },
settings = {
["rust-analyzer"] = { cargo = { features = "all" } }
}
}
'';
options.mae.nvim.rust = {
enable = mkEnableOption "Enable rust support in nvim";
};
config.programs.neovim = mkIf cfg.enable {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-rust-analyzer
];
coc.settings = {
"rust-analyzer.server.path" = "${pkgs.rust-analyzer-nightly}/bin/rust-analyzer";
"rust-analyzer.updates.prompt" = false;
"rust-analyzer.updates.checkOnStartup" = false;
"rust-analyzer.cargo.loadOutDirsFromCheck" = true;
"rust-analyzer.procMacro.enable" = true;
};
};
}

View file

@ -0,0 +1,41 @@
{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim;
in
with lib;
{
options.mae.nvim.web = {
enable = mkEnableOption "Enable webdev support in nvim";
};
options.mae.nvim.js = {
enable = mkEnableOption "Enable js/ts support in nvim";
};
config = mkMerge [
(mkIf cfg.js.enable {
programs.neovim = {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-tsserver
{
plugin = vim-jsdoc;
config = ''
let g:jsdoc_formatter = "tsdoc"
let g:typescript_indent_disable = 1
'';
}
];
};
})
(mkIf cfg.web.enable {
mae.nvim.js.enable = true;
programs.neovim = {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-emmet
coc-html
];
};
})
];
}

View file

@ -2,13 +2,10 @@
{
mae.nvim = {
enable = true;
lsp.enable = true;
js.tsserver.enable = true;
js.deno.enable = true;
# js.tsserver.enable = true;
nix.enable = true;
rust.enable = true;
go.enable = true;
clangd.enable = true;
#python.enable = true;
python.enable = true;
};
}