getting stuff ready for flake to see

This commit is contained in:
Deepak Mallubhotla 2024-04-24 03:51:38 +00:00
parent 48d0d64349
commit 822bc0394e
Signed by: deepak
GPG Key ID: 8F904A3FC7021497
7 changed files with 87 additions and 22 deletions

18
flake.lock generated
View File

@ -22,6 +22,23 @@
"type": "github" "type": "github"
} }
}, },
"cmp-vimtex": {
"flake": false,
"locked": {
"lastModified": 1708936870,
"narHash": "sha256-07FqXsRe0RP5f3b6osrsi5gai+bZi9ybm5JL/nnBH+4=",
"owner": "micangl",
"repo": "cmp-vimtex",
"rev": "613fbfc54d9488252b0b0289d6d1d60242513558",
"type": "github"
},
"original": {
"owner": "micangl",
"ref": "master",
"repo": "cmp-vimtex",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -132,6 +149,7 @@
"root": { "root": {
"inputs": { "inputs": {
"NixOS-WSL": "NixOS-WSL", "NixOS-WSL": "NixOS-WSL",
"cmp-vimtex": "cmp-vimtex",
"homeManager": "homeManager", "homeManager": "homeManager",
"homeManager-23-11": "homeManager-23-11", "homeManager-23-11": "homeManager-23-11",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",

View File

@ -1,28 +1,37 @@
{ {
description = "Configuration v1"; description = "Configuration v1";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-23-11.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs-23-11.url = "github:NixOS/nixpkgs/nixos-23.11";
homeManager = { homeManager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
};
homeManager-23-11 = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-23-11";
};
NixOS-WSL = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, homeManager, NixOS-WSL, nixpkgs-23-11, homeManager-23-11, ...}@inputs: { homeManager-23-11 = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-23-11";
};
NixOS-WSL = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
cmp-vimtex = {
url = "github:micangl/cmp-vimtex/master";
flake = false;
};
};
outputs = { self, nixpkgs, homeManager, NixOS-WSL, nixpkgs-23-11, homeManager-23-11, cmp-vimtex, ...}@inputs:
let
customPackageOverlay = import ./overlays/cmp-vimtex.nix { inherit cmp-vimtex; };
in
{
nixosConfigurations = ( nixosConfigurations = (
import ./hosts/hosts.nix { import ./hosts/hosts.nix {
inherit nixpkgs; inherit nixpkgs;
@ -30,8 +39,10 @@
inherit inputs; inherit inputs;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
inherit NixOS-WSL; inherit NixOS-WSL;
inherit nixpkgs-23-11; inherit nixpkgs-23-11;
inherit homeManager-23-11; inherit homeManager-23-11;
inherit cmp-vimtex;
inherit customPackageOverlay;
} }
); );

View File

@ -82,10 +82,17 @@
vim-fugitive vim-fugitive
friendly-snippets friendly-snippets
luasnip luasnip
pkgs.customVimPlugins.cmp-vimtex
]; ];
extraConfig = '' extraConfig = ''
inoremap jj <Esc> inoremap jj <Esc>
inoremap kk <Esc> inoremap kk <Esc>
set tabstop=4
set noexpandtab
set list
set listchars=eol:¬,tab:\,trail:·
lua << EOF lua << EOF
local lsp_zero = require('lsp-zero') local lsp_zero = require('lsp-zero')
@ -104,6 +111,7 @@
{name = 'nvim_lsp'}, {name = 'nvim_lsp'},
{name = 'buffer'}, {name = 'buffer'},
{name = 'luasnip'}, {name = 'luasnip'},
{name = 'vimtex'},
}, },
formatting = cmp_format, formatting = cmp_format,
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({

View File

@ -1,7 +1,10 @@
{ lib, inputs, nixpkgs, nixpkgs-23-11, homeManager, homeManager-23-11, NixOS-WSL, ... }: { lib, inputs, nixpkgs-23-11, homeManager, homeManager-23-11, NixOS-WSL, customPackageOverlay, ... }:
{ {
"maxos" = lib.nixosSystem { "maxos" = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {
inherit customPackageOverlay;
};
modules = [ modules = [
./maxos/configuration.nix ./maxos/configuration.nix
homeManager.nixosModules.home-manager { homeManager.nixosModules.home-manager {
@ -19,6 +22,9 @@
"nixosWSL" = nixpkgs-23-11.lib.nixosSystem { "nixosWSL" = nixpkgs-23-11.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {
inherit customPackageOverlay;
};
modules = [ modules = [
./nixosWSL/configuration.nix ./nixosWSL/configuration.nix
homeManager-23-11.nixosModules.home-manager { homeManager-23-11.nixosModules.home-manager {

View File

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs, ... }: { pkgs, customPackageOverlay, ... }:
let let
custom-fonts = import ../../fonts { inherit pkgs; }; custom-fonts = import ../../fonts { inherit pkgs; };
@ -109,6 +109,9 @@ in
programs.zsh.enable = true; programs.zsh.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
customPackageOverlay.overlay
];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.

View File

@ -1,4 +1,4 @@
{ pkgs, modulesPath, ... }: { pkgs, customPackageOverlay, modulesPath, ... }:
let let
custom-fonts = import ../../fonts { inherit pkgs; }; custom-fonts = import ../../fonts { inherit pkgs; };
@ -34,6 +34,10 @@ in
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
nixpkgs.overlays = [
customPackageOverlay.overlay
];
system.stateVersion = "22.05"; system.stateVersion = "22.05";
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.

15
overlays/cmp-vimtex.nix Normal file
View File

@ -0,0 +1,15 @@
{ cmp-vimtex }:
{
overlay = final: prev:
let
cmpVimtexPlugin = prev.vimUtils.buildVimPlugin {
src = cmp-vimtex;
name = "cmp-vimtex";
};
in
{
customVimPlugins = [
cmpVimtexPlugin
];
};
}