refactor(flake): expose appsPackages
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
5dd3f3f4e6
commit
d3e9a1b1d7
5 changed files with 26 additions and 10 deletions
|
@ -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));
|
||||
|
|
|
@ -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
14
apps/nix/packages.nix
Normal 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"])
|
|
@ -2,12 +2,9 @@
|
|||
pkgs,
|
||||
self,
|
||||
}: let
|
||||
inherit (pkgs.lib) mapAttrs' nameValuePair removeAttrs removeSuffix;
|
||||
inherit (pkgs.lib) mapAttrs' nameValuePair;
|
||||
in
|
||||
mapAttrs'
|
||||
(name: app:
|
||||
nameValuePair "app-${name}" (pkgs.symlinkJoin {
|
||||
name = "app-${name}";
|
||||
paths = [(removeSuffix "/bin/${name}" (toString app.program))];
|
||||
}))
|
||||
(removeAttrs self.apps.${pkgs.system} ["genflake"])
|
||||
nameValuePair "app-${name}" app)
|
||||
self.appsPackages.${pkgs.system}
|
||||
|
|
|
@ -143,6 +143,10 @@
|
|||
perSystem (pkgs:
|
||||
import ./apps {inherit inputs pkgs;});
|
||||
|
||||
appsPackages =
|
||||
perSystem (pkgs:
|
||||
import ./apps/nix/packages.nix {inherit pkgs self;});
|
||||
|
||||
devShells = perSystem (pkgs: let
|
||||
bumpNpmDeps = pkgs.writeShellApplication {
|
||||
name = "bumpNpmDeps";
|
||||
|
@ -174,7 +178,7 @@
|
|||
|
||||
sudo sed -i -e "/^$GROUP:/d" /etc/group # Remove generated group entry
|
||||
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} + # Change GID on existing files
|
||||
sudo nixos-rebuild --switch # Regenerate /etc/group with new GID
|
||||
exec nh os switch # Regenerate /etc/group with new GID
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue