Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelreyrol committed Aug 20, 2023
1 parent a808516 commit b683acb
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 45 deletions.
9 changes: 4 additions & 5 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
sbomnix.url = "github:tiiuae/sbomnix";
sbomnix.inputs.nixpkgs.follows = "unstable";

nixvim.url = "github:nix-community/nixvim/nixos-23.05";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
nixvim.url = "github:nix-community/nixvim";
nixvim.inputs.nixpkgs.follows = "unstable";
nixvim.inputs.pre-commit-hooks.follows = "pre-commit-hooks";

udev-nix.url = "github:gaelreyrol/udev-nix";
Expand All @@ -37,7 +37,7 @@
mention.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = inputs@{ self, nixpkgs, unstable, treefmt-nix, pre-commit-hooks, sbomnix, udev-nix, ... }:
outputs = inputs@{ self, nixpkgs, unstable, treefmt-nix, pre-commit-hooks, sbomnix, udev-nix, nixvim, ... }:
let
myLib = import ./lib { inherit inputs; };
config = {
Expand Down Expand Up @@ -86,6 +86,10 @@
actionlint.enable = true;
};
};
nvim = nixvim.lib.${system}.check.mkTestDerivationFromNvim {
inherit (self.packages.${system}) nvim;
name = "A nixvim configuration";
};
});

devShells = forSystems ({ pkgs, system }: {
Expand Down Expand Up @@ -134,7 +138,12 @@
}
];

packages = forSystems ({ pkgs, system }: pkgs.myPkgs);
packages = forSystems ({ pkgs, system }: pkgs.myPkgs // {
nvim = nixvim.legacyPackages."${system}".makeNixvimWithModule {
pkgs = pkgs.unstable;
module = import ./users/gael/neovim.nix;
};
});

templates = {
trivial = {
Expand Down
5 changes: 2 additions & 3 deletions lib/os/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ inputs, ... }:

let
inherit (inputs) self nixpkgs sops-nix nur home-manager nixvim udev-nix mention;
inherit (inputs) self nixpkgs sops-nix nur home-manager udev-nix mention;
in
rec {
mkNixosSystem = { system, host, user, ... }: nixpkgs.lib.nixosSystem {
inherit system;

specialArgs = {
inherit self inputs;
inherit self system inputs;
};

modules = [
Expand Down Expand Up @@ -55,7 +55,6 @@ rec {
sops-nix.nixosModules.sops

home-manager.nixosModules.home-manager
nixvim.nixosModules.nixvim
nur.nixosModules.nur
mention.nixosModules.default
{
Expand Down
43 changes: 10 additions & 33 deletions users/gael/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ config, pkgs, ... }:
{ system, pkgs, inputs, ... }:

let
inherit (inputs) nixvim;
in
{
users.users.gael = {
isNormalUser = true;
Expand Down Expand Up @@ -42,36 +45,10 @@
# ACTION=="remove", SUBSYSTEM=="input", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0010|0110|0111|0114|0116|0401|0403|0405|0407|0410", ENV{ID_SECURITY_TOKEN}="1", RUN+="${pkgs.systemd}/bin/systemctl start xlock.service"
# '';


programs.nixvim = {
enable = true;

colorscheme = "solarized";

plugins = {
cmp-treesitter.enable = true;
# dap.enable = true;
# diffview.enable = true;
gitsigns.enable = true;
indent-blankline.enable = true;
lsp.enable = true;
neo-tree.enable = true;
nix.enable = true;
telescope.enable = true;
treesitter.enable = true;
# trouble.enable = true; in error
which-key.enable = true;
};

extraPlugins = with pkgs.vimPlugins; [
heirline-nvim
nvim-autopairs
solarized-nvim
vim-hardtime

# not available in nixvim/nixos-23.05
nvim-dap
diffview-nvim
];
};
environment.systemPackages = [
(nixvim.legacyPackages."${system}".makeNixvimWithModule {
pkgs = pkgs.unstable;
module = import ./neovim.nix;
})
];
}
39 changes: 39 additions & 0 deletions users/gael/neovim.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ pkgs, ... }:

{
config = {
colorscheme = "NeoSolarized";

options = {
number = true;
};

extraConfigVim = ''
set background=light
'';

plugins = {
cmp-treesitter.enable = true;
dap.enable = true;
diffview.enable = true;
gitsigns.enable = true;
indent-blankline.enable = true;
lsp.enable = true;
neo-tree.enable = true;
nix.enable = true;
nvim-cmp.enable = true;
telescope.enable = true;
treesitter.enable = true;
trouble.enable = true;
which-key.enable = true;
};

extraPlugins = with pkgs.vimPlugins; [
heirline-nvim
NeoSolarized
nvim-autopairs
solarized-nvim
vim-hardtime
];
};
}

0 comments on commit b683acb

Please sign in to comment.