From d67f533948b2d9ae72b7015443332e3ef8700682 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Thu, 19 Jun 2025 08:26:20 +0200 Subject: [PATCH] fix running `nixops4 apply test` (#391) Closes #390 Reviewed-on: https://git.fediversity.eu/Fediversity/Fediversity/pulls/391 Reviewed-by: kiara Grouwstra Co-authored-by: Valentin Gagarin Co-committed-by: Valentin Gagarin --- infra/common/resource.nix | 5 +++-- infra/flake-part.nix | 3 +++ npins/sources.json | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/infra/common/resource.nix b/infra/common/resource.nix index 7e86467c..ebaea6c6 100644 --- a/infra/common/resource.nix +++ b/infra/common/resource.nix @@ -1,4 +1,5 @@ { + inputs, lib, config, ... @@ -9,7 +10,7 @@ let inherit (lib.attrsets) concatMapAttrs optionalAttrs; inherit (lib.strings) removeSuffix; sources = import ../../npins; - inherit (sources) nixpkgs agenix disko; + inherit (sources) agenix disko; secretsPrefix = ../../secrets; secrets = import (secretsPrefix + "/secrets.nix"); @@ -26,7 +27,7 @@ in hostPublicKey = config.fediversityVm.hostPublicKey; }; - inherit nixpkgs; + inherit (inputs) nixpkgs; ## The configuration of the machine. We strive to keep in this file only the ## options that really need to be injected from the resource. Everything else diff --git a/infra/flake-part.nix b/infra/flake-part.nix index b7bd46f4..068bf6a6 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -21,6 +21,9 @@ let makeResourceModule = { vmName, isTestVm }: { + # TODO(@fricklerhandwerk): this is terrible but IMO we should just ditch flake-parts and have our own data model for how the project is organised internally + _module.args = { inherit inputs; }; + imports = [ ./common/resource.nix diff --git a/npins/sources.json b/npins/sources.json index 657e8a3a..a96ffcb2 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -25,6 +25,22 @@ "url": null, "hash": "1w2gsy6qwxa5abkv8clb435237iifndcxq0s79wihqw11a5yb938" }, + "disko": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "disko" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v1.12.0", + "revision": "7121f74b976481bc36877abaf52adab2a178fcbe", + "url": "https://api.github.com/repos/nix-community/disko/tarball/v1.12.0", + "hash": "0wbx518d2x54yn4xh98cgm65wvj0gpy6nia6ra7ns4j63hx14fkq" + }, "flake-inputs": { "type": "GitRelease", "repository": {