2021-09-10 00:42:56 +03:00
|
|
|
{
|
|
|
|
description = "dream2nix: A generic framework for 2nix tools";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
2021-09-14 05:00:29 +03:00
|
|
|
npmlock2nix = { url = "github:nix-community/npmlock2nix"; flake = false; };
|
2021-09-10 00:42:56 +03:00
|
|
|
};
|
|
|
|
|
2021-09-14 05:00:29 +03:00
|
|
|
outputs = { self, nixpkgs, npmlock2nix }:
|
2021-09-10 00:42:56 +03:00
|
|
|
let
|
|
|
|
|
2021-09-14 05:00:29 +03:00
|
|
|
lib = nixpkgs.lib;
|
2021-09-10 00:42:56 +03:00
|
|
|
|
|
|
|
supportedSystems = [ "x86_64-linux" ];
|
|
|
|
|
|
|
|
forAllSystems = f: lib.genAttrs supportedSystems (system: f system);
|
|
|
|
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
});
|
|
|
|
|
2021-09-14 05:00:29 +03:00
|
|
|
dream2nixFor = forAllSystems (system: import ./src rec {
|
|
|
|
pkgs = nixpkgsFor."${system}";
|
2021-09-17 15:12:07 +03:00
|
|
|
inherit lib;
|
2021-09-14 05:00:29 +03:00
|
|
|
externalSources = pkgs.runCommand "dream2nix-imported" {} ''
|
|
|
|
mkdir -p $out/npmlock2nix
|
|
|
|
cp ${npmlock2nix}/{internal.nix,LICENSE} $out/npmlock2nix/
|
|
|
|
'';
|
|
|
|
});
|
2021-09-10 00:42:56 +03:00
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
overlay = curr: prev: {};
|
|
|
|
|
2021-09-16 17:05:31 +03:00
|
|
|
lib.dream2nix = dream2nixFor;
|
|
|
|
|
2021-09-13 20:08:28 +03:00
|
|
|
defaultApp = forAllSystems (system: self.apps."${system}".cli);
|
|
|
|
|
2021-09-10 00:42:56 +03:00
|
|
|
apps = forAllSystems (system: {
|
2021-09-13 20:08:28 +03:00
|
|
|
cli = {
|
2021-09-10 00:42:56 +03:00
|
|
|
"type" = "app";
|
2021-09-13 20:08:28 +03:00
|
|
|
"program" = builtins.toString (dream2nixFor."${system}".apps.cli);
|
2021-09-10 00:42:56 +03:00
|
|
|
};
|
|
|
|
install = {
|
|
|
|
"type" = "app";
|
|
|
|
"program" = builtins.toString (dream2nixFor."${system}".apps.install);
|
|
|
|
};
|
|
|
|
});
|
2021-09-16 17:05:31 +03:00
|
|
|
|
|
|
|
devShell = forAllSystems (system: nixpkgsFor."${system}".mkShell {
|
2021-09-17 12:46:03 +03:00
|
|
|
buildInputs = with nixpkgsFor."${system}"; [
|
|
|
|
nixUnstable
|
|
|
|
];
|
2021-09-16 17:05:31 +03:00
|
|
|
shellHook = ''
|
|
|
|
export NIX_PATH=nixpkgs=${nixpkgs}
|
|
|
|
'';
|
|
|
|
});
|
2021-09-10 00:42:56 +03:00
|
|
|
};
|
|
|
|
}
|