Use system architecture reported by nixos-facter

This commit is contained in:
Pim Kunis 2024-11-04 22:44:26 +01:00
parent 2a63bee83b
commit 6b80438243
9 changed files with 4 additions and 18 deletions

View file

@ -15,11 +15,12 @@ in {
nodes = mkDeployNodes (name: machine: let nodes = mkDeployNodes (name: machine: let
nixosConfiguration = self.nixosConfigurations.${name}; nixosConfiguration = self.nixosConfigurations.${name};
machineArch = nixosConfiguration.config.facter.report.system;
in { in {
hostname = nixosConfiguration.config.networking.fqdn; hostname = nixosConfiguration.config.networking.fqdn;
profiles.system = { profiles.system = {
remoteBuild = machine.arch != deployArch; remoteBuild = machineArch != deployArch;
path = deploy-rs.lib.${machine.arch}.activate.nixos nixosConfiguration; path = deploy-rs.lib.${machineArch}.activate.nixos nixosConfiguration;
}; };
}); });
}; };

View file

@ -1,6 +1,5 @@
{ {
machines.atlas = { machines.atlas = {
arch = "x86_64-linux";
kubernetesNodeLabels.storageType = "slow"; kubernetesNodeLabels.storageType = "slow";
facterReportPath = ./facter.json; facterReportPath = ./facter.json;

View file

@ -9,14 +9,6 @@ flake-utils.lib.eachDefaultSystem (system: let
machineOpts = {config, ...}: { machineOpts = {config, ...}: {
options = { options = {
arch = lib.mkOption {
default = null;
type = with lib.types; nullOr str;
description = ''
CPU architecture of this machine.
'';
};
facterReportPath = lib.mkOption { facterReportPath = lib.mkOption {
default = null; default = null;
type = with lib.types; nullOr path; type = with lib.types; nullOr path;

View file

@ -1,6 +1,5 @@
{ {
machines.jefke = { machines.jefke = {
arch = "x86_64-linux";
kubernetesNodeLabels.storageType = "fast"; kubernetesNodeLabels.storageType = "fast";
facterReportPath = ./facter.json; facterReportPath = ./facter.json;

View file

@ -1,6 +1,5 @@
{ {
machines.lewis = { machines.lewis = {
arch = "x86_64-linux";
kubernetesNodeLabels = { kubernetesNodeLabels = {
storageType = "fast"; storageType = "fast";
hasMedia = "true"; hasMedia = "true";

View file

@ -1,7 +1,5 @@
{ {
machines.talos = { machines.talos = {
arch = "x86_64-linux";
nixosModule = {lib, ...}: { nixosModule = {lib, ...}: {
lab.storage.profile = "normal"; lab.storage.profile = "normal";

View file

@ -1,6 +1,5 @@
{ {
machines.warwick = { machines.warwick = {
arch = "aarch64-linux";
facterReportPath = ./facter.json; facterReportPath = ./facter.json;
nixosModule = {inputs, ...}: { nixosModule = {inputs, ...}: {

View file

@ -29,7 +29,7 @@
overlays = [ overlays = [
(final: _prev: { (final: _prev: {
unstable = import inputs.nixpkgs-unstable { unstable = import inputs.nixpkgs-unstable {
system = machine.arch; system = config.nixpkgs.hostPlatform.system;
}; };
}) })
]; ];

View file

@ -1,5 +1,4 @@
{ {
self,
inputs, inputs,
pkgs, pkgs,
lib, lib,