feat: refactor to add apps README
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
2cab8107ba
commit
546eda3ee2
12 changed files with 81 additions and 52 deletions
|
@ -133,11 +133,11 @@
|
||||||
|
|
||||||
apps =
|
apps =
|
||||||
perSystem (pkgs:
|
perSystem (pkgs:
|
||||||
import ./apps {inherit inputs pkgs;});
|
import ./apps {inherit pkgs self;});
|
||||||
|
|
||||||
appsPackages =
|
appsPackages =
|
||||||
perSystem (pkgs:
|
perSystem (pkgs:
|
||||||
import ./apps/packages.nix {inherit pkgs self;});
|
import ./apps/packages.nix {inherit inputs pkgs;});
|
||||||
|
|
||||||
devShells =
|
devShells =
|
||||||
perSystem (pkgs:
|
perSystem (pkgs:
|
||||||
|
|
11
apps/README.md
Normal file
11
apps/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# apps
|
||||||
|
|
||||||
|
This directory contains every derivations for apps exposed by this flake.
|
||||||
|
|
||||||
|
## List of my apps found in `self.apps`
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| ---- | ----------- |
|
||||||
|
| `app-extract-subs` | Extract all `srt` subtitle files from a `mkv` video with the appropriate name. |
|
||||||
|
| `app-gen-docs` | Generates the READMEs in this repository from nix attributes. |
|
||||||
|
| `app-update-sources` | Updates all derivation sources in this repository and generates a commit message for the changes made. |
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
runtimeInputs,
|
|
||||||
npmDepsHash,
|
|
||||||
src,
|
|
||||||
lib,
|
lib,
|
||||||
|
src,
|
||||||
|
npmDepsHash,
|
||||||
|
runtimeInputs,
|
||||||
buildNpmPackage,
|
buildNpmPackage,
|
||||||
|
meta,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
nodejs_latest,
|
nodejs_latest,
|
||||||
jq,
|
jq,
|
||||||
|
@ -13,12 +14,11 @@
|
||||||
inherit (builtins) fromJSON readFile;
|
inherit (builtins) fromJSON readFile;
|
||||||
|
|
||||||
packageJSON = fromJSON (readFile "${src}/package.json");
|
packageJSON = fromJSON (readFile "${src}/package.json");
|
||||||
in
|
|
||||||
buildNpmPackage rec {
|
|
||||||
pname = packageJSON.name;
|
pname = packageJSON.name;
|
||||||
inherit (packageJSON) version;
|
inherit (packageJSON) version;
|
||||||
|
in
|
||||||
inherit src runtimeInputs npmDepsHash;
|
buildNpmPackage {
|
||||||
|
inherit pname version src runtimeInputs npmDepsHash;
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
mv ./tsconfig.json ./project.json
|
mv ./tsconfig.json ./project.json
|
||||||
|
@ -35,5 +35,6 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nodejs = nodejs_latest;
|
nodejs = nodejs_latest;
|
||||||
meta.mainProgram = pname;
|
|
||||||
|
meta = {mainProgram = pname;} // meta;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,17 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
self,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs.lib) getExe listToAttrs nameValuePair;
|
inherit (pkgs.lib) getExe mapAttrs' nameValuePair removePrefix;
|
||||||
|
|
||||||
buildApp = attrs: (pkgs.callPackage ./buildApp.nix ({} // inputs // attrs));
|
mkApp = pkg: {
|
||||||
|
program = getExe pkg;
|
||||||
mkNodeApp = file: {
|
|
||||||
program = getExe (pkgs.callPackage file ({inherit buildApp;} // inputs));
|
|
||||||
type = "app";
|
type = "app";
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNodeApps = apps: listToAttrs (map (x: nameValuePair x (mkNodeApp ./${x})) apps);
|
|
||||||
in
|
in
|
||||||
mkNodeApps [
|
mapAttrs' (
|
||||||
"extract-subs"
|
n: v:
|
||||||
"update-sources"
|
nameValuePair (removePrefix "app-" n) (mkApp v)
|
||||||
]
|
)
|
||||||
// {
|
self.appsPackages.${pkgs.system}
|
||||||
gen-docs = {
|
|
||||||
program = getExe (pkgs.callPackage ./gen-docs {});
|
|
||||||
type = "app";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -10,4 +10,8 @@ buildApp {
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
ffmpeg-full
|
ffmpeg-full
|
||||||
];
|
];
|
||||||
|
|
||||||
|
meta.description = ''
|
||||||
|
Extract all `srt` subtitle files from a `mkv` video with the appropriate name.
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,8 @@ writeShellApplication {
|
||||||
name = "gen-docs";
|
name = "gen-docs";
|
||||||
runtimeInputs = [jq pandoc];
|
runtimeInputs = [jq pandoc];
|
||||||
text = builtins.readFile ./script.sh;
|
text = builtins.readFile ./script.sh;
|
||||||
|
|
||||||
|
meta.description = ''
|
||||||
|
Generates the READMEs in this repository from nix attributes.
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,11 @@ substitute() {
|
||||||
nix eval \
|
nix eval \
|
||||||
--impure \
|
--impure \
|
||||||
--json \
|
--json \
|
||||||
.#"$1" \
|
"$FLAKE"#"$1" \
|
||||||
--apply "$packageMetaFunc" |
|
--apply "$packageMetaFunc" |
|
||||||
jq -r
|
jq -r
|
||||||
) -t markdown --template "$2" -o "$3"
|
) -t markdown --template "$2" -o "$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md"
|
substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md"
|
||||||
|
substitute "appsPackages" "$FLAKE/apps/gen-docs/templates/apps.md" "$FLAKE/apps/README.md"
|
||||||
|
|
11
apps/gen-docs/templates/apps.md
Normal file
11
apps/gen-docs/templates/apps.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# apps
|
||||||
|
|
||||||
|
This directory contains every derivations for apps exposed by this flake.
|
||||||
|
|
||||||
|
## List of my apps found in `self.apps`
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| ---- | ----------- |
|
||||||
|
$for(attrs/pairs)$
|
||||||
|
| `$it.key$` | $it.value.desc/nowrap$ |
|
||||||
|
$endfor$
|
|
@ -7,5 +7,5 @@ This directory contains every derivations for devShells exposed by this flake.
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| ---- | ----------- |
|
| ---- | ----------- |
|
||||||
$for(attrs/pairs)$
|
$for(attrs/pairs)$
|
||||||
| $it.key$ | $it.value.desc/nowrap$ |
|
| `$it.key$` | $it.value.desc/nowrap$ |
|
||||||
$endfor$
|
$endfor$
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
self,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs.lib) mapAttrs removeSuffix;
|
inherit (pkgs.lib) listToAttrs nameValuePair;
|
||||||
|
|
||||||
|
buildApp = attrs: (pkgs.callPackage ./buildApp.nix ({} // inputs // attrs));
|
||||||
|
callPackage = file: pkgs.callPackage file ({inherit buildApp;} // inputs);
|
||||||
in
|
in
|
||||||
mapAttrs (
|
listToAttrs (map (x: nameValuePair "app-${x}" (callPackage ./${x})) [
|
||||||
name: app: (pkgs.symlinkJoin {
|
"extract-subs"
|
||||||
name = "app-${name}";
|
"gen-docs"
|
||||||
paths = [(removeSuffix "/bin/${name}" (toString app.program))];
|
"update-sources"
|
||||||
})
|
])
|
||||||
)
|
|
||||||
(removeAttrs self.apps.${pkgs.system} ["genflake"])
|
|
||||||
|
|
|
@ -18,4 +18,9 @@ buildApp {
|
||||||
prefetch-npm-deps
|
prefetch-npm-deps
|
||||||
(callPackage ../../modules/docker/updateImage.nix {})
|
(callPackage ../../modules/docker/updateImage.nix {})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
meta.description = ''
|
||||||
|
Updates all derivation sources in this repository and
|
||||||
|
generates a commit message for the changes made.
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,14 @@ This directory contains every derivations for devShells exposed by this flake.
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| ---- | ----------- |
|
| ---- | ----------- |
|
||||||
| c-lang | c-lang shell to be loaded by my Neovim config dynamically. |
|
| `c-lang` | c-lang shell to be loaded by my Neovim config dynamically. |
|
||||||
| csharp | csharp shell to be loaded by my Neovim config dynamically. |
|
| `csharp` | csharp shell to be loaded by my Neovim config dynamically. |
|
||||||
| flake | Shell providing some utility scripts concerning the main flake. |
|
| `flake` | Shell providing some utility scripts concerning the main flake. |
|
||||||
| json | json shell to be loaded by my Neovim config dynamically. |
|
| `json` | json shell to be loaded by my Neovim config dynamically. |
|
||||||
| lua | lua shell to be loaded by my Neovim config dynamically. |
|
| `lua` | lua shell to be loaded by my Neovim config dynamically. |
|
||||||
| markdown | markdown shell to be loaded by my Neovim config dynamically. |
|
| `markdown` | markdown shell to be loaded by my Neovim config dynamically. |
|
||||||
| netdaemon | Shell that makes sure we have the right dotnet-sdk version for NetDaemon development. |
|
| `netdaemon` | Shell that makes sure we have the right dotnet-sdk version for NetDaemon development. |
|
||||||
| node | Shell that provides `bumpNpmDeps`, node and typescript. |
|
| `node` | Shell that provides `bumpNpmDeps`, node and typescript. |
|
||||||
| rust | rust shell to be loaded by my Neovim config dynamically. |
|
| `rust` | rust shell to be loaded by my Neovim config dynamically. |
|
||||||
| subtitles-dev | Shell that provides the dependencies for my subtitle management scripts. |
|
| `subtitles-dev` | Shell that provides the dependencies for my subtitle management scripts. |
|
||||||
| web | web shell to be loaded by my Neovim config dynamically. |
|
| `web` | web shell to be loaded by my Neovim config dynamically. |
|
||||||
|
|
Loading…
Reference in a new issue