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 #!/usr/bin/env bash
export NIX_CONFIG='builders = ' export NIX_CONFIG='builders = '
export NIXPKGS_ALLOW_UNFREE=1

View File

@ -10,65 +10,66 @@
erosanix, erosanix,
... ...
} @ inputs: } @ 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 {}; packages = forAllSystems ({ pkgs, ... }: {
mediafire-dl = python3Packages.callPackage ./pkgs/mediafire-dl.nix {}; 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 # mkWindowsApp resources:
fetchFromMega # - https://github.com/emmanuelrosa/erosanix/tree/master/pkgs/mkwindowsapp
fetchFromMediafire; # - https://github.com/emmanuelrosa/sumatrapdf-nix/blob/master/sumatrapdf.nix
pokemon = let packages.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; let
callPackage = newScope (erosanix.lib.x86_64-linux // { callPackage = newScope (
wine = wineWowPackages.full; { wine = wineWowPackages.full; wineArch = "win64"; }
wineArch = "win64"; // self.lib.x86_64-linux
inherit // erosanix.lib.x86_64-linux
fetchFromDrive );
fetchFromMega in rec {
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"; };
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 = { apps.x86_64-linux.gc = {
type = "app"; type = "app";
program = "${erosanix.packages.x86_64-linux.mkwindowsapp-tools}/bin/mkwindows-tools-gc"; 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;
};
}; };
} }