diff --git a/flake.nix b/flake.nix index 0f06a11c..c78e8ca2 100644 --- a/flake.nix +++ b/flake.nix @@ -12,56 +12,45 @@ nix-filter.url = "github:numtide/nix-filter"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = inputs: let - nix-filter = import inputs.nix-filter; - pkgs = common: packages: builtins.map (element: common.pkgs.${element}) packages; - in - inputs.nci.lib.makeOutputs { + outputs = inputs: + let + name = "hvm"; + nix-filter = import inputs.nix-filter; + pkgs = common: packages: + builtins.map (element: common.pkgs.${element}) packages; + in inputs.nci.lib.makeOutputs { config = common: { - cCompiler = { - enable = true; - package = common.pkgs.clang; - }; + cCompiler = { package = common.pkgs.clang; }; outputs = { defaults = { - app = "hvm"; - package = "hvm"; + app = name; + package = name; }; }; - runtimeLibs = pkgs common ["openssl"]; - shell = {commands = builtins.map (element: {package = common.pkgs.${element};}) ["ghc" "nodejs"];}; + runtimeLibs = pkgs common [ "openssl" ]; + shell = { + commands = + builtins.map (element: { package = common.pkgs.${element}; }) [ + "ghc" + "nodejs" + ]; + }; }; - pkgConfig = common: let - buildInputs = common.libs.getLibs ["openssl" "pkg-config"]; - in { - hvm = { - app = true; - build = true; - overrides = { - inherit buildInputs; - meta = with common.pkgs.lib; { - description = "A massively parallel functional runtime."; - homepage = "https://github.com/HigherOrderCO/HVM"; - license = licenses.mit; - }; - }; - depsOverrides = {inherit buildInputs;}; - profiles = { - dev = false; - dev_fast = false; - release = false; + pkgConfig = common: + let + override = { buildInputs = pkgs common [ "openssl" "pkg-config" ]; }; + in { + ${name} = { + app = true; + build = true; + depsOverrides = { inherit override; }; + overrides = { inherit override; }; + profiles = { release = false; }; }; }; - }; - # Only include directories necessary for building the project, to make the derivation smaller. root = nix-filter { root = ./.; - include = [ - ./src - ./Cargo.lock - ./Cargo.toml - ./rust-toolchain.toml - ]; + include = [ "src" "Cargo.lock" "Cargo.toml" "rust-toolchain.toml" ]; }; }; }