diff --git a/flake.lock b/flake.lock index 4d2a58f..c6ab80e 100644 --- a/flake.lock +++ b/flake.lock @@ -2,7 +2,9 @@ "nodes": { "disko": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1733168902, @@ -18,6 +20,45 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "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" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -39,23 +80,35 @@ "type": "github" } }, - "nixpkgs": { + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1732238832, - "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", + "lastModified": 1729958008, + "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "NuschtOS", + "ref": "v0.0.6", + "repo": "ixx", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs": { "locked": { "lastModified": 1733261153, "narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=", @@ -71,11 +124,79 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "devshell": [], + "flake-compat": [], + "flake-parts": "flake-parts", + "git-hooks": [], + "home-manager": [], + "nix-darwin": [], + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": [] + }, + "locked": { + "lastModified": 1734447589, + "narHash": "sha256-APyzO3pn6iiGJxkWczifnxm3pKZrNYgpJUPpnVfUwsk=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "4f0d5e0d2947dbf111f2ce00c99ca4c6c659dc79", + "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": 1733773348, + "narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=", + "owner": "NuschtOS", + "repo": "search", + "rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" + "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" } } }, diff --git a/flake.nix b/flake.nix index 44e3a3a..1dd0f66 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,26 @@ description = "NixOS configuration flake"; inputs = { - disko.url = "github:nix-community/disko"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager/release-24.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixvim = { + url = "github:nix-community/nixvim/nixos-24.11"; + inputs = { + nixpkgs.follows = "nixpkgs"; + devshell.follows = ""; + flake-compat.follows = ""; + git-hooks.follows = ""; + home-manager.follows = ""; + nix-darwin.follows = ""; + treefmt-nix.follows = ""; + }; + }; }; - outputs = { self, nixpkgs, home-manager, disko,...}: + outputs = { self, nixpkgs, home-manager, disko, nixvim, ...}: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -23,7 +36,7 @@ ]; }; tien = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + inherit system; modules = [ disko.nixosModules.disko ./vps-configuration.nix @@ -34,9 +47,10 @@ homeConfigurations = { "rothe@lift" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ - ./home/rothe.nix + modules = [ + ./home/terminal ./home/wayland + nixvim.homeManagerModules.nixvim ]; extraSpecialArgs = { mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"]; @@ -44,8 +58,9 @@ }; "rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ - ./home/rothe.nix + modules = [ + ./home/terminal + nixvim.homeManagerModules.nixvim ]; extraSpecialArgs = { mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"]; @@ -53,8 +68,9 @@ }; "rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ - ./home/rothe.nix + modules = [ + ./home/terminal + nixvim.homeManagerModules.nixvim ]; extraSpecialArgs = { mail = nixpkgs.lib.strings.concatStrings ["rothe" "@" "magazino.eu"]; diff --git a/home/rothe.nix b/home/rothe.nix deleted file mode 100644 index 5c9daae..0000000 --- a/home/rothe.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - home.username = "rothe"; - home.homeDirectory = "/home/rothe"; - - imports = [ - ./terminal - ]; - - # Add extra variables like $EDITOR - home.sessionVariables = { - }; - - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.05"; # Please read the comment before changing. - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/home/terminal/default.nix b/home/terminal/default.nix index b00228d..624b382 100644 --- a/home/terminal/default.nix +++ b/home/terminal/default.nix @@ -1,7 +1,16 @@ { config, pkgs, lib, mail, ... }: { + imports = [ ./nixvim ]; + config = { + home.username = "rothe"; + home.homeDirectory = "/home/rothe"; + + # Add extra variables like $EDITOR + home.sessionVariables = { + }; + home.packages = with pkgs; [ black devenv @@ -22,7 +31,7 @@ silver-searcher shellcheck sops - (nerdfonts.override { fonts = [ + (nerdfonts.override { fonts = [ "JetBrainsMono" "RobotoMono" ]; }) @@ -245,7 +254,17 @@ programs.direnv = { enable = true; }; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.05"; # Please read the comment before changing. + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; }; - } - diff --git a/home/terminal/nixvim/default.nix b/home/terminal/nixvim/default.nix new file mode 100644 index 0000000..59f25c5 --- /dev/null +++ b/home/terminal/nixvim/default.nix @@ -0,0 +1,74 @@ +{ config, pkgs, lib, mail, ... }: +{ + # TODO + # Linter (ale) + # Markdown spellcheck + # Autocomplete + # Missing plugins + # Telescope and fuzzy finder + # Ruff linter for python and black + # Format on exit + # Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix + + programs.nixvim = { + colorscheme = "sonokai"; + enable = true; + extraPlugins = [ + pkgs.vimPlugins.indentLine + pkgs.vimPlugins.polyglot + pkgs.vimPlugins.sonokai + ]; + globals = { + mapleader = ","; + sonokai_style = "atlantis"; + sonokai_disable_italic_comment = 1; + }; + keymaps = [ + { + key = "t"; + action = "Neotree toggle"; + } + ]; + opts = { + colorcolumn = "88"; + cursorline = true; + number = true; + termguicolors = true; + }; + plugins = { + cmp = { + enable = true; # Completion + autoEnableSources = true; + settings.sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + settings.mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })"; + }; + }; + committia.enable = true; + gitgutter.enable = true; + guess-indent.enable = true; + lsp.enable = true; + lsp.servers.pylsp = { + enable = true; + settings.plugins = { + black.enabled = true; + isort.enabled = true; + ruff.enabled = true; + }; + }; + lualine.enable = true; + neo-tree.enable = true; + web-devicons.enable = true; + }; + }; +}