From 07e260db586a5c3497c47b6b8c5b4ac2c832df6f Mon Sep 17 00:00:00 2001 From: Michal Atlas Date: Thu, 26 Oct 2023 13:19:15 +0200 Subject: [PATCH] Truth: Base --- index.html | 3 +++ the-truth/.envrc | 1 + the-truth/flake.lock | 26 +++++++++++++++++++++++++ the-truth/flake.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 the-truth/.envrc create mode 100644 the-truth/flake.lock create mode 100644 the-truth/flake.nix diff --git a/index.html b/index.html index de8729c..2b663fa 100644 --- a/index.html +++ b/index.html @@ -799,6 +799,9 @@

Lock file

+
+
Where do I output the build?



diff --git a/the-truth/.envrc b/the-truth/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/the-truth/.envrc @@ -0,0 +1 @@ +use flake diff --git a/the-truth/flake.lock b/the-truth/flake.lock new file mode 100644 index 0000000..5bad0f2 --- /dev/null +++ b/the-truth/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", + "owner": "NixOs", + "repo": "nixpkgs", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", + "type": "github" + }, + "original": { + "owner": "NixOs", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/the-truth/flake.nix b/the-truth/flake.nix new file mode 100644 index 0000000..7239139 --- /dev/null +++ b/the-truth/flake.nix @@ -0,0 +1,46 @@ +{ + inputs.nixpkgs.url = "github:NixOs/nixpkgs"; + + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + packages.${system} = { + isolation = builtins.derivation { + name = "isolation"; + builder = "${pkgs.bash}/bin/bash"; + args = [ + (builtins.toFile "builder.sh" '' + set -euox pipefail; + mkdir "$out"; + env > "$out/env"; + ls /nix/store > "$out/visible-store"; + '') + ]; + PATH = "${pkgs.coreutils}/bin"; + inherit system; + }; + unworth = builtins.derivation { + name = "unworth"; + builder = "${pkgs.bash}/bin/bash"; + args = [ + (builtins.toFile "builder.sh" '' + exit 1 + '') + ]; + inherit system; + }; + sloth = builtins.derivation { + name = "sloth"; + builder = "${pkgs.bash}/bin/bash"; + args = [ + (builtins.toFile "builder.sh" '' + exit 0 + '') + ]; + inherit system; + }; + }; + }; +}