diff --git a/flake.lock b/flake.lock index 3363833..16078de 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,28 @@ { "nodes": { + "beautysh": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "poetry2nix": "poetry2nix", + "utils": "utils" + }, + "locked": { + "lastModified": 1680308980, + "narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=", + "owner": "lovesegfault", + "repo": "beautysh", + "rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c", + "type": "github" + }, + "original": { + "owner": "lovesegfault", + "repo": "beautysh", + "type": "github" + } + }, "blobs": { "flake": false, "locked": { @@ -17,6 +40,22 @@ } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1668681692, @@ -32,6 +71,64 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -118,6 +215,22 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1690272529, @@ -135,6 +248,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1690031011, + "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "12303c652b881435065a98729eb7278313041e49", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1670751203, "narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=", @@ -149,22 +278,96 @@ "type": "indirect" } }, + "nixvim": { + "inputs": { + "beautysh": "beautysh", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1690107839, + "narHash": "sha256-ll3j+g3qz239sfLHYhHynKRWhMkxFXsJ9MOAXzSqQMc=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "4c25722d73694245e767839b462026ab2296542b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "nixvim", + "beautysh", + "utils" + ], + "nixpkgs": [ + "nixvim", + "beautysh", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1658665240, + "narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1689668210, + "narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "eb433bff05b285258be76513add6f6c57b441775", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "kmonad": "kmonad", "nixpkgs": "nixpkgs_2", + "nixvim": "nixvim", "simple-nixos-mailserver": "simple-nixos-mailserver" } }, "simple-nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs_3", + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs_4", "nixpkgs-22_11": "nixpkgs-22_11", "nixpkgs-23_05": "nixpkgs-23_05", - "utils": "utils" + "utils": "utils_2" }, "locked": { "lastModified": 1689976554, @@ -181,7 +384,52 @@ "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" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "locked": { "lastModified": 1605370193, "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", diff --git a/flake.nix b/flake.nix index 941d9c9..f878c99 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,16 @@ description = "Nick's NixOS Configuration"; inputs = { + nixvim.url = "github:nix-community/nixvim"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + kmonad.url = "github:kmonad/kmonad?dir=nix"; + # dead code? + simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; home-manager = { url = github:nix-community/home-manager; inputs.nixpkgs.follows = "nixpkgs"; }; - kmonad.url = "github:kmonad/kmonad?dir=nix"; - simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; }; @@ -25,7 +27,7 @@ in { nixosConfigurations = { inherit (nixpkgs) lib; - inherit inputs nixpkgs home-manager user kmonad ; + inherit inputs nixpkgs home-manager user kmonad; # Home server Alaska = lib.nixosSystem { @@ -50,7 +52,6 @@ ]; }; - NicksNixLaptop = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; @@ -92,7 +93,12 @@ useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit user; }; - users.${user} = import ./users/${user}.nix; + users.${user} = { + imports = [ + (import ./users/${user}.nix) + inputs.nixvim.homeManagerModules.nixvim + ]; + }; }; } ]; diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 486b206..0fa2845 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -65,7 +65,7 @@ password = "password"; }; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = ["DejaVuSansMono"]; }) dejavu_fonts xkcd-font diff --git a/modules/vim.nix b/modules/neovim.nix similarity index 52% rename from modules/vim.nix rename to modules/neovim.nix index eff415e..c85b220 100644 --- a/modules/vim.nix +++ b/modules/neovim.nix @@ -1,12 +1,13 @@ -{ config, pkgs, ... }: - -let - +{ pkgs, lib, ... }: +let in { - programs.vim = { + programs.nixvim = { enable = true; - plugins = with pkgs.vimPlugins; + viAlias = true; + vimAlias = true; + #extraConfigVim = import ./../rsrcs/.vimrc; + extraPlugins = with pkgs.vimPlugins; let moonfly = pkgs.vimUtils.buildVimPlugin { name = "moonfly"; @@ -18,21 +19,27 @@ in }; }; in [ - vim-airline - vim-airline-themes - moonfly + # Themes and statusbar + # vim-airline + # vim-airline-themes + # moonfly - coc-rust-analyzer + #QoL features + # telescope-nvim + # nvim-treesitter + + nvchad + nvchad-ui + + # Rust + coc-rust-analyzer coc-nvim rust-vim + # Language support vim-nix typescript-vim vim-javascript ]; - - defaultEditor = true; - extraConfig = builtins.readFile ../rsrcs/.vimrc; }; - -} +} diff --git a/rsrcs/.vimrc b/rsrcs/.vimrc index 5679c3b..6450373 100644 --- a/rsrcs/.vimrc +++ b/rsrcs/.vimrc @@ -12,6 +12,7 @@ filetype plugin indent on " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable + " nvim-treesitter " delays and poor user experience. set updatetime=300 @@ -89,10 +90,10 @@ filetype plugin indent on set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} -colorscheme moonfly +" colorscheme moonfly set number " Remove moonfly's background color for the terminal color -highlight Normal ctermbg=NONE -highlight LineNr ctermbg=NONE -highlight CocInlayHint ctermbg=NONE +" highlight Normal ctermbg=NONE +" highlight LineNr ctermbg=NONE +" highlight CocInlayHint ctermbg=NONE diff --git a/users/nixolas.nix b/users/nixolas.nix index 326e6c2..b613bde 100644 --- a/users/nixolas.nix +++ b/users/nixolas.nix @@ -1,4 +1,4 @@ -{ config, pkgs, user, ... }: +{ inputs, config, pkgs, user, ... }: let moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); @@ -24,7 +24,7 @@ in ../modules/fusuma.nix ../modules/git.nix ../modules/rofi.nix - ../modules/vim.nix + ../modules/neovim.nix ../modules/wezterm.nix ../modules/xdg.nix ../modules/zsh.nix