depot: support system arg

This commit is contained in:
Luke Granger-Brown 2021-09-05 09:21:41 +00:00
parent 26dad9dce1
commit c705bf788a
3 changed files with 6 additions and 4 deletions

View file

@ -2,8 +2,9 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ system ? builtins.currentSystem, ... }:
let let
depot = (import ./default.nix {}); depot = (import ./default.nix { inherit system; });
pkgs = depot.third_party.nixpkgs; pkgs = depot.third_party.nixpkgs;
lib = pkgs.lib; lib = pkgs.lib;
prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; }); prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; });

View file

@ -2,12 +2,12 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ ... }: { system ? builtins.currentSystem, ... }:
let let
fix = f: let x = f x; in x; fix = f: let x = f x; in x;
config = depot: { config = depot: {
inherit depot; inherit depot system;
pkgs = depot.third_party.nixpkgs; pkgs = depot.third_party.nixpkgs;
}; };
in fix (self: in fix (self:

View file

@ -2,7 +2,7 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ depot, ... }@ch: { depot, system, ... }@ch:
let let
nixpkgsConfig = { nixpkgsConfig = {
allowUnfree = true; allowUnfree = true;
@ -15,6 +15,7 @@ let
}; };
}; };
nixpkgs = import ./nixpkgs { nixpkgs = import ./nixpkgs {
inherit system;
config = nixpkgsConfig; config = nixpkgsConfig;
}; };
crate2nixSrc = nixpkgs.fetchFromGitHub { crate2nixSrc = nixpkgs.fetchFromGitHub {