Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Mar 12, 2024
1 parent b6dd307 commit 7ddf858
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 51 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@
pkgs.callPackage ./nix/happ.nix {
inherit dnas holochain happManifest;
};
ui-package = { system, workspacePath, rootPath }:
npmPackage = { system, workspacePath, rootPath }:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};
in
pkgs.callPackage ./nix/ui-package.nix {
pkgs.callPackage ./nix/npm-package.nix {
inherit workspacePath rootPath;
};
};
Expand Down
2 changes: 1 addition & 1 deletion nix/fixture/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 52 additions & 48 deletions nix/fixture/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,61 @@
};

outputs = inputs @ { ... }:
inputs.holochain.inputs.flake-parts.lib.mkFlake
{
inherit inputs;
specialArgs = rec {
rootPath = ./.;
holochainSources = inputs': with inputs'; [
profiles
# ... and add the name of the repository here as well
let
holochainSources = inputs': with inputs'; [
profiles
# ... and add the name of the repository here as well
];

# Aggregators: take all the packages from this repository and the upstream
# holochain sources and merge them
allHolochainPackages = { inputs', self' }: inputs.nixpkgs.lib.attrsets.mergeAttrsList (
[ self'.packages ]
++ builtins.map (s: s.packages) (holochainSources inputs')
);
allZomes = { inputs', self' }: inputs.hcUtils.outputs.lib.filterZomes (allHolochainPackages { inherit inputs' self'; });
allDnas = { inputs', self' }: inputs.hcUtils.outputs.lib.filterDnas (allHolochainPackages { inherit inputs' self'; });
allHapps = { inputs', self' }: inputs.hcUtils.outputs.lib.filterHapps (allHolochainPackages { inherit inputs' self'; });
allNpmPackages = { inputs', self' }: inputs.hcUtils.outputs.lib.filterNpmPackages (allHolochainPackages { inherit inputs' self'; });
in
inputs.holochain.inputs.flake-parts.lib.mkFlake
{
inherit inputs;
specialArgs = {
rootPath = ./.;
inherit holochainSources allHolochainPackages allZomes allDnas allHapps allNpmPackages;
};
}
{
imports = [
./happ.nix
];

# Aggregators: take all the packages from this repository and the upstream
# holochain sources and merge them
allHolochainPackages = { inputs', self' }: inputs.nixpkgs.lib.attrsets.mergeAttrsList (
[ self'.packages ]
++ builtins.map (s: s.packages) (holochainSources inputs')
);
allZomes = { inputs', self' }: inputs.hcUtils.outputs.lib.filterZomes (allHolochainPackages { inherit inputs' self'; });
allDnas = { inputs', self' }: inputs.hcUtils.outputs.lib.filterDnas (allHolochainPackages { inherit inputs' self'; });
allHapps = { inputs', self' }: inputs.hcUtils.outputs.lib.filterHapps (allHolochainPackages { inherit inputs' self'; });
allNpmPackages = { inputs', self' }: inputs.hcUtils.outputs.lib.filterNpmPackages (allHolochainPackages { inherit inputs' self'; });
};
}
{
imports = [
./happ.nix
];
systems = builtins.attrNames inputs.holochain.devShells;
perSystem =
{ inputs'
, config
, pkgs
, system
, lib
, self'
, ...
}: {
devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holochain.devShells.holonix ];
packages = with pkgs; [
nodejs_20
# more packages go here
cargo-nextest
] ++ [
inputs'.hcUtils.packages.sync-npm-dependencies-with-nix
];

systems = builtins.attrNames inputs.holochain.devShells;
perSystem =
{ inputs'
, config
, pkgs
, system
, lib
, ...
}: {
devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holochain.devShells.holonix ];
packages = with pkgs; [
nodejs_20
# more packages go here
cargo-nextest
] ++ [
inputs'.hcUtils.packages.sync-npm-dependencies-with-nix
];
shellHook = ''
sync-npm-dependencies-with-nix ${builtins.trace (allNpmPackages {inherit inputs' self';}) "hey"}
'';
};

shellHook = ''
sync-npm-dependencies-with-nix ${builtins.trace config "hey"}
'';
};

};
};
};
}
File renamed without changes.

0 comments on commit 7ddf858

Please sign in to comment.