1
0
Fork 0
VaultUI/flake.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2022-02-10 14:28:30 +00:00
{
description = "A comfy UI for Hashicorp Vault.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, ... }:
{
overlay = final: prev:
let
system = final.system;
nodePackages = (final.callPackage ./node_nix/default.nix {
pkgs = prev;
system = final.system;
}) // {
node-sass = nodePackages.node-sass.override {
buildInputs = [ final.pkgconfig final.libsass ];
};
};
nodeDependencies = nodePackages.shell.nodeDependencies;
in {
vaultui = final.stdenv.mkDerivation rec {
pname = "vaultui";
version = "latest";
src = ./.;
nativeBuildInputs = with final; [ git ];
buildPhase = ''
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
export PATH="${nodeDependencies}/bin:$PATH"
webpack
'';
installPhase = ''
cp -r dist $out/
'';
};
};
} // utils.lib.eachSystem (utils.lib.defaultSystems) (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in {
defaultPackage = self.packages."${system}".vaultui;
packages.vaultui = pkgs.vaultui;
devShell =
pkgs.mkShell { inputsFrom = [ self.packages.${system}.vaultui ]; };
lib = pkgs.vaultui.lib;
});
}