Make known-folders a flake input

Simpler than using `fetchFromGitHub`, we can have `nix` manage the
version instead
This commit is contained in:
LeRoyce Pearson 2022-07-19 00:08:04 -06:00
parent 5b94a7df02
commit 5010de46db
2 changed files with 21 additions and 17 deletions

View File

@ -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"
}

View File

@ -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 = ''