-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
42 lines (41 loc) · 1.22 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
description = "GCC Explorer";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
gcc-explorer = pkgs.callPackage ./nix-support/source.nix {};
run-local = pkgs.writeScriptBin "run-gcc-explorer" ''
#!${pkgs.stdenv.shell}
${pkgs.static-web-server}/bin/static-web-server \
--port=80 \
--root=${gcc-explorer}
'';
in {
apps = {
default = {
type = "app";
program = "${run-local}/bin/run-gcc-explorer";
};
};
packages = {
docker-image = pkgs.dockerTools.buildImage {
name = "jarkinstall/gcc-explorer";
tag = pkgs.stdenv.system;
config = {
Cmd = [ "${run-local}/bin/run-gcc-explorer" ];
ExposedPorts = {
"80/tcp" = {};
};
};
};
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ static-web-server ];
};
});
}