Skip to content

Commit

Permalink
refactor(nvim): merge with r17x/nvim.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed May 23, 2024
1 parent a71d84d commit f672425
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
37 changes: 17 additions & 20 deletions flake.lock

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

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
## -- nixpkgs
master.url = "github:NixOS/nixpkgs/master";
stable.url = "github:NixOS/nixpkgs/release-22.11";
unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

## -- Platform

Expand Down
9 changes: 7 additions & 2 deletions modules/parts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
imports = [ ];

perSystem = { lib, pkgs, system, inputs', ... }: {
perSystem = { lib, system, inputs', ... }: {
formatter = inputs.nixpkgs-fmt.defaultPackage.${system};

_module.args = rec {
Expand All @@ -13,6 +13,12 @@
inherit (pkgs) stdenv;
};

pkgs = import inputs.nixpkgs {
inherit (nixpkgs) config;
inherit system;
overlays = [ self.overlays.default ];
};

# nixpkgs (channel) configuration (not the flake input)
nixpkgs = {
config = lib.mkForce {
Expand Down Expand Up @@ -49,7 +55,6 @@
in
{
master = pkgsFrom inputs.master system;
unstable = pkgsFrom inputs.unstable system;
stable = pkgsFrom inputs.stable system;
};
};
Expand Down
47 changes: 23 additions & 24 deletions nvim.nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@
perSystem =
{ pkgs
, system
, nixpkgs
, ...
}:
}:
let
nixvimLib = inputs.nixvim.lib.${system};
nixvim' = inputs.nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config; # import the module directly
# You can use `extraSpecialArgs` to pass additional arguments to your module files
# extraSpecialArgs = {
# # inherit (inputs) foo;
# };
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in
{
checks = {
# Run `nix flake check .` to verify that your config is not broken
nvim = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
nixvimLib = inputs.nixvim.lib.${system};
nixvim' = inputs.nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config; # import the module directly
# You can use `extraSpecialArgs` to pass additional arguments to your module files
# extraSpecialArgs = {
# # inherit (inputs) foo;
# };
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in
{
checks = {
# Run `nix flake check .` to verify that your config is not broken
nvim = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};

packages = {
# Lets you run `nix run .` to start nixvim
inherit nvim;
};
};
packages = {
# Lets you run `nix run .` to start nixvim
inherit nvim;
};
};
}

0 comments on commit f672425

Please sign in to comment.