Skip to content

Commit

Permalink
modules: various fixups for rendering docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavHau authored and mergify[bot] committed Oct 11, 2023
1 parent af64cc5 commit dc43eeb
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 19 deletions.
1 change: 1 addition & 0 deletions modules/dream2nix/core/public/interface.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ in {
The final result of the evaluated package.
Contains everything that nix expects from a derivation.
Contains fields like name, outputs, drvPath, outPath, etc.
Can be build with nix-build or `nix build`.
'';
};
}
2 changes: 1 addition & 1 deletion modules/dream2nix/package-func/interface.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in {
};

package-func.args = l.mkOption {
type = t.attrsOf (t.either (t.listOf t.raw) t.anything);
type = t.lazyAttrsOf (t.either (t.listOf t.raw) t.anything);
description = "The arguments which will be passed to `package-func.func`";
};

Expand Down
3 changes: 3 additions & 0 deletions modules/dream2nix/php-composer-lock/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
config,
dream2nix,
lib,
...
}: let
Expand Down Expand Up @@ -28,6 +29,7 @@
in {
imports = [
./interface.nix
dream2nix.modules.dream2nix.mkDerivation
];

# declare external dependencies
Expand All @@ -47,5 +49,6 @@ in {
if cfg.composerLockFile != null
then l.fromJSON (l.readFile cfg.composerLockFile)
else lib.mkDefault {};
source = lib.mkOptionDefault config.mkDerivation.src;
};
}
7 changes: 6 additions & 1 deletion modules/dream2nix/php-composer-lock/interface.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ in {
The composer.json file to use.
'';
default = cfg.source + "/composer.json";
defaultText = ''
''${cfg.source}/composer.json
'';
};
composerJson = {
type = t.attrs;
Expand All @@ -31,6 +34,9 @@ in {
The composer.lock file to use.
'';
default = cfg.source + "/composer.lock";
defaultText = ''
''${cfg.source}/composer.lock
'';
};
composerLock = {
type = t.attrs;
Expand All @@ -39,7 +45,6 @@ in {
source = {
type = t.either t.path t.package;
description = "Source of the package";
default = config.mkDerivation.src;
};
withDevDependencies = {
type = t.bool;
Expand Down
6 changes: 5 additions & 1 deletion modules/dream2nix/php-granular/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ in {
version:
# the submodule for this dependency
{...}: {
imports = [(commonModule name version)];
imports = [
./interface.nix
(commonModule name version)
dream2nix.modules.dream2nix.mkDerivation
];
inherit name version;
}
))
Expand Down
8 changes: 5 additions & 3 deletions modules/dream2nix/php-granular/interface.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
in {
options.php-granular = l.mapAttrs (_: l.mkOption) {
deps = {
type = t.attrsOf (t.attrsOf (t.submodule {
type = t.lazyAttrsOf (t.lazyAttrsOf (t.submodule {
imports = [
dream2nix.modules.dream2nix.core
dream2nix.modules.dream2nix.mkDerivation
./interface.nix
# TODO: fix this
# putting mkDerivation here leads to an error when generating docs:
# The option `php-granular.deps.<name>.<name>.version' is used but not defined.
# dream2nix.modules.dream2nix.mkDerivation
];
_module.args = {inherit dream2nix packageSets;};
}));
Expand Down
2 changes: 1 addition & 1 deletion modules/dream2nix/pip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ in {
imports = [
commonModule
./interface.nix
../pip-hotfixes
./pip-hotfixes
];

deps = {nixpkgs, ...}:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions modules/dream2nix/rust-cargo-lock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
in {
imports = [
./interface.nix
dream2nix.modules.dream2nix.mkDerivation
];
rust-cargo-lock = {
inherit dreamLock;
Expand Down
26 changes: 14 additions & 12 deletions modules/flake-parts/website.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# "buildPythonPackage"
# "buildRustPackage"
# "builtins-derivation"
# "core"
"core"
# "groups"
# "mkDerivation"
# "mkDerivation-sane-defaults"
Expand All @@ -30,20 +30,22 @@
# "nodejs-package-lock"
# "nodejs-package-lock-v3"
# "package-func"
# "php-composer-lock"
# "php-granular"
# "pip"
# "pip-hotfixes"
# "rust-cargo-lock"
# "rust-crane"
# "_template"
# "WIP-python-pdm"
# "WIP-python-pyproject"
# "WIP-spago"
"php-composer-lock"
"php-granular"

"pip"
"rust-cargo-lock"
"WIP-python-pdm"
"WIP-python-pyproject"
"WIP-spago"

# "lock"
"lock"
"mkDerivation"
"public"

# NOT WORKING
# "rust-crane"
# "_template"
]) (self.modules.dream2nix))
(name: module: {
title = name;
Expand Down

0 comments on commit dc43eeb

Please sign in to comment.