From a59e95a287bba7ba3bfd70cff0eb7d8864238bdb Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 18 Mar 2025 16:33:48 +0000 Subject: [PATCH] fix(ops/nixos): don't set nixpkgs.pkgs explicitly As soon as you pass in an already-instantiated nixpkgs version, it will cause nixpkgs.hostPlatform etc. to be not applied. This means it's impossible to describe the architecture of a VM closure you're deploying, and have it deviate from the machine you're evaluating from, making it quite hard to deploy that x86_64-linux machine from aarch64-linux (where I'm writing this commit message from). Drop explicitly passing in nixpkgs.path, and set nixpkgs.hostPlatform explicitly for all remaining system configurations in the repository where not already set. Change-Id: Ie2a596e0826da54674b4f02fcd8fed3569fee0a4 Reviewed-on: https://cl.snix.dev/c/snix/+/30104 Autosubmit: Florian Klink Tested-by: besadii Reviewed-by: Ryan Lahfa --- ops/machines/build01/default.nix | 2 ++ ops/machines/meta01/default.nix | 2 ++ ops/machines/public01/default.nix | 2 ++ ops/nixos.nix | 4 +--- users/flokli/nixos/archivist-ec2/configuration.nix | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ops/machines/build01/default.nix b/ops/machines/build01/default.nix index 812135862..a262f31c7 100644 --- a/ops/machines/build01/default.nix +++ b/ops/machines/build01/default.nix @@ -12,6 +12,8 @@ in (depot.third_party.agenix.src + "/modules/age.nix") ]; + nixpkgs.hostPlatform = "x86_64-linux"; + # Machine model taken from project Floral. boot.isContainer = true; diff --git a/ops/machines/meta01/default.nix b/ops/machines/meta01/default.nix index 31ba1a1bc..c449262ad 100644 --- a/ops/machines/meta01/default.nix +++ b/ops/machines/meta01/default.nix @@ -25,6 +25,8 @@ in (depot.third_party.disko.src + "/module.nix") ]; + nixpkgs.hostPlatform = "x86_64-linux"; + infra.hardware.hetzner-cloud = { enable = true; ipv6 = "2a01:4f8:c013:4a58::1/64"; diff --git a/ops/machines/public01/default.nix b/ops/machines/public01/default.nix index 9b7a91612..818eaca4c 100644 --- a/ops/machines/public01/default.nix +++ b/ops/machines/public01/default.nix @@ -27,6 +27,8 @@ in (depot.third_party.disko.src + "/module.nix") ]; + nixpkgs.hostPlatform = "x86_64-linux"; + infra.hardware.hetzner-cloud = { enable = true; ipv6 = "2a01:4f8:c013:3e62::1/64"; diff --git a/ops/nixos.nix b/ops/nixos.nix index b98c32dd8..89c7c1037 100644 --- a/ops/nixos.nix +++ b/ops/nixos.nix @@ -1,12 +1,10 @@ # Helper functions for instantiating depot-compatible NixOS machines. { depot, lib, pkgs, ... }@args: -let inherit (lib) findFirst isAttrs; +let inherit (lib) findFirst; in rec { # This provides our standard set of arguments to all NixOS modules. baseModule = { ... }: { - # Ensure that pkgs == third_party.nix - nixpkgs.pkgs = depot.third_party.nixpkgs; nix.nixPath = let # Due to nixpkgsBisectPath, pkgs.path is not always in the nix store diff --git a/users/flokli/nixos/archivist-ec2/configuration.nix b/users/flokli/nixos/archivist-ec2/configuration.nix index b43cff837..b4d538f4a 100644 --- a/users/flokli/nixos/archivist-ec2/configuration.nix +++ b/users/flokli/nixos/archivist-ec2/configuration.nix @@ -6,6 +6,8 @@ ../profiles/archivist.nix ]; + nixpkgs.hostPlatform = "x86_64-linux"; + systemd.timers.parse-bucket-logs = { wantedBy = [ "multi-user.target" ]; timerConfig.OnCalendar = "*-*-* 03:00:00 UTC";