about summary refs log tree commit diff
path: root/users/sterni/nix/char
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/nix/char')
-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 e6b8d6d7f168..aacfc9dcbe4d 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"
   '';
 }