From a941429ecbe9372f0f90b641d3c29417dd5cb28c Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 5 May 2024 17:56:14 +0300 Subject: [PATCH] add flake --- flake.lock | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c8e537a --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix2lua": { + "locked": { + "lastModified": 1713973306, + "narHash": "sha256-eZco7L3r60+hLjfrBYWZ25Gszq3w2JV2f4xPL8WNDWk=", + "ref": "refs/heads/main", + "rev": "dc43d7ceda246e634547cbb2227dd16c56b52a2b", + "revCount": 39, + "type": "git", + "url": "https://git.pleshevski.ru/mynix/nix2lua" + }, + "original": { + "type": "git", + "url": "https://git.pleshevski.ru/mynix/nix2lua" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714656196, + "narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "94035b482d181af0a0f8f77823a790b256b7c3cc", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nix2lua": "nix2lua", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..98f8571 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = ""; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + nix2lua.url = "git+https://git.pleshevski.ru/mynix/nix2lua"; + }; + outputs = + { self + , nixpkgs + , flake-utils + , nix2lua + , ... + } @ inputs: + let + mkNixeovim = { system, config }: + let pkgs = import nixpkgs { inherit system; }; in + import ./. { inherit config pkgs nix2lua; }; + mkNixeovimPackage = args: (mkNixeovim args).build.neovim.package; + in + { + lib = { inherit mkNixeovim mkNixeovimPackage; }; + } + // flake-utils.lib.eachDefaultSystem ( + system: + let nixeovimPackage = config: mkNixeovimPackage { inherit system config; }; in + { + packages = { + default = nixeovimPackage { }; + }; + } + ); +}