Update flake

This commit is contained in:
Nathan McCarty 2022-11-29 01:16:44 -05:00
parent 4ade2ae9e9
commit f83a6053da
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
2 changed files with 29 additions and 40 deletions

View File

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1655122334, "lastModified": 1669597967,
"narHash": "sha256-Rwwvo9TDCH0a4m/Jvoq5wZ3FLSLiVLBD1FFfN/3XawA=", "narHash": "sha256-R+2NaDkXsYkOpFOhmVR8jBZ77Pq55Z6ilaqwFLLn000=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e1a1cfb56504d1b82a3953bfb0632b37a1ca8d30", "rev": "be9e3762e719211368d186f547f847737baad720",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -24,11 +24,11 @@
}, },
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1667395993,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -10,18 +10,13 @@
utils.lib.eachSystem [ "x86_64-linux" ] (system: utils.lib.eachSystem [ "x86_64-linux" ] (system:
let let
sources = builtins.fromJSON (builtins.readFile ./sources.json); sources = builtins.fromJSON (builtins.readFile ./sources.json);
buildAdoptLike = with import nixpkgs { system = system; }; name: value: buildAdoptLike = with import nixpkgs { system = system; };
name: value:
let let
cpuName = stdenv.hostPlatform.parsed.cpu.name; cpuName = stdenv.hostPlatform.parsed.cpu.name;
runtimeDependencies = [ runtimeDependencies = [ pkgs.cups pkgs.cairo pkgs.glib pkgs.gtk3 ];
pkgs.cups
pkgs.cairo
pkgs.glib
pkgs.gtk3
];
runtimeLibraryPath = lib.makeLibraryPath runtimeDependencies; runtimeLibraryPath = lib.makeLibraryPath runtimeDependencies;
in in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "jdk${toString value.major_version}"; name = "jdk${toString value.major_version}";
src = builtins.fetchurl { src = builtins.fetchurl {
url = value.link; url = value.link;
@ -40,10 +35,7 @@
xorg.libXtst xorg.libXtst
zlib zlib
]; ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [ autoPatchelfHook makeWrapper ];
autoPatchelfHook
makeWrapper
];
dontStrip = 1; dontStrip = 1;
installPhase = '' installPhase = ''
cd .. cd ..
@ -72,7 +64,9 @@
for bin in $( find "$out" -executable -type f -not -name jspawnhelper ); do for bin in $( find "$out" -executable -type f -not -name jspawnhelper ); do
if patchelf --print-interpreter "$bin" &> /dev/null; then if patchelf --print-interpreter "$bin" &> /dev/null; then
wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}" \ wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}" \
--prefix PATH : ${lib.makeBinPath [ pkgs.util-linux ]} --prefix PATH : ${
lib.makeBinPath [ pkgs.util-linux ]
}
fi fi
done done
''; '';
@ -81,13 +75,9 @@
patchelf --add-needed libfontconfig.so {} \; patchelf --add-needed libfontconfig.so {} \;
''; '';
}; };
in in with import nixpkgs { system = system; }; {
with import nixpkgs { system = system; }; packages.temurin =
{ (builtins.mapAttrs (name: value: buildAdoptLike name value)
packages.temurin = (builtins.mapAttrs
(name: value:
buildAdoptLike name value
)
sources.${system}.temurin.versions) // { sources.${system}.temurin.versions) // {
latest = buildAdoptLike "latest" sources.${system}.temurin.latest; latest = buildAdoptLike "latest" sources.${system}.temurin.latest;
stable = buildAdoptLike "stable" sources.${system}.temurin.stable; stable = buildAdoptLike "stable" sources.${system}.temurin.stable;
@ -98,9 +88,8 @@
packages.temurin-stable = self.packages.${system}.temurin.stable; packages.temurin-stable = self.packages.${system}.temurin.stable;
packages.temurin-lts = self.packages.${system}.temurin.lts; packages.temurin-lts = self.packages.${system}.temurin.lts;
packages.semeru = (builtins.mapAttrs packages.semeru =
(name: value: (builtins.mapAttrs (name: value: buildAdoptLike name value)
buildAdoptLike name value)
sources.${system}.semeru.versions) // { sources.${system}.semeru.versions) // {
latest = buildAdoptLike "latest" sources.${system}.semeru.latest; latest = buildAdoptLike "latest" sources.${system}.semeru.latest;
stable = buildAdoptLike "stable" sources.${system}.semeru.stable; stable = buildAdoptLike "stable" sources.${system}.semeru.stable;