Skip to content

Commit

Permalink
feat!: summer cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Jul 11, 2024
1 parent 7249087 commit 2308327
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 349 deletions.
135 changes: 28 additions & 107 deletions flake.lock

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

92 changes: 45 additions & 47 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
lazy-nvim.url = "github:folke/lazy.nvim";
lazy-nvim.flake = false;
pre-commit-nix.url = "github:cachix/pre-commit-hooks.nix";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "";
};
};

outputs = {
flake-parts,
self,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit self inputs;} {
imports = [
inputs.pre-commit-nix.flakeModule
];
outputs = {flake-parts, ...} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
imports =
if inputs.git-hooks ? flakeModule
then [inputs.git-hooks.flakeModule]
else [];

flake = {
flakeModule = {
imports = [./modules];
};
flake.flakeModule = {
imports = [./modules];
};

systems = ["aarch64-darwin" "x86_64-linux"];
Expand All @@ -32,41 +32,39 @@
pkgs,
system,
...
}: {
apps = {
check.program = pkgs.writeShellApplication {
name = "check";
text = ''
nix run ./example#test
'';
}:
{
apps = {
check.program = pkgs.writeShellApplication {
name = "check";
text = ''
nix run ./example#test
'';
};
check-local.program = pkgs.writeShellApplication {
name = "check-local";
text = ''
nix run --override-input neovim-nix path:./. ./example#test
'';
};
};
check-local.program = pkgs.writeShellApplication {
name = "check-local";
text = ''
nix run --override-input neovim-nix path:./. ./example#test

formatter = pkgs.alejandra;
}
// inputs.nixpkgs.lib.optionalAttrs (inputs.git-hooks ? flakeModule) {
devShells.default = pkgs.mkShell {
name = "neovim.nix";
shellHook = ''
${config.pre-commit.installationScript}
'';
};
};

devShells.default = pkgs.mkShell {
name = "neovim.nix";
shellHook = ''
${config.pre-commit.installationScript}
'';
};

formatter = pkgs.alejandra;

packages = {
utils = pkgs.callPackage ./utils.nix {};
};

pre-commit = {
settings = {
hooks.alejandra.enable = true;
hooks.stylua.enable = true;
pre-commit = {
settings = {
hooks.alejandra.enable = true;
hooks.stylua.enable = true;
};
};
};
};
};
}
21 changes: 12 additions & 9 deletions modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
lib,
flake-parts-lib,
lib,
...
}:
with lib; let
Expand Down Expand Up @@ -44,9 +44,6 @@ with lib; let
};
in {
imports = [
{
_module.args.neovim-lib = import ./lib.nix {inherit lib;};
}
./neovim
./plugins
];
Expand Down Expand Up @@ -81,12 +78,18 @@ in {
};
};
};
});
};

config = {
neovim = {
final = mkNeovimEnv {inherit config pkgs;};
};
config = {
perSystem = {
config,
pkgs,
...
}: {
neovim = {
final = mkNeovimEnv {inherit config pkgs;};
};
});
};
};
}
18 changes: 0 additions & 18 deletions modules/lib.nix

This file was deleted.

Loading

0 comments on commit 2308327

Please sign in to comment.