diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cc385a..0950460 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: - run: nix build '.#anonymous-overflow' - run: nix build '.#fennel-ls' - run: nix build '.#nitter-unstable' + - run: nix build '.#neovim-nightly' - run: nix build '.#q' - run: nix build '.#rimgo' - run: nix build '.#website-docs-nifoc-pw' @@ -39,6 +40,8 @@ jobs: authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix build '.#cliclick' - run: nix build '.#fennel-ls' + - run: nix build '.#liblpeg-darwin' + - run: nix build '.#neovim-nightly' - run: nix build '.#phantomjs' - run: nix build '.#q' @@ -54,4 +57,5 @@ jobs: name: nifoc authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix build '.#fennel-ls' + - run: nix build '.#neovim-nightly' - run: nix build '.#q' diff --git a/flake.lock b/flake.lock index 52b982a..c090280 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,50 @@ { "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "neovim-flake": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "contrib", + "lastModified": 1683738879, + "narHash": "sha256-V53XRMc6YUYoHFdQ0OgE3HE5qbnwvXWJT9tEi6lT75w=", + "owner": "neovim", + "repo": "neovim", + "rev": "ac1aee99bc76c0036aa0ccf7b9eda48fcf46ac11", + "type": "github" + }, + "original": { + "dir": "contrib", + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1683657389, - "narHash": "sha256-jx91UqqoBneE8QPAKJA29GANrU/Z7ULghoa/JE0+Edw=", + "lastModified": 1683686518, + "narHash": "sha256-ieG0J4GCUqOE9Wo8cNSsa1Ev9QKMLrHANOlu22v17bo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9524f57dd5b3944c819dd594aed8ed941932ef56", + "rev": "12ba1a5f90b16acdca741ac82d8204b3ec8c2aaf", "type": "github" }, "original": { @@ -18,6 +56,7 @@ }, "root": { "inputs": { + "neovim-flake": "neovim-flake", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 2b91d5d..7f90c13 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,15 @@ { description = "Collection of (useful) tools"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - outputs = { self, nixpkgs }: { + neovim-flake = { + url = "github:neovim/neovim?dir=contrib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs@{ self, nixpkgs, ... }: { packages = nixpkgs.lib.genAttrs [ "aarch64-darwin" @@ -13,7 +20,12 @@ (system: import ./packages.nix { inherit system; inherit (nixpkgs) lib; + pkgs = nixpkgs.legacyPackages.${system}; + + otherPkgs = { + neovim = inputs.neovim-flake.packages.${system}; + }; }); overlay = import ./overlay.nix; diff --git a/overlay.nix b/overlay.nix index d77ef77..08efb37 100644 --- a/overlay.nix +++ b/overlay.nix @@ -15,4 +15,5 @@ in inherit (custom) website-docs-nifoc-pw; inherit (custom) liblpeg-darwin; + inherit (custom) neovim-nightly; } diff --git a/packages.nix b/packages.nix index 04f3cfd..3a191d4 100644 --- a/packages.nix +++ b/packages.nix @@ -1,6 +1,6 @@ -{ system, lib, pkgs }: +{ system, lib, pkgs, otherPkgs }: -{ +rec { agilebits-op = import ./packages/agilebits-op.nix { inherit system lib pkgs; }; anonymous-overflow = import ./packages/anonymous-overflow.nix { inherit system lib pkgs; }; cliclick = import ./packages/cliclick.nix { inherit system lib pkgs; }; @@ -12,4 +12,5 @@ website-docs-nifoc-pw = import ./packages/website-docs-nifoc-pw.nix { inherit system lib pkgs; }; liblpeg-darwin = import ./packages/liblpeg-darwin.nix { inherit system lib pkgs; }; + neovim-nightly = import ./packages/neovim-nightly.nix { inherit system lib pkgs otherPkgs liblpeg-darwin; }; } diff --git a/packages/neovim-nightly.nix b/packages/neovim-nightly.nix new file mode 100644 index 0000000..a2f3232 --- /dev/null +++ b/packages/neovim-nightly.nix @@ -0,0 +1,22 @@ +{ pkgs, otherPkgs, lib, liblpeg-darwin, ... }: + +let + inherit (pkgs.stdenv) isDarwin; + inherit (lib) optionals; +in +otherPkgs.neovim.neovim.overrideAttrs (oa: { + nativeBuildInputs = oa.nativeBuildInputs ++ optionals isDarwin [ + liblpeg-darwin + ]; + + patches = builtins.filter + (p: + let + patch = + if builtins.typeOf p == "set" + then baseNameOf p.name + else baseNameOf p; + in + patch != "use-the-correct-replacement-args-for-gsub-directive.patch") + oa.patches; +})