Compare commits
No commits in common. "68ed4f226196eb197b8456a35d87a71948b7aa41" and "5dd0370eedbac68de5370de8a73aaa57c0cd08c3" have entirely different histories.
68ed4f2261
...
5dd0370eed
6 changed files with 31 additions and 90 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
result
|
|
|
@ -56,21 +56,37 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
legacyPackages = (
|
# checks = {
|
||||||
(alexandriaLib.indexByName ./documents/by-name)
|
# inherit build-drv build-script watch-script;
|
||||||
// (alexandriaLib.indexByCourse ./documents/by-course)
|
|
||||||
);
|
|
||||||
# devShells.default = typixLib.devShell {
|
|
||||||
# inherit (commonArgs) fontPaths virtualPaths;
|
|
||||||
# packages = [
|
|
||||||
# # WARNING: Don't run `typst-build` directly, instead use `nix run .#build`
|
|
||||||
# # See https://github.com/loqusion/typix/issues/2
|
|
||||||
# # build-script
|
|
||||||
# watch-script
|
|
||||||
# # More packages can be added here, like typstfmt
|
|
||||||
# pkgs.typstyle
|
|
||||||
# ];
|
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
legacyPackages = {
|
||||||
|
phil-1 = {
|
||||||
|
paper-1 = alexandriaLib.callTypstProject (import ./documents/by-course/phil-1/paper-1/package.nix);
|
||||||
|
};
|
||||||
|
digression-linear-algebra = alexandriaLib.callTypstProject (import ./documents/by-name/digression-linear-algebra/package.nix);
|
||||||
|
};
|
||||||
|
# apps = rec {
|
||||||
|
# default = watch;
|
||||||
|
# build = flake-utils.lib.mkApp {
|
||||||
|
# drv = build-script;
|
||||||
|
# };
|
||||||
|
# watch = flake-utils.lib.mkApp {
|
||||||
|
# drv = watch-script;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# devShells.default = typixLib.devShell {
|
||||||
|
# inherit (commonArgs) fontPaths virtualPaths;
|
||||||
|
# packages = [
|
||||||
|
# # WARNING: Don't run `typst-build` directly, instead use `nix run .#build`
|
||||||
|
# # See https://github.com/loqusion/typix/issues/2
|
||||||
|
# # build-script
|
||||||
|
# watch-script
|
||||||
|
# # More packages can be added here, like typstfmt
|
||||||
|
# pkgs.typstyle
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,4 @@ rec {
|
||||||
inherit cleanTypstSource;
|
inherit cleanTypstSource;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
indexByName = (import ./indexByName.nix) (defaultArgs // { inherit callTypstProject; });
|
|
||||||
indexByCourse = (import ./indexByCourse.nix) (defaultArgs // { inherit indexByName; });
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
indexByName,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
baseDirectory:
|
|
||||||
let
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
inherit (lib.attrsets)
|
|
||||||
mapAttrs
|
|
||||||
mapAttrsToList
|
|
||||||
mergeAttrsList
|
|
||||||
;
|
|
||||||
inherit (builtins) readDir;
|
|
||||||
in
|
|
||||||
let
|
|
||||||
# Package files for a single shard
|
|
||||||
# Type: String -> String -> AttrsOf Path
|
|
||||||
namesForShard =
|
|
||||||
shard: type:
|
|
||||||
if type != "directory" then
|
|
||||||
# Ignore all non-directories. Technically only README.md is allowed as a file in the base directory, so we could alternatively:
|
|
||||||
# - Assume that README.md is the only file and change the condition to `shard == "README.md"` for a minor performance improvement.
|
|
||||||
# This would however cause very poor error messages if there's other files.
|
|
||||||
# - Ensure that README.md is the only file, throwing a better error message if that's not the case.
|
|
||||||
# However this would make for a poor code architecture, because one type of error would have to be duplicated in the validity checks and here.
|
|
||||||
# Additionally in either of those alternatives, we would have to duplicate the hardcoding of "README.md"
|
|
||||||
{ }
|
|
||||||
else
|
|
||||||
mapAttrs (a: b: indexByName (baseDirectory + "/${a}")) (readDir baseDirectory);
|
|
||||||
|
|
||||||
in
|
|
||||||
# mapAttrs (a: b: builtins.trace (builtins.tryEval a) b) (
|
|
||||||
# mergeAttrsList (mapAttrsToList namesForShard (readDir baseDirectory))
|
|
||||||
# )
|
|
||||||
mergeAttrsList (mapAttrsToList namesForShard (readDir baseDirectory))
|
|
|
@ -1,37 +0,0 @@
|
||||||
{ pkgs, callTypstProject, ... }:
|
|
||||||
baseDirectory:
|
|
||||||
let
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
inherit (lib.attrsets)
|
|
||||||
mapAttrs
|
|
||||||
mapAttrsToList
|
|
||||||
mergeAttrsList
|
|
||||||
;
|
|
||||||
inherit (builtins) readDir;
|
|
||||||
in
|
|
||||||
let
|
|
||||||
# Package files for a single shard
|
|
||||||
# Type: String -> String -> AttrsOf Path
|
|
||||||
namesForShard =
|
|
||||||
name: type:
|
|
||||||
if type != "directory" then
|
|
||||||
# Ignore all non-directories. Technically only README.md is allowed as a file in the base directory, so we could alternatively:
|
|
||||||
# - Assume that README.md is the only file and change the condition to `shard == "README.md"` for a minor performance improvement.
|
|
||||||
# This would however cause very poor error messages if there's other files.
|
|
||||||
# - Ensure that README.md is the only file, throwing a better error message if that's not the case.
|
|
||||||
# However this would make for a poor code architecture, because one type of error would have to be duplicated in the validity checks and here.
|
|
||||||
# Additionally in either of those alternatives, we would have to duplicate the hardcoding of "README.md"
|
|
||||||
{ }
|
|
||||||
else
|
|
||||||
# mapAttrs (name: _: baseDirectory + "/${shard}/${name}/package.nix") (
|
|
||||||
# readDir (baseDirectory + "/${shard}")
|
|
||||||
# );
|
|
||||||
mapAttrs (name: _: baseDirectory + "/${name}/package.nix") (readDir baseDirectory);
|
|
||||||
|
|
||||||
in
|
|
||||||
# mapAttrs (a: b: builtins.trace (builtins.tryEval a) b) (
|
|
||||||
# mergeAttrsList (mapAttrsToList namesForShard (readDir baseDirectory))
|
|
||||||
# )
|
|
||||||
mapAttrs (a: b: callTypstProject (import (/. + b))) (
|
|
||||||
mergeAttrsList (mapAttrsToList namesForShard (readDir baseDirectory))
|
|
||||||
)
|
|
1
2024/result
Symbolic link
1
2024/result
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/nix/store/fv6y2dqv26lw4gzb2pf6ms5hyikpbkm9-typst
|
Loading…
Reference in a new issue