summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-10-29 22:37:49 -0400
committerGitHub <[email protected]>2024-10-30 02:37:49 +0000
commit310fdf8de53d98ddd3a56936c131186e25814f0f (patch)
treef4265ab11de2262bacb2498cdc4661420a2df278 /flake.nix
parent7ed0a2b87684eb32009944bd9eb8d7eaa9af0462 (diff)
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
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix107
1 files changed, 39 insertions, 68 deletions
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;
}
);