Merge remote-tracking branch 'origin/nixos' into nixos

dev-docs
Moritz Böhme 2023-02-17 14:10:32 +01:00
commit c59527e2f2
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
5 changed files with 340 additions and 47 deletions

View File

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1675176355,
"narHash": "sha256-Qjxh5cmN56siY97mzmBLI1+cdjXSPqmfPVsKxBvHmwI=",
"lastModified": 1676599101,
"narHash": "sha256-CKS6UsOGhoNxGDBt9wyFiWHvtng/+BMAJ4G8ahhe1DE=",
"owner": "ryantm",
"repo": "agenix",
"rev": "b7ffcfe77f817d9ee992640ba1f270718d197f28",
"rev": "de657061b13cf329c57a1a9730a5049a971b40b3",
"type": "github"
},
"original": {
@ -84,11 +84,11 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1676057905,
"narHash": "sha256-9uGgDgMTwspDQlR2laeYa4qwf3BoU04sKpOR1h6/bvM=",
"lastModified": 1676394233,
"narHash": "sha256-RHO/MgRyFqgmIgogrL5LBmBhAt8hTpUJJ6Dww46GyZI=",
"ref": "main",
"rev": "346600bd993ca400a493c9d9323a1caea267c650",
"revCount": 93,
"rev": "6fb9f917901160b2b212f420a8a8e4995c823626",
"revCount": 98,
"type": "git",
"url": "ssh://git@gitea.moritzboeh.me/moritz/emacs.git"
},
@ -210,6 +210,36 @@
}
},
"flake-utils_5": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_7": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
@ -291,11 +321,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1675935446,
"narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=",
"lastModified": 1676367705,
"narHash": "sha256-un5UbRat9TwruyImtwUGcKF823rCEp4fQxnsaLFL7CM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2dce7f1a55e785a22d61668516df62899278c9e4",
"rev": "da72e6fc6b7dc0c3f94edbd310aae7cd95c678b5",
"type": "github"
},
"original": {
@ -352,11 +382,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1676120405,
"narHash": "sha256-5DSaAh3ifx3tW7ZMF7GFy/Kw4uHs3ZUtt+cH9+YVOXY=",
"lastModified": 1676630258,
"narHash": "sha256-pc3aIr2LgmJFcTQwICpz3d4/u5/xHDI14qY/zEhGM3k=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "97e0f02621829d011e08506c7361236b07f3f2b4",
"rev": "be2e4d9dd1e58991a4f54078a331cbcbd8265c7f",
"type": "github"
},
"original": {
@ -391,11 +421,11 @@
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1676033584,
"narHash": "sha256-MeF1nR09cUdkCd1KNjzxImwhqsP2cbn/0M6z87fNJAk=",
"lastModified": 1676406424,
"narHash": "sha256-G+JhFuaeB15MTU8DbJALm/Yf240FCQmrWZ8Y0UzyqRI=",
"owner": "hyprwm",
"repo": "hyprpaper",
"rev": "44a38bfedc009bcc05eed571e80a397a80075a9f",
"rev": "1d76f4db0d3b487b9a9562195815e181652aef7c",
"type": "github"
},
"original": {
@ -406,11 +436,11 @@
},
"master": {
"locked": {
"lastModified": 1676126546,
"narHash": "sha256-LYDhE85B+MQMvIS3/SVnLSsKBC6aTeFrMRa6pN75mlg=",
"lastModified": 1676634984,
"narHash": "sha256-VlcjVkzFEYGOVMXvlpS9hREF40Zs3n3Gpw53nlo22CI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "aebc76376ca2da5ee4524326e6f83a3a18587d54",
"rev": "98042fc6d36ebb11a4defe4f2cee76aa6192257d",
"type": "github"
},
"original": {
@ -419,6 +449,47 @@
"type": "github"
}
},
"neovim": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"dir": "contrib",
"lastModified": 1676634789,
"narHash": "sha256-ywC4XWyG6Qgs48ZYHU1BaxfPTlPS/Vt4Zgb5x0kYEWo=",
"owner": "neovim",
"repo": "neovim",
"rev": "f905ab04507fc5a86affeb5eaf8550c1795ac9b8",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"nil": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_7",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1676390054,
"narHash": "sha256-w0KvrM+9WIEYr0juDh4Vs39ed2IaT0T696fp9pZ7i1I=",
"owner": "oxalica",
"repo": "nil",
"rev": "944d5c335531778a1d7b54a97bf7fb5ec0c3e976",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "nil",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1673540789,
@ -533,11 +604,27 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1675940568,
"narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=",
"lastModified": 1671983799,
"narHash": "sha256-Z2Ro6hFPZHkBqkVXY5/aBUzxi5xizQGvuHQ9+T5B/ks=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71",
"rev": "fad51abd42ca17a60fc1d4cb9382e2d79ae31836",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1675309347,
"narHash": "sha256-D3CQ6HRDT2m3XJlrzb5jKq4vNFR5xFTEFKC7iSjlFpM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5",
"type": "github"
},
"original": {
@ -547,7 +634,23 @@
"type": "github"
}
},
"nixpkgs_7": {
"nixpkgs_8": {
"locked": {
"lastModified": 1676549890,
"narHash": "sha256-sq/WcOEAl7gWrrfGkWdnyYazRyTf+enEim/o6LOQzI8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8c66bd1b68f4708c90dcc97c6f7052a5a7b33257",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1671271357,
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
@ -619,17 +722,17 @@
"pre-commit-hooks_3": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_4",
"flake-utils": "flake-utils_6",
"gitignore": "gitignore_2",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_9",
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1675688762,
"narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=",
"lastModified": 1676513100,
"narHash": "sha256-MK39nQV86L2ag4TmcK5/+r1ULpzRLPbbfvWbPvIoYJE=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ab608394886fb04b8a5df3cb0bab2598400e3634",
"rev": "5f0cba88ac4d6dd8cad5c6f6f1540b3d6a21a798",
"type": "github"
},
"original": {
@ -651,19 +754,46 @@
"hyprland": "hyprland",
"hyprpaper": "hyprpaper",
"master": "master",
"nixpkgs": "nixpkgs_6",
"neovim": "neovim",
"nil": "nil",
"nixpkgs": "nixpkgs_8",
"pre-commit-hooks": "pre-commit-hooks_3",
"stable": "stable",
"utils": "utils_2"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"nil",
"flake-utils"
],
"nixpkgs": [
"nil",
"nixpkgs"
]
},
"locked": {
"lastModified": 1675391458,
"narHash": "sha256-ukDKZw922BnK5ohL9LhwtaDAdCsJL7L6ScNEyF1lO9w=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "383a4acfd11d778d5c2efcf28376cbd845eeaedf",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"stable": {
"locked": {
"lastModified": 1675918889,
"narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=",
"lastModified": 1676546582,
"narHash": "sha256-MJ+PXNmUyxnMTFoss7G2lEcUY2cfYZM6RudBAL5aX1k=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe",
"rev": "2fb7d749c084890192b2cd08ba264e5e4a14df1b",
"type": "github"
},
"original": {
@ -690,7 +820,7 @@
},
"utils_2": {
"inputs": {
"flake-utils": "flake-utils_5"
"flake-utils": "flake-utils_7"
},
"locked": {
"lastModified": 1657226504,

View File

@ -48,6 +48,10 @@
emacs.url = "git+ssh://git@gitea.moritzboeh.me/moritz/emacs.git?ref=main";
neovim.url = "github:neovim/neovim?dir=contrib";
nil.url = "github:oxalica/nil";
# Hyprland
hyprland.url = "github:hyprwm/Hyprland";
hyprpaper.url = "github:hyprwm/hyprpaper";
@ -70,12 +74,10 @@
overlay = import ./overlays { inherit inputs; };
channels.nixpkgs.overlaysBuilder = channels: [
inputs.agenix.overlays.default
inputs.emacs.overlays.default
inputs.howdy.overlays.default
inputs.hypr-contrib.overlays.default
inputs.hyprland.overlays.default
inputs.hyprpaper.overlays.default
inputs.utils.overlay
self.overlay
];

View File

@ -20,22 +20,33 @@ in
config = mkIf cfg.enable {
home-manager.users.moritz.programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
extraLuaConfig = builtins.readFile ./init.lua;
extraPackages = with pkgs; [
sumneko-lua-language-server
nil
];
plugins = with pkgs.vimPlugins; [
catppuccin-nvim
cmp-nvim-lsp
dashboard-nvim
neogit
noice-nvim
nui-nvim # for noice-nvim
nvim-cmp
nvim-lspconfig
nvim-treesitter.withAllGrammars
nvim-web-devicons # for dashboard-nvim
plenary-nvim # for telescope, neogit
telescope-nvim
which-key-nvim
cmp_luasnip
luasnip
lsp_lines-nvim
];
};
};

View File

@ -33,11 +33,13 @@ vim.opt.updatetime = 300
vim.opt_local.spell = true
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
-- plugins
require("catppuccin").setup({
flavour = "macchiato",
compile_path = vim.fn.stdpath("cache") .. "/catppuccin", -- fix issue of writing to nix store
integrations = {
which_key = true,
},
})
vim.cmd.colorscheme("catppuccin")
vim.cmd.colorscheme("catppuccin-macchiato")
vim.o.timeout = true
vim.o.timeoutlen = 300
@ -63,20 +65,20 @@ require("noice").setup({
})
wk.register({
f = {
name="find",
f = { "<cmd>Telescope find_files<cr>", "find file" },
g = { "<cmd>Telescope live_grep<cr>", "live grep" },
b = { "<cmd>Telescope buffers<cr>", "find buffer" },
},
f = {
name = "find",
f = { "<cmd>Telescope find_files<cr>", "find file" },
g = { "<cmd>Telescope live_grep<cr>", "live grep" },
b = { "<cmd>Telescope buffers<cr>", "find buffer" },
},
}, { prefix = "<leader>" })
require("neogit").setup({
disable_commit_confirmation = true,
disable_commit_confirmation = true,
})
wk.register({
g = { "<cmd>Neogit<cr>", "git" }
}, { prefix = "<leader>"})
g = { "<cmd>Neogit<cr>", "git" },
}, { prefix = "<leader>" })
require("nvim-treesitter.configs").setup({
sync_install = false,
@ -86,3 +88,146 @@ require("nvim-treesitter.configs").setup({
additional_vim_regex_highlighting = true,
},
})
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
},
})
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
local on_attach_def = function(_, bufnr)
wk.register({
K = { vim.lsp.buf.hover, "show info" },
["<leader>l"] = {
name = "lsp",
d = { vim.diagnostic.open_float, "open diagnostic window" },
n = { vim.diagnostic.goto_next, "next error" },
p = { vim.diagnostic.goto_prev, "prev error" },
c = { vim.lsp.buf.code_action, "code action" },
r = { vim.lsp.buf.rename, "rename" },
f = {
function()
vim.lsp.buf.format({ async = true })
end,
"format",
},
},
g = {
name = "goto",
r = { vim.lsp.buf.references, "references" },
d = { vim.lsp.buf.definition, "definition" },
D = { vim.lsp.buf.declaration, "declaration" },
i = { vim.lsp.buf.implementation, "implementation" },
t = { vim.lsp.buf.type_definition, "type defininition" },
},
}, { noremap = true, silent = true, buffer = bufnr })
end
local servers = { "nil_ls", "pylsp" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
on_attach = on_attach_def,
capabilities = capabilities,
flags = {
debounce_text_changes = 100,
},
})
end
lspconfig.sumneko_lua.setup({
on_attach = on_attach_def,
capabilities = capabilities,
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
format = {
enable = true,
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "2",
},
},
},
},
})
local lsp_lines = require("lsp_lines")
lsp_lines.setup()
-- Disable virtual_text since it's redundant due to lsp_lines.
vim.diagnostic.config({
virtual_text = false,
})
wk.register({
t = {
name = "toggle",
l = { lsp_lines.toggle, "lsp lines" },
},
{ prefix = "<leader>" },
})
require("dashboard").setup({
theme = "hyper",
config = {
packages = { enable = true },
week_header = {
enable = true,
},
},
})

View File

@ -1,4 +1,9 @@
{ inputs }: final: prev: {
agenix = inputs.agenix.packages.${prev.system}.default;
hyprpaper = inputs.hyprpaper.packages.${prev.system}.default;
neovim-nightly = inputs.neovim.packages.${prev.system}.default;
nil = inputs.nil.packages.${prev.system}.default;
logseq-wayland = prev.symlinkJoin {
name = "logseq-wayland";
paths = [ prev.logseq ];