mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-08-16 18:00:30 +03:00
chore: use projects.toml in docs and examples
This commit is contained in:
parent
da780c7cdd
commit
01b5d43524
@ -72,6 +72,7 @@ Minimal Example `flake.nix`:
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
projects = ./projects.toml;
|
||||
};
|
||||
}
|
||||
```
|
||||
@ -86,6 +87,7 @@ Extensive Example `flake.nix`:
|
||||
config.projectRoot = ./.;
|
||||
|
||||
source = ./.;
|
||||
projects = ./projects.toml;
|
||||
|
||||
# Configure the behavior of dream2nix when translating projects.
|
||||
# A setting applies to all discovered projects if `filter` is unset,
|
||||
|
@ -32,6 +32,7 @@ Alternatively, we can define the targets in the `flake.nix` like so:
|
||||
systems = ["x86_64-linux"]; # <- This line.
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
projects = ./projects.toml;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
@ -24,6 +24,7 @@
|
||||
inherit systems;
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
projects = ./projects.toml;
|
||||
};
|
||||
in
|
||||
dream2nix.lib.dlib.mergeFlakes [
|
||||
|
9
examples/_d2n-extend-devShell/projects.toml
Normal file
9
examples/_d2n-extend-devShell/projects.toml
Normal file
@ -0,0 +1,9 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[prettier]
|
||||
name = "prettier"
|
||||
relPath = ""
|
||||
subsystem = "nodejs"
|
||||
translator = "yarn-lock"
|
@ -16,12 +16,8 @@
|
||||
./builders.nix
|
||||
];
|
||||
source = ./.;
|
||||
settings = [
|
||||
{
|
||||
builder = "dummy";
|
||||
translator = "dummy";
|
||||
}
|
||||
];
|
||||
# The dummy discoverer will discover a project `hello` automatically.
|
||||
autoProjects = true;
|
||||
})
|
||||
// {
|
||||
checks.x86_64-linux.hello = self.packages.x86_64-linux.hello;
|
||||
|
@ -50,12 +50,12 @@
|
||||
'')
|
||||
];
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
builder = "brp-new";
|
||||
translator = "cargo-toml-new";
|
||||
}
|
||||
];
|
||||
projects.linemd = {
|
||||
name = "linemd";
|
||||
subsystem = "rust";
|
||||
translator = "cargo-toml-new";
|
||||
builder = "brp-new";
|
||||
};
|
||||
})
|
||||
// {
|
||||
# checks.x86_64-linux.linemd = self.packages.x86_64-linux.linemd;
|
||||
|
16
examples/_d2n-extended/projects.toml
Normal file
16
examples/_d2n-extended/projects.toml
Normal file
@ -0,0 +1,16 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[linemd]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
subsystem = "rust"
|
||||
translator = "cargo-lock"
|
||||
translators = [ "cargo-lock", "cargo-toml",]
|
||||
|
||||
[[linemd.subsystemInfo.crates]]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
version = "0.4.0"
|
||||
|
@ -18,11 +18,6 @@
|
||||
pkgs = allPkgs;
|
||||
config.projectRoot = ./.;
|
||||
source = inp.src;
|
||||
settings = [
|
||||
{
|
||||
builder = "build-rust-package";
|
||||
translator = "cargo-lock";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
};
|
||||
}
|
||||
|
16
examples/_d2n-init-pkgs/projects.toml
Normal file
16
examples/_d2n-init-pkgs/projects.toml
Normal file
@ -0,0 +1,16 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[linemd]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
subsystem = "rust"
|
||||
translator = "cargo-lock"
|
||||
builder = "build-rust-package"
|
||||
|
||||
[[linemd.subsystemInfo.crates]]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
version = "0.4.0"
|
||||
|
@ -13,10 +13,6 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
translator = "cabal-freeze";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
});
|
||||
}
|
||||
|
9
examples/haskell_cabal-freeze/projects.toml
Normal file
9
examples/haskell_cabal-freeze/projects.toml
Normal file
@ -0,0 +1,9 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[main]
|
||||
name = "main"
|
||||
relPath = ""
|
||||
subsystem = "haskell"
|
||||
translator = "cabal-freeze"
|
@ -14,11 +14,7 @@
|
||||
pkgs = dream2nix.inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
source = src;
|
||||
config.projectRoot = ./.;
|
||||
settings = [
|
||||
{
|
||||
translator = "cabal-plan";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks.x86_64-linux.cabal2json = self.packages.x86_64-linux.cabal2json.overrideAttrs (old: {
|
||||
|
9
examples/haskell_cabal-plan/projects.toml
Normal file
9
examples/haskell_cabal-plan/projects.toml
Normal file
@ -0,0 +1,9 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[main]
|
||||
name = "main"
|
||||
relPath = ""
|
||||
subsystem = "haskell"
|
||||
translator = "cabal-plan"
|
@ -14,15 +14,7 @@
|
||||
pkgs = dream2nix.inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
source = src;
|
||||
config.projectRoot = ./.;
|
||||
settings = [
|
||||
{
|
||||
# Optionally, override the compiler version
|
||||
subsystemInfo.compiler = {
|
||||
name = "ghc";
|
||||
version = "8.10.7";
|
||||
};
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks = self.packages;
|
||||
|
14
examples/haskell_stack-lock/projects.toml
Normal file
14
examples/haskell_stack-lock/projects.toml
Normal file
@ -0,0 +1,14 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[main]
|
||||
name = "main"
|
||||
relPath = ""
|
||||
subsystem = "haskell"
|
||||
translator = "stack-lock"
|
||||
translators = [ "stack-lock",]
|
||||
|
||||
[[main.subsystemInfo.compiler]]
|
||||
name = "ghc"
|
||||
version = "8.10.7"
|
@ -14,12 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
subsystemInfo.noDev = true;
|
||||
aggregate = true;
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
checks = self.packages;
|
||||
|
15
examples/nodejs_eslint-aggreagted/projects.toml
Normal file
15
examples/nodejs_eslint-aggreagted/projects.toml
Normal file
@ -0,0 +1,15 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[eslint]
|
||||
name = "eslint"
|
||||
relPath = ""
|
||||
subsystem = "nodejs"
|
||||
translator = "package-json"
|
||||
translators = [ "package-json",]
|
||||
|
||||
[eslint.subsystemInfo]
|
||||
noDev = true
|
||||
noedjs = 18
|
||||
aggregated = true
|
@ -14,12 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
subsystemInfo.noDev = true;
|
||||
subsystemInfo.nodejs = 18;
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks = self.packages;
|
||||
|
14
examples/nodejs_eslint/projects.toml
Normal file
14
examples/nodejs_eslint/projects.toml
Normal file
@ -0,0 +1,14 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[eslint]
|
||||
name = "eslint"
|
||||
relPath = ""
|
||||
subsystem = "nodejs"
|
||||
translator = "package-json"
|
||||
translators = [ "package-json",]
|
||||
|
||||
[eslint.subsystemInfo]
|
||||
noDev = true
|
||||
noedjs = 18
|
@ -14,6 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
checks.x86_64-linux.prettier = self.packages.x86_64-linux.prettier;
|
||||
|
9
examples/nodejs_prettier/projects.toml
Normal file
9
examples/nodejs_prettier/projects.toml
Normal file
@ -0,0 +1,9 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[prettier]
|
||||
name = "prettier"
|
||||
relPath = ""
|
||||
subsystem = "nodejs"
|
||||
translator = "yarn-lock"
|
@ -11,8 +11,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
settings = [
|
||||
];
|
||||
autoProjects = true;
|
||||
})
|
||||
// {
|
||||
checks = self.packages;
|
||||
|
@ -14,7 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks = self.packages;
|
||||
|
12
examples/php_composer/projects.toml
Normal file
12
examples/php_composer/projects.toml
Normal file
@ -0,0 +1,12 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
["gipetto/cowsay"]
|
||||
name = "gipetto/cowsay"
|
||||
relPath = ""
|
||||
subsystem = "php"
|
||||
translator = "composer-lock"
|
||||
translators = [ "composer-lock", "composer-json",]
|
||||
|
||||
["gipetto/cowsay".subsystemInfo]
|
@ -14,14 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
# optionally define python version
|
||||
subsystemInfo.pythonVersion = "3.8";
|
||||
# optionally define extra setup requirements;
|
||||
subsystemInfo.extraSetupDeps = ["cython > 0.29"];
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
checks.x86_64-linux.aiohttp = self.packages.x86_64-linux.main;
|
||||
|
21
examples/python_pip/projects.toml
Normal file
21
examples/python_pip/projects.toml
Normal file
@ -0,0 +1,21 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[llhttp]
|
||||
name = "llhttp"
|
||||
relPath = "vendor/llhttp"
|
||||
subsystem = "nodejs"
|
||||
translator = "package-lock"
|
||||
|
||||
[main]
|
||||
name = "main"
|
||||
relPath = ""
|
||||
subsystem = "python"
|
||||
translator = "pip"
|
||||
|
||||
[llhttp.subsystemInfo]
|
||||
|
||||
[main.subsystemInfo]
|
||||
pythonAttr = "python3"
|
||||
pythonVersion = "3.8"
|
@ -14,5 +14,6 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = goblins;
|
||||
projects = ./projects.toml;
|
||||
});
|
||||
}
|
||||
|
11
examples/racket/projects.toml
Normal file
11
examples/racket/projects.toml
Normal file
@ -0,0 +1,11 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[goblins]
|
||||
name = "goblins"
|
||||
relPath = "goblins"
|
||||
subsystem = "racket"
|
||||
translator = "racket-impure"
|
||||
|
||||
[goblins.subsystemInfo]
|
@ -14,12 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
builder = "crane";
|
||||
translator = "cargo-toml";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks.x86_64-linux.linemd = self.packages.x86_64-linux.linemd;
|
||||
|
17
examples/rust_no-cargo-lock/projects.toml
Normal file
17
examples/rust_no-cargo-lock/projects.toml
Normal file
@ -0,0 +1,17 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[linemd]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
subsystem = "rust"
|
||||
translator = "cargo-toml"
|
||||
builder = "crane"
|
||||
|
||||
|
||||
[[linemd.subsystemInfo.crates]]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
version = "0.4.0"
|
||||
|
@ -14,12 +14,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
builder = "crane";
|
||||
translator = "cargo-lock";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
})
|
||||
// {
|
||||
# checks.x86_64-linux.ripgrep = self.packages.x86_64-linux.ripgrep;
|
||||
|
64
examples/rust_ripgrep/projects.toml
Normal file
64
examples/rust_ripgrep/projects.toml
Normal file
@ -0,0 +1,64 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[ripgrep]
|
||||
name = "ripgrep"
|
||||
relPath = ""
|
||||
subsystem = "rust"
|
||||
translator = "cargo-lock"
|
||||
translators = [ "cargo-lock", "cargo-toml",]
|
||||
builder = "crane"
|
||||
|
||||
[ripgrep.subsystemInfo]
|
||||
workspaceMembers = [ "crates/globset", "crates/grep", "crates/cli", "crates/matcher", "crates/pcre2", "crates/printer", "crates/regex", "crates/searcher", "crates/ignore",]
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "ripgrep"
|
||||
relPath = ""
|
||||
version = "13.0.0"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-cli"
|
||||
relPath = "crates/cli"
|
||||
version = "0.1.6"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "globset"
|
||||
relPath = "crates/globset"
|
||||
version = "0.4.7"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep"
|
||||
relPath = "crates/grep"
|
||||
version = "0.2.8"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "ignore"
|
||||
relPath = "crates/ignore"
|
||||
version = "0.4.18"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-matcher"
|
||||
relPath = "crates/matcher"
|
||||
version = "0.1.5"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-pcre2"
|
||||
relPath = "crates/pcre2"
|
||||
version = "0.1.5"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-printer"
|
||||
relPath = "crates/printer"
|
||||
version = "0.1.6"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-regex"
|
||||
relPath = "crates/regex"
|
||||
version = "0.1.9"
|
||||
|
||||
[[ripgrep.subsystemInfo.crates]]
|
||||
name = "grep-searcher"
|
||||
relPath = "crates/searcher"
|
||||
version = "0.1.8"
|
||||
|
@ -23,12 +23,7 @@
|
||||
systems = [system];
|
||||
config.projectRoot = ./.;
|
||||
source = src;
|
||||
settings = [
|
||||
{
|
||||
builder = "crane";
|
||||
translator = "cargo-lock";
|
||||
}
|
||||
];
|
||||
projects = ./projects.toml;
|
||||
packageOverrides = {
|
||||
# override all packages and set a toolchain
|
||||
"^.*" = {
|
||||
|
15
examples/rust_set-rust-toolchain/projects.toml
Normal file
15
examples/rust_set-rust-toolchain/projects.toml
Normal file
@ -0,0 +1,15 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
||||
[linemd]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
subsystem = "rust"
|
||||
translator = "cargo-lock"
|
||||
|
||||
[[linemd.subsystemInfo.crates]]
|
||||
name = "linemd"
|
||||
relPath = ""
|
||||
version = "0.4.0"
|
||||
|
@ -1,3 +1,3 @@
|
||||
# To re-generate this file, run:
|
||||
# nix run github:nix-community/dream2nix#detect-projects $source
|
||||
# ... where `$source` points to the source of your project
|
||||
# ... where `$source` points to the source of your project.
|
||||
|
@ -5,5 +5,6 @@
|
||||
systemsFromFile = ./nix_systems;
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
projects = ./projects.toml;
|
||||
};
|
||||
}
|
||||
|
@ -23,5 +23,6 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
autoProjects = true;
|
||||
});
|
||||
}
|
||||
|
@ -24,5 +24,6 @@
|
||||
config.projectRoot = ./.;
|
||||
packageOverrides = {};
|
||||
source = ./.;
|
||||
autoProjects = true;
|
||||
};
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
systems = ["x86_64-linux"];
|
||||
config.projectRoot = ./.;
|
||||
source = ./.;
|
||||
autoProjects = true;
|
||||
packageOverrides = {
|
||||
test = {
|
||||
"check-linked-bin-version" = {
|
||||
|
Loading…
Reference in New Issue
Block a user