move fetchers to lib

now 'nix flake show' works
This commit is contained in:
Peder Bergebakken Sundt 2023-06-25 08:29:46 +02:00
parent 9164da55a6
commit eeddc85c71
2 changed files with 48 additions and 46 deletions

1
.envrc
View File

@ -1,2 +1,3 @@
#!/usr/bin/env bash
export NIX_CONFIG='builders = '
export NIXPKGS_ALLOW_UNFREE=1

View File

@ -10,65 +10,66 @@
erosanix,
...
} @ inputs:
{
let
systems = nixpkgs.lib.systems.flakeExposed;
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f rec {
inherit system;
inherit (nixpkgs.legacyPackages.${system}) pkgs lib;
});
in nixpkgs.lib.recursiveUpdate {
packages.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; rec {
lib = forAllSystems ({ pkgs, system, ... }: pkgs.callPackage ./pkgs/fetchers.nix {
inherit (self.packages.${system}) badown mediafire-dl;
});
badown = callPackage ./pkgs/badown.nix {};
mediafire-dl = python3Packages.callPackage ./pkgs/mediafire-dl.nix {};
packages = forAllSystems ({ pkgs, ... }: {
badown = pkgs.callPackage ./pkgs/badown.nix {};
mediafire-dl = pkgs.python3Packages.callPackage ./pkgs/mediafire-dl.nix {};
});
inherit (callPackage ./pkgs/fetchers.nix { inherit badown mediafire-dl; })
fetchFromDrive
fetchFromMega
fetchFromMediafire;
}{
# mkWindowsApp resources:
# - https://github.com/emmanuelrosa/erosanix/tree/master/pkgs/mkwindowsapp
# - https://github.com/emmanuelrosa/sumatrapdf-nix/blob/master/sumatrapdf.nix
pokemon = let
callPackage = newScope (erosanix.lib.x86_64-linux // {
wine = wineWowPackages.full;
wineArch = "win64";
inherit
fetchFromDrive
fetchFromMega
fetchFromMediafire;
});
in {
# mkWindowsApp resources:
# - https://github.com/emmanuelrosa/erosanix/tree/master/pkgs/mkwindowsapp
# - https://github.com/emmanuelrosa/sumatrapdf-nix/blob/master/sumatrapdf.nix
infinite-fusion = callPackage ./games/infinite-fusion.nix {
legacy-version = false;
};
infinite-fusion-legacy = callPackage ./games/infinite-fusion.nix {
legacy-version = true;
wine = winePackages.full;
wineArch = "win32";
};
project-untamed = callPackage ./games/project-untamed.nix { };
uranium = callPackage ./games/uranium.nix { wine = winePackages.full; wineArch = "win32"; };
clockwork = callPackage ./games/clockwork.nix { wine = winePackages.full; wineArch = "win32"; };
packages.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; let
callPackage = newScope (
{ wine = wineWowPackages.full; wineArch = "win64"; }
// self.lib.x86_64-linux
// erosanix.lib.x86_64-linux
);
in rec {
pokemon-infinite-fusion = callPackage ./games/infinite-fusion.nix {
legacy-version = false;
};
pokemon-infinite-fusion-legacy = callPackage ./games/infinite-fusion.nix {
legacy-version = true;
wine = winePackages.full;
wineArch = "win32";
};
pokemon-project-untamed = callPackage ./games/project-untamed.nix { };
pokemon-uranium = callPackage ./games/uranium.nix { wine = winePackages.full; wineArch = "win32"; };
pokemon-clockwork = callPackage ./games/clockwork.nix { wine = winePackages.full; wineArch = "win32"; };
};
# garbage-collect
# a mkWindowsApp garbage-collect tool
apps.x86_64-linux.gc = {
type = "app";
program = "${erosanix.packages.x86_64-linux.mkwindowsapp-tools}/bin/mkwindows-tools-gc";
};
lib.x86_64-linux = {
inherit (self.packages.x86_64-linux)
fetchFromDrive
fetchFromMega
fetchFromMediafire;
};
};
}