From 310fdf8de53d98ddd3a56936c131186e25814f0f Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 29 Oct 2024 22:37:49 -0400 Subject: use lz.n (#69) * remove bufferline & some cmp sources * factor things out of after/ folder This is bad practice or something * make sure ftdetect plugins aren't loaded multiple times * use lz.n * mini.pairs -> mini.surround * flake: cleanup checks * ftplugin: enforce spaces in nix files --- flake.nix | 107 +++++++++++++++++++++++--------------------------------------- 1 file changed, 39 insertions(+), 68 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index cc72977..aa09357 100644 --- a/flake.nix +++ b/flake.nix @@ -3,18 +3,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - vim-tera = { - url = "github:vkhitrin/vim-tera"; - flake = false; - }; }; outputs = { self, nixpkgs, - vim-tera, }: let inherit (nixpkgs) lib; @@ -28,42 +22,43 @@ forAllSystems = lib.genAttrs systems; nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system}); + + date = + let + # YYYYMMDD + date = builtins.substring 0 8 self.lastModifiedDate; + # YYYY + year = builtins.substring 0 4 date; + # MM + month = builtins.substring 4 2 date; + # DD + day = builtins.substring 6 2 date; + in + builtins.concatStringsSep "-" [ + year + month + day + ]; + version = "0-unstable-${date}"; in { checks = forAllSystems ( system: let pkgs = nixpkgsFor.${system}; + + mkCheck = + name: deps: script: + pkgs.runCommand name { nativeBuildInputs = deps; } '' + ${script} + touch $out + ''; in { - check-format-and-lint = - pkgs.runCommand "check-format-and-lint" - { - nativeBuildInputs = [ - pkgs.actionlint - pkgs.nixfmt-rfc-style - pkgs.selene - pkgs.statix - ]; - } - '' - cd ${self} - - echo "running actionlint..." - actionlint ./.github/workflows/* - - echo "running nixfmt..." - nixfmt --check . - - echo "running selene...." - selene **/*.lua - - echo "running statix..." - statix check . - - touch $out - ''; - + actionlint = mkCheck "check-actionlint" [ pkgs.actionlint ] "actionlint ${./.github/workflows}/*"; + deadnix = mkCheck "check-deadnix" [ pkgs.deadnix ] "deadnix --fail ${self}"; + selene = mkCheck "check-selene" [ pkgs.selene ] "cd ${self} && selene ."; + statix = mkCheck "check-statix" [ pkgs.statix ] "statix check ${self}"; } ); @@ -99,43 +94,19 @@ let pkgs = nixpkgsFor.${system}; - dateFrom = - flake: - let - # YYYYMMDD - date = builtins.substring 0 8 flake.lastModifiedDate; - # YYYY - year = builtins.substring 0 4 date; - # MM - month = builtins.substring 4 2 date; - # DD - day = builtins.substring 6 2 date; - in - builtins.concatStringsSep "-" [ - year - month - day - ]; + ourPackages = lib.makeScope pkgs.newScope (final: { + getchvim = final.callPackage ./neovim.nix { }; + + getchoo-neovim-config = pkgs.vimUtils.buildVimPlugin { + pname = "getchoo-neovim-config"; + inherit version; + src = self; + }; + }); in { - getchvim = pkgs.callPackage (self + "/neovim.nix") { - inherit (self.packages.${system}) getchoo-neovim-config vim-tera; - }; - - getchoo-neovim-config = pkgs.vimUtils.buildVimPlugin { - pname = "getchoo-neovim-config"; - version = "0-unstable-" + dateFrom self; - - src = self; - }; - - vim-tera = pkgs.vimUtils.buildVimPlugin { - pname = "vim-tera"; - version = "0-unstable-" + dateFrom vim-tera; - src = vim-tera; - }; - + inherit (ourPackages) getchvim getchoo-neovim-config; default = self.packages.${system}.getchvim; } ); -- cgit v1.2.3