From 10438875e09b9985732e00c989a54830909f8886 Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 21 Sep 2021 21:23:08 +0530 Subject: build as flake --- .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..af3204b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1632176121, + "narHash": "sha256-N2oSOhbW38rbc53R1R8qXC/Xstht1PIsAcTzJfmCpTc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3397f0ede9ea2ded1f8b6fa689dda71a7a67b806", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e96f699 --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + + description = "Improved text objects for {neo,}vim"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; + }; + + outputs = + { self + , nixpkgs + , ... + } @ rest: + let + supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; + + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + nixpkgsFor = forAllSystems (system: + import nixpkgs { + inherit system; + overlays = [ self.overlay ]; + } + ); + in + { + + overlay = final: prev: rec { + better-text-objs = + with final; pkgs.vimUtils.buildVimPlugin { + pname = "better-text-objs"; + version = "0.1.0"; + src = ./.; + }; + }; + + packages = forAllSystems (system: + { + inherit (nixpkgsFor."${system}") better-text-objs; + } + ); + + defaultPackage = + forAllSystems (system: self.packages."${system}".better-text-objs); + + }; + +} -- cgit v1.2.3