From 532a01853b0ae3f83d0ef925f828eb67626c5c55 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Fri, 23 Feb 2024 15:54:03 -0600 Subject: [PATCH] Hosts and derivations. --- flake.nix | 1 + hosts.nix | 21 +++++++++++++++++++++ packages/default.nix | 12 +++++------- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 hosts.nix diff --git a/flake.nix b/flake.nix index f74eb44..2332518 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ ]; in { + hosts = import ./hosts.nix; pkgs = forAllSystems (localSystem: import nixpkgs { inherit localSystem; config = { diff --git a/hosts.nix b/hosts.nix new file mode 100644 index 0000000..5248598 --- /dev/null +++ b/hosts.nix @@ -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; + }; +} \ No newline at end of file diff --git a/packages/default.nix b/packages/default.nix index fb20f68..4e03594 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -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; } \ No newline at end of file