From bf9b5aef4a3dcc431e712f6f881d01e83ac25512 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Tue, 24 Feb 2026 20:30:56 +0100 Subject: [PATCH] mod: add example on how to import only contracts --- demo/minimal/flake.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/demo/minimal/flake.nix b/demo/minimal/flake.nix index 3eff276..66e60bf 100644 --- a/demo/minimal/flake.nix +++ b/demo/minimal/flake.nix @@ -181,6 +181,40 @@ ) ]; }; + + # Test with: + # nix build .#nixosConfigurations.contractsDirect.config.system.build.toplevel + contractsDirect = + let + nixosSystem' = import "${selfhostblocks.inputs.nixpkgs}/nixos/lib/eval-config.nix"; + in + nixosSystem' { + inherit system; + modules = [ + filesystemModule + (import "${selfhostblocks}/lib/module.nix") + ( + { + config, + lib, + shb, + ... + }: + { + options.myOption = lib.mkOption { + # Using provided nixosSystem directly. + # SHB's lib is available under `shb` thanks to the overlay. + type = shb.secretFileType; + }; + config = { + myOption.source = "/a/path"; + # Use the option. + environment.etc.myOption.text = config.myOption.source; + }; + } + ) + ]; + }; }; }; }