From f0a7d563a385663513f24aecad92219ecfc83bd8 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sat, 26 Apr 2025 13:13:58 +0200 Subject: vault backup: 2025-04-26 13:13:58 --- A nice way to test flake output.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 A nice way to test flake output.md (limited to 'A nice way to test flake output.md') diff --git a/A nice way to test flake output.md b/A nice way to test flake output.md new file mode 100644 index 0000000..cddf712 --- /dev/null +++ b/A nice way to test flake output.md @@ -0,0 +1,37 @@ +--- +tags: + - nix +--- +Flakes are described in [[Basic building blocks of Nix]]. + +A way to test flake outputs is by loading the flake in nix-repl and then using `:b` which builds a derivation. I learnt about `:b` from [this Nix Pill](https://nixos.org/guides/nix-pills/06-our-first-derivation.html). + +``` +box main 7s +❯ nix repl +Nix 2.24.14 +Type :? for help. +nix-repl> :lf . +Added 13 variables. + +nix-repl> outputs.packages.x86_64-linux.default +«derivation /nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv» + +nix-repl> :b outputs.packages.x86_64-linux.default +error: builder for '/nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv' failed with exit code 1; + last 9 log lines: + > Running phase: unpackPhase + > unpacking source archive /nix/store/gli7ljgsva1wchy3h4n2lmvs1rfssl40-source + > source root is source + > Running phase: patchPhase + > Running phase: updateAutotoolsGnuConfigScriptsPhase + > Running phase: configurePhase + > no configure script, doing nothing + > Running phase: buildPhase + > failed to initialize build cache at /homeless-shelter/.cache/go-build: mkdir /homeless-shelter: permission denied + For full logs, run 'nix log /nix/store/g8y3gdd2rr2j5awx8p75ih0k072571yr-box.drv'. +[0 built (1 failed)] +nix-repl> + +``` + -- cgit v1.2.3