summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-31 08:01:03 -0500
committerseth <[email protected]>2023-12-31 08:52:04 -0500
commitdec8d36cbdbb3b9c5c12792ed199892ce2e82069 (patch)
tree89422c04c25b4ed4c3156d4477c894416500e8b3 /flake.nix
parentae9136a14ae0b0fe91faad59b23d3a532ca84ed5 (diff)
back to regular lua
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix120
1 files changed, 40 insertions, 80 deletions
diff --git a/flake.nix b/flake.nix
index 6967818..41c6b86 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,16 +3,6 @@
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
- utils.url = "https://flakehub.com/f/numtide/flake-utils/0.1.88.tar.gz";
-
- nixvim = {
- url = "https://flakehub.com/f/nix-community/nixvim/0.1.*.tar.gz";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- flake-utils.follows = "utils";
- pre-commit-hooks.follows = "";
- };
- };
tree-sitter-just = {
url = "github:IndianBoy42/tree-sitter-just";
@@ -21,83 +11,53 @@
};
outputs = {
+ self,
nixpkgs,
- utils,
- nixvim,
- tree-sitter-just,
...
- }:
- utils.lib.eachDefaultSystem (system: let
- pkgs = nixpkgs.legacyPackages.${system};
- inherit (pkgs) lib;
- in rec {
- checks = {
- check-actionlint =
- pkgs.runCommand "check-actionlint" {
- nativeBuildInputs = [pkgs.actionlint];
- } ''
- actionlint ${./.}/.github/workflows/*
- touch $out
- '';
-
- "check-${formatter.pname}" =
- pkgs.runCommand "check-${formatter.pname}" {
- nativeBuildInputs = [formatter];
- } ''
- ${lib.getExe formatter} --check ${./.}
- touch $out
- '';
-
- check-statix =
- pkgs.runCommand "check-statix" {
- nativeBuildInputs = [pkgs.statix];
- }
- ''
- statix check ${./.}
- touch $out
- '';
-
- check-nil =
- pkgs.runCommand "check-nil" {
- nativeBuildInputs = with pkgs; [fd git nil];
- }
- ''
- cd ${./.}
- fd . -e 'nix' | while read -r file; do
- nil diagnostics "$file"
- done
-
- touch $out
- '';
- };
-
- devShells = {
- default = pkgs.mkShell {
- packages = with pkgs; [
- actionlint
- formatter
- deadnix
- nil
- statix
- ];
- };
+ } @ inputs: let
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
+
+ forSystem = system: fn: fn nixpkgs.legacyPackages.${system};
+ forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: forSystem system fn);
+ in {
+ checks = forAllSystems (pkgs: import ./checks.nix {inherit pkgs self;});
+
+ devShells = forAllSystems (pkgs: {
+ default = pkgs.mkShell {
+ packages = with pkgs; [
+ actionlint
+
+ # lua
+ lua-language-server
+ stylua
+
+ # nix
+ self.formatter.${pkgs.system}
+ deadnix
+ nil
+ statix
+ ];
};
+ });
- formatter = pkgs.alejandra;
+ formatter = forAllSystems (pkgs: pkgs.alejandra);
- packages = {
- nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
- module = ./config;
- extraSpecialArgs = {self = packages;};
- };
+ packages = forAllSystems (pkgs: rec {
+ getchvim = import ./neovim.nix self pkgs;
- tree-sitter-just = pkgs.tree-sitter.buildGrammar {
- language = "just";
- version = builtins.substring 0 8 tree-sitter-just.lastModifiedDate;
- src = tree-sitter-just;
- };
+ tree-sitter-just = pkgs.tree-sitter.buildGrammar {
+ language = "just";
+ version = builtins.substring 0 8 inputs.tree-sitter-just.lastModifiedDate;
- default = packages.nvim;
+ src = inputs.tree-sitter-just;
};
+
+ default = getchvim;
});
+ };
}