refactor(flake): expose appsPackages

This commit is contained in:
matt1432 2024-11-23 19:35:01 -05:00
parent 5dd3f3f4e6
commit d3e9a1b1d7
5 changed files with 26 additions and 10 deletions

View file

@ -5,7 +5,7 @@
}: let
inherit (pkgs.lib) getExe listToAttrs nameValuePair;
buildApp = attrs: (pkgs.callPackage ./buildApp.nix ({} // inputs // attrs));
buildApp = attrs: (pkgs.callPackage ./nix/buildApp.nix ({} // inputs // attrs));
mkApp = file: {
program = getExe (pkgs.callPackage file ({inherit buildApp;} // inputs));

View file

@ -10,8 +10,9 @@
...
}: let
inherit (lib) concatMapStringsSep getBin;
inherit (builtins) fromJSON readFile;
packageJSON = builtins.fromJSON (builtins.readFile "${src}/package.json");
packageJSON = fromJSON (readFile "${src}/package.json");
in
buildNpmPackage rec {
pname = packageJSON.name;
@ -21,7 +22,7 @@ in
prePatch = ''
mv ./tsconfig.json ./project.json
sed 's/^ *\/\/.*//' ${./tsconfig.json} > ./base.json
sed 's/^ *\/\/.*//' ${../tsconfig.json} > ./base.json
${jq}/bin/jq -sr '.[0] * .[1] | del(.extends)' ./project.json ./base.json > ./tsconfig.json
rm base.json project.json
'';

14
apps/nix/packages.nix Normal file
View file

@ -0,0 +1,14 @@
{
pkgs,
self,
...
}: let
inherit (pkgs.lib) mapAttrs removeSuffix;
in
mapAttrs (
name: app: (pkgs.symlinkJoin {
name = "app-${name}";
paths = [(removeSuffix "/bin/${name}" (toString app.program))];
})
)
(removeAttrs self.apps.${pkgs.system} ["genflake"])