From 83c8716afd872180fb59abac70ad74412ac04d77 Mon Sep 17 00:00:00 2001 From: sterni Date: Mon, 30 Aug 2021 17:26:06 +0200 Subject: chore(3p): update NixOS channels to 2021-08-30 This lets us benefit from the recent OpenSSL security-related update [1]. Since nixos-unstable is still stuck, we temporarily use nixos-unstable-small as our unstable channel. Fixes necessary: * //users/sterni/nix/char: Someone has decided to drop writers.writeC upstream [2], so we reimplement it ad-hoc using runCommandCC [1]: https://www.openssl.org/news/secadv/20210824.txt [2]: https://github.com/nixos/nixpkgs/commit/982f46985e37a6488d8e904b46e0cba2060adc71 Change-Id: Id84756e2e370296b7a27e1a3f1744f58f8fe3c47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3463 Reviewed-by: sterni Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/sterni/nix/char/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'users/sterni/nix') diff --git a/users/sterni/nix/char/default.nix b/users/sterni/nix/char/default.nix index e6b8d6d7f1..aacfc9dcbe 100644 --- a/users/sterni/nix/char/default.nix +++ b/users/sterni/nix/char/default.nix @@ -78,13 +78,18 @@ in { # originally I generated a nix file containing a list of # characters, but infinisil uses a better way which I adapt # which is using builtins.readFile instead of import. - __generateAllChars = pkgs.writers.writeC "generate-all-chars" {} '' - #include - - int main(void) { - for(int i = 1; i <= 0xff; i++) { - putchar(i); + __generateAllChars = pkgs.runCommandCC "generate-all-chars" { + source = '' + #include + + int main(void) { + for(int i = 1; i <= 0xff; i++) { + putchar(i); + } } - } + ''; + passAsFile = [ "source" ]; + } '' + $CC -o "$out" -x c "$sourcePath" ''; } -- cgit 1.4.1