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 <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <masterancpp@gmail.com>
This commit is contained in:
Florian Klink 2025-03-18 16:33:48 +00:00 committed by clbot
parent 2bdb497c85
commit a59e95a287
5 changed files with 9 additions and 3 deletions

View file

@ -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