From 2a137869d4cae7475182b8cb4662de6dc667f950 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 2 May 2025 12:55:36 +0200 Subject: [PATCH] use nixvim module --- flake.lock | 285 ++++++++++++++++++++++++++++++++++++++++- flake.nix | 7 + systems/common-cli.nix | 66 ++++++---- 3 files changed, 331 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 9c17d87..dddada5 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,27 @@ "type": "gitlab" } }, + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "owner": "numtide", + "repo": "devshell", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "dogetipbot-telegram": { "inputs": { "nixpkgs": [ @@ -38,6 +59,20 @@ } }, "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -53,6 +88,115 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744743431, + "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, "ipmihddtemp": { "inputs": { "nixpkgs": [ @@ -74,6 +218,56 @@ "type": "gitlab" } }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737371634, + "narHash": "sha256-fTVAWzT1UMm1lT+YxHuVPtH+DATrhYfea3B0MxG/cGw=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "a1176e2a10ce745ff8f63e4af124ece8fe0b1648", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.7", + "repo": "ixx", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743127615, + "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "nix-darwin-24.11", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1744440957, @@ -120,6 +314,58 @@ "type": "indirect" } }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1745068593, + "narHash": "sha256-YuQRMvqLVu+ghl2XzqXyVg/YevH/t3XHVCl7w+UrCH8=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "d35dc6dfcae3ff1a0c72f2d59491a7d83e5505a3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-24.11", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745046075, + "narHash": "sha256-8v4y6k16Ra/fiecb4DxhsoOGtzLKgKlS+9/XJ9z0T2I=", + "owner": "NuschtOS", + "repo": "search", + "rev": "066afe8643274470f4a294442aadd988356a478f", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { "dogetipbot-telegram": "dogetipbot-telegram", @@ -127,13 +373,14 @@ "nixpkgs": "nixpkgs", "nixpkgs-4a3fc4cf7": "nixpkgs-4a3fc4cf7", "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", "simple-nixos-mailserver": "simple-nixos-mailserver" } }, "simple-nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixpkgs-unstable" ], @@ -155,6 +402,42 @@ "repo": "nixos-mailserver", "type": "gitlab" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744961264, + "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "8d404a69efe76146368885110f29a2ca3700bee6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 4efa9e8..a5b8cdb 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ nixpkgs-24_11.follows = "nixpkgs"; }; }; + nixvim = { + url = "github:nix-community/nixvim/nixos-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; dogetipbot-telegram = { url = "gitlab:nyanloutre/dogetipbot-telegram/master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -28,6 +32,7 @@ nixpkgs-unstable, nixpkgs-4a3fc4cf7, simple-nixos-mailserver, + nixvim, dogetipbot-telegram, ipmihddtemp, }@inputs: @@ -39,6 +44,7 @@ system = "x86_64-linux"; modules = [ nixpkgs-unstable.nixosModules.notDetected + nixvim.nixosModules.nixvim { nixpkgs.config.allowUnfree = true; nix = { @@ -69,6 +75,7 @@ modules = [ nixpkgs-unstable.nixosModules.notDetected simple-nixos-mailserver.nixosModule + nixvim.nixosModules.nixvim dogetipbot-telegram.nixosModule ipmihddtemp.nixosModule { diff --git a/systems/common-cli.nix b/systems/common-cli.nix index c075abe..67ec0c7 100644 --- a/systems/common-cli.nix +++ b/systems/common-cli.nix @@ -4,35 +4,49 @@ time.timeZone = "Europe/Paris"; - environment.systemPackages = with pkgs; [ - # Editeurs - (neovim.override { - viAlias = true; - vimAlias = true; - configure = { - customRC = '' - set tabstop=8 - set shiftwidth=4 - set softtabstop=0 - set expandtab - set smarttab - set background=dark - set mouse= - ''; - packages.myVimPackage = with pkgs.vimPlugins; { - start = [ - vim-startify - airline - sensible - polyglot - ale - fugitive - ]; - opt = [ ]; + programs.nixvim = { + enable = true; + viAlias = true; + vimAlias = true; + files = { + "ftplugin/nix.lua" = { + opts = { + tabstop = 8; + shiftwidth = 4; + softtabstop = 0; + expandtab = true; + smarttab = true; + background = "dark"; + mouse = ""; }; }; - }) + }; + plugins = { + lualine.enable = true; + lsp = { + enable = true; + servers = { + nixd.enable = true; + ruff.enable = true; + }; + }; + bufferline.enable = true; + telescope.enable = true; + which-key.enable = true; + treesitter.enable = true; + cmp = { + enable = true; + autoEnableSources = true; + settings.sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + }; + }; + }; + environment.systemPackages = with pkgs; [ # Gestionnaires de version tig gitAndTools.hub