aboutsummaryrefslogtreecommitdiff
path: root/modules/apps
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-09-19 16:37:49 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-09-19 16:37:49 +0300
commitc894de7e6c1330c2367b142f4d32d8400ed3cb26 (patch)
tree72dd96f0b47568330cf1bbb9171ca9fc7699e343 /modules/apps
parent85c5f176c6a8c3a1ea097f4c4f8a454507691395 (diff)
downloadnixsap-c894de7e6c1330c2367b142f4d32d8400ed3cb26.tar.gz
cli: use GCC explicitly
`runCommand` does not include C compiler, `runCommandCC` does, but we want GCC, so make sure we use it.
Diffstat (limited to 'modules/apps')
-rw-r--r--modules/apps/cli.nix7
1 files 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 <unistd.h>
#include <grp.h>
#include <pwd.h>
- #include <stdio.h>
+ #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -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, ...}:
{