packages: improve per-system filtering

This commit is contained in:
Max Headroom 2022-05-23 10:58:42 +02:00
parent 54116aafea
commit e5918d019b
5 changed files with 18 additions and 11 deletions

View file

@ -78,7 +78,7 @@
(host: mkDeploy host // (overrides.${host} or {}) );
depot = forSystems (system: import ./packages {
inherit inputs;
inherit inputs system;
pkgs = nixpkgsFor system;
});

View file

@ -1,4 +1,4 @@
{ pkgs, inputs }@args:
{ pkgs, inputs, system }@args:
let
patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = all; });
patched-inputs = import ./patched-inputs.nix args;
@ -6,8 +6,11 @@ let
all = patched-derivations
// patched-inputs
// projects.packages;
filters = import ./system-filter.nix;
in {
packages = pkgs.lib.filterAttrs (_: pkg: pkg ? meta.platforms -> builtins.elem pkgs.system pkg.meta.platforms) all;
packages = pkgs.lib.filterAttrs (name: _:
filters ? "${name}" -> builtins.elem system filters."${name}"
) all;
inherit (projects) devShells;
}

View file

@ -1,9 +1,9 @@
let tools = import ./lib/tools.nix;
in with tools;
{ inputs, pkgs, ... }: rec {
inherit (inputs.deploy-rs.packages.${pkgs.system}) deploy-rs;
{ inputs, pkgs, system, ... }: rec {
inherit (inputs.deploy-rs.packages.${system}) deploy-rs;
nix-super = inputs.nix-super.defaultPackage.${pkgs.system};
nix-super = inputs.nix-super.defaultPackage.${system};
agenix = inputs.agenix.packages.${pkgs.system}.agenix.override { nix = nix-super; };
agenix = inputs.agenix.packages.${system}.agenix.override { nix = nix-super; };
}

View file

@ -1,6 +1,6 @@
{ pkgs, inputs, ... }@args:
{ pkgs, inputs, system, ... }@args:
let
inherit (pkgs) lib system;
inherit (pkgs) lib;
dream2nix = inputs.dream2nix.lib2.init {
systems = [ system ];
config = {
@ -27,7 +27,7 @@ in
};
inherit (dream.packages.${system}) ghost;
in
lib.recursiveUpdate ghost { meta.platforms = [ "x86_64-linux" ]; };
ghost;
uptime-kuma = let
dream = dream2nix.makeFlakeOutputs {
@ -40,7 +40,7 @@ in
};
inherit (dream.packages.${system}) uptime-kuma;
in
lib.recursiveUpdate uptime-kuma { meta.platforms = [ "x86_64-linux" ]; };
uptime-kuma;
hyprspace = pkgs.callPackage ./networking/hyprspace { iproute2mac = null; };

View file

@ -0,0 +1,4 @@
{
ghost = [ "x86_64-linux" ];
uptime-kuma = [ "x86_64-linux" ];
}