Make known-folders
a flake input
Simpler than using `fetchFromGitHub`, we can have `nix` manage the version instead
This commit is contained in:
parent
5b94a7df02
commit
5010de46db
17
flake.lock
17
flake.lock
@ -50,6 +50,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"known-folders": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1640092413,
|
||||
"narHash": "sha256-eqaZxIax8C75L2UwDbVKSUZ7iThm/iWblfoaTfPyHLM=",
|
||||
"owner": "ziglibs",
|
||||
"repo": "known-folders",
|
||||
"rev": "9db1b99219c767d5e24994b1525273fe4031e464",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ziglibs",
|
||||
"repo": "known-folders",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1658119717,
|
||||
@ -70,6 +86,7 @@
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"gitignore": "gitignore",
|
||||
"known-folders": "known-folders",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"zig-overlay": "zig-overlay"
|
||||
}
|
||||
|
21
flake.nix
21
flake.nix
@ -9,9 +9,12 @@
|
||||
gitignore.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
known-folders.url = "github:ziglibs/known-folders";
|
||||
known-folders.flake = false;
|
||||
};
|
||||
|
||||
outputs = {self, nixpkgs, zig-overlay, gitignore, flake-utils }:
|
||||
outputs = {self, nixpkgs, zig-overlay, gitignore, flake-utils, known-folders }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
inherit (gitignore.lib) gitignoreSource;
|
||||
@ -19,21 +22,6 @@
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
zig = zig-overlay.packages.${system}.master.latest;
|
||||
known-folders = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "known-folders";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "ziglibs";
|
||||
repo = "known-folders";
|
||||
rev = "9db1b99219c767d5e24994b1525273fe4031e464";
|
||||
sha256 = "sha256-eqaZxIax8C75L2UwDbVKSUZ7iThm/iWblfoaTfPyHLM=";
|
||||
};
|
||||
dontConfigure = true;
|
||||
dontInstall = true;
|
||||
buildPhase = ''
|
||||
mkdir -p $out
|
||||
cp known-folders.zig $out
|
||||
'';
|
||||
};
|
||||
in rec {
|
||||
packages.default = packages.zls;
|
||||
packages.zls = pkgs.stdenvNoCC.mkDerivation {
|
||||
@ -41,7 +29,6 @@
|
||||
version = "master";
|
||||
src = gitignoreSource ./.;
|
||||
nativeBuildInputs = [ zig ];
|
||||
buildInputs = [ known-folders ];
|
||||
dontConfigure = true;
|
||||
dontInstall = true;
|
||||
buildPhase = ''
|
||||
|
Loading…
Reference in New Issue
Block a user