Hosts and derivations.
This commit is contained in:
parent
db86fe6244
commit
532a01853b
3 changed files with 27 additions and 7 deletions
|
@ -47,6 +47,7 @@
|
|||
];
|
||||
in
|
||||
{
|
||||
hosts = import ./hosts.nix;
|
||||
pkgs = forAllSystems (localSystem: import nixpkgs {
|
||||
inherit localSystem;
|
||||
config = {
|
||||
|
|
21
hosts.nix
Normal file
21
hosts.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
durincore = {
|
||||
type = "nixos";
|
||||
hostPlatform = "x86_64-linux";
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsUe5YF5z8vGcEYtQX7AAiw2rJygGf2l7xxr8nZZa7w";
|
||||
};
|
||||
gandalf = {
|
||||
type = "nixos";
|
||||
address = "gandalf.jahanson.tech";
|
||||
hostPlatform = "x86_64-linux";
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsUe5YF5z8vGcEYtQX7AAiw2rJygGf2l7xxr8nZZa7w";
|
||||
remoteBuild = true;
|
||||
};
|
||||
este = {
|
||||
type = "nixos";
|
||||
address = "este.jahanson.tech";
|
||||
hostPlatform = "x86_64-linux";
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsUe5YF5z8vGcEYtQX7AAiw2rJygGf2l7xxr8nZZa7w";
|
||||
remoteBuild = true;
|
||||
};
|
||||
}
|
|
@ -6,23 +6,21 @@
|
|||
hostPlatform:
|
||||
|
||||
let
|
||||
inherit (self.pkgs.${hostPlatform}) callPackage lib linkFarm;
|
||||
inherit (self.pkgs."x86_64-linux") callPackage lib linkFarm;
|
||||
|
||||
nixosDrvs = lib.mapAttrs (_: nixos: nixos.config.system.build.toplevel) self.nixosConfigurations;
|
||||
darwinDrvs = lib.mapAttrs (_: darwin: darwin.system) self.darwinConfigurations;
|
||||
hostDrvs = nixosDrvs // darwinDrvs;
|
||||
hostDrvs = lib.mapAttrs (_: nixos: nixos.config.system.build.toplevel) self.nixosConfigurations;
|
||||
|
||||
compatHosts = lib.filterAttrs (_: host: host.hostPlatform == hostPlatform) self.hosts;
|
||||
compatHostDrvs = lib.mapAttrs
|
||||
(name: _: hostDrvs.${name})
|
||||
compatHosts;
|
||||
|
||||
compatHostsFarm = linkFarm "hosts-${hostPlatform}" (lib.mapAttrsToList (name: path: { inherit name path; }) compatHostDrvs);
|
||||
compatHostsFarm = linkFarm "hosts-x86_64-linux" (lib.mapAttrsToList (name: path: { inherit name path; }) compatHostDrvs);
|
||||
in
|
||||
compatHostDrvs
|
||||
// (lib.optionalAttrs (compatHosts != { }) {
|
||||
default = compatHostsFarm;
|
||||
}) // {
|
||||
inherit (nix-fast-build.packages.${hostPlatform}) nix-fast-build;
|
||||
inherit (self.pkgs.${hostPlatform}) cachix nix-eval-jobs;
|
||||
inherit (nix-fast-build.packages."x86_64-linux") nix-fast-build;
|
||||
inherit (self.pkgs."x86_64-linux") cachix nix-eval-jobs;
|
||||
}
|
Reference in a new issue