Document not found (404)
+This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +diff --git a/.envrc b/.envrc deleted file mode 100644 index 11f188f..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake .#default diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6dfd78d..0000000 --- a/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# pre-commit autogenerated file -.pre-commit-config.yaml - -# Haskell .gitignore -dist -dist-* -cabal-dev -*.o -*.hi -*.hie -*.chi -*.chs.h -*.dyn_o -*.dyn_hi -.hpc -.hsenv -.cabal-sandbox/ -cabal.sandbox.config -*.prof -*.aux -*.hp -*.eventlog -.stack-work/ -cabal.project.local -cabal.project.local~ -.HTF/ -.ghc.environment.* diff --git a/404.html b/404.html new file mode 100644 index 0000000..7a2b1d7 --- /dev/null +++ b/404.html @@ -0,0 +1,200 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Makes a derivation containing a Haskell Cabal package with data modules (using Cabal data stanzas)
+Type: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function, args: {cabalDataPatterns, cabalPackageName, cabalPackageVersion?, srcs}>
Example:
+''
+ ```haskell
+ haskellData {
+ srcs = [ ./. ];
+ cabalDataPatterns = [ "**/*.json" ];
+ cabalPackageName = "golden-json-data";
+ };
+ ```
+''
+
+Declared by:
+ +TODO(jaredponn): write down documentation here
+Type: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function>
Example:
+''
+ TODO(jaredponn): write down an example here
+''
+
+Declared by:
+ +TODO(jaredponn): write down documentation here
+Type: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function>
Example:
+''
+ TODO(jaredponn): write down an example here
+''
+
+Declared by:
+ +TODO(jaredponn): write down documentation here
+Type: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function>
Example:
+''
+ TODO(jaredponn): write down an example here
+''
+
+Declared by:
+ +Creates a flake for a Rust project.
+Arguments:
+src
: Source folder (unfiltered)extraSourceFilters
(optional): Extra filters to add non-rust related files to
+the derivationcrane
(optional): Crane version to be usedcrateName
: Name of the projectversion
: Major version of the projectrustChannel
(default=stable): Rust profile (stable, nightly, etc.)rustVersion
(default=latest): Rust versionnativeBuildInputs
(optional): Additional native build inputsbuildInputs
(optional): Additional build inputsextraSources
(optional): Extra sources, allowing to use other rustFlake components
+to be used as dependenciesextraSourcesDir
(default=.extras): Folder to store extra source librariesdata
(optional): Data dependenciesdataDir
(default=data): Folder to store the data dependenciesdevShellHook
(optional): Shell script executed after entering the dev shelldevShellTools
(optional): Packages made available in the dev shelltestTools
(optional): Packages made available in checks and the dev shellcargoNextestExtraArgs
(optional): Extra cargo nextest argumentsdoInstallCargoArtifacts
(optional): Controls whether cargo’s target directory
+should be copied as an outputtarget
(optional): Main Rust compilation target
+(Rust will figure out by default)extraTargets
(optional): Extra Rust compilation targetsextraRustcFlags
(optional): Extra rustc flagsextraCargoArgs
(optional): Extra cargo argumentsextraEnvVars
(optional): Extra environment variablesgenerateDocs
(default=true): Generate RustdocrunTests
(default=true): Run testsuite using cargo-nextestrunClippy
(default=true): Run clippy linterexportTests
(default=false): Build testsuite as standalone executablesReturns:
+Returns an attribute set of the form
+{
+ devShells."dev-${name}-rust" = derivation { ... };
+ packages."${name}-rust" = derivation { ... };
+ packages."${name}-rust-src" = derivation { ... };
+ packages."${name}-rust-build-env" = derivation { ... };
+ packages."${name}-rust-doc" = derivation { ... };
+ checks."${name}-rust-test" = derivation { ... };
+ checks."${name}-rust-clippy" = derivation { ... };
+}
+
+where
+packages."${name}-rust"
contains the binary executable of the project.packages."${name}-rust-src"
contains the source folder, to be used as a
+dependency of other application in extraSourcespackages."${name}-rust-build-env"
contains the source folder, to be used
+as a standalone library (not is extraSources)packages."${name}-rust-doc"
contains the API references documentchecks."${name}-rust-test"
runs tests using cargo nextestchecks."${name}-rust-clippy"
runs clippyType: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function, args: {buildInputs?, cargoNextestExtraArgs?, crane?, crateName, data?, dataDir?, devShellHook?, devShellTools?, doInstallCargoArtifacts?, exportTests?, extraCargoArgs?, extraEnvVars?, extraRustcFlags?, extraSourceFilters?, extraSources?, extraSourcesDir?, extraTargets?, generateDocs?, nativeBuildInputs?, runClippy?, runTests?, rustChannel?, rustProfile?, rustVersion?, src, target?, testTools?, version?}>
Example:
+''
+ { ... }:
+ {
+ perSystem =
+ { config, ... }:
+
+ let
+ rustFlake = config.lib.rustFlake {
+ src = ./.;
+ crateName = "rust-flake-project";
+
+ devShellHook = config.settings.shell.hook;
+ exportTests = true;
+ };
+ in
+ {
+
+ inherit (rustFlake) packages checks devShells;
+
+ };
+ }
+''
+
+Declared by:
+ +Creates a flake for a TypeScript project.
+Returns an attribute set of the form
+{
+ devShells."${name}-typescript" = derivation { ... };
+ packages."${name}-typescript" = derivation { ... };
+ packages."${name}-typescript-exe" = derivation { ... };
+ packages."${name}-typescript-lib" = derivation { ... };
+ packages."${name}-typescript-tgz" = derivation { ... };
+ packages."${name}-typescript-node2nix" = derivation { ... };
+ checks."${name}-typescript-test" = derivation { ... };
+}
+
+where
+packages."${name}-typescript"
contains the project with a
+node_modules/
provided by Nix (in the configurePhase
), and
+its buildPhase
runs npm run "$npmBuildScript"
(where npmBuildScript
is
+build
by default).
+Indeed, one can overlay the entire derivation (which contains
+all its dependencies) to postprocess their project as they
+see fit. For example, one may want to generate documentation
+instead of building the project, by running:
packages."${name}-typescript".overrideAttrs (_self: _super: {
+ npmBuildScript = "docs";
+ installPhase =
+ ''
+ mv ./docs "$out"
+ '';
+ });
+
+where we assume that the package.json
contains
+scripts.docs = <some-script>
which produces documentation
+in the ./docs
folder.
devShells."${name}-typescript"
provides a developer shell with the
+environment variable NODE_PATH
as the path to the node_modules/
produced
+by Nix, and the command ${name}-npm-extra-dependencies
which copies the
+transitive closure of npmExtraDependencies
to the folder
+./.extra-dependencies
.
Moreover, the shellHook
will:
node_modules
pointing to
+$NODE_PATH
; and${name}-npm-extra-dependencies
.As such, one should enter the development shell in the folder that the
+project exists in, so npm
may use the provided dependencies from nix.
packages."${name}-typescript-exe"
is packages."${name}-typescript"
except
+runs npm install --global --prefix="$out"
for the installPhase
and
+copies some of the symbolic links so that the output makes sense.
packages."${name}-typescript-tgz"
is packages."${name}-typescript"
except
+runs npm pack
after the buildPhase
to create a tarball of the project in
+the directory $out/tarballs/
.
packages."${name}-typescript-lib"
is packages."${name}-typescript-tgz"
except
+that it unpacks the tarball to $out/lib/node_modules/<package-name>
packages."${name}-typescript-test"
is packages."${name}-typescript"
+except it runs npm test
after the buildPhase
succeeding only if npm test
succeeds.
Type: +function that evaluates to a(n) (attribute set) (read only)
+Default:
+<function, args: {data?, dataDir?, devShellHook?, devShellTools?, name, nodejs?, npmBuildScript?, npmExtraDependencies?, src, testTools?}>
Example:
+"TODO(jaredponn)"
Declared by:
+ + +This library provides a set of Nix functions to make creating flakes for +languages such as Haskell, PureScript, Rust, and TypeScript easier.
+ +