dream2nix/examples/_d2n-extended/flake.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

refactor: implement a validation system for builders / translators, reorganize files (#155) * refactor: implement a validation system for builders / translators etc, organize files * refactor: use seq instead of complicated validation function for validator * feat: allow adding discoverers, translators and builders via config * refactor: rework discoverers to use makeSubsystemModules as well * fix: validate extra modules properly * feat: support inline modules * feat: use extra attribute for extending * feat: make fetchers extensible properly * fix: add name to extra fetchers * feat: support list for extra * docs: add some comment to lib/modules.nix * fix: get extra module args from extraArgs * fix: collect all modules instead of only collecting modules for built-in subsystems * refactor: minor improvements * refactor: improve how default subsystem modules are declared * fix: translators and builders are directly under subsystem now * fix: correct attribute path, remove unused argument * fix: correct translators attribute paths * fix: correct file paths and translators attribute paths * fix: use correct translator attr path in wrapPureTranslator * fix: update unit tests code * fix: remove extra paranthesis in unit tests code * tests: add an extended dream2nix example * refactor: replace recursiveUpdate usage with normal update op * tests: fix and extend d2n-extended example * fix: pass config to d2n instance in wrap pure translator script * fix: correct toFile usage * fix: pass config to dlib in more places * fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator * refactor: remove unused extra modules validation, add warning for function modules * fix: remove non-existent inherited variable * docs: update translator attr path in contributors guide * docs: add docs for extending dream2nix * refactor: comment more code, warn for function modules only if extra is an attrset decl * docs: fix some typos * docs: explain some stuff in extending d2n better * fix: print function modules warning when it is a function * tests: add a new example that tests adding new subsystem and config.extra as nix file * tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs * feat: add ifd warning for builders * tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder * fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock * fix(rust/builders): delete cargo lock before writing it? * refactor: also print ifd warnings for translators * docs: link extending d2n doc in readme, link examples in extending d2n * docs: example naming (translators.new -> translators.example-translator) * feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators) * refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively * refactor: throw instead of warning if function declarations for modules are used * refactor: fix throw usage * refactor: improve modules code * chore(deps): update nixpkgs * fix: correct some map usages * fix: use correct attr path for extra modules * chore: update examples flake inputs * style: minor formatting changes
2022-05-29 22:42:47 +03:00
{
inputs = {
dream2nix.url = "path:../..";
src.url = "github:yusdacra/linemd/v0.4.0";
refactor: implement a validation system for builders / translators, reorganize files (#155) * refactor: implement a validation system for builders / translators etc, organize files * refactor: use seq instead of complicated validation function for validator * feat: allow adding discoverers, translators and builders via config * refactor: rework discoverers to use makeSubsystemModules as well * fix: validate extra modules properly * feat: support inline modules * feat: use extra attribute for extending * feat: make fetchers extensible properly * fix: add name to extra fetchers * feat: support list for extra * docs: add some comment to lib/modules.nix * fix: get extra module args from extraArgs * fix: collect all modules instead of only collecting modules for built-in subsystems * refactor: minor improvements * refactor: improve how default subsystem modules are declared * fix: translators and builders are directly under subsystem now * fix: correct attribute path, remove unused argument * fix: correct translators attribute paths * fix: correct file paths and translators attribute paths * fix: use correct translator attr path in wrapPureTranslator * fix: update unit tests code * fix: remove extra paranthesis in unit tests code * tests: add an extended dream2nix example * refactor: replace recursiveUpdate usage with normal update op * tests: fix and extend d2n-extended example * fix: pass config to d2n instance in wrap pure translator script * fix: correct toFile usage * fix: pass config to dlib in more places * fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator * refactor: remove unused extra modules validation, add warning for function modules * fix: remove non-existent inherited variable * docs: update translator attr path in contributors guide * docs: add docs for extending dream2nix * refactor: comment more code, warn for function modules only if extra is an attrset decl * docs: fix some typos * docs: explain some stuff in extending d2n better * fix: print function modules warning when it is a function * tests: add a new example that tests adding new subsystem and config.extra as nix file * tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs * feat: add ifd warning for builders * tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder * fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock * fix(rust/builders): delete cargo lock before writing it? * refactor: also print ifd warnings for translators * docs: link extending d2n doc in readme, link examples in extending d2n * docs: example naming (translators.new -> translators.example-translator) * feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators) * refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively * refactor: throw instead of warning if function declarations for modules are used * refactor: fix throw usage * refactor: improve modules code * chore(deps): update nixpkgs * fix: correct some map usages * fix: use correct attr path for extra modules * chore: update examples flake inputs * style: minor formatting changes
2022-05-29 22:42:47 +03:00
src.flake = false;
};
outputs = {
self,
dream2nix,
src,
} @ inp:
(dream2nix.lib.makeFlakeOutputs {
refactor: implement a validation system for builders / translators, reorganize files (#155) * refactor: implement a validation system for builders / translators etc, organize files * refactor: use seq instead of complicated validation function for validator * feat: allow adding discoverers, translators and builders via config * refactor: rework discoverers to use makeSubsystemModules as well * fix: validate extra modules properly * feat: support inline modules * feat: use extra attribute for extending * feat: make fetchers extensible properly * fix: add name to extra fetchers * feat: support list for extra * docs: add some comment to lib/modules.nix * fix: get extra module args from extraArgs * fix: collect all modules instead of only collecting modules for built-in subsystems * refactor: minor improvements * refactor: improve how default subsystem modules are declared * fix: translators and builders are directly under subsystem now * fix: correct attribute path, remove unused argument * fix: correct translators attribute paths * fix: correct file paths and translators attribute paths * fix: use correct translator attr path in wrapPureTranslator * fix: update unit tests code * fix: remove extra paranthesis in unit tests code * tests: add an extended dream2nix example * refactor: replace recursiveUpdate usage with normal update op * tests: fix and extend d2n-extended example * fix: pass config to d2n instance in wrap pure translator script * fix: correct toFile usage * fix: pass config to dlib in more places * fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator * refactor: remove unused extra modules validation, add warning for function modules * fix: remove non-existent inherited variable * docs: update translator attr path in contributors guide * docs: add docs for extending dream2nix * refactor: comment more code, warn for function modules only if extra is an attrset decl * docs: fix some typos * docs: explain some stuff in extending d2n better * fix: print function modules warning when it is a function * tests: add a new example that tests adding new subsystem and config.extra as nix file * tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs * feat: add ifd warning for builders * tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder * fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock * fix(rust/builders): delete cargo lock before writing it? * refactor: also print ifd warnings for translators * docs: link extending d2n doc in readme, link examples in extending d2n * docs: example naming (translators.new -> translators.example-translator) * feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators) * refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively * refactor: throw instead of warning if function declarations for modules are used * refactor: fix throw usage * refactor: improve modules code * chore(deps): update nixpkgs * fix: correct some map usages * fix: use correct attr path for extra modules * chore: update examples flake inputs * style: minor formatting changes
2022-05-29 22:42:47 +03:00
systems = ["x86_64-linux"];
config.projectRoot = ./.;
config.modules = [
(builtins.toFile "cargo-toml-new.nix" ''
{
translators.cargo-toml-new = {
2022-10-06 22:48:12 +03:00
imports = [(attrs: import "${inp.dream2nix}/src/subsystems/rust/translators/cargo-toml" attrs.framework)];
name = "cargo-toml-new";
subsystem = "rust";
};
}
'')
2022-09-25 22:54:05 +03:00
(builtins.toFile "brp-new.nix" ''
{
builders.brp-new = {
2022-10-06 22:48:12 +03:00
imports = [(attrs: import "${inp.dream2nix}/src/subsystems/rust/builders/build-rust-package" attrs.framework)];
2022-09-25 22:54:05 +03:00
name = "brp-new";
subsystem = "rust";
};
}
'')
2022-09-27 21:51:00 +03:00
(builtins.toFile "cargo-new.nix" ''
{
discoverers.cargo-new = {
2022-10-06 22:48:12 +03:00
imports = [(attrs: import "${inp.dream2nix}/src/subsystems/rust/discoverers/cargo" attrs.framework)];
2022-09-27 21:51:00 +03:00
name = "cargo-new";
subsystem = "rust";
};
}
'')
2022-10-04 15:29:26 +03:00
(builtins.toFile "crates-io-new.nix" ''
{config, ...}: {
fetchers.crates-io = config.lib.mkForce {
2022-10-06 22:48:12 +03:00
imports = [(attrs: import "${inp.dream2nix}/src/fetchers/crates-io" attrs.framework)];
2022-10-04 15:29:26 +03:00
};
}
'')
];
refactor: implement a validation system for builders / translators, reorganize files (#155) * refactor: implement a validation system for builders / translators etc, organize files * refactor: use seq instead of complicated validation function for validator * feat: allow adding discoverers, translators and builders via config * refactor: rework discoverers to use makeSubsystemModules as well * fix: validate extra modules properly * feat: support inline modules * feat: use extra attribute for extending * feat: make fetchers extensible properly * fix: add name to extra fetchers * feat: support list for extra * docs: add some comment to lib/modules.nix * fix: get extra module args from extraArgs * fix: collect all modules instead of only collecting modules for built-in subsystems * refactor: minor improvements * refactor: improve how default subsystem modules are declared * fix: translators and builders are directly under subsystem now * fix: correct attribute path, remove unused argument * fix: correct translators attribute paths * fix: correct file paths and translators attribute paths * fix: use correct translator attr path in wrapPureTranslator * fix: update unit tests code * fix: remove extra paranthesis in unit tests code * tests: add an extended dream2nix example * refactor: replace recursiveUpdate usage with normal update op * tests: fix and extend d2n-extended example * fix: pass config to d2n instance in wrap pure translator script * fix: correct toFile usage * fix: pass config to dlib in more places * fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator * refactor: remove unused extra modules validation, add warning for function modules * fix: remove non-existent inherited variable * docs: update translator attr path in contributors guide * docs: add docs for extending dream2nix * refactor: comment more code, warn for function modules only if extra is an attrset decl * docs: fix some typos * docs: explain some stuff in extending d2n better * fix: print function modules warning when it is a function * tests: add a new example that tests adding new subsystem and config.extra as nix file * tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs * feat: add ifd warning for builders * tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder * fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock * fix(rust/builders): delete cargo lock before writing it? * refactor: also print ifd warnings for translators * docs: link extending d2n doc in readme, link examples in extending d2n * docs: example naming (translators.new -> translators.example-translator) * feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators) * refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively * refactor: throw instead of warning if function declarations for modules are used * refactor: fix throw usage * refactor: improve modules code * chore(deps): update nixpkgs * fix: correct some map usages * fix: use correct attr path for extra modules * chore: update examples flake inputs * style: minor formatting changes
2022-05-29 22:42:47 +03:00
source = src;
settings = [
{
builder = "brp-new";
translator = "cargo-toml-new";
}
];
})
// {
# checks.x86_64-linux.linemd = self.packages.x86_64-linux.linemd;
refactor: implement a validation system for builders / translators, reorganize files (#155) * refactor: implement a validation system for builders / translators etc, organize files * refactor: use seq instead of complicated validation function for validator * feat: allow adding discoverers, translators and builders via config * refactor: rework discoverers to use makeSubsystemModules as well * fix: validate extra modules properly * feat: support inline modules * feat: use extra attribute for extending * feat: make fetchers extensible properly * fix: add name to extra fetchers * feat: support list for extra * docs: add some comment to lib/modules.nix * fix: get extra module args from extraArgs * fix: collect all modules instead of only collecting modules for built-in subsystems * refactor: minor improvements * refactor: improve how default subsystem modules are declared * fix: translators and builders are directly under subsystem now * fix: correct attribute path, remove unused argument * fix: correct translators attribute paths * fix: correct file paths and translators attribute paths * fix: use correct translator attr path in wrapPureTranslator * fix: update unit tests code * fix: remove extra paranthesis in unit tests code * tests: add an extended dream2nix example * refactor: replace recursiveUpdate usage with normal update op * tests: fix and extend d2n-extended example * fix: pass config to d2n instance in wrap pure translator script * fix: correct toFile usage * fix: pass config to dlib in more places * fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator * refactor: remove unused extra modules validation, add warning for function modules * fix: remove non-existent inherited variable * docs: update translator attr path in contributors guide * docs: add docs for extending dream2nix * refactor: comment more code, warn for function modules only if extra is an attrset decl * docs: fix some typos * docs: explain some stuff in extending d2n better * fix: print function modules warning when it is a function * tests: add a new example that tests adding new subsystem and config.extra as nix file * tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs * feat: add ifd warning for builders * tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder * fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock * fix(rust/builders): delete cargo lock before writing it? * refactor: also print ifd warnings for translators * docs: link extending d2n doc in readme, link examples in extending d2n * docs: example naming (translators.new -> translators.example-translator) * feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators) * refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively * refactor: throw instead of warning if function declarations for modules are used * refactor: fix throw usage * refactor: improve modules code * chore(deps): update nixpkgs * fix: correct some map usages * fix: use correct attr path for extra modules * chore: update examples flake inputs * style: minor formatting changes
2022-05-29 22:42:47 +03:00
};
}