nix: allow to pass the system attribute
This allows to build ormolu for another system as the machine's,
combined with Nix remote builders. It is also useful in a context of a
pure evaluation (like Flakes).
commit0b92af2a7f9db48102c2cb2d7248e0795ab0bf66
authorzimbatm <zimbatm@zimbatm.com>
dateFri 21 Aug 2020, 14:45 (6 years ago)
parentd8c3e55
default.nix+2−1
@@ -1,4 +1,5 @@
1−{ pkgs ? (import ./nix/nixpkgs)
1+{ pkgs ? (import ./nix/nixpkgs { inherit system; })
2+, system ? builtins.currentSystem
23, ormoluCompiler ? "ghc883" # the shell doesn't work with ghc8101 yet
34}:
45
nix/nixpkgs/default.nix+5−1
@@ -1,3 +1,4 @@
1+{ system ? builtins.currentSystem }:
12let
23 rev = "807ca93fadd5197c2260490de0c76e500562dc05";
34 sha256 = "10yq8bnls77fh3pk5chkkb1sv5lbdgyk1rr2v9xn71rr1k2x563p";
@@ -5,5 +6,8 @@ let
56 url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
67 inherit sha256;
78 };
8− pkgs = import nixpkgs { config.allowUnfree = true; };
9+ pkgs = import nixpkgs {
10+ inherit system;
11+ config.allowUnfree = true;
12+ };
913in pkgs
shell.nix+3−1
@@ -1,3 +1,5 @@
1−{ pkgs ? (import ./nix/nixpkgs) }:
1+{ pkgs ? (import ./nix/nixpkgs { inherit system; })
2+, system ? builtins.currentSystem
3+}:
24
35(import ./default.nix { inherit pkgs; }).dev.ormoluShell