Merge pull request #547 from nix-community/dont-filter-other-systems

packages: allow all systems...
This commit is contained in:
Paul Haerle 2023-07-11 10:38:04 +02:00 committed by GitHub
commit 4532520021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 61 deletions

View File

@ -5,25 +5,6 @@ on:
jobs:
tests-pure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: cachix/install-nix-action@v22
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/8i0c4nnvddybdq6a684ffybc5p7ziif0/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
max-jobs = 10
- uses: cachix/cachix-action@v12
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix flake check
tests-format:
runs-on: ubuntu-latest
steps:

View File

@ -10,48 +10,45 @@
lib,
pkgs,
...
}:
if system != "x86_64-linux"
then {}
else let
# A module imported into every package setting up the eval cache
setup = {config, ...}: {
lock.lockFileRel = "/v1/nix/modules/drvs/${config.name}/lock-${system}.json";
lock.repoRoot = self;
eval-cache.cacheFileRel = "/v1/nix/modules/drvs/${config.name}/cache-${system}.json";
eval-cache.repoRoot = self;
eval-cache.enable = true;
deps.npm = inputs.nixpkgsV1.legacyPackages.${system}.nodejs.pkgs.npm.override (old: rec {
version = "8.19.4";
src = builtins.fetchTarball {
url = "https://registry.npmjs.org/npm/-/npm-${version}.tgz";
sha256 = "0xmvjkxgfavlbm8cj3jx66mlmc20f9kqzigjqripgj71j6b2m9by";
};
});
};
# evalautes the package behind a given module
makeDrv = module: let
evaled = lib.evalModules {
modules = [
inputs.drv-parts.modules.drv-parts.core
inputs.drv-parts.modules.drv-parts.docs
module
../drv-parts/eval-cache
../drv-parts/lock
setup
];
specialArgs.packageSets = {
nixpkgs = inputs.nixpkgsV1.legacyPackages.${system};
writers = config.writers;
};
specialArgs.drv-parts = inputs.drv-parts;
specialArgs.dream2nix = self;
}: let
# A module imported into every package setting up the eval cache
setup = {config, ...}: {
lock.lockFileRel = "/v1/nix/modules/drvs/${config.name}/lock-${system}.json";
lock.repoRoot = self;
eval-cache.cacheFileRel = "/v1/nix/modules/drvs/${config.name}/cache-${system}.json";
eval-cache.repoRoot = self;
eval-cache.enable = true;
deps.npm = inputs.nixpkgsV1.legacyPackages.${system}.nodejs.pkgs.npm.override (old: rec {
version = "8.19.4";
src = builtins.fetchTarball {
url = "https://registry.npmjs.org/npm/-/npm-${version}.tgz";
sha256 = "0xmvjkxgfavlbm8cj3jx66mlmc20f9kqzigjqripgj71j6b2m9by";
};
in
evaled.config.public;
in {
# map all modules in ../drvs to a package output in the flake.
packages = lib.mapAttrs (_: drvModule: makeDrv drvModule) self.modules.drvs;
});
};
# evalautes the package behind a given module
makeDrv = module: let
evaled = lib.evalModules {
modules = [
inputs.drv-parts.modules.drv-parts.core
inputs.drv-parts.modules.drv-parts.docs
module
../drv-parts/eval-cache
../drv-parts/lock
setup
];
specialArgs.packageSets = {
nixpkgs = inputs.nixpkgsV1.legacyPackages.${system};
writers = config.writers;
};
specialArgs.drv-parts = inputs.drv-parts;
specialArgs.dream2nix = self;
};
in
evaled.config.public;
in {
# map all modules in ../drvs to a package output in the flake.
packages = lib.mapAttrs (_: drvModule: makeDrv drvModule) self.modules.drvs;
};
}