git.delta.rocks / fleet / refs/commits / 6a5196a1ce6c

difftreelog

feat crosscompilation support

Yaroslav Bolyukin2021-12-20parent: #41ecf40.patch.diff

2 files changed

modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -7,7 +7,7 @@
     flake-utils.url = "github:numtide/flake-utils";
   };
   outputs = { self, rust-overlay, flake-utils, nixpkgs }: with nixpkgs.lib; rec {
-    lib = import ./lib;
+    lib = import ./lib { inherit flake-utils; };
   } // flake-utils.lib.eachDefaultSystem (system:
     let
       pkgs = import nixpkgs
modifiedlib/default.nixdiffbeforeafterboth
after · lib/default.nix
1{ flake-utils }: {2  fleetConfiguration = { data, nixpkgs, hosts, ... }@allConfig:3    let4      config = builtins.removeAttrs allConfig [ "nixpkgs" "data" ];5    in6    flake-utils.lib.eachDefaultSystem (system: rec {7      root = nixpkgs.lib.evalModules {8        modules = (import ../modules/fleet/_modules.nix) ++ [ config data ];9        specialArgs = {10          inherit nixpkgs;11          fleet = import ./fleetLib.nix {12            inherit nixpkgs hosts;13          };14        };15      };16      configuredHosts = root.config.hosts;17      configuredSecrets = root.config.secrets;18      configuredSystems = nixpkgs.lib.listToAttrs (19        map20          (21            name: {22              inherit name;23              value = nixpkgs.lib.nixosSystem {24                system = configuredHosts.${name}.system;25                modules = configuredHosts.${name}.modules ++ (26                  if configuredHosts.${name}.system == "aarch64-linux" then [ (nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix") ]27                  else [ ]28                ) ++ [29                  ({ ... }: {30                    nixpkgs.localSystem.system = system;31                    nixpkgs.crossSystem = if system == configuredHosts.${name}.system then null else {32                      system = configuredHosts.${name}.system;33                    };34                  })35                ];36              };37            }38          )39          (builtins.attrNames root.config.hosts)40      ); #nixpkgs.lib.nixosSystem {}41    });42}