From 8bffb0b8dff96c204dc37cd4b9807a37e3d5e8a2 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 23 Oct 2023 22:37:48 +0200 Subject: [PATCH] init add some big N resources --- flake.nix | 7 +++++++ overlay.nix | 8 ++++++++ pkgs/oot-debug/default.nix | 11 +++++++++++ pkgs/sm64-us/default.nix | 10 ++++++++++ table.nix | 6 ++++++ 5 files changed, 42 insertions(+) create mode 100644 flake.nix create mode 100644 overlay.nix create mode 100644 pkgs/oot-debug/default.nix create mode 100644 pkgs/sm64-us/default.nix create mode 100644 table.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7a021ff --- /dev/null +++ b/flake.nix @@ -0,0 +1,7 @@ +{ + description = "A very basic flake"; + + outputs = { self, nixpkgs }: { + overlays.default = import ./overlay.nix; + }; +} diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..fdf564d --- /dev/null +++ b/overlay.nix @@ -0,0 +1,8 @@ +final: prev: +let + table = final.callPackage ./table.nix { }; +in { + requireFile = { ... }@args: let + hash = args.hash or args.sha256 or args.sha1; + in table.${hash} or (prev.requireFile args); +} diff --git a/pkgs/oot-debug/default.nix b/pkgs/oot-debug/default.nix new file mode 100644 index 0000000..0f664c3 --- /dev/null +++ b/pkgs/oot-debug/default.nix @@ -0,0 +1,11 @@ +{ lib, runCommand, fetchFromBittorrent, p7zip}: +let + torrent = fetchFromBittorrent { + url = "https://archive.org/download/ZELOOTD/ZELOOTD_archive.torrent"; + hash = "sha256-4CaZ2nv/vnweYwKd/qjfO8se71D1vfH9qhyDH9Aj21E="; + }; +in +runCommand "oot-debug.z64" { nativeBuildInputs = [ p7zip ]; } '' + 7z x "${torrent}/ZELOOTD.zip" + cp "ZELOOTD.z64" "$out" +'' diff --git a/pkgs/sm64-us/default.nix b/pkgs/sm64-us/default.nix new file mode 100644 index 0000000..e63fa59 --- /dev/null +++ b/pkgs/sm64-us/default.nix @@ -0,0 +1,10 @@ +{ lib, runCommand, fetchFromBittorrent }: +let + torrent = fetchFromBittorrent { + url = "https://archive.org/download/super-mario-64-usa/super-mario-64-usa_archive.torrent"; + hash = "sha256-6tkCKQD2modogcTo0ESookWJDm7rjA79t5ZOVz3luYM="; + }; +in +runCommand "baserom.us.z64" { } '' + cp "${torrent}/Super Mario 64 (U) [!].z64" "$out" +'' diff --git a/table.nix b/table.nix new file mode 100644 index 0000000..de1cf15 --- /dev/null +++ b/table.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +{ + "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91" = callPackage ./pkgs/sm64-us { }; + "cee6bc3c2a634b41728f2af8da54d9bf8cc14099" = callPackage ./pkgs/oot-debug { }; +}