From 072654abd6547f0489776d710cef805576dc6c15 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sun, 6 Jul 2025 16:43:38 +0200 Subject: [PATCH] Templates: fix invalid mock flake --- pkgs/clan-cli/clan_lib/flake/flake.py | 9 ++++++--- templates/flake.nix | 10 ++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/clan-cli/clan_lib/flake/flake.py b/pkgs/clan-cli/clan_lib/flake/flake.py index e4beaf2c2..4aed6e820 100644 --- a/pkgs/clan-cli/clan_lib/flake/flake.py +++ b/pkgs/clan-cli/clan_lib/flake/flake.py @@ -832,7 +832,8 @@ nix repl --expr 'rec {{ """) # fmt: on elif len(selectors) == 1: - log.debug(f""" + log.debug( + f""" selecting: {selectors[0]} to debug run: nix repl --expr 'rec {{ @@ -840,11 +841,13 @@ nix repl --expr 'rec {{ selectLib = (builtins.getFlake "path:{select_source()}?narHash={select_hash}").lib; query = selectLib.select '"''{selectors[0]}''"' flake; }}' - """) + """ + ) build_output = Path( run( - nix_build(["--expr", nix_code, *nix_options]), RunOpts(log=Log.NONE, trace=False), + nix_build(["--expr", nix_code, *nix_options]), + RunOpts(log=Log.NONE, trace=False), ).stdout.strip() ) diff --git a/templates/flake.nix b/templates/flake.nix index e349af18b..c7e76fb92 100644 --- a/templates/flake.nix +++ b/templates/flake.nix @@ -1,8 +1,8 @@ { outputs = { ... }: - { - clan.templates = { + let + templates = { disko = { single-disk = { description = "A simple ext4 disk with a single partition"; @@ -41,5 +41,11 @@ }; }; }; + in + rec { + inherit (clan) clanInternals; + + clan.clanInternals.templates = templates; + clan.templates = templates; }; }