aux-search/flake.nix
Yannik Sander 29651d086b
Fix/devshell (#390)
* Fix flake-info attribute name in devShell definition

* Export rust stdlib path though shell hook

* Format flake.nix
2021-12-15 02:38:06 +01:00

45 lines
1.2 KiB
Nix

{
description = "Code behind search.nixos.org";
inputs = {
nixpkgs = { url = "nixpkgs/nixos-unstable"; };
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
mkPackage = path: system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ ];
};
in
import path { inherit pkgs; };
packages = system:
{
flake-info = mkPackage ./flake-info system;
frontend = mkPackage ./. system;
};
devShell = system:
let
packages_inst = (packages system);
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.mkShell {
inputsFrom = builtins.attrValues packages_inst;
shellHook = ''
export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}";
export NIXPKGS_PANDOC_FILTERS_PATH="${packages_inst.flake-info.NIXPKGS_PANDOC_FILTERS_PATH}";
'';
};
in
{
defaultPackage = forAllSystems (mkPackage ./.);
packages = forAllSystems packages;
devShell = forAllSystems devShell;
};
}