pass system

This commit is contained in:
Kiara Grouwstra 2025-08-26 17:15:23 +02:00
parent 0536f3662b
commit 91004e014e
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
3 changed files with 14 additions and 5 deletions

View file

@ -1,5 +1,6 @@
{ {
config, config,
system,
inputs ? (import ../../../default.nix { }).inputs, inputs ? (import ../../../default.nix { }).inputs,
sources ? import ../../../npins, sources ? import ../../../npins,
... ...
@ -7,7 +8,8 @@
let let
inherit (sources) nixpkgs; inherit (sources) nixpkgs;
lib = import "${nixpkgs}/lib"; pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
deployment-config = config; deployment-config = config;
inherit (lib) mkOption types; inherit (lib) mkOption types;
eval = eval =
@ -81,7 +83,7 @@ let
}; };
}; };
applications.hello = applications.hello =
{ pkgs, ... }: { ... }:
{ {
description = ''Command-line tool that will print "Hello, world!" on the terminal''; description = ''Command-line tool that will print "Hello, world!" on the terminal'';
module = module =
@ -107,7 +109,7 @@ let
key-file = null; key-file = null;
}; };
nixos-configuration = nixos-configuration =
{ pkgs, ... }: { ... }:
{ {
imports = [ imports = [
./options.nix ./options.nix

View file

@ -1,6 +1,7 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: }:
let let
@ -48,6 +49,7 @@ in
}; };
inherit inherit
((import ./deployment.nix { ((import ./deployment.nix {
inherit (pkgs) system;
config = deployment-config; config = deployment-config;
}).ssh-host.ssh }).ssh-host.ssh
) )
@ -66,9 +68,14 @@ in
# INSTANTIATE # INSTANTIATE
command=(nix-instantiate --show-trace --expr ' command=(nix-instantiate --show-trace --expr '
let
system = "${pkgs.system}"; # FIXME: what system are we deploying to?
in
import ${pathToRoot}/deployment/nixos.nix { import ${pathToRoot}/deployment/nixos.nix {
inherit system;
configuration = ( configuration = (
import ${pathToRoot}/deployment/check/data-model/deployment.nix { import ${pathToRoot}/deployment/check/data-model/deployment.nix {
inherit system;
config = builtins.fromJSON "${escapedJson deployment-config}"; config = builtins.fromJSON "${escapedJson deployment-config}";
} }
).ssh-host.nixos-configuration; ).ssh-host.nixos-configuration;

View file

@ -1,9 +1,9 @@
{ {
configuration, configuration,
system ? builtins.currentSystem, system,
sources ? import ../npins,
}: }:
let let
sources = import ../npins;
eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" { eval = import "${sources.nixpkgs}/nixos/lib/eval-config.nix" {
inherit system; inherit system;
specialArgs = { specialArgs = {