From 61cc348281f54bbd70432a67c3075e26eb7b1d9e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 15 Jun 2019 14:32:59 +0200 Subject: [PATCH] Pass system through project nix files --- default.nix | 2 +- nix/default.nix | 12 +++++++++--- shell.nix | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 2570b9f..7f48895 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -args@{ pkgs ? import ./nix args, ... }: +args@{ pkgs ? import ./nix args, system ? null, ... }: { inherit (pkgs) arion tests; diff --git a/nix/default.nix b/nix/default.nix index 4c25cf1..c3fd071 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,8 +1,12 @@ /** * This is the entry-point for all nix execution in this project. */ -{ nixpkgsSrc ? ./nixpkgs.nix, ... }: -import (import ./nixpkgs.nix) { +{ nixpkgsSrc ? ./nixpkgs.nix +, system ? null +, ... +}: + +import (import ./nixpkgs.nix) ({ # Makes the config pure as well. See /top-level/impure.nix: config = { }; @@ -10,4 +14,6 @@ import (import ./nixpkgs.nix) { # all the packages are defined there: (import ./overlay.nix) ]; -} +} // (if system == null then {} else { + inherit system; +})) diff --git a/shell.nix b/shell.nix index 14e3ffe..f6c0ea0 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1 @@ -(import ./nix {}).arion-project.shell +args@{...}: (import ./nix args).arion-project.shell