diff --git a/common/default.nix b/common/default.nix index ebb53042..93bdaa90 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,4 +1,4 @@ -({ nixpkgs, ... }: { +({ nixpkgs, home-manager, lib, ... }: { # Select internationalisation properties. i18n.defaultLocale = "en_CA.UTF-8"; console = { @@ -24,6 +24,18 @@ }; }; + home-manager.users = let + default = { + imports = [ + ./modules/neovim/nvim.nix + ]; + home.stateVersion = lib.mkDefault "23.05"; + }; + in { + root = default; + matt = default; + }; + imports = [ ./overlays/list.nix ]; diff --git a/hosts/wim/config/nvim/base.vim b/common/modules/neovim/config/base.vim similarity index 100% rename from hosts/wim/config/nvim/base.vim rename to common/modules/neovim/config/base.vim diff --git a/hosts/wim/config/nvim/config.lua b/common/modules/neovim/config/config.lua similarity index 100% rename from hosts/wim/config/nvim/config.lua rename to common/modules/neovim/config/config.lua diff --git a/hosts/wim/home/nvim.nix b/common/modules/neovim/nvim.nix similarity index 95% rename from hosts/wim/home/nvim.nix rename to common/modules/neovim/nvim.nix index 7a865d60..fe4eb3a9 100644 --- a/hosts/wim/home/nvim.nix +++ b/common/modules/neovim/nvim.nix @@ -1,3 +1,5 @@ +# Home-manager module + { pkgs, lib, ... }: let # installs a vim plugin from git with a given tag / branch plugin = owner: repo: rev: hash: pkgs.vimUtils.buildVimPlugin { @@ -23,10 +25,10 @@ in package = pkgs.neovim-nightly; extraConfig = builtins.concatStringsSep "\n" [ - (lib.strings.fileContents ../config/nvim/base.vim) + (lib.strings.fileContents ./config/base.vim) '' lua << EOF - ${lib.strings.fileContents ../config/nvim/config.lua} + ${lib.strings.fileContents ./config/config.lua} EOF '' ]; diff --git a/hosts/wim/home/main.nix b/hosts/wim/home/main.nix index 956db08f..0e433691 100644 --- a/hosts/wim/home/main.nix +++ b/hosts/wim/home/main.nix @@ -22,7 +22,6 @@ root = { imports = [ ./bashdots.nix - ./nvim.nix ]; home.stateVersion = "23.05"; @@ -38,7 +37,6 @@ ./bashdots.nix ./dotfiles.nix ./packages.nix - ./nvim.nix ./firefox/main.nix ];