From 5355e5737890558a3e2e87f5b1e24adb17b89e46 Mon Sep 17 00:00:00 2001 From: lois <lois@procolix.eu> Date: Wed, 12 Mar 2025 16:39:30 +0100 Subject: [PATCH] WIP: change env to environment --- infra/flake-part.nix | 30 +++++++++++++++------------- infra/machines/fedi201/default.nix | 5 +++-- infra/machines/fedi201/fedipanel.nix | 9 +++++---- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/infra/flake-part.nix b/infra/flake-part.nix index f90bd2f..0636c69 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -141,20 +141,22 @@ in ## - Each normal machine gets a deployment. ## - We add a “default” deployment with all normal machines. ## - We add a “test” deployment with all test machines. - nixops4Deployments = genAttrs machines makeDeployment' // { - default = makeDeployment machines; - test = makeTestDeployment ( - fromJSON ( - let - env = builtins.getEnv "DEPLOYMENT"; - in - if env != "" then - env - else - builtins.trace "env var DEPLOYMENT not set, falling back to ./test-machines/configuration.json!" (readFile ./test-machines/configuration.json) - ) - ); - }; + nixops4Deployments = + builtins.trace (builtins.attrNames inputs) genAttrs machines makeDeployment' + // { + default = makeDeployment machines; + test = makeTestDeployment ( + fromJSON ( + let + env = builtins.getEnv "DEPLOYMENT"; + in + if env != "" then + env + else + builtins.trace "env var DEPLOYMENT not set, falling back to ./test-machines/configuration.json!" (readFile ./test-machines/configuration.json) + ) + ); + }; flake.nixosConfigurations = genAttrs machines (makeConfiguration false) // genAttrs testMachines (makeConfiguration true); diff --git a/infra/machines/fedi201/default.nix b/infra/machines/fedi201/default.nix index 239c85c..28397a8 100644 --- a/infra/machines/fedi201/default.nix +++ b/infra/machines/fedi201/default.nix @@ -3,8 +3,9 @@ config, pkgs, ... -}@args: -builtins.trace args { +}: +# builtins.trace args.pkgs +{ fediversityVm = { vmId = 201; proxmox = "fediversity"; diff --git a/infra/machines/fedi201/fedipanel.nix b/infra/machines/fedi201/fedipanel.nix index 2b34114..154bd6e 100644 --- a/infra/machines/fedi201/fedipanel.nix +++ b/infra/machines/fedi201/fedipanel.nix @@ -1,13 +1,14 @@ { inputs, config, - pkgs, + # pkgs, ... }: let name = "panel"; panel = (import ../../../panel/default.nix { }).package; in +# builtins.trace args.pkgs { imports = [ ../../../panel/nix/configuration.nix @@ -43,8 +44,8 @@ in STATIC_ROOT = "/var/lib/${name}/static"; }; }; - systemd.services.${name}.env = { - REPO_DIR = builtins.trace inputs inputs; - NIX_DIR = pkgs.nix; + systemd.services.${name}.environment = { + REPO_DIR = inputs; + # NIX_DIR = pkgs.nix; }; }