Use nix and nix-index from nixpkgs instead of their own flakes

This commit is contained in:
Ilya K 2023-01-12 20:58:42 +03:00
parent 8656f3e07f
commit 1b0aa5e0d1
2 changed files with 12 additions and 114 deletions

View file

@ -1,85 +1,12 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1641205782,
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1673354285,
"narHash": "sha256-nSZH3ziwlMBe83pfAeMZWy6+URpEQISnZNmdO438dC8=",
"owner": "NixOS",
"repo": "nix",
"rev": "877e7a5ccf21279d9e027867e63181b2b9a6a15a",
"type": "github"
},
"original": {
"id": "nix",
"type": "indirect"
}
},
"nix-index": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1673358637,
"narHash": "sha256-UVKfgjnkU8U5+z96CiKUs1pnIFd3/2cJuvcQmWC0Hoo=",
"owner": "bennofs",
"repo": "nix-index",
"rev": "7ac935501a0f4ec094d15a35acf2bb35442259bb",
"type": "github"
},
"original": {
"owner": "bennofs",
"repo": "nix-index",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1670461440, "lastModified": 1673527292,
"narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", "narHash": "sha256-903EpRSDCfUvic7Hsiqwy+h7zlMTLAUbCXkEGGriCfM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425", "rev": "6a3f9996408c970b99b8b992b11bb249d1455b62",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -89,30 +16,9 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nix": "nix", "nixpkgs": "nixpkgs"
"nix-index": "nix-index",
"nixpkgs": [
"nix",
"nixpkgs"
]
} }
} }
}, },

View file

@ -1,22 +1,15 @@
{ {
description = "Script for generating Nixpkgs/NixOS channels"; description = "Script for generating Nixpkgs/NixOS channels";
inputs.nixpkgs.follows = "nix/nixpkgs"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small";
inputs.nix-index = {
url = "github:bennofs/nix-index";
inputs.nixpkgs.follows = "nix/nixpkgs";
};
outputs = { self, nixpkgs, nix, nix-index }: outputs = { self, nixpkgs }:
let nix-index' = nix-index.packages.x86_64-linux.nix-index; in
{ {
overlays.default = final: prev: { overlays.default = final: prev: {
nixos-channel-native-programs = with final; stdenv.mkDerivation { nixos-channel-native-programs = with final; stdenv.mkDerivation {
name = "nixos-channel-native-programs"; name = "nixos-channel-native-programs";
buildInputs = [ buildInputs = [
final.nix nix
pkgconfig pkgconfig
boehmgc boehmgc
nlohmann_json nlohmann_json
@ -38,8 +31,8 @@
nixos-channel-scripts = with final; stdenv.mkDerivation { nixos-channel-scripts = with final; stdenv.mkDerivation {
name = "nixos-channel-scripts"; name = "nixos-channel-scripts";
buildInputs = with final.perlPackages; buildInputs = with perlPackages;
[ final.nix [ nix
sqlite sqlite
makeWrapper makeWrapper
perl perl
@ -52,7 +45,7 @@
brotli brotli
jq jq
nixos-channel-native-programs nixos-channel-native-programs
nix-index' nix-index
]; ];
buildCommand = '' buildCommand = ''
@ -61,7 +54,7 @@
cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch
wrapProgram $out/bin/mirror-nixos-branch \ wrapProgram $out/bin/mirror-nixos-branch \
--set PERL5LIB $PERL5LIB \ --set PERL5LIB $PERL5LIB \
--prefix PATH : ${wget}/bin:${git}/bin:${final.nix}/bin:${gnutar}/bin:${xz}/bin:${rsync}/bin:${openssh}/bin:${nix-index'}/bin:${nixos-channel-native-programs}/bin:$out/bin --prefix PATH : ${lib.makeBinPath [ wget git nix gnutar xz rsync openssh nix-index nixos-channel-native-programs ]}
patchShebangs $out/bin patchShebangs $out/bin
''; '';
@ -71,8 +64,7 @@
defaultPackage.x86_64-linux = (import nixpkgs { defaultPackage.x86_64-linux = (import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
overlays = [ nix.overlays.default self.overlays.default ]; overlays = [ self.overlays.default ];
}).nixos-channel-scripts; }).nixos-channel-scripts;
}; };
} }