From 78c96317b03e7ed0f3a74afb0229ff42ca771319 Mon Sep 17 00:00:00 2001 From: Jake Waksbaum Date: Mon, 24 Aug 2020 00:35:14 -0400 Subject: [PATCH] Move with-cross.nix functionaity into flake.nix --- flake.nix | 11 +++++++++-- with-cross.nix | 11 ----------- 2 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 with-cross.nix diff --git a/flake.nix b/flake.nix index 8f09639..b19f344 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ } // flake-utils.lib.eachDefaultSystem ( system: let + inherit (nixpkgs) lib; darwin_network_cmds_openssl_overlay = final: prev: { darwin = prev.darwin // { network_cmds = prev.darwin.network_cmds.override { openssl_1_0_2 = prev.openssl; }; @@ -39,13 +40,19 @@ defaultPackage = packages.sdImage; - nixosConfigurations = nixpkgs.lib.nixosSystem { + nixosConfigurations = lib.nixosSystem { system = "aarch64-linux"; # Pass nixpkgs as an argument to each module so that modules from nixpkgs can be imported purely specialArgs = { inherit nixpkgs; }; modules = [ { nixpkgs.config.allowUnfree = true; } - (if system == "aarch64-linux" then "${self}/configuration.nix" else "${self}/with-cross.nix") + "${self}/configuration.nix" + ( + lib.optionalAttrs (system != "aarch64-linux") { + imports = [ "${self}/cross-hacks.nix" ]; + nixpkgs.crossSystem.system = "aarch64-linux"; + } + ) ]; }; diff --git a/with-cross.nix b/with-cross.nix deleted file mode 100644 index d0e44a3..0000000 --- a/with-cross.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - imports = [ - ./cross-hacks.nix - ./configuration.nix - ]; - - nixpkgs.crossSystem = { - system = "aarch64-linux"; - }; -}