From c894de7e6c1330c2367b142f4d32d8400ed3cb26 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 19 Sep 2017 16:37:49 +0300 Subject: cli: use GCC explicitly `runCommand` does not include C compiler, `runCommandCC` does, but we want GCC, so make sure we use it. --- modules/apps/cli.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/apps/cli.nix b/modules/apps/cli.nix index 6db92e3..fa16b8a 100644 --- a/modules/apps/cli.nix +++ b/modules/apps/cli.nix @@ -2,8 +2,6 @@ let - inherit (builtins) - toString ; inherit (lib) concatMapStrings filterAttrs mapAttrs mapAttrsToList mkOption unique ; inherit (lib.types) @@ -14,13 +12,14 @@ let exec = name: { user, command, ... }: let + cc = "${pkgs.gcc}/bin/gcc -Wall -Wextra -Werror -s -std=gnu99 -O2"; uid = toString config.users.users.${user}.uid; gid = uid; src = pkgs.writeText "${name}.c" '' #include #include #include - #include + #include #include #include @@ -84,7 +83,7 @@ let return EXIT_FAILURE; } ''; - in pkgs.runCommand name {} "gcc -Wall -Wextra -Werror -s -std=gnu99 -O2 ${src} -o $out"; + in pkgs.runCommand name {} "${cc} -o $out ${src}"; cliapp = submodule({name, ...}: { -- cgit v1.2.3