From dc7d7fea2ca7e2452ee6e8c371ba8214f53645fa Mon Sep 17 00:00:00 2001 From: Johannes Hendrik Gerard van der Weide Date: Sat, 17 Feb 2024 13:14:27 +0100 Subject: [PATCH] NixVim is added --- flake.lock | 283 +++++++++++++++++++++++++++++++++++ flake.nix | 56 +++++++ programs/vim/colorScheme.nix | 7 + programs/vim/default.nix | 8 + programs/vim/extraLua.nix | 5 + programs/vim/lsp.nix | 21 +++ 6 files changed, 380 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 programs/vim/colorScheme.nix create mode 100644 programs/vim/default.nix create mode 100644 programs/vim/extraLua.nix create mode 100644 programs/vim/lsp.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..16a783a --- /dev/null +++ b/flake.lock @@ -0,0 +1,283 @@ +{ + "nodes": { + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/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, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708031129, + "narHash": "sha256-EH20hJfNnc1/ODdDVat9B7aKm0B95L3YtkIRwKLvQG8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3d6791b3897b526c82920a2ab5f61d71985b3cf8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707919853, + "narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "043ba285c6dc20f36441d48525402bcb9743c498", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707707289, + "narHash": "sha256-YuDt/eSTXMEHv8jS8BEZJgqCcG8Tr3cyqaZjJFXZHsw=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "44f50a5ecaab72a61d5fd8e5c5717bc4bf9c25dd", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1708160610, + "narHash": "sha256-vbtzx0c9R52p3SBjvkz4Iw5Jz1VUm751UDwY1XMCqQ0=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "e23d1d1f3c42e76f1d2f904838aaf4d49578be9e", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1708091350, + "narHash": "sha256-o28BJYi68qqvHipT7V2jkWxDiMS1LF9nxUsou+eFUPQ=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "106d3fec43bcea19cb2e061ca02531d54b542ce3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1707956935, + "narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixvim": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1708168372, + "narHash": "sha256-kjhmh4uDIWUnfYiQCmonhiRrs+ymJdQHKG/2bSaWb4w=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "361e2ec74b69ac22002febe61af9b4b14a75dcc6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707297608, + "narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "0db2e67ee49910adfa13010e7f012149660af7f0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nix-flatpak": "nix-flatpak", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f789c53 --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + description = "The Nix flake whatever the fuck it is that Hertog is doing"; + + inputs = { + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + nix-flatpak.url = "github:gmodena/nix-flatpak"; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixos-hardware, nixpkgs, nix-flatpak, nixvim, home-manager, ... }@inputs: + let + system = "x86_64-linux"; + currentSystem = system; + pkgs = import nixpkgs { + inherit system; + }; + + lib = nixpkgs.lib; + + in { + # Laptop NixOS configuration + nixosConfigurations = { + default = lib.nixosSystem { + inherit system; + modules = [ + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users = { + hertog = import ./Users/Hertog/homeFull.nix; + }; + }; + } + ]; + specialArgs = { + inputs = inputs; + inherit system; + }; + }; + }; + packages."${system}" = { + default = nixvim.legacyPackages."${system}".makeNixvimWithModule { + module = import ./programs/vim; + }; + }; + }; +} diff --git a/programs/vim/colorScheme.nix b/programs/vim/colorScheme.nix new file mode 100644 index 0000000..41ece4d --- /dev/null +++ b/programs/vim/colorScheme.nix @@ -0,0 +1,7 @@ +{ + colorschemes = { + nord = { + enable = true; + }; + }; +} diff --git a/programs/vim/default.nix b/programs/vim/default.nix new file mode 100644 index 0000000..035dfb7 --- /dev/null +++ b/programs/vim/default.nix @@ -0,0 +1,8 @@ +{ + # Import the nixVim modules + imports = [ + ./extraLua.nix + ./lsp.nix + ./colorScheme.nix + ]; +} diff --git a/programs/vim/extraLua.nix b/programs/vim/extraLua.nix new file mode 100644 index 0000000..0701aae --- /dev/null +++ b/programs/vim/extraLua.nix @@ -0,0 +1,5 @@ +{ + extraConfigLua = '' + print("Welcome to Vim, Hertog! :3") + ''; +} diff --git a/programs/vim/lsp.nix b/programs/vim/lsp.nix new file mode 100644 index 0000000..df3119e --- /dev/null +++ b/programs/vim/lsp.nix @@ -0,0 +1,21 @@ +{ + plugins.lsp = { + enable = true; + servers = { + # Nix + nixd = { + enable = true; + }; + # Rust + rust-analyzer = { + enable = true; + installRustc = true; + installCargo = true; + }; + # Godot + gdscript = { + enable = true; + }; + }; + }; +}