chore(nix): move to flake-parts
parent
0df7f7399c
commit
14bc2d39de
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./formatter.nix
|
||||||
|
./shell.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
perSystem = {pkgs, ...}: {
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
perSystem = {pkgs, ...}: {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
alejandra
|
||||||
|
git-cliff
|
||||||
|
nil
|
||||||
|
sumneko-lua-language-server
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
68
flake.lock
68
flake.lock
|
|
@ -1,5 +1,23 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1743550720,
|
||||||
|
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739020877,
|
"lastModified": 1739020877,
|
||||||
|
|
@ -16,6 +34,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1743296961,
|
||||||
|
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660438583,
|
"lastModified": 1660438583,
|
||||||
|
|
@ -33,44 +66,11 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"utils": "utils",
|
|
||||||
"yants": "yants"
|
"yants": "yants"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"yants": {
|
"yants": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
|
|
||||||
36
flake.nix
36
flake.nix
|
|
@ -3,35 +3,17 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
utils.url = "github:numtide/flake-utils";
|
|
||||||
yants.url = "github:divnix/yants";
|
yants.url = "github:divnix/yants";
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {flake-parts, ...} @ inputs: let
|
||||||
self,
|
in (flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
nixpkgs,
|
systems = ["x86_64-linux"];
|
||||||
utils,
|
|
||||||
yants,
|
|
||||||
...
|
|
||||||
} @ inputs: let
|
|
||||||
inherit (builtins) readFile replaceStrings;
|
|
||||||
fu = utils.lib;
|
|
||||||
versionFile = replaceStrings ["\n"] [""] (readFile ./VERSION);
|
|
||||||
version =
|
|
||||||
if self.sourceInfo ? dirtyShortRev
|
|
||||||
then "${versionFile}-${self.sourceInfo.dirtyShortRev}"
|
|
||||||
else versionFile;
|
|
||||||
|
|
||||||
forSystem = system: let
|
imports = [
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
./dev
|
||||||
inherit (pkgs) nil;
|
./lib
|
||||||
in {
|
];
|
||||||
formatter = pkgs.alejandra;
|
});
|
||||||
devShells.default = import ./shell.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(fu.eachDefaultSystem forSystem)
|
|
||||||
// {lib = import ./lib {inherit version yants;};};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,19 @@
|
||||||
{
|
{
|
||||||
version,
|
self,
|
||||||
yants,
|
inputs,
|
||||||
|
...
|
||||||
}: let
|
}: let
|
||||||
types = import ./types.nix {inherit yants;};
|
inherit (builtins) readFile replaceStrings;
|
||||||
|
versionFile = replaceStrings ["\n"] [""] (readFile ../VERSION);
|
||||||
|
version =
|
||||||
|
if self.sourceInfo ? dirtyShortRev
|
||||||
|
then "${versionFile}-${self.sourceInfo.dirtyShortRev}"
|
||||||
|
else versionFile;
|
||||||
|
|
||||||
|
types = import ./types.nix {inherit (inputs) yants;};
|
||||||
in {
|
in {
|
||||||
mkNeovimPkg = import ./mkNeovimPkg.nix {inherit version types;};
|
flake.lib = {
|
||||||
mkPluginsFromInputs = import ./mkPluginsFromInputs.nix;
|
mkNeovimPkg = import ./mkNeovimPkg.nix {inherit version types;};
|
||||||
|
mkPluginsFromInputs = import ./mkPluginsFromInputs.nix;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue