about summary refs log tree commit diff
path: root/users/sterni/nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-08-30T15·26+0200
committersterni <sternenseemann@systemli.org>2021-08-30T17·06+0000
commit83c8716afd872180fb59abac70ad74412ac04d77 (patch)
treeb94340f7f9eadad84cffa0c99ec55d0247cfcc46 /users/sterni/nix
parentd67b9e319263b012d8e7fe3ceceab88848c073d6 (diff)
chore(3p): update NixOS channels to 2021-08-30 r/2801
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 <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/sterni/nix')
-rw-r--r--users/sterni/nix/char/default.nix19
1 files changed, 12 insertions, 7 deletions
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 <stdio.h>
-
-    int main(void) {
-      for(int i = 1; i <= 0xff; i++) {
-        putchar(i);
+  __generateAllChars = pkgs.runCommandCC "generate-all-chars" {
+    source = ''
+      #include <stdio.h>
+
+      int main(void) {
+        for(int i = 1; i <= 0xff; i++) {
+          putchar(i);
+        }
       }
-    }
+    '';
+    passAsFile = [ "source" ];
+  } ''
+    $CC -o "$out" -x c "$sourcePath"
   '';
 }