Merge remote-tracking branch 'origin/master' into haskell-updates
This commit is contained in:
commit
019780631c
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -12,6 +12,7 @@ result-*
|
|||
|
||||
.DS_Store
|
||||
.mypy_cache
|
||||
__pycache__
|
||||
|
||||
/pkgs/development/libraries/qt-5/*/tmp/
|
||||
/pkgs/desktops/kde-5/*/tmp/
|
||||
|
|
|
@ -538,8 +538,123 @@ buildPythonPackage rec {
|
|||
```
|
||||
Note also the line `doCheck = false;`, we explicitly disabled running the test-suite.
|
||||
|
||||
#### Testing Python Packages
|
||||
|
||||
#### Develop local package
|
||||
It is highly encouraged to have testing as part of the package build. This
|
||||
helps to avoid situations where the package was able to build and install,
|
||||
but is not usable at runtime. Currently, all packages will use the `test`
|
||||
command provided by the setup.py (i.e. `python setup.py test`). However,
|
||||
this is currently deprecated https://github.com/pypa/setuptools/pull/1878
|
||||
and your package should provide its own checkPhase.
|
||||
|
||||
*NOTE:* The `checkPhase` for python maps to the `installCheckPhase` on a
|
||||
normal derivation. This is due to many python packages not behaving well
|
||||
to the pre-installed version of the package. Version info, and natively
|
||||
compiled extensions generally only exist in the install directory, and
|
||||
thus can cause issues when a test suite asserts on that behavior.
|
||||
|
||||
*NOTE:* Tests should only be disabled if they don't agree with nix
|
||||
(e.g. external dependencies, network access, flakey tests), however,
|
||||
as many tests should be enabled as possible. Failing tests can still be
|
||||
a good indication that the package is not in a valid state.
|
||||
|
||||
#### Using pytest
|
||||
|
||||
Pytest is the most common test runner for python repositories. A trivial
|
||||
test run would be:
|
||||
```
|
||||
checkInputs = [ pytest ];
|
||||
checkPhase = "pytest";
|
||||
```
|
||||
|
||||
However, many repositories' test suites do not translate well to nix's build
|
||||
sandbox, and will generally need many tests to be disabled.
|
||||
|
||||
To filter tests using pytest, one can do the following:
|
||||
```
|
||||
checkInputs = [ pytest ];
|
||||
# avoid tests which need additional data or touch network
|
||||
checkPhase = ''
|
||||
pytest tests/ --ignore=tests/integration -k 'not download and not update'
|
||||
'';
|
||||
```
|
||||
|
||||
`--ignore` will tell pytest to ignore that file or directory from being
|
||||
collected as part of a test run. This is useful is a file uses a package
|
||||
which is not available in nixpkgs, thus skipping that test file is much
|
||||
easier than having to create a new package.
|
||||
|
||||
`-k` is used to define a predicate for test names. In this example, we are
|
||||
filtering out tests which contain `download` or `update` in their test case name.
|
||||
Only one `-k` argument is allows, and thus a long predicate should be concatenated
|
||||
with "\" and wrapped to the next line.
|
||||
|
||||
*NOTE:* In pytest==6.0.1, the use of "\" to continue a line (e.g. `-k 'not download \'`) has
|
||||
been removed, in this case, it's recommended to use `pytestCheckHook`.
|
||||
|
||||
#### Using pytestCheckHook
|
||||
|
||||
`pytestCheckHook` is a convenient hook which will substitute the setuptools
|
||||
`test` command for a checkPhase which runs `pytest`. This is also beneficial
|
||||
when a package may need many items disabled to run the test suite.
|
||||
|
||||
Using the example above, the analagous pytestCheckHook usage would be:
|
||||
```
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
# requires additional data
|
||||
pytestFlagsArray = [ "tests/" "--ignore=tests/integration" ];
|
||||
|
||||
disabledTests = [
|
||||
# touches network
|
||||
"download"
|
||||
"update"
|
||||
];
|
||||
```
|
||||
|
||||
This is expecially useful when tests need to be conditionallydisabled,
|
||||
for example:
|
||||
|
||||
```
|
||||
disabledTests = [
|
||||
# touches network
|
||||
"download"
|
||||
"update"
|
||||
] ++ lib.optionals (pythonAtLeast "3.8") [
|
||||
# broken due to python3.8 async changes
|
||||
"async"
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
# can fail when building with other packages
|
||||
"socket"
|
||||
];
|
||||
```
|
||||
Trying to concatenate the related strings to disable tests in a regular checkPhase
|
||||
would be much harder to read. This also enables us to comment on why specific tests
|
||||
are disabled.
|
||||
|
||||
#### Using pythonImportsCheck
|
||||
|
||||
Although unit tests are highly prefered to valid correctness of a package. Not
|
||||
all packages have test suites that can be ran easily, and some have none at all.
|
||||
To help ensure the package still works, `pythonImportsCheck` can attempt to import
|
||||
the listed modules.
|
||||
|
||||
```
|
||||
pythonImportsCheck = [ "requests" "urllib" ];
|
||||
```
|
||||
roughly translates to:
|
||||
```
|
||||
postCheck = ''
|
||||
PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
||||
python -c "import requests; import urllib"
|
||||
'';
|
||||
```
|
||||
However, this is done in it's own phase, and not dependent on whether `doCheck = true;`
|
||||
|
||||
This can also be useful in verifying that the package doesn't assume commonly
|
||||
present packages (e.g. `setuptools`)
|
||||
|
||||
### Develop local package
|
||||
|
||||
As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
|
||||
(`python setup.py develop`); instead of installing the package this command
|
||||
|
@ -640,8 +755,8 @@ and in this case the `python38` interpreter is automatically used.
|
|||
|
||||
### Interpreters
|
||||
|
||||
Versions 2.7, 3.5, 3.6, 3.7 and 3.8 of the CPython interpreter are available as
|
||||
respectively `python27`, `python35`, `python36`, `python37` and `python38`. The
|
||||
Versions 2.7, 3.6, 3.7 and 3.8 of the CPython interpreter are available as
|
||||
respectively `python27`, `python36`, `python37` and `python38`. The
|
||||
aliases `python2` and `python3` correspond to respectively `python27` and
|
||||
`python38`. The default interpreter, `python`, maps to `python2`. The PyPy
|
||||
interpreters compatible with Python 2.7 and 3 are available as `pypy27` and
|
||||
|
@ -689,15 +804,16 @@ attribute set is created for each available Python interpreter. The available
|
|||
sets are
|
||||
|
||||
* `pkgs.python27Packages`
|
||||
* `pkgs.python35Packages`
|
||||
* `pkgs.python36Packages`
|
||||
* `pkgs.python37Packages`
|
||||
* `pkgs.python38Packages`
|
||||
* `pkgs.python39Packages`
|
||||
* `pkgs.pypyPackages`
|
||||
|
||||
and the aliases
|
||||
|
||||
* `pkgs.python2Packages` pointing to `pkgs.python27Packages`
|
||||
* `pkgs.python3Packages` pointing to `pkgs.python37Packages`
|
||||
* `pkgs.python3Packages` pointing to `pkgs.python38Packages`
|
||||
* `pkgs.pythonPackages` pointing to `pkgs.python2Packages`
|
||||
|
||||
#### `buildPythonPackage` function
|
||||
|
@ -1016,7 +1132,7 @@ are used in `buildPythonPackage`.
|
|||
- `pipBuildHook` to build a wheel using `pip` and PEP 517. Note a build system
|
||||
(e.g. `setuptools` or `flit`) should still be added as `nativeBuildInput`.
|
||||
- `pipInstallHook` to install wheels.
|
||||
- `pytestCheckHook` to run tests with `pytest`.
|
||||
- `pytestCheckHook` to run tests with `pytest`. See [example usage](#using-pytestcheckhook).
|
||||
- `pythonCatchConflictsHook` to check whether a Python package is not already existing.
|
||||
- `pythonImportsCheckHook` to check whether importing the listed modules works.
|
||||
- `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder.
|
||||
|
|
|
@ -43,7 +43,6 @@ rustPlatform.buildRustPackage rec {
|
|||
homepage = "https://github.com/BurntSushi/ripgrep";
|
||||
license = licenses.unlicense;
|
||||
maintainers = [ maintainers.tailhook ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
|
|
@ -254,7 +254,7 @@ let f(h, h + 1, i) = i + h
|
|||
|
||||
<variablelist>
|
||||
<title>Variables specifying dependencies</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsBuildBuild">
|
||||
<term>
|
||||
<varname>depsBuildBuild</varname>
|
||||
</term>
|
||||
|
@ -267,7 +267,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-nativeBuildInputs">
|
||||
<term>
|
||||
<varname>nativeBuildInputs</varname>
|
||||
</term>
|
||||
|
@ -280,7 +280,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsBuildTarget">
|
||||
<term>
|
||||
<varname>depsBuildTarget</varname>
|
||||
</term>
|
||||
|
@ -296,7 +296,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsHostHost">
|
||||
<term>
|
||||
<varname>depsHostHost</varname>
|
||||
</term>
|
||||
|
@ -306,7 +306,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-buildInputs">
|
||||
<term>
|
||||
<varname>buildInputs</varname>
|
||||
</term>
|
||||
|
@ -319,7 +319,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsTargetTarget">
|
||||
<term>
|
||||
<varname>depsTargetTarget</varname>
|
||||
</term>
|
||||
|
@ -329,7 +329,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsBuildBuildPropagated">
|
||||
<term>
|
||||
<varname>depsBuildBuildPropagated</varname>
|
||||
</term>
|
||||
|
@ -339,7 +339,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-propagatedNativeBuildInputs">
|
||||
<term>
|
||||
<varname>propagatedNativeBuildInputs</varname>
|
||||
</term>
|
||||
|
@ -349,7 +349,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsBuildTargetPropagated">
|
||||
<term>
|
||||
<varname>depsBuildTargetPropagated</varname>
|
||||
</term>
|
||||
|
@ -359,7 +359,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsHostHostPropagated">
|
||||
<term>
|
||||
<varname>depsHostHostPropagated</varname>
|
||||
</term>
|
||||
|
@ -369,7 +369,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-propagatedBuildInputs">
|
||||
<term>
|
||||
<varname>propagatedBuildInputs</varname>
|
||||
</term>
|
||||
|
@ -379,7 +379,7 @@ let f(h, h + 1, i) = i + h
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-depsTargetTargetPropagated">
|
||||
<term>
|
||||
<varname>depsTargetTargetPropagated</varname>
|
||||
</term>
|
||||
|
@ -396,7 +396,7 @@ let f(h, h + 1, i) = i + h
|
|||
|
||||
<variablelist>
|
||||
<title>Variables affecting <literal>stdenv</literal> initialisation</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-NIX_DEBUG">
|
||||
<term>
|
||||
<varname>NIX_DEBUG</varname>
|
||||
</term>
|
||||
|
@ -410,7 +410,7 @@ let f(h, h + 1, i) = i + h
|
|||
|
||||
<variablelist>
|
||||
<title>Attributes affecting build properties</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-enableParallelBuilding">
|
||||
<term>
|
||||
<varname>enableParallelBuilding</varname>
|
||||
</term>
|
||||
|
@ -427,7 +427,7 @@ let f(h, h + 1, i) = i + h
|
|||
|
||||
<variablelist>
|
||||
<title>Special variables</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-passthru">
|
||||
<term>
|
||||
<varname>passthru</varname>
|
||||
</term>
|
||||
|
@ -504,7 +504,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
There are a number of variables that control what phases are executed and in what order:
|
||||
<variablelist>
|
||||
<title>Variables affecting phase control</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-phases">
|
||||
<term>
|
||||
<varname>phases</varname>
|
||||
</term>
|
||||
|
@ -517,7 +517,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-prePhases">
|
||||
<term>
|
||||
<varname>prePhases</varname>
|
||||
</term>
|
||||
|
@ -527,7 +527,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preConfigurePhases">
|
||||
<term>
|
||||
<varname>preConfigurePhases</varname>
|
||||
</term>
|
||||
|
@ -537,7 +537,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preBuildPhases">
|
||||
<term>
|
||||
<varname>preBuildPhases</varname>
|
||||
</term>
|
||||
|
@ -547,7 +547,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preInstallPhases">
|
||||
<term>
|
||||
<varname>preInstallPhases</varname>
|
||||
</term>
|
||||
|
@ -557,7 +557,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preFixupPhases">
|
||||
<term>
|
||||
<varname>preFixupPhases</varname>
|
||||
</term>
|
||||
|
@ -567,7 +567,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preDistPhases">
|
||||
<term>
|
||||
<varname>preDistPhases</varname>
|
||||
</term>
|
||||
|
@ -577,7 +577,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postPhases">
|
||||
<term>
|
||||
<varname>postPhases</varname>
|
||||
</term>
|
||||
|
@ -635,7 +635,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the unpack phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-src">
|
||||
<term>
|
||||
<varname>srcs</varname> / <varname>src</varname>
|
||||
</term>
|
||||
|
@ -645,7 +645,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-sourceRoot">
|
||||
<term>
|
||||
<varname>sourceRoot</varname>
|
||||
</term>
|
||||
|
@ -655,7 +655,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-setSourceRoot">
|
||||
<term>
|
||||
<varname>setSourceRoot</varname>
|
||||
</term>
|
||||
|
@ -665,7 +665,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preUnpack">
|
||||
<term>
|
||||
<varname>preUnpack</varname>
|
||||
</term>
|
||||
|
@ -675,7 +675,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postUnpack">
|
||||
<term>
|
||||
<varname>postUnpack</varname>
|
||||
</term>
|
||||
|
@ -685,7 +685,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontUnpack">
|
||||
<term>
|
||||
<varname>dontUnpack</varname>
|
||||
</term>
|
||||
|
@ -695,7 +695,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontMakeSourcesWritable">
|
||||
<term>
|
||||
<varname>dontMakeSourcesWritable</varname>
|
||||
</term>
|
||||
|
@ -705,7 +705,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-unpackCmd">
|
||||
<term>
|
||||
<varname>unpackCmd</varname>
|
||||
</term>
|
||||
|
@ -727,7 +727,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the patch phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontPatch">
|
||||
<term>
|
||||
<varname>dontPatch</varname>
|
||||
</term>
|
||||
|
@ -737,7 +737,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-patches">
|
||||
<term>
|
||||
<varname>patches</varname>
|
||||
</term>
|
||||
|
@ -747,7 +747,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-patchFlags">
|
||||
<term>
|
||||
<varname>patchFlags</varname>
|
||||
</term>
|
||||
|
@ -757,7 +757,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-prePatch">
|
||||
<term>
|
||||
<varname>prePatch</varname>
|
||||
</term>
|
||||
|
@ -767,7 +767,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postPatch">
|
||||
<term>
|
||||
<varname>postPatch</varname>
|
||||
</term>
|
||||
|
@ -789,7 +789,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the configure phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-configureScript">
|
||||
<term>
|
||||
<varname>configureScript</varname>
|
||||
</term>
|
||||
|
@ -799,7 +799,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-configureFlags">
|
||||
<term>
|
||||
<varname>configureFlags</varname>
|
||||
</term>
|
||||
|
@ -809,7 +809,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontConfigure">
|
||||
<term>
|
||||
<varname>dontConfigure</varname>
|
||||
</term>
|
||||
|
@ -819,7 +819,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-configureFlagsArray">
|
||||
<term>
|
||||
<varname>configureFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -829,7 +829,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontAddPrefix">
|
||||
<term>
|
||||
<varname>dontAddPrefix</varname>
|
||||
</term>
|
||||
|
@ -839,7 +839,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-prefix">
|
||||
<term>
|
||||
<varname>prefix</varname>
|
||||
</term>
|
||||
|
@ -849,7 +849,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-prefixKey">
|
||||
<term>
|
||||
<varname>prefixKey</varname>
|
||||
</term>
|
||||
|
@ -859,7 +859,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontAddDisableDepTrack">
|
||||
<term>
|
||||
<varname>dontAddDisableDepTrack</varname>
|
||||
</term>
|
||||
|
@ -869,7 +869,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontFixLibtool">
|
||||
<term>
|
||||
<varname>dontFixLibtool</varname>
|
||||
</term>
|
||||
|
@ -885,7 +885,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontDisableStatic">
|
||||
<term>
|
||||
<varname>dontDisableStatic</varname>
|
||||
</term>
|
||||
|
@ -898,7 +898,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-configurePlatforms">
|
||||
<term>
|
||||
<varname>configurePlatforms</varname>
|
||||
</term>
|
||||
|
@ -913,7 +913,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preConfigure">
|
||||
<term>
|
||||
<varname>preConfigure</varname>
|
||||
</term>
|
||||
|
@ -923,7 +923,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postConfigure">
|
||||
<term>
|
||||
<varname>postConfigure</varname>
|
||||
</term>
|
||||
|
@ -945,7 +945,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the build phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontBuild">
|
||||
<term>
|
||||
<varname>dontBuild</varname>
|
||||
</term>
|
||||
|
@ -955,7 +955,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-makefile">
|
||||
<term>
|
||||
<varname>makefile</varname>
|
||||
</term>
|
||||
|
@ -965,7 +965,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-makeFlags">
|
||||
<term>
|
||||
<varname>makeFlags</varname>
|
||||
</term>
|
||||
|
@ -983,7 +983,7 @@ makeFlags = [ "PREFIX=$(out)" ];
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-makeFlagsArray">
|
||||
<term>
|
||||
<varname>makeFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -999,7 +999,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-buildFlags">
|
||||
<term>
|
||||
<varname>buildFlags</varname> / <varname>buildFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -1009,7 +1009,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preBuild">
|
||||
<term>
|
||||
<varname>preBuild</varname>
|
||||
</term>
|
||||
|
@ -1019,7 +1019,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postBuild">
|
||||
<term>
|
||||
<varname>postBuild</varname>
|
||||
</term>
|
||||
|
@ -1049,7 +1049,7 @@ preBuild = ''
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the check phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-doCheck">
|
||||
<term>
|
||||
<varname>doCheck</varname>
|
||||
</term>
|
||||
|
@ -1067,11 +1067,11 @@ preBuild = ''
|
|||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
See the build phase for details.
|
||||
See the <link xlink:href="#var-stdenv-makeFlags">build phase</link> for details.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-checkTarget">
|
||||
<term>
|
||||
<varname>checkTarget</varname>
|
||||
</term>
|
||||
|
@ -1081,7 +1081,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-checkFlags">
|
||||
<term>
|
||||
<varname>checkFlags</varname> / <varname>checkFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -1091,7 +1091,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-checkInputs">
|
||||
<term>
|
||||
<varname>checkInputs</varname>
|
||||
</term>
|
||||
|
@ -1101,7 +1101,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preCheck">
|
||||
<term>
|
||||
<varname>preCheck</varname>
|
||||
</term>
|
||||
|
@ -1111,7 +1111,7 @@ preBuild = ''
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postCheck">
|
||||
<term>
|
||||
<varname>postCheck</varname>
|
||||
</term>
|
||||
|
@ -1133,7 +1133,7 @@ preBuild = ''
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the install phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontInstall">
|
||||
<term>
|
||||
<varname>dontInstall</varname>
|
||||
</term>
|
||||
|
@ -1149,11 +1149,11 @@ preBuild = ''
|
|||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
See the build phase for details.
|
||||
See the <link xlink:href="#var-stdenv-makeFlags">build phase</link> for details.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-installTargets">
|
||||
<term>
|
||||
<varname>installTargets</varname>
|
||||
</term>
|
||||
|
@ -1165,7 +1165,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-installFlags">
|
||||
<term>
|
||||
<varname>installFlags</varname> / <varname>installFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -1175,7 +1175,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preInstall">
|
||||
<term>
|
||||
<varname>preInstall</varname>
|
||||
</term>
|
||||
|
@ -1185,7 +1185,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postInstall">
|
||||
<term>
|
||||
<varname>postInstall</varname>
|
||||
</term>
|
||||
|
@ -1229,7 +1229,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the fixup phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontFixup">
|
||||
<term>
|
||||
<varname>dontFixup</varname>
|
||||
</term>
|
||||
|
@ -1239,7 +1239,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontStrip">
|
||||
<term>
|
||||
<varname>dontStrip</varname>
|
||||
</term>
|
||||
|
@ -1249,7 +1249,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontStripHost">
|
||||
<term>
|
||||
<varname>dontStripHost</varname>
|
||||
</term>
|
||||
|
@ -1259,7 +1259,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontStripTarget">
|
||||
<term>
|
||||
<varname>dontStripTarget</varname>
|
||||
</term>
|
||||
|
@ -1269,7 +1269,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontMoveSbin">
|
||||
<term>
|
||||
<varname>dontMoveSbin</varname>
|
||||
</term>
|
||||
|
@ -1279,7 +1279,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-stripAllList">
|
||||
<term>
|
||||
<varname>stripAllList</varname>
|
||||
</term>
|
||||
|
@ -1289,7 +1289,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-stripAllFlags">
|
||||
<term>
|
||||
<varname>stripAllFlags</varname>
|
||||
</term>
|
||||
|
@ -1299,7 +1299,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-stripDebugList">
|
||||
<term>
|
||||
<varname>stripDebugList</varname>
|
||||
</term>
|
||||
|
@ -1309,7 +1309,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-stripDebugFlags">
|
||||
<term>
|
||||
<varname>stripDebugFlags</varname>
|
||||
</term>
|
||||
|
@ -1319,7 +1319,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontPatchELF">
|
||||
<term>
|
||||
<varname>dontPatchELF</varname>
|
||||
</term>
|
||||
|
@ -1329,7 +1329,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontPatchShebangs">
|
||||
<term>
|
||||
<varname>dontPatchShebangs</varname>
|
||||
</term>
|
||||
|
@ -1339,7 +1339,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontPruneLibtoolFiles">
|
||||
<term>
|
||||
<varname>dontPruneLibtoolFiles</varname>
|
||||
</term>
|
||||
|
@ -1349,7 +1349,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-forceShare">
|
||||
<term>
|
||||
<varname>forceShare</varname>
|
||||
</term>
|
||||
|
@ -1359,7 +1359,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-setupHook">
|
||||
<term>
|
||||
<varname>setupHook</varname>
|
||||
</term>
|
||||
|
@ -1370,7 +1370,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preFixup">
|
||||
<term>
|
||||
<varname>preFixup</varname>
|
||||
</term>
|
||||
|
@ -1380,7 +1380,7 @@ installTargets = "install-bin install-doc";</programlisting>
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postFixup">
|
||||
<term>
|
||||
<varname>postFixup</varname>
|
||||
</term>
|
||||
|
@ -1419,7 +1419,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the installCheck phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-doInstallCheck">
|
||||
<term>
|
||||
<varname>doInstallCheck</varname>
|
||||
</term>
|
||||
|
@ -1431,7 +1431,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-installCheckTarget">
|
||||
<term>
|
||||
<varname>installCheckTarget</varname>
|
||||
</term>
|
||||
|
@ -1441,7 +1441,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-installCheckFlags">
|
||||
<term>
|
||||
<varname>installCheckFlags</varname> / <varname>installCheckFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -1451,7 +1451,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-installCheckInputs">
|
||||
<term>
|
||||
<varname>installCheckInputs</varname>
|
||||
</term>
|
||||
|
@ -1461,7 +1461,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preInstallCheck">
|
||||
<term>
|
||||
<varname>preInstallCheck</varname>
|
||||
</term>
|
||||
|
@ -1471,7 +1471,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postInstallCheck">
|
||||
<term>
|
||||
<varname>postInstallCheck</varname>
|
||||
</term>
|
||||
|
@ -1493,7 +1493,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
|
||||
<variablelist>
|
||||
<title>Variables controlling the distribution phase</title>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-distTarget">
|
||||
<term>
|
||||
<varname>distTarget</varname>
|
||||
</term>
|
||||
|
@ -1503,7 +1503,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-distFlags">
|
||||
<term>
|
||||
<varname>distFlags</varname> / <varname>distFlagsArray</varname>
|
||||
</term>
|
||||
|
@ -1513,7 +1513,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-tarballs">
|
||||
<term>
|
||||
<varname>tarballs</varname>
|
||||
</term>
|
||||
|
@ -1523,7 +1523,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-dontCopyDist">
|
||||
<term>
|
||||
<varname>dontCopyDist</varname>
|
||||
</term>
|
||||
|
@ -1533,7 +1533,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-preDist">
|
||||
<term>
|
||||
<varname>preDist</varname>
|
||||
</term>
|
||||
|
@ -1543,7 +1543,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<varlistentry xml:id="var-stdenv-postDist">
|
||||
<term>
|
||||
<varname>postDist</varname>
|
||||
</term>
|
||||
|
|
|
@ -85,6 +85,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) {
|
|||
fullName = ''Beerware License'';
|
||||
};
|
||||
|
||||
blueOak100 = spdx {
|
||||
spdxId = "BlueOak-1.0.0";
|
||||
fullName = "Blue Oak Model License 1.0.0";
|
||||
};
|
||||
|
||||
bsd0 = spdx {
|
||||
spdxId = "0BSD";
|
||||
fullName = "BSD Zero Clause License";
|
||||
|
|
160
lib/modules.nix
160
lib/modules.nix
|
@ -58,6 +58,23 @@ rec {
|
|||
default = check;
|
||||
description = "Whether to check whether all option definitions have matching declarations.";
|
||||
};
|
||||
|
||||
_module.freeformType = mkOption {
|
||||
# Disallow merging for now, but could be implemented nicely with a `types.optionType`
|
||||
type = types.nullOr (types.uniq types.attrs);
|
||||
internal = true;
|
||||
default = null;
|
||||
description = ''
|
||||
If set, merge all definitions that don't have an associated option
|
||||
together using this type. The result then gets combined with the
|
||||
values of all declared options to produce the final <literal>
|
||||
config</literal> value.
|
||||
|
||||
If this is <literal>null</literal>, definitions without an option
|
||||
will throw an error unless <option>_module.check</option> is
|
||||
turned off.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@ -65,35 +82,55 @@ rec {
|
|||
};
|
||||
};
|
||||
|
||||
collected = collectModules
|
||||
(specialArgs.modulesPath or "")
|
||||
(modules ++ [ internalModule ])
|
||||
({ inherit config options lib; } // specialArgs);
|
||||
merged =
|
||||
let collected = collectModules
|
||||
(specialArgs.modulesPath or "")
|
||||
(modules ++ [ internalModule ])
|
||||
({ inherit lib options config; } // specialArgs);
|
||||
in mergeModules prefix (reverseList collected);
|
||||
|
||||
options = mergeModules prefix (reverseList collected);
|
||||
options = merged.matchedOptions;
|
||||
|
||||
# Traverse options and extract the option values into the final
|
||||
# config set. At the same time, check whether all option
|
||||
# definitions have matching declarations.
|
||||
# !!! _module.check's value can't depend on any other config values
|
||||
# without an infinite recursion. One way around this is to make the
|
||||
# 'config' passed around to the modules be unconditionally unchecked,
|
||||
# and only do the check in 'result'.
|
||||
config = yieldConfig prefix options;
|
||||
yieldConfig = prefix: set:
|
||||
let res = removeAttrs (mapAttrs (n: v:
|
||||
if isOption v then v.value
|
||||
else yieldConfig (prefix ++ [n]) v) set) ["_definedNames"];
|
||||
in
|
||||
if options._module.check.value && set ? _definedNames then
|
||||
foldl' (res: m:
|
||||
foldl' (res: name:
|
||||
if set ? ${name} then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")
|
||||
res m.names)
|
||||
res set._definedNames
|
||||
else
|
||||
res;
|
||||
result = {
|
||||
config =
|
||||
let
|
||||
|
||||
# For definitions that have an associated option
|
||||
declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
|
||||
|
||||
# If freeformType is set, this is for definitions that don't have an associated option
|
||||
freeformConfig =
|
||||
let
|
||||
defs = map (def: {
|
||||
file = def.file;
|
||||
value = setAttrByPath def.prefix def.value;
|
||||
}) merged.unmatchedDefns;
|
||||
in if defs == [] then {}
|
||||
else declaredConfig._module.freeformType.merge prefix defs;
|
||||
|
||||
in if declaredConfig._module.freeformType == null then declaredConfig
|
||||
# Because all definitions that had an associated option ended in
|
||||
# declaredConfig, freeformConfig can only contain the non-option
|
||||
# paths, meaning recursiveUpdate will never override any value
|
||||
else recursiveUpdate freeformConfig declaredConfig;
|
||||
|
||||
checkUnmatched =
|
||||
if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
|
||||
let
|
||||
firstDef = head merged.unmatchedDefns;
|
||||
baseMsg = "The option `${showOption (prefix ++ firstDef.prefix)}' defined in `${firstDef.file}' does not exist.";
|
||||
in
|
||||
if attrNames options == [ "_module" ]
|
||||
then throw ''
|
||||
${baseMsg}
|
||||
|
||||
However there are no options defined in `${showOption prefix}'. Are you sure you've
|
||||
declared your options properly? This can happen if you e.g. declared your options in `types.submodule'
|
||||
under `config' rather than `options'.
|
||||
''
|
||||
else throw baseMsg
|
||||
else null;
|
||||
|
||||
result = builtins.seq checkUnmatched {
|
||||
inherit options;
|
||||
config = removeAttrs config [ "_module" ];
|
||||
inherit (config) _module;
|
||||
|
@ -174,12 +211,16 @@ rec {
|
|||
/* Massage a module into canonical form, that is, a set consisting
|
||||
of ‘options’, ‘config’ and ‘imports’ attributes. */
|
||||
unifyModuleSyntax = file: key: m:
|
||||
let addMeta = config: if m ? meta
|
||||
then mkMerge [ config { meta = m.meta; } ]
|
||||
else config;
|
||||
let
|
||||
addMeta = config: if m ? meta
|
||||
then mkMerge [ config { meta = m.meta; } ]
|
||||
else config;
|
||||
addFreeformType = config: if m ? freeformType
|
||||
then mkMerge [ config { _module.freeformType = m.freeformType; } ]
|
||||
else config;
|
||||
in
|
||||
if m ? config || m ? options then
|
||||
let badAttrs = removeAttrs m ["_file" "key" "disabledModules" "imports" "options" "config" "meta"]; in
|
||||
let badAttrs = removeAttrs m ["_file" "key" "disabledModules" "imports" "options" "config" "meta" "freeformType"]; in
|
||||
if badAttrs != {} then
|
||||
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: ${toString (attrNames badAttrs)}) into the explicit `config' attribute."
|
||||
else
|
||||
|
@ -188,7 +229,7 @@ rec {
|
|||
disabledModules = m.disabledModules or [];
|
||||
imports = m.imports or [];
|
||||
options = m.options or {};
|
||||
config = addMeta (m.config or {});
|
||||
config = addFreeformType (addMeta (m.config or {}));
|
||||
}
|
||||
else
|
||||
{ _file = m._file or file;
|
||||
|
@ -196,7 +237,7 @@ rec {
|
|||
disabledModules = m.disabledModules or [];
|
||||
imports = m.require or [] ++ m.imports or [];
|
||||
options = {};
|
||||
config = addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports"]);
|
||||
config = addFreeformType (addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"]));
|
||||
};
|
||||
|
||||
applyIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
|
||||
|
@ -233,7 +274,23 @@ rec {
|
|||
declarations in all modules, combining them into a single set.
|
||||
At the same time, for each option declaration, it will merge the
|
||||
corresponding option definitions in all machines, returning them
|
||||
in the ‘value’ attribute of each option. */
|
||||
in the ‘value’ attribute of each option.
|
||||
|
||||
This returns a set like
|
||||
{
|
||||
# A recursive set of options along with their final values
|
||||
matchedOptions = {
|
||||
foo = { _type = "option"; value = "option value of foo"; ... };
|
||||
bar.baz = { _type = "option"; value = "option value of bar.baz"; ... };
|
||||
...
|
||||
};
|
||||
# A list of definitions that weren't matched by any option
|
||||
unmatchedDefns = [
|
||||
{ file = "file.nix"; prefix = [ "qux" ]; value = "qux"; }
|
||||
...
|
||||
];
|
||||
}
|
||||
*/
|
||||
mergeModules = prefix: modules:
|
||||
mergeModules' prefix modules
|
||||
(concatMap (m: map (config: { file = m._file; inherit config; }) (pushDownProperties m.config)) modules);
|
||||
|
@ -280,9 +337,9 @@ rec {
|
|||
defnsByName' = byName "config" (module: value:
|
||||
[{ inherit (module) file; inherit value; }]
|
||||
) configs;
|
||||
in
|
||||
(flip mapAttrs declsByName (name: decls:
|
||||
# We're descending into attribute ‘name’.
|
||||
|
||||
resultsByName = flip mapAttrs declsByName (name: decls:
|
||||
# We're descending into attribute ‘name’.
|
||||
let
|
||||
loc = prefix ++ [name];
|
||||
defns = defnsByName.${name} or [];
|
||||
|
@ -291,7 +348,10 @@ rec {
|
|||
in
|
||||
if nrOptions == length decls then
|
||||
let opt = fixupOptionType loc (mergeOptionDecls loc decls);
|
||||
in evalOptionValue loc opt defns'
|
||||
in {
|
||||
matchedOptions = evalOptionValue loc opt defns';
|
||||
unmatchedDefns = [];
|
||||
}
|
||||
else if nrOptions != 0 then
|
||||
let
|
||||
firstOption = findFirst (m: isOption m.options) "" decls;
|
||||
|
@ -299,9 +359,27 @@ rec {
|
|||
in
|
||||
throw "The option `${showOption loc}' in `${firstOption._file}' is a prefix of options in `${firstNonOption._file}'."
|
||||
else
|
||||
mergeModules' loc decls defns
|
||||
))
|
||||
// { _definedNames = map (m: { inherit (m) file; names = attrNames m.config; }) configs; };
|
||||
mergeModules' loc decls defns);
|
||||
|
||||
matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
|
||||
|
||||
# an attrset 'name' => list of unmatched definitions for 'name'
|
||||
unmatchedDefnsByName =
|
||||
# Propagate all unmatched definitions from nested option sets
|
||||
mapAttrs (n: v: v.unmatchedDefns) resultsByName
|
||||
# Plus the definitions for the current prefix that don't have a matching option
|
||||
// removeAttrs defnsByName' (attrNames matchedOptions);
|
||||
in {
|
||||
inherit matchedOptions;
|
||||
|
||||
# Transforms unmatchedDefnsByName into a list of definitions
|
||||
unmatchedDefns = concatLists (mapAttrsToList (name: defs:
|
||||
map (def: def // {
|
||||
# Set this so we know when the definition first left unmatched territory
|
||||
prefix = [name] ++ (def.prefix or []);
|
||||
}) defs
|
||||
) unmatchedDefnsByName);
|
||||
};
|
||||
|
||||
/* Merge multiple option declarations into a single declaration. In
|
||||
general, there should be only one declaration of each option.
|
||||
|
|
|
@ -210,6 +210,29 @@ checkConfigOutput "empty" config.value.foo ./declare-lazyAttrsOf.nix ./attrsOf-c
|
|||
checkConfigError 'The option value .* in .* is not of type .*' \
|
||||
config.value ./declare-int-unsigned-value.nix ./define-value-list.nix ./define-value-int-positive.nix
|
||||
|
||||
## Freeform modules
|
||||
# Assigning without a declared option should work
|
||||
checkConfigOutput 24 config.value ./freeform-attrsOf.nix ./define-value-string.nix
|
||||
# No freeform assigments shouldn't make it error
|
||||
checkConfigOutput '{ }' config ./freeform-attrsOf.nix
|
||||
# but only if the type matches
|
||||
checkConfigError 'The option value .* in .* is not of type .*' config.value ./freeform-attrsOf.nix ./define-value-list.nix
|
||||
# and properties should be applied
|
||||
checkConfigOutput yes config.value ./freeform-attrsOf.nix ./define-value-string-properties.nix
|
||||
# Options should still be declarable, and be able to have a type that doesn't match the freeform type
|
||||
checkConfigOutput false config.enable ./freeform-attrsOf.nix ./define-value-string.nix ./declare-enable.nix
|
||||
checkConfigOutput 24 config.value ./freeform-attrsOf.nix ./define-value-string.nix ./declare-enable.nix
|
||||
# and this should work too with nested values
|
||||
checkConfigOutput false config.nest.foo ./freeform-attrsOf.nix ./freeform-nested.nix
|
||||
checkConfigOutput bar config.nest.bar ./freeform-attrsOf.nix ./freeform-nested.nix
|
||||
# Check whether a declared option can depend on an freeform-typed one
|
||||
checkConfigOutput null config.foo ./freeform-attrsOf.nix ./freeform-str-dep-unstr.nix
|
||||
checkConfigOutput 24 config.foo ./freeform-attrsOf.nix ./freeform-str-dep-unstr.nix ./define-value-string.nix
|
||||
# Check whether an freeform-typed value can depend on a declared option, this can only work with lazyAttrsOf
|
||||
checkConfigError 'infinite recursion encountered' config.foo ./freeform-attrsOf.nix ./freeform-unstr-dep-str.nix
|
||||
checkConfigError 'The option .* is used but not defined' config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix
|
||||
checkConfigOutput 24 config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix ./define-value-string.nix
|
||||
|
||||
cat <<EOF
|
||||
====== module tests ======
|
||||
$pass Pass
|
||||
|
|
12
lib/tests/modules/define-value-string-properties.nix
Normal file
12
lib/tests/modules/define-value-string-properties.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ lib, ... }: {
|
||||
|
||||
imports = [{
|
||||
value = lib.mkDefault "def";
|
||||
}];
|
||||
|
||||
value = lib.mkMerge [
|
||||
(lib.mkIf false "nope")
|
||||
"yes"
|
||||
];
|
||||
|
||||
}
|
3
lib/tests/modules/freeform-attrsOf.nix
Normal file
3
lib/tests/modules/freeform-attrsOf.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ lib, ... }: {
|
||||
freeformType = with lib.types; attrsOf (either str (attrsOf str));
|
||||
}
|
3
lib/tests/modules/freeform-lazyAttrsOf.nix
Normal file
3
lib/tests/modules/freeform-lazyAttrsOf.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ lib, ... }: {
|
||||
freeformType = with lib.types; lazyAttrsOf (either str (lazyAttrsOf str));
|
||||
}
|
7
lib/tests/modules/freeform-nested.nix
Normal file
7
lib/tests/modules/freeform-nested.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }: {
|
||||
options.nest.foo = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
config.nest.bar = "bar";
|
||||
}
|
8
lib/tests/modules/freeform-str-dep-unstr.nix
Normal file
8
lib/tests/modules/freeform-str-dep-unstr.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ lib, config, ... }: {
|
||||
options.foo = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
config.foo = lib.mkIf (config ? value) config.value;
|
||||
}
|
8
lib/tests/modules/freeform-unstr-dep-str.nix
Normal file
8
lib/tests/modules/freeform-unstr-dep-str.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ lib, config, ... }: {
|
||||
options.value = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
config.foo = lib.mkIf (config.value != null) config.value;
|
||||
}
|
|
@ -486,9 +486,15 @@ rec {
|
|||
else value
|
||||
) defs;
|
||||
|
||||
freeformType = (evalModules {
|
||||
inherit modules specialArgs;
|
||||
args.name = "‹name›";
|
||||
})._module.freeformType;
|
||||
|
||||
in
|
||||
mkOptionType rec {
|
||||
name = "submodule";
|
||||
description = freeformType.description or name;
|
||||
check = x: isAttrs x || isFunction x || path.check x;
|
||||
merge = loc: defs:
|
||||
(evalModules {
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
|
||||
`handle == github` is strongly preferred whenever `github` is an acceptable attribute name and is short and convenient.
|
||||
|
||||
If `github` begins with a numeral, `handle` should be prefixed with an underscore.
|
||||
```nix
|
||||
_1example = {
|
||||
github = "1example";
|
||||
};
|
||||
```
|
||||
|
||||
Add PGP/GPG keys only if you actually use them to sign commits and/or mail.
|
||||
|
||||
To get the required PGP/GPG values for a key run
|
||||
|
@ -41,7 +48,7 @@
|
|||
See `./scripts/check-maintainer-github-handles.sh` for an example on how to work with this data.
|
||||
*/
|
||||
{
|
||||
"0x4A6F" = {
|
||||
_0x4A6F = {
|
||||
email = "mail-maintainer@0x4A6F.dev";
|
||||
name = "Joachim Ernst";
|
||||
github = "0x4A6F";
|
||||
|
@ -51,7 +58,7 @@
|
|||
fingerprint = "F466 A548 AD3F C1F1 8C88 4576 8702 7528 B006 D66D";
|
||||
}];
|
||||
};
|
||||
"1000101" = {
|
||||
_1000101 = {
|
||||
email = "b1000101@pm.me";
|
||||
github = "1000101";
|
||||
githubId = 791309;
|
||||
|
@ -1884,7 +1891,7 @@
|
|||
githubId = 4971975;
|
||||
name = "Janne Heß";
|
||||
};
|
||||
"dasj19" = {
|
||||
dasj19 = {
|
||||
email = "daniel@serbanescu.dk";
|
||||
github = "dasj19";
|
||||
githubId = 7589338;
|
||||
|
@ -2460,6 +2467,12 @@
|
|||
githubId = 97852;
|
||||
name = "Ellis Whitehead";
|
||||
};
|
||||
elkowar = {
|
||||
email = "thereal.elkowar@gmail.com";
|
||||
github = "elkowar";
|
||||
githubId = 5300871;
|
||||
name = "Leon Kowarschick";
|
||||
};
|
||||
elohmeier = {
|
||||
email = "elo-nixos@nerdworks.de";
|
||||
github = "elohmeier";
|
||||
|
@ -3042,12 +3055,6 @@
|
|||
githubId = 313929;
|
||||
name = "Gabriel Ebner";
|
||||
};
|
||||
geistesk = {
|
||||
email = "post@0x21.biz";
|
||||
github = "geistesk";
|
||||
githubId = 8402811;
|
||||
name = "Alvar Penning";
|
||||
};
|
||||
genesis = {
|
||||
email = "ronan@aimao.org";
|
||||
github = "bignaux";
|
||||
|
@ -3259,6 +3266,10 @@
|
|||
github = "haozeke";
|
||||
githubId = 4336207;
|
||||
name = "Rohit Goswami";
|
||||
keys = [{
|
||||
longkeyid = "rsa4096/0x9CCCE36402CB49A6";
|
||||
fingerprint = "74B1 F67D 8E43 A94A 7554 0768 9CCC E364 02CB 49A6";
|
||||
}];
|
||||
};
|
||||
haslersn = {
|
||||
email = "haslersn@fius.informatik.uni-stuttgart.de";
|
||||
|
@ -3954,6 +3965,12 @@
|
|||
githubId = 8735102;
|
||||
name = "John Ramsden";
|
||||
};
|
||||
johntitor = {
|
||||
email = "huyuumi.dev@gmail.com";
|
||||
github = "JohnTitor";
|
||||
githubId = 25030997;
|
||||
name = "Yuki Okushi";
|
||||
};
|
||||
jojosch = {
|
||||
name = "Johannes Schleifenbaum";
|
||||
email = "johannes@js-webcoding.de";
|
||||
|
@ -4661,6 +4678,12 @@
|
|||
fingerprint = "7FE2 113A A08B 695A C8B8 DDE6 AE53 B4C2 E58E DD45";
|
||||
}];
|
||||
};
|
||||
lf- = {
|
||||
email = "nix-maint@lfcode.ca";
|
||||
github = "lf-";
|
||||
githubId = 6652840;
|
||||
name = "Jade";
|
||||
};
|
||||
lheckemann = {
|
||||
email = "git@sphalerite.org";
|
||||
github = "lheckemann";
|
||||
|
@ -6190,6 +6213,16 @@
|
|||
fingerprint = "514B B966 B46E 3565 0508 86E8 0E6C A66E 5C55 7AA8";
|
||||
}];
|
||||
};
|
||||
oxzi = {
|
||||
email = "post@0x21.biz";
|
||||
github = "oxzi";
|
||||
githubId = 8402811;
|
||||
name = "Alvar Penning";
|
||||
keys = [{
|
||||
longkeyid = "rsa4096/0xF32A45637FA25E31";
|
||||
fingerprint = "EB14 4E67 E57D 27E2 B5A4 CD8C F32A 4563 7FA2 5E31";
|
||||
}];
|
||||
};
|
||||
oyren = {
|
||||
email = "m.scheuren@oyra.eu";
|
||||
github = "oyren";
|
||||
|
@ -7928,6 +7961,12 @@
|
|||
githubId = 332289;
|
||||
name = "Rafał Łasocha";
|
||||
};
|
||||
syberant = {
|
||||
email = "sybrand@neuralcoding.com";
|
||||
github = "syberant";
|
||||
githubId = 20063502;
|
||||
name = "Sybrand Aarnoutse";
|
||||
};
|
||||
symphorien = {
|
||||
email = "symphorien_nixpkgs@xlumurb.eu";
|
||||
github = "symphorien";
|
||||
|
@ -8172,7 +8211,7 @@
|
|||
githubId = 8547242;
|
||||
name = "Stefan Rohrbacher";
|
||||
};
|
||||
"thelegy" = {
|
||||
thelegy = {
|
||||
email = "mail+nixos@0jb.de";
|
||||
github = "thelegy";
|
||||
githubId = 3105057;
|
||||
|
@ -8390,6 +8429,12 @@
|
|||
githubId = 207457;
|
||||
name = "Matthieu Chevrier";
|
||||
};
|
||||
trepetti = {
|
||||
email = "trepetti@cs.columbia.edu";
|
||||
github = "trepetti";
|
||||
githubId = 25440339;
|
||||
name = "Tom Repetti";
|
||||
};
|
||||
trevorj = {
|
||||
email = "nix@trevor.joynson.io";
|
||||
github = "akatrevorjay";
|
||||
|
@ -8717,6 +8762,14 @@
|
|||
githubId = 13259982;
|
||||
name = "Vanessa McHale";
|
||||
};
|
||||
|
||||
voidless = {
|
||||
email = "julius.schmitt@yahoo.de";
|
||||
github = "voidIess";
|
||||
githubId = 45292658;
|
||||
name = "Julius Schmitt";
|
||||
};
|
||||
|
||||
volhovm = {
|
||||
email = "volhovm.cs@gmail.com";
|
||||
github = "volhovm";
|
||||
|
|
68
nixos/doc/manual/development/freeform-modules.xml
Normal file
68
nixos/doc/manual/development/freeform-modules.xml
Normal file
|
@ -0,0 +1,68 @@
|
|||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="5.0"
|
||||
xml:id="sec-freeform-modules">
|
||||
<title>Freeform modules</title>
|
||||
<para>
|
||||
Freeform modules allow you to define values for option paths that have not been declared explicitly. This can be used to add attribute-specific types to what would otherwise have to be <literal>attrsOf</literal> options in order to accept all attribute names.
|
||||
</para>
|
||||
<para>
|
||||
This feature can be enabled by using the attribute <literal>freeformType</literal> to define a freeform type. By doing this, all assignments without an associated option will be merged using the freeform type and combined into the resulting <literal>config</literal> set. Since this feature nullifies name checking for entire option trees, it is only recommended for use in submodules.
|
||||
</para>
|
||||
<example xml:id="ex-freeform-module">
|
||||
<title>Freeform submodule</title>
|
||||
<para>
|
||||
The following shows a submodule assigning a freeform type that allows arbitrary attributes with <literal>str</literal> values below <literal>settings</literal>, but also declares an option for the <literal>settings.port</literal> attribute to have it type-checked and assign a default value. See <xref linkend="ex-settings-typed-attrs"/> for a more complete example.
|
||||
</para>
|
||||
<programlisting>
|
||||
{ lib, config, ... }: {
|
||||
|
||||
options.settings = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
|
||||
freeformType = with lib.types; attrsOf str;
|
||||
|
||||
# We want this attribute to be checked for the correct type
|
||||
options.port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
# Declaring the option also allows defining a default value
|
||||
default = 8080;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
And the following shows what such a module then allows
|
||||
</para>
|
||||
<programlisting>
|
||||
{
|
||||
# Not a declared option, but the freeform type allows this
|
||||
settings.logLevel = "debug";
|
||||
|
||||
# Not allowed because the the freeform type only allows strings
|
||||
# settings.enable = true;
|
||||
|
||||
# Allowed because there is a port option declared
|
||||
settings.port = 80;
|
||||
|
||||
# Not allowed because the port option doesn't allow strings
|
||||
# settings.port = "443";
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<para>
|
||||
Freeform attributes cannot depend on other attributes of the same set without infinite recursion:
|
||||
<programlisting>
|
||||
{
|
||||
# This throws infinite recursion encountered
|
||||
settings.logLevel = lib.mkIf (config.settings.port == 80) "debug";
|
||||
}
|
||||
</programlisting>
|
||||
To prevent this, declare options for all attributes that need to depend on others. For above example this means to declare <literal>logLevel</literal> to be an option.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
|
@ -137,7 +137,7 @@ in {
|
|||
description = ''
|
||||
Configuration for foo, see
|
||||
<link xlink:href="https://example.com/docs/foo"/>
|
||||
for supported values.
|
||||
for supported settings.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -167,13 +167,50 @@ in {
|
|||
|
||||
# We know that the `user` attribute exists because we set a default value
|
||||
# for it above, allowing us to use it without worries here
|
||||
users.users.${cfg.settings.user} = {}
|
||||
users.users.${cfg.settings.user} = {};
|
||||
|
||||
# ...
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
<section xml:id="sec-settings-attrs-options">
|
||||
<title>Option declarations for attributes</title>
|
||||
<para>
|
||||
Some <literal>settings</literal> attributes may deserve some extra care. They may need a different type, default or merging behavior, or they are essential options that should show their documentation in the manual. This can be done using <xref linkend='sec-freeform-modules'/>.
|
||||
<example xml:id="ex-settings-typed-attrs">
|
||||
<title>Declaring a type-checked <literal>settings</literal> attribute</title>
|
||||
<para>
|
||||
We extend above example using freeform modules to declare an option for the port, which will enforce it to be a valid integer and make it show up in the manual.
|
||||
</para>
|
||||
<programlisting>
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
|
||||
freeformType = settingsFormat.type;
|
||||
|
||||
# Declare an option for the port such that the type is checked and this option
|
||||
# is shown in the manual.
|
||||
options.port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8080;
|
||||
description = ''
|
||||
Which port this service should listen on.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
default = {};
|
||||
description = ''
|
||||
Configuration for Foo, see
|
||||
<link xlink:href="https://example.com/docs/foo"/>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
|
|
@ -183,5 +183,6 @@ in {
|
|||
<xi:include href="meta-attributes.xml" />
|
||||
<xi:include href="importing-modules.xml" />
|
||||
<xi:include href="replace-modules.xml" />
|
||||
<xi:include href="freeform-modules.xml" />
|
||||
<xi:include href="settings-options.xml" />
|
||||
</chapter>
|
||||
|
|
|
@ -63,8 +63,8 @@ in {
|
|||
fsType = "ext4";
|
||||
configFile = pkgs.writeText "configuration.nix"
|
||||
''
|
||||
{
|
||||
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
|
||||
{ modulesPath, ... }: {
|
||||
imports = [ "''${modulesPath}/virtualisation/amazon-image.nix" ];
|
||||
${optionalString config.ec2.hvm ''
|
||||
ec2.hvm = true;
|
||||
''}
|
||||
|
|
|
@ -1,292 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.fonts.fontconfig;
|
||||
|
||||
fcBool = x: "<bool>" + (boolToString x) + "</bool>";
|
||||
|
||||
# back-supported fontconfig version and package
|
||||
# version is used for font cache generation
|
||||
supportVersion = "210";
|
||||
supportPkg = pkgs."fontconfig_${supportVersion}";
|
||||
|
||||
# latest fontconfig version and package
|
||||
# version is used for configuration folder name, /etc/fonts/VERSION/
|
||||
# note: format differs from supportVersion and can not be used with makeCacheConf
|
||||
latestVersion = pkgs.fontconfig.configVersion;
|
||||
latestPkg = pkgs.fontconfig;
|
||||
|
||||
# supported version fonts.conf
|
||||
supportFontsConf = pkgs.makeFontsConf { fontconfig = supportPkg; fontDirectories = config.fonts.fonts; };
|
||||
|
||||
# configuration file to read fontconfig cache
|
||||
# version dependent
|
||||
# priority 0
|
||||
cacheConfSupport = makeCacheConf { version = supportVersion; };
|
||||
cacheConfLatest = makeCacheConf {};
|
||||
|
||||
# generate the font cache setting file for a fontconfig version
|
||||
# use latest when no version is passed
|
||||
makeCacheConf = { version ? null }:
|
||||
let
|
||||
fcPackage = if version == null
|
||||
then "fontconfig"
|
||||
else "fontconfig_${version}";
|
||||
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; };
|
||||
cache = makeCache pkgs.${fcPackage};
|
||||
cache32 = makeCache pkgs.pkgsi686Linux.${fcPackage};
|
||||
in
|
||||
pkgs.writeText "fc-00-nixos-cache.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
<!-- Font directories -->
|
||||
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
|
||||
<!-- Pre-generated font caches -->
|
||||
<cachedir>${cache}</cachedir>
|
||||
${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
|
||||
<cachedir>${cache32}</cachedir>
|
||||
''}
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
# local configuration file
|
||||
localConf = pkgs.writeText "fc-local.conf" cfg.localConf;
|
||||
|
||||
# rendering settings configuration files
|
||||
# priority 10
|
||||
hintingConf = pkgs.writeText "fc-10-hinting.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<!-- Default rendering settings -->
|
||||
<match target="pattern">
|
||||
<edit mode="append" name="hinting">
|
||||
${fcBool cfg.hinting.enable}
|
||||
</edit>
|
||||
<edit mode="append" name="autohint">
|
||||
${fcBool cfg.hinting.autohint}
|
||||
</edit>
|
||||
<edit mode="append" name="hintstyle">
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
antialiasConf = pkgs.writeText "fc-10-antialias.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<!-- Default rendering settings -->
|
||||
<match target="pattern">
|
||||
<edit mode="append" name="antialias">
|
||||
${fcBool cfg.antialias}
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
subpixelConf = pkgs.writeText "fc-10-subpixel.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<!-- Default rendering settings -->
|
||||
<match target="pattern">
|
||||
<edit mode="append" name="rgba">
|
||||
<const>${cfg.subpixel.rgba}</const>
|
||||
</edit>
|
||||
<edit mode="append" name="lcdfilter">
|
||||
<const>lcd${cfg.subpixel.lcdfilter}</const>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
dpiConf = pkgs.writeText "fc-11-dpi.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<match target="pattern">
|
||||
<edit name="dpi" mode="assign">
|
||||
<double>${toString cfg.dpi}</double>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
# default fonts configuration file
|
||||
# priority 52
|
||||
defaultFontsConf =
|
||||
let genDefault = fonts: name:
|
||||
optionalString (fonts != []) ''
|
||||
<alias>
|
||||
<family>${name}</family>
|
||||
<prefer>
|
||||
${concatStringsSep ""
|
||||
(map (font: ''
|
||||
<family>${font}</family>
|
||||
'') fonts)}
|
||||
</prefer>
|
||||
</alias>
|
||||
'';
|
||||
in
|
||||
pkgs.writeText "fc-52-nixos-default-fonts.conf" ''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<!-- Default fonts -->
|
||||
${genDefault cfg.defaultFonts.sansSerif "sans-serif"}
|
||||
|
||||
${genDefault cfg.defaultFonts.serif "serif"}
|
||||
|
||||
${genDefault cfg.defaultFonts.monospace "monospace"}
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
# reject Type 1 fonts
|
||||
# priority 53
|
||||
rejectType1 = pkgs.writeText "fc-53-nixos-reject-type1.conf" ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
|
||||
<!-- Reject Type 1 fonts -->
|
||||
<selectfont>
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="fontformat"><string>Type 1</string></patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
# The configuration to be included in /etc/font/
|
||||
penultimateConf = pkgs.runCommand "fontconfig-penultimate-conf" {
|
||||
preferLocalBuild = true;
|
||||
} ''
|
||||
support_folder=$out/etc/fonts/conf.d
|
||||
latest_folder=$out/etc/fonts/${latestVersion}/conf.d
|
||||
|
||||
mkdir -p $support_folder
|
||||
mkdir -p $latest_folder
|
||||
|
||||
# fonts.conf
|
||||
ln -s ${supportFontsConf} $support_folder/../fonts.conf
|
||||
ln -s ${latestPkg.out}/etc/fonts/fonts.conf \
|
||||
$latest_folder/../fonts.conf
|
||||
|
||||
# fontconfig-penultimate various configuration files
|
||||
ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \
|
||||
$support_folder
|
||||
ln -s ${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/*.conf \
|
||||
$latest_folder
|
||||
|
||||
ln -s ${cacheConfSupport} $support_folder/00-nixos-cache.conf
|
||||
ln -s ${cacheConfLatest} $latest_folder/00-nixos-cache.conf
|
||||
|
||||
rm $support_folder/10-antialias.conf $latest_folder/10-antialias.conf
|
||||
ln -s ${antialiasConf} $support_folder/10-antialias.conf
|
||||
ln -s ${antialiasConf} $latest_folder/10-antialias.conf
|
||||
|
||||
rm $support_folder/10-hinting.conf $latest_folder/10-hinting.conf
|
||||
ln -s ${hintingConf} $support_folder/10-hinting.conf
|
||||
ln -s ${hintingConf} $latest_folder/10-hinting.conf
|
||||
|
||||
${optionalString cfg.useEmbeddedBitmaps ''
|
||||
rm $support_folder/10-no-embedded-bitmaps.conf
|
||||
rm $latest_folder/10-no-embedded-bitmaps.conf
|
||||
''}
|
||||
|
||||
rm $support_folder/10-subpixel.conf $latest_folder/10-subpixel.conf
|
||||
ln -s ${subpixelConf} $support_folder/10-subpixel.conf
|
||||
ln -s ${subpixelConf} $latest_folder/10-subpixel.conf
|
||||
|
||||
${optionalString (cfg.dpi != 0) ''
|
||||
ln -s ${dpiConf} $support_folder/11-dpi.conf
|
||||
ln -s ${dpiConf} $latest_folder/11-dpi.conf
|
||||
''}
|
||||
|
||||
# 50-user.conf
|
||||
${optionalString (!cfg.includeUserConf) ''
|
||||
rm $support_folder/50-user.conf
|
||||
rm $latest_folder/50-user.conf
|
||||
''}
|
||||
|
||||
# 51-local.conf
|
||||
rm $latest_folder/51-local.conf
|
||||
substitute \
|
||||
${pkgs.fontconfig-penultimate}/etc/fonts/conf.d/51-local.conf \
|
||||
$latest_folder/51-local.conf \
|
||||
--replace local.conf /etc/fonts/${latestVersion}/local.conf
|
||||
|
||||
# local.conf (indirect priority 51)
|
||||
${optionalString (cfg.localConf != "") ''
|
||||
ln -s ${localConf} $support_folder/../local.conf
|
||||
ln -s ${localConf} $latest_folder/../local.conf
|
||||
''}
|
||||
|
||||
# 52-nixos-default-fonts.conf
|
||||
ln -s ${defaultFontsConf} $support_folder/52-nixos-default-fonts.conf
|
||||
ln -s ${defaultFontsConf} $latest_folder/52-nixos-default-fonts.conf
|
||||
|
||||
# 53-no-bitmaps.conf
|
||||
${optionalString cfg.allowBitmaps ''
|
||||
rm $support_folder/53-no-bitmaps.conf
|
||||
rm $latest_folder/53-no-bitmaps.conf
|
||||
''}
|
||||
|
||||
${optionalString (!cfg.allowType1) ''
|
||||
# 53-nixos-reject-type1.conf
|
||||
ln -s ${rejectType1} $support_folder/53-nixos-reject-type1.conf
|
||||
ln -s ${rejectType1} $latest_folder/53-nixos-reject-type1.conf
|
||||
''}
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
fonts = {
|
||||
|
||||
fontconfig = {
|
||||
|
||||
penultimate = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable fontconfig-penultimate settings to supplement the
|
||||
NixOS defaults by providing per-font rendering defaults and
|
||||
metric aliases.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf (config.fonts.fontconfig.enable && config.fonts.fontconfig.penultimate.enable) {
|
||||
|
||||
fonts.fontconfig.confPackages = [ penultimateConf ];
|
||||
|
||||
};
|
||||
|
||||
}
|
|
@ -204,8 +204,10 @@ let
|
|||
ln -s ${renderConf} $dst/10-nixos-rendering.conf
|
||||
|
||||
# 50-user.conf
|
||||
${optionalString (!cfg.includeUserConf) ''
|
||||
rm $dst/50-user.conf
|
||||
# Since latest fontconfig looks for default files inside the package,
|
||||
# we had to move this one elsewhere to be able to exclude it here.
|
||||
${optionalString cfg.includeUserConf ''
|
||||
ln -s ${pkg.out}/etc/fonts/conf.d.bak/50-user.conf $dst/50-user.conf
|
||||
''}
|
||||
|
||||
# local.conf (indirect priority 51)
|
||||
|
@ -455,7 +457,7 @@ in
|
|||
environment.systemPackages = [ pkgs.fontconfig ];
|
||||
environment.etc.fonts.source = "${fontconfigEtc}/etc/fonts/";
|
||||
})
|
||||
(mkIf (cfg.enable && !cfg.penultimate.enable) {
|
||||
(mkIf cfg.enable {
|
||||
fonts.fontconfig.confPackages = [ confPkg ];
|
||||
})
|
||||
];
|
||||
|
|
|
@ -27,6 +27,7 @@ with lib;
|
|||
fonts.fontconfig.enable = false;
|
||||
|
||||
nixpkgs.overlays = singleton (const (super: {
|
||||
cairo = super.cairo.override { x11Support = false; };
|
||||
dbus = super.dbus.override { x11Support = false; };
|
||||
networkmanager-fortisslvpn = super.networkmanager-fortisslvpn.override { withGnome = false; };
|
||||
networkmanager-l2tp = super.networkmanager-l2tp.override { withGnome = false; };
|
||||
|
@ -35,6 +36,7 @@ with lib;
|
|||
networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
|
||||
networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
|
||||
gobject-introspection = super.gobject-introspection.override { x11Support = false; };
|
||||
qemu = super.qemu.override { gtkSupport = false; spiceSupport = false; sdlSupport = false; };
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! @shell@ -e
|
||||
#! @runtimeShell@ -e
|
||||
|
||||
# Shows the usage of this command to the user
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! @shell@
|
||||
#! @runtimeShell@
|
||||
|
||||
set -e
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! @shell@
|
||||
#! @runtimeShell@
|
||||
|
||||
set -e
|
||||
shopt -s nullglob
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! @shell@
|
||||
#! @runtimeShell@
|
||||
|
||||
if [ -x "@shell@" ]; then export SHELL="@shell@"; fi;
|
||||
if [ -x "@runtimeShell@" ]; then export SHELL="@runtimeShell@"; fi;
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! @shell@
|
||||
#! @runtimeShell@
|
||||
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
|
|
|
@ -14,11 +14,13 @@ let
|
|||
nixos-build-vms = makeProg {
|
||||
name = "nixos-build-vms";
|
||||
src = ./nixos-build-vms/nixos-build-vms.sh;
|
||||
inherit (pkgs) runtimeShell;
|
||||
};
|
||||
|
||||
nixos-install = makeProg {
|
||||
name = "nixos-install";
|
||||
src = ./nixos-install.sh;
|
||||
inherit (pkgs) runtimeShell;
|
||||
nix = config.nix.package.out;
|
||||
path = makeBinPath [ nixos-enter ];
|
||||
};
|
||||
|
@ -28,6 +30,7 @@ let
|
|||
makeProg {
|
||||
name = "nixos-rebuild";
|
||||
src = ./nixos-rebuild.sh;
|
||||
inherit (pkgs) runtimeShell;
|
||||
nix = config.nix.package.out;
|
||||
nix_x86_64_linux = fallback.x86_64-linux;
|
||||
nix_i686_linux = fallback.i686-linux;
|
||||
|
@ -50,6 +53,7 @@ let
|
|||
nixos-version = makeProg {
|
||||
name = "nixos-version";
|
||||
src = ./nixos-version.sh;
|
||||
inherit (pkgs) runtimeShell;
|
||||
inherit (config.system.nixos) version codeName revision;
|
||||
inherit (config.system) configurationRevision;
|
||||
json = builtins.toJSON ({
|
||||
|
@ -64,6 +68,7 @@ let
|
|||
nixos-enter = makeProg {
|
||||
name = "nixos-enter";
|
||||
src = ./nixos-enter.sh;
|
||||
inherit (pkgs) runtimeShell;
|
||||
};
|
||||
|
||||
in
|
||||
|
|
|
@ -198,7 +198,7 @@ in
|
|||
bosun = 161;
|
||||
kubernetes = 162;
|
||||
peerflix = 163;
|
||||
chronos = 164;
|
||||
#chronos = 164; # removed 2020-08-15
|
||||
gitlab = 165;
|
||||
tox-bootstrapd = 166;
|
||||
cadvisor = 167;
|
||||
|
@ -247,7 +247,7 @@ in
|
|||
bepasty = 215;
|
||||
# pumpio = 216; # unused, removed 2018-02-24
|
||||
nm-openvpn = 217;
|
||||
mathics = 218;
|
||||
# mathics = 218; # unused, removed 2020-08-15
|
||||
ejabberd = 219;
|
||||
postsrsd = 220;
|
||||
opendkim = 221;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
[
|
||||
./config/debug-info.nix
|
||||
./config/fonts/fontconfig.nix
|
||||
./config/fonts/fontconfig-penultimate.nix
|
||||
./config/fonts/fontdir.nix
|
||||
./config/fonts/fonts.nix
|
||||
./config/fonts/ghostscript.nix
|
||||
|
@ -466,14 +465,11 @@
|
|||
./services/misc/leaps.nix
|
||||
./services/misc/lidarr.nix
|
||||
./services/misc/mame.nix
|
||||
./services/misc/mathics.nix
|
||||
./services/misc/matrix-appservice-discord.nix
|
||||
./services/misc/matrix-synapse.nix
|
||||
./services/misc/mautrix-telegram.nix
|
||||
./services/misc/mbpfan.nix
|
||||
./services/misc/mediatomb.nix
|
||||
./services/misc/mesos-master.nix
|
||||
./services/misc/mesos-slave.nix
|
||||
./services/misc/metabase.nix
|
||||
./services/misc/mwlib.nix
|
||||
./services/misc/nix-daemon.nix
|
||||
|
@ -489,6 +485,7 @@
|
|||
./services/misc/parsoid.nix
|
||||
./services/misc/plex.nix
|
||||
./services/misc/tautulli.nix
|
||||
./services/misc/pinnwand.nix
|
||||
./services/misc/pykms.nix
|
||||
./services/misc/radarr.nix
|
||||
./services/misc/redmine.nix
|
||||
|
@ -785,10 +782,8 @@
|
|||
./services/networking/znc/default.nix
|
||||
./services/printing/cupsd.nix
|
||||
./services/scheduling/atd.nix
|
||||
./services/scheduling/chronos.nix
|
||||
./services/scheduling/cron.nix
|
||||
./services/scheduling/fcron.nix
|
||||
./services/scheduling/marathon.nix
|
||||
./services/search/elasticsearch.nix
|
||||
./services/search/elasticsearch-curator.nix
|
||||
./services/search/hound.nix
|
||||
|
@ -870,6 +865,7 @@
|
|||
./services/web-apps/moinmoin.nix
|
||||
./services/web-apps/restya-board.nix
|
||||
./services/web-apps/sogo.nix
|
||||
./services/web-apps/rss-bridge.nix
|
||||
./services/web-apps/tt-rss.nix
|
||||
./services/web-apps/trac.nix
|
||||
./services/web-apps/trilium.nix
|
||||
|
|
|
@ -17,8 +17,12 @@ with lib;
|
|||
(mkAliasOptionModule [ "environment" "checkConfigurationOptions" ] [ "_module" "check" ])
|
||||
|
||||
# Completely removed modules
|
||||
(mkRemovedOptionModule [ "fonts" "fontconfig" "penultimate" ] "The corresponding package has removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "services" "chronos" ] "The corresponding package was removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "services" "firefox" "syncserver" "user" ] "")
|
||||
(mkRemovedOptionModule [ "services" "firefox" "syncserver" "group" ] "")
|
||||
(mkRemovedOptionModule [ "services" "marathon" ] "The corresponding package was removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "services" "mesos" ] "The corresponding package was removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "services" "winstone" ] "The corresponding package was removed from nixpkgs.")
|
||||
(mkRemovedOptionModule [ "networking" "vpnc" ] "Use environment.etc.\"vpnc/service.conf\" instead.")
|
||||
(mkRemovedOptionModule [ "environment" "blcr" "enable" ] "The BLCR module has been removed")
|
||||
|
@ -28,6 +32,7 @@ with lib;
|
|||
(mkRemovedOptionModule [ "services" "osquery" ] "The osquery module has been removed")
|
||||
(mkRemovedOptionModule [ "services" "fourStore" ] "The fourStore module has been removed")
|
||||
(mkRemovedOptionModule [ "services" "fourStoreEndpoint" ] "The fourStoreEndpoint module has been removed")
|
||||
(mkRemovedOptionModule [ "services" "mathics" ] "The Mathics module has been removed")
|
||||
(mkRemovedOptionModule [ "programs" "way-cooler" ] ("way-cooler is abandoned by its author: " +
|
||||
"https://way-cooler.org/blog/2020/01/09/way-cooler-post-mortem.html"))
|
||||
(mkRemovedOptionModule [ "services" "xserver" "multitouch" ] ''
|
||||
|
|
|
@ -160,8 +160,11 @@ in
|
|||
config = {
|
||||
|
||||
security.wrappers = {
|
||||
# These are mount related wrappers that require the +s permission.
|
||||
fusermount.source = "${pkgs.fuse}/bin/fusermount";
|
||||
fusermount3.source = "${pkgs.fuse3}/bin/fusermount3";
|
||||
mount.source = "${lib.getBin pkgs.utillinux}/bin/mount";
|
||||
umount.source = "${lib.getBin pkgs.utillinux}/bin/umount";
|
||||
};
|
||||
|
||||
boot.specialFileSystems.${parentWrapperDir} = {
|
||||
|
|
|
@ -15,26 +15,27 @@ let
|
|||
fi
|
||||
'';
|
||||
|
||||
desktopApplicationFile = pkgs.writeTextFile {
|
||||
name = "emacsclient.desktop";
|
||||
destination = "/share/applications/emacsclient.desktop";
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Name=Emacsclient
|
||||
GenericName=Text Editor
|
||||
Comment=Edit text
|
||||
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
||||
Exec=emacseditor %F
|
||||
Icon=emacs
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Categories=Development;TextEditor;
|
||||
StartupWMClass=Emacs
|
||||
Keywords=Text;Editor;
|
||||
'';
|
||||
};
|
||||
desktopApplicationFile = pkgs.writeTextFile {
|
||||
name = "emacsclient.desktop";
|
||||
destination = "/share/applications/emacsclient.desktop";
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Name=Emacsclient
|
||||
GenericName=Text Editor
|
||||
Comment=Edit text
|
||||
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
||||
Exec=emacseditor %F
|
||||
Icon=emacs
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Categories=Development;TextEditor;
|
||||
StartupWMClass=Emacs
|
||||
Keywords=Text;Editor;
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.services.emacs = {
|
||||
enable = mkOption {
|
||||
|
@ -86,10 +87,10 @@ in {
|
|||
description = "Emacs: the extensible, self-documenting text editor";
|
||||
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
Type = "forking";
|
||||
ExecStart = "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --daemon'";
|
||||
ExecStop = "${cfg.package}/bin/emacsclient --eval (kill-emacs)";
|
||||
Restart = "always";
|
||||
ExecStop = "${cfg.package}/bin/emacsclient --eval (kill-emacs)";
|
||||
Restart = "always";
|
||||
};
|
||||
} // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };
|
||||
|
||||
|
|
|
@ -696,7 +696,6 @@ in {
|
|||
"L+ /run/gitlab/shell-config.yml - - - - ${pkgs.writeText "config.yml" (builtins.toJSON gitlabShellConfig)}"
|
||||
|
||||
"L+ ${cfg.statePath}/config/unicorn.rb - - - - ${./defaultUnicornConfig.rb}"
|
||||
"L+ ${cfg.statePath}/config/initializers/extra-gitlab.rb - - - - ${extraGitlabRb}"
|
||||
];
|
||||
|
||||
systemd.services.gitlab-sidekiq = {
|
||||
|
@ -816,6 +815,7 @@ in {
|
|||
rm -f ${cfg.statePath}/lib
|
||||
cp -rf --no-preserve=mode ${cfg.packages.gitlab}/share/gitlab/config.dist/* ${cfg.statePath}/config
|
||||
cp -rf --no-preserve=mode ${cfg.packages.gitlab}/share/gitlab/db/* ${cfg.statePath}/db
|
||||
ln -sf ${extraGitlabRb} ${cfg.statePath}/config/initializers/extra-gitlab.rb
|
||||
|
||||
${cfg.packages.gitlab-shell}/bin/install
|
||||
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.mathics;
|
||||
|
||||
in {
|
||||
options = {
|
||||
services.mathics = {
|
||||
enable = mkEnableOption "Mathics notebook service";
|
||||
|
||||
external = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Listen on all interfaces, rather than just localhost?";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8000;
|
||||
description = "TCP port to listen on.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
users.users.mathics = {
|
||||
group = config.users.groups.mathics.name;
|
||||
description = "Mathics user";
|
||||
home = "/var/lib/mathics";
|
||||
createHome = true;
|
||||
uid = config.ids.uids.mathics;
|
||||
};
|
||||
|
||||
users.groups.mathics.gid = config.ids.gids.mathics;
|
||||
|
||||
systemd.services.mathics = {
|
||||
description = "Mathics notebook server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
User = config.users.users.mathics.name;
|
||||
Group = config.users.groups.mathics.name;
|
||||
ExecStart = concatStringsSep " " [
|
||||
"${pkgs.mathics}/bin/mathicsserver"
|
||||
"--port" (toString cfg.port)
|
||||
(if cfg.external then "--external" else "")
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.mesos.master;
|
||||
|
||||
in {
|
||||
|
||||
options.services.mesos = {
|
||||
|
||||
master = {
|
||||
enable = mkOption {
|
||||
description = "Whether to enable the Mesos Master.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
ip = mkOption {
|
||||
description = "IP address to listen on.";
|
||||
default = "0.0.0.0";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
description = "Mesos Master port";
|
||||
default = 5050;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
advertiseIp = mkOption {
|
||||
description = "IP address advertised to reach this master.";
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
|
||||
advertisePort = mkOption {
|
||||
description = "Port advertised to reach this Mesos master.";
|
||||
default = null;
|
||||
type = types.nullOr types.int;
|
||||
};
|
||||
|
||||
zk = mkOption {
|
||||
description = ''
|
||||
ZooKeeper URL (used for leader election amongst masters).
|
||||
May be one of:
|
||||
zk://host1:port1,host2:port2,.../mesos
|
||||
zk://username:password@host1:port1,host2:port2,.../mesos
|
||||
'';
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
workDir = mkOption {
|
||||
description = "The Mesos work directory.";
|
||||
default = "/var/lib/mesos/master";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
extraCmdLineOptions = mkOption {
|
||||
description = ''
|
||||
Extra command line options for Mesos Master.
|
||||
|
||||
See https://mesos.apache.org/documentation/latest/configuration/
|
||||
'';
|
||||
default = [ "" ];
|
||||
type = types.listOf types.str;
|
||||
example = [ "--credentials=VALUE" ];
|
||||
};
|
||||
|
||||
quorum = mkOption {
|
||||
description = ''
|
||||
The size of the quorum of replicas when using 'replicated_log' based
|
||||
registry. It is imperative to set this value to be a majority of
|
||||
masters i.e., quorum > (number of masters)/2.
|
||||
|
||||
If 0 will fall back to --registry=in_memory.
|
||||
'';
|
||||
default = 0;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
logLevel = mkOption {
|
||||
description = ''
|
||||
The logging level used. Possible values:
|
||||
'INFO', 'WARNING', 'ERROR'
|
||||
'';
|
||||
default = "INFO";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.workDir}' 0700 - - - -"
|
||||
];
|
||||
systemd.services.mesos-master = {
|
||||
description = "Mesos Master";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.mesos}/bin/mesos-master \
|
||||
--ip=${cfg.ip} \
|
||||
--port=${toString cfg.port} \
|
||||
${optionalString (cfg.advertiseIp != null) "--advertise_ip=${cfg.advertiseIp}"} \
|
||||
${optionalString (cfg.advertisePort != null) "--advertise_port=${toString cfg.advertisePort}"} \
|
||||
${if cfg.quorum == 0
|
||||
then "--registry=in_memory"
|
||||
else "--zk=${cfg.zk} --registry=replicated_log --quorum=${toString cfg.quorum}"} \
|
||||
--work_dir=${cfg.workDir} \
|
||||
--logging_level=${cfg.logLevel} \
|
||||
${toString cfg.extraCmdLineOptions}
|
||||
'';
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.mesos.slave;
|
||||
|
||||
mkAttributes =
|
||||
attrs: concatStringsSep ";" (mapAttrsToList
|
||||
(k: v: "${k}:${v}")
|
||||
(filterAttrs (k: v: v != null) attrs));
|
||||
attribsArg = optionalString (cfg.attributes != {})
|
||||
"--attributes=${mkAttributes cfg.attributes}";
|
||||
|
||||
containerizersArg = concatStringsSep "," (
|
||||
lib.unique (
|
||||
cfg.containerizers ++ (optional cfg.withDocker "docker")
|
||||
)
|
||||
);
|
||||
|
||||
imageProvidersArg = concatStringsSep "," (
|
||||
lib.unique (
|
||||
cfg.imageProviders ++ (optional cfg.withDocker "docker")
|
||||
)
|
||||
);
|
||||
|
||||
isolationArg = concatStringsSep "," (
|
||||
lib.unique (
|
||||
cfg.isolation ++ (optionals cfg.withDocker [ "filesystem/linux" "docker/runtime"])
|
||||
)
|
||||
);
|
||||
|
||||
in {
|
||||
|
||||
options.services.mesos = {
|
||||
slave = {
|
||||
enable = mkOption {
|
||||
description = "Whether to enable the Mesos Slave.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
ip = mkOption {
|
||||
description = "IP address to listen on.";
|
||||
default = "0.0.0.0";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
description = "Port to listen on.";
|
||||
default = 5051;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
advertiseIp = mkOption {
|
||||
description = "IP address advertised to reach this agent.";
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
|
||||
advertisePort = mkOption {
|
||||
description = "Port advertised to reach this agent.";
|
||||
default = null;
|
||||
type = types.nullOr types.int;
|
||||
};
|
||||
|
||||
containerizers = mkOption {
|
||||
description = ''
|
||||
List of containerizer implementations to compose in order to provide
|
||||
containerization. Available options are mesos and docker.
|
||||
The order the containerizers are specified is the order they are tried.
|
||||
'';
|
||||
default = [ "mesos" ];
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
|
||||
imageProviders = mkOption {
|
||||
description = "List of supported image providers, e.g., APPC,DOCKER.";
|
||||
default = [ ];
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
|
||||
imageProvisionerBackend = mkOption {
|
||||
description = ''
|
||||
Strategy for provisioning container rootfs from images,
|
||||
e.g., aufs, bind, copy, overlay.
|
||||
'';
|
||||
default = "copy";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
isolation = mkOption {
|
||||
description = ''
|
||||
Isolation mechanisms to use, e.g., posix/cpu,posix/mem, or
|
||||
cgroups/cpu,cgroups/mem, or network/port_mapping, or `gpu/nvidia` for nvidia
|
||||
specific gpu isolation.
|
||||
'';
|
||||
default = [ "posix/cpu" "posix/mem" ];
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
|
||||
master = mkOption {
|
||||
description = ''
|
||||
May be one of:
|
||||
zk://host1:port1,host2:port2,.../path
|
||||
zk://username:password@host1:port1,host2:port2,.../path
|
||||
'';
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
withHadoop = mkOption {
|
||||
description = "Add the HADOOP_HOME to the slave.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
withDocker = mkOption {
|
||||
description = "Enable the docker containerizer.";
|
||||
default = config.virtualisation.docker.enable;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
dockerRegistry = mkOption {
|
||||
description = ''
|
||||
The default url for pulling Docker images.
|
||||
It could either be a Docker registry server url,
|
||||
or a local path in which Docker image archives are stored.
|
||||
'';
|
||||
default = null;
|
||||
type = types.nullOr (types.either types.str types.path);
|
||||
};
|
||||
|
||||
workDir = mkOption {
|
||||
description = "The Mesos work directory.";
|
||||
default = "/var/lib/mesos/slave";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
extraCmdLineOptions = mkOption {
|
||||
description = ''
|
||||
Extra command line options for Mesos Slave.
|
||||
|
||||
See https://mesos.apache.org/documentation/latest/configuration/
|
||||
'';
|
||||
default = [ "" ];
|
||||
type = types.listOf types.str;
|
||||
example = [ "--gc_delay=3days" ];
|
||||
};
|
||||
|
||||
logLevel = mkOption {
|
||||
description = ''
|
||||
The logging level used. Possible values:
|
||||
'INFO', 'WARNING', 'ERROR'
|
||||
'';
|
||||
default = "INFO";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
attributes = mkOption {
|
||||
description = ''
|
||||
Machine attributes for the slave instance.
|
||||
|
||||
Use caution when changing this; you may need to manually reset slave
|
||||
metadata before the slave can re-register.
|
||||
'';
|
||||
default = {};
|
||||
type = types.attrsOf types.str;
|
||||
example = { rack = "aa";
|
||||
host = "aabc123";
|
||||
os = "nixos"; };
|
||||
};
|
||||
|
||||
executorEnvironmentVariables = mkOption {
|
||||
description = ''
|
||||
The environment variables that should be passed to the executor, and thus subsequently task(s).
|
||||
'';
|
||||
default = {
|
||||
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
||||
};
|
||||
type = types.attrsOf types.str;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.workDir}' 0701 - - - -"
|
||||
];
|
||||
systemd.services.mesos-slave = {
|
||||
description = "Mesos Slave";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ] ++ optionals cfg.withDocker [ "docker.service" ] ;
|
||||
path = [ pkgs.runtimeShellPackage ];
|
||||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.mesos}/bin/mesos-slave \
|
||||
--containerizers=${containerizersArg} \
|
||||
--image_providers=${imageProvidersArg} \
|
||||
--image_provisioner_backend=${cfg.imageProvisionerBackend} \
|
||||
--isolation=${isolationArg} \
|
||||
--ip=${cfg.ip} \
|
||||
--port=${toString cfg.port} \
|
||||
${optionalString (cfg.advertiseIp != null) "--advertise_ip=${cfg.advertiseIp}"} \
|
||||
${optionalString (cfg.advertisePort != null) "--advertise_port=${toString cfg.advertisePort}"} \
|
||||
--master=${cfg.master} \
|
||||
--work_dir=${cfg.workDir} \
|
||||
--logging_level=${cfg.logLevel} \
|
||||
${attribsArg} \
|
||||
${optionalString cfg.withHadoop "--hadoop-home=${pkgs.hadoop}"} \
|
||||
${optionalString cfg.withDocker "--docker=${pkgs.docker}/libexec/docker/docker"} \
|
||||
${optionalString (cfg.dockerRegistry != null) "--docker_registry=${cfg.dockerRegistry}"} \
|
||||
--executor_environment_variables=${lib.escapeShellArg (builtins.toJSON cfg.executorEnvironmentVariables)} \
|
||||
${toString cfg.extraCmdLineOptions}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
78
nixos/modules/services/misc/pinnwand.nix
Normal file
78
nixos/modules/services/misc/pinnwand.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.pinnwand;
|
||||
|
||||
format = pkgs.formats.toml {};
|
||||
configFile = format.generate "pinnwand.toml" cfg.settings;
|
||||
in
|
||||
{
|
||||
options.services.pinnwand = {
|
||||
enable = mkEnableOption "Pinnwand";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
description = "The port to listen on.";
|
||||
default = 8000;
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = format.type;
|
||||
description = ''
|
||||
Your <filename>pinnwand.toml</filename> as a Nix attribute set. Look up
|
||||
possible options in the <link xlink:href="https://github.com/supakeen/pinnwand/blob/master/pinnwand.toml-example">pinnwand.toml-example</link>.
|
||||
'';
|
||||
default = {
|
||||
# https://github.com/supakeen/pinnwand/blob/master/pinnwand.toml-example
|
||||
database_uri = "sqlite:///var/lib/pinnwand/pinnwand.db";
|
||||
preferred_lexeres = [];
|
||||
paste_size = 262144;
|
||||
paste_help = ''
|
||||
<p>Welcome to pinnwand, this site is a pastebin. It allows you to share code with others. If you write code in the text area below and press the paste button you will be given a link you can share with others so they can view your code as well.</p><p>People with the link can view your pasted code, only you can remove your paste and it expires automatically. Note that anyone could guess the URI to your paste so don't rely on it being private.</p>
|
||||
'';
|
||||
footer = ''
|
||||
View <a href="//github.com/supakeen/pinnwand" target="_BLANK">source code</a>, the <a href="/removal">removal</a> or <a href="/expiry">expiry</a> stories, or read the <a href="/about">about</a> page.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.pinnwand = {
|
||||
description = "Pinnwannd HTTP Server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
unitConfig.Documentation = "https://pinnwand.readthedocs.io/en/latest/";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.pinnwand}/bin/pinnwand --configuration-path ${configFile} http --port ${toString(cfg.port)}";
|
||||
StateDirectory = "pinnwand";
|
||||
StateDirectoryMode = "0700";
|
||||
|
||||
AmbientCapabilities = [];
|
||||
CapabilityBoundingSet = "";
|
||||
DevicePolicy = "closed";
|
||||
DynamicUser = true;
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
PrivateDevices = true;
|
||||
PrivateUsers = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = "@system-service";
|
||||
UMask = "0077";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -256,6 +256,6 @@ in
|
|||
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
meta.maintainers = with maintainers; [ _1000101 ];
|
||||
|
||||
}
|
||||
|
|
|
@ -270,6 +270,6 @@ in
|
|||
nameValuePair "${cfg.group}" { })) eachBlockbook;
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
meta.maintainers = with maintainers; [ _1000101 ];
|
||||
|
||||
}
|
||||
|
|
|
@ -129,13 +129,17 @@ in {
|
|||
systemd.services."kresd@".serviceConfig = {
|
||||
ExecStart = "${package}/bin/kresd --noninteractive "
|
||||
+ "-c ${package}/lib/knot-resolver/distro-preconfig.lua -c ${configFile}";
|
||||
# Ensure correct ownership in case UID or GID changes.
|
||||
# Ensure /run/knot-resolver exists
|
||||
RuntimeDirectory = "knot-resolver";
|
||||
RuntimeDirectoryMode = "0770";
|
||||
# Ensure /var/lib/knot-resolver exists
|
||||
StateDirectory = "knot-resolver";
|
||||
StateDirectoryMode = "0770";
|
||||
# Ensure /var/cache/knot-resolver exists
|
||||
CacheDirectory = "knot-resolver";
|
||||
CacheDirectoryMode = "0750";
|
||||
CacheDirectoryMode = "0770";
|
||||
};
|
||||
|
||||
systemd.tmpfiles.packages = [ package ];
|
||||
|
||||
# Try cleaning up the previously default location of cache file.
|
||||
# Note that /var/cache/* should always be safe to remove.
|
||||
# TODO: remove later, probably between 20.09 and 21.03
|
||||
|
|
|
@ -108,7 +108,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
meta.maintainers = with maintainers; [ _1000101 ];
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ in
|
|||
config = mkIf cfg.enable (
|
||||
mkMerge [
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers."0x4A6F" ];
|
||||
meta.maintainers = with lib.maintainers; [ _0x4A6F ];
|
||||
|
||||
systemd.services.xandikos = {
|
||||
description = "A Simple Calendar and Contact Server";
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.chronos;
|
||||
|
||||
in {
|
||||
|
||||
###### interface
|
||||
|
||||
options.services.chronos = {
|
||||
enable = mkOption {
|
||||
description = "Whether to enable graphite web frontend.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
httpPort = mkOption {
|
||||
description = "Chronos listening port";
|
||||
default = 4400;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
master = mkOption {
|
||||
description = "Chronos mesos master zookeeper address";
|
||||
default = "zk://${head cfg.zookeeperHosts}/mesos";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
zookeeperHosts = mkOption {
|
||||
description = "Chronos mesos zookepper addresses";
|
||||
default = [ "localhost:2181" ];
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.chronos = {
|
||||
description = "Chronos Service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "zookeeper.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.chronos}/bin/chronos --master ${cfg.master} --zk_hosts ${concatStringsSep "," cfg.zookeeperHosts} --http_port ${toString cfg.httpPort}";
|
||||
User = "chronos";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.chronos.uid = config.ids.uids.chronos;
|
||||
};
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.marathon;
|
||||
|
||||
in {
|
||||
|
||||
###### interface
|
||||
|
||||
options.services.marathon = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable the marathon mesos framework.
|
||||
'';
|
||||
};
|
||||
|
||||
master = mkOption {
|
||||
type = types.str;
|
||||
default = "zk://${concatStringsSep "," cfg.zookeeperHosts}/mesos";
|
||||
example = "zk://1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181/mesos";
|
||||
description = ''
|
||||
Mesos master address. See <link xlink:href="https://mesosphere.github.io/marathon/docs/"/> for details.
|
||||
'';
|
||||
};
|
||||
|
||||
zookeeperHosts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "localhost:2181" ];
|
||||
example = [ "1.2.3.4:2181" "2.3.4.5:2181" "3.4.5.6:2181" ];
|
||||
description = ''
|
||||
ZooKeeper hosts' addresses.
|
||||
'';
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "marathon";
|
||||
example = "root";
|
||||
description = ''
|
||||
The user that the Marathon framework will be launched as. If the user doesn't exist it will be created.
|
||||
If you want to run apps that require root access or you want to launch apps using arbitrary users, that
|
||||
is using the `--mesos_user` flag then you need to change this to `root`.
|
||||
'';
|
||||
};
|
||||
|
||||
httpPort = mkOption {
|
||||
type = types.int;
|
||||
default = 8080;
|
||||
description = ''
|
||||
Marathon listening port for HTTP connections.
|
||||
'';
|
||||
};
|
||||
|
||||
extraCmdLineOptions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "--https_port=8443" "--zk_timeout=10000" "--marathon_store_timeout=2000" ];
|
||||
description = ''
|
||||
Extra command line options to pass to Marathon.
|
||||
See <link xlink:href="https://mesosphere.github.io/marathon/docs/command-line-flags.html"/> for all possible flags.
|
||||
'';
|
||||
};
|
||||
|
||||
environment = mkOption {
|
||||
default = { };
|
||||
type = types.attrs;
|
||||
example = { JAVA_OPTS = "-Xmx512m"; MESOSPHERE_HTTP_CREDENTIALS = "username:password"; };
|
||||
description = ''
|
||||
Environment variables passed to Marathon.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.marathon = {
|
||||
description = "Marathon Service";
|
||||
environment = cfg.environment;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "zookeeper.service" "mesos-master.service" "mesos-slave.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.marathon}/bin/marathon --master ${cfg.master} --zk zk://${concatStringsSep "," cfg.zookeeperHosts}/marathon --http_port ${toString cfg.httpPort} ${concatStringsSep " " cfg.extraCmdLineOptions}";
|
||||
User = cfg.user;
|
||||
Restart = "always";
|
||||
RestartSec = "2";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${cfg.user}.isSystemUser = true;
|
||||
};
|
||||
}
|
|
@ -11,6 +11,7 @@ let
|
|||
settingsDir = ".config/transmission-daemon";
|
||||
downloadsDir = "Downloads";
|
||||
incompleteDir = ".incomplete";
|
||||
watchDir = "watchdir";
|
||||
# TODO: switch to configGen.json once RFC0042 is implemented
|
||||
settingsFile = pkgs.writeText "settings.json" (builtins.toJSON cfg.settings);
|
||||
in
|
||||
|
@ -35,6 +36,8 @@ in
|
|||
download-dir = "${cfg.home}/${downloadsDir}";
|
||||
incomplete-dir = "${cfg.home}/${incompleteDir}";
|
||||
incomplete-dir-enabled = true;
|
||||
watch-dir = "${cfg.home}/${watchDir}";
|
||||
watch-dir-enabled = false;
|
||||
message-level = 1;
|
||||
peer-port = 51413;
|
||||
peer-port-random-high = 65535;
|
||||
|
@ -161,6 +164,9 @@ in
|
|||
{ assertion = types.path.check cfg.settings.incomplete-dir;
|
||||
message = "`services.transmission.settings.incomplete-dir' must be an absolute path.";
|
||||
}
|
||||
{ assertion = types.path.check cfg.settings.watch-dir;
|
||||
message = "`services.transmission.settings.watch-dir' must be an absolute path.";
|
||||
}
|
||||
{ assertion = cfg.settings.script-torrent-done-filename == "" || types.path.check cfg.settings.script-torrent-done-filename;
|
||||
message = "`services.transmission.settings.script-torrent-done-filename' must be an absolute path.";
|
||||
}
|
||||
|
@ -220,14 +226,16 @@ in
|
|||
cfg.settings.download-dir
|
||||
] ++
|
||||
optional cfg.settings.incomplete-dir-enabled
|
||||
cfg.settings.incomplete-dir;
|
||||
cfg.settings.incomplete-dir
|
||||
++
|
||||
optional cfg.settings.watch-dir-enabled
|
||||
cfg.settings.watch-dir
|
||||
;
|
||||
BindReadOnlyPaths = [
|
||||
# No confinement done of /nix/store here like in systemd-confinement.nix,
|
||||
# an AppArmor profile is provided to get a confinement based upon paths and rights.
|
||||
builtins.storeDir
|
||||
"-/etc/hosts"
|
||||
"-/etc/ld-nix.so.preload"
|
||||
"-/etc/localtime"
|
||||
"/etc"
|
||||
] ++
|
||||
optional (cfg.settings.script-torrent-done-enabled &&
|
||||
cfg.settings.script-torrent-done-filename != "")
|
||||
|
@ -410,11 +418,17 @@ in
|
|||
${optionalString cfg.settings.incomplete-dir-enabled ''
|
||||
rw ${cfg.settings.incomplete-dir}/**,
|
||||
''}
|
||||
${optionalString cfg.settings.watch-dir-enabled ''
|
||||
rw ${cfg.settings.watch-dir}/**,
|
||||
''}
|
||||
profile dirs {
|
||||
rw ${cfg.settings.download-dir}/**,
|
||||
${optionalString cfg.settings.incomplete-dir-enabled ''
|
||||
rw ${cfg.settings.incomplete-dir}/**,
|
||||
''}
|
||||
${optionalString cfg.settings.watch-dir-enabled ''
|
||||
rw ${cfg.settings.watch-dir}/**,
|
||||
''}
|
||||
}
|
||||
|
||||
${optionalString (cfg.settings.script-torrent-done-enabled &&
|
||||
|
|
|
@ -383,6 +383,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
meta.maintainers = with maintainers; [ _1000101 ];
|
||||
|
||||
}
|
||||
|
|
|
@ -47,8 +47,18 @@ let
|
|||
in {
|
||||
|
||||
imports = [
|
||||
( mkRemovedOptionModule [ "services" "nextcloud" "nginx" "enable" ]
|
||||
"The nextcloud module dropped support for other webservers than nginx.")
|
||||
(mkRemovedOptionModule [ "services" "nextcloud" "nginx" "enable" ] ''
|
||||
The nextcloud module supports `nginx` as reverse-proxy by default and doesn't
|
||||
support other reverse-proxies officially.
|
||||
|
||||
However it's possible to use an alternative reverse-proxy by
|
||||
|
||||
* disabling nginx
|
||||
* setting `listen.owner` & `listen.group` in the phpfpm-pool to a different value
|
||||
|
||||
Further details about this can be found in the `Nextcloud`-section of the NixOS-manual
|
||||
(which can be openend e.g. by running `nixos-help`).
|
||||
'')
|
||||
];
|
||||
|
||||
options.services.nextcloud = {
|
||||
|
@ -544,36 +554,40 @@ in {
|
|||
'';
|
||||
};
|
||||
"/" = {
|
||||
priority = 200;
|
||||
extraConfig = "rewrite ^ /index.php;";
|
||||
priority = 900;
|
||||
extraConfig = "try_files $uri $uri/ /index.php$request_uri;";
|
||||
};
|
||||
"~ ^/store-apps" = {
|
||||
priority = 201;
|
||||
extraConfig = "root ${cfg.home};";
|
||||
};
|
||||
"= /.well-known/carddav" = {
|
||||
"^~ /.well-known" = {
|
||||
priority = 210;
|
||||
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
||||
extraConfig = ''
|
||||
location = /.well-known/carddav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
location = /.well-known/caldav {
|
||||
return 301 $scheme://$host/remote.php/dav;
|
||||
}
|
||||
try_files $uri $uri/ =404;
|
||||
'';
|
||||
};
|
||||
"= /.well-known/caldav" = {
|
||||
priority = 210;
|
||||
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
||||
};
|
||||
"~ ^\\/(?:build|tests|config|lib|3rdparty|templates|data)\\/" = {
|
||||
priority = 300;
|
||||
extraConfig = "deny all;";
|
||||
};
|
||||
"~ ^\\/(?:\\.|autotest|occ|issue|indie|db_|console)" = {
|
||||
priority = 300;
|
||||
extraConfig = "deny all;";
|
||||
};
|
||||
"~ ^\\/(?:index|remote|public|cron|core/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|ocs-provider\\/.+|ocm-provider\\/.+)\\.php(?:$|\\/)" = {
|
||||
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)".extraConfig = ''
|
||||
return 404;
|
||||
'';
|
||||
"~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)".extraConfig = ''
|
||||
return 404;
|
||||
'';
|
||||
"~ \\.php(?:$|/)" = {
|
||||
priority = 500;
|
||||
extraConfig = ''
|
||||
include ${config.services.nginx.package}/conf/fastcgi.conf;
|
||||
fastcgi_split_path_info ^(.+\.php)(\\/.*)$;
|
||||
fastcgi_split_path_info ^(.+?\.php)(\\/.*)$;
|
||||
set $path_info $fastcgi_path_info;
|
||||
try_files $fastcgi_script_name =404;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param HTTPS ${if cfg.https then "on" else "off"};
|
||||
fastcgi_param modHeadersAvailable true;
|
||||
fastcgi_param front_controller_active true;
|
||||
|
@ -583,28 +597,24 @@ in {
|
|||
fastcgi_read_timeout 120s;
|
||||
'';
|
||||
};
|
||||
"~ \\.(?:css|js|svg|gif|map)$".extraConfig = ''
|
||||
try_files $uri /index.php$request_uri;
|
||||
expires 6M;
|
||||
access_log off;
|
||||
'';
|
||||
"~ \\.woff2?$".extraConfig = ''
|
||||
try_files $uri /index.php$request_uri;
|
||||
expires 7d;
|
||||
access_log off;
|
||||
'';
|
||||
"~ ^\\/(?:updater|ocs-provider|ocm-provider)(?:$|\\/)".extraConfig = ''
|
||||
try_files $uri/ =404;
|
||||
index index.php;
|
||||
'';
|
||||
"~ \\.(?:css|js|woff2?|svg|gif)$".extraConfig = ''
|
||||
try_files $uri /index.php$request_uri;
|
||||
add_header Cache-Control "public, max-age=15778463";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
add_header X-Download-Options noopen;
|
||||
add_header X-Permitted-Cross-Domain-Policies none;
|
||||
add_header X-Frame-Options sameorigin;
|
||||
add_header Referrer-Policy no-referrer;
|
||||
access_log off;
|
||||
'';
|
||||
"~ \\.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$".extraConfig = ''
|
||||
try_files $uri /index.php$request_uri;
|
||||
access_log off;
|
||||
'';
|
||||
};
|
||||
extraConfig = ''
|
||||
index index.php index.html /index.php$request_uri;
|
||||
expires 1m;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
|
@ -613,8 +623,6 @@ in {
|
|||
add_header X-Frame-Options sameorigin;
|
||||
add_header Referrer-Policy no-referrer;
|
||||
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
||||
error_page 403 /core/templates/403.php;
|
||||
error_page 404 /core/templates/404.php;
|
||||
client_max_body_size ${cfg.maxUploadSize};
|
||||
fastcgi_buffers 64 4K;
|
||||
fastcgi_hide_header X-Powered-By;
|
||||
|
|
|
@ -123,6 +123,61 @@
|
|||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="module-services-nextcloud-httpd">
|
||||
<title>Using an alternative webserver as reverse-proxy (e.g. <literal>httpd</literal>)</title>
|
||||
<para>
|
||||
By default, <package>nginx</package> is used as reverse-proxy for <package>nextcloud</package>.
|
||||
However, it's possible to use e.g. <package>httpd</package> by explicitly disabling
|
||||
<package>nginx</package> using <xref linkend="opt-services.nginx.enable" /> and fixing the
|
||||
settings <literal>listen.owner</literal> & <literal>listen.group</literal> in the
|
||||
<link linkend="opt-services.phpfpm.pools">corresponding <literal>phpfpm</literal> pool</link>.
|
||||
</para>
|
||||
<para>
|
||||
An exemplary configuration may look like this:
|
||||
<programlisting>{ config, lib, pkgs, ... }: {
|
||||
<link linkend="opt-services.nginx.enable">services.nginx.enable</link> = false;
|
||||
services.nextcloud = {
|
||||
<link linkend="opt-services.nextcloud.enable">enable</link> = true;
|
||||
<link linkend="opt-services.nextcloud.hostName">hostName</link> = "localhost";
|
||||
|
||||
/* further, required options */
|
||||
};
|
||||
<link linkend="opt-services.phpfpm.pools._name_.settings">services.phpfpm.pools.nextcloud.settings</link> = {
|
||||
"listen.owner" = config.services.httpd.user;
|
||||
"listen.group" = config.services.httpd.group;
|
||||
};
|
||||
services.httpd = {
|
||||
<link linkend="opt-services.httpd.enable">enable</link> = true;
|
||||
<link linkend="opt-services.httpd.adminAddr">adminAddr</link> = "webmaster@localhost";
|
||||
<link linkend="opt-services.httpd.extraModules">extraModules</link> = [ "proxy_fcgi" ];
|
||||
virtualHosts."localhost" = {
|
||||
<link linkend="opt-services.httpd.virtualHosts._name_.documentRoot">documentRoot</link> = config.services.nextcloud.package;
|
||||
<link linkend="opt-services.httpd.virtualHosts._name_.extraConfig">extraConfig</link> = ''
|
||||
<Directory "${config.services.nextcloud.package}">
|
||||
<FilesMatch "\.php$">
|
||||
<If "-f %{REQUEST_FILENAME}">
|
||||
SetHandler "proxy:unix:${config.services.phpfpm.pools.nextcloud.socket}|fcgi://localhost/"
|
||||
</If>
|
||||
</FilesMatch>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.php$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.php [L]
|
||||
</IfModule>
|
||||
DirectoryIndex index.php
|
||||
Require all granted
|
||||
Options +FollowSymLinks
|
||||
</Directory>
|
||||
'';
|
||||
};
|
||||
};
|
||||
}</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="module-services-nextcloud-maintainer-info">
|
||||
<title>Maintainer information</title>
|
||||
|
||||
|
|
127
nixos/modules/services/web-apps/rss-bridge.nix
Normal file
127
nixos/modules/services/web-apps/rss-bridge.nix
Normal file
|
@ -0,0 +1,127 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.rss-bridge;
|
||||
|
||||
poolName = "rss-bridge";
|
||||
|
||||
whitelist = pkgs.writeText "rss-bridge_whitelist.txt"
|
||||
(concatStringsSep "\n" cfg.whitelist);
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.rss-bridge = {
|
||||
enable = mkEnableOption "rss-bridge";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "nginx";
|
||||
example = "nginx";
|
||||
description = ''
|
||||
User account under which both the service and the web-application run.
|
||||
'';
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "nginx";
|
||||
example = "nginx";
|
||||
description = ''
|
||||
Group under which the web-application run.
|
||||
'';
|
||||
};
|
||||
|
||||
pool = mkOption {
|
||||
type = types.str;
|
||||
default = poolName;
|
||||
description = ''
|
||||
Name of existing phpfpm pool that is used to run web-application.
|
||||
If not specified a pool will be created automatically with
|
||||
default values.
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.str;
|
||||
default = "/var/lib/rss-bridge";
|
||||
description = ''
|
||||
Location in which cache directory will be created.
|
||||
You can put <literal>config.ini.php</literal> in here.
|
||||
'';
|
||||
};
|
||||
|
||||
virtualHost = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "rss-bridge";
|
||||
description = ''
|
||||
Name of the nginx virtualhost to use and setup. If null, do not setup any virtualhost.
|
||||
'';
|
||||
};
|
||||
|
||||
whitelist = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = options.literalExample ''
|
||||
[
|
||||
"Facebook"
|
||||
"Instagram"
|
||||
"Twitter"
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of bridges to be whitelisted.
|
||||
If the list is empty, rss-bridge will use whitelist.default.txt.
|
||||
Use <literal>[ "*" ]</literal> to whitelist all.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.phpfpm.pools = mkIf (cfg.pool == poolName) {
|
||||
${poolName} = {
|
||||
user = cfg.user;
|
||||
settings = mapAttrs (name: mkDefault) {
|
||||
"listen.owner" = cfg.user;
|
||||
"listen.group" = cfg.user;
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
"pm.start_servers" = 10;
|
||||
"pm.min_spare_servers" = 5;
|
||||
"pm.max_spare_servers" = 20;
|
||||
"pm.max_requests" = 500;
|
||||
"catch_workers_output" = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.dataDir}/cache' 0750 ${cfg.user} ${cfg.group} - -"
|
||||
(mkIf (cfg.whitelist != []) "L+ ${cfg.dataDir}/whitelist.txt - - - - ${whitelist}")
|
||||
"z '${cfg.dataDir}/config.ini.php' 0750 ${cfg.user} ${cfg.group} - -"
|
||||
];
|
||||
|
||||
services.nginx = mkIf (cfg.virtualHost != null) {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
${cfg.virtualHost} = {
|
||||
root = "${pkgs.rss-bridge}";
|
||||
|
||||
locations."/" = {
|
||||
tryFiles = "$uri /index.php$is_args$args";
|
||||
};
|
||||
|
||||
locations."~ ^/index.php(/|$)" = {
|
||||
extraConfig = ''
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.${cfg.pool}.socket};
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param RSSBRIDGE_DATA ${cfg.dataDir};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -120,9 +120,12 @@ in {
|
|||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
PrivateUsers = false;
|
||||
ProtectHostname = true;
|
||||
ProtectClock = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
|
||||
LockPersonality = true;
|
||||
|
|
|
@ -81,10 +81,6 @@ let
|
|||
"systemd-coredump.socket"
|
||||
"systemd-coredump@.service"
|
||||
|
||||
# SysV init compatibility.
|
||||
"systemd-initctl.socket"
|
||||
"systemd-initctl.service"
|
||||
|
||||
# Kernel module loading.
|
||||
"systemd-modules-load.service"
|
||||
"kmod-static-nodes.service"
|
||||
|
@ -1012,18 +1008,18 @@ in
|
|||
"sysctl.d/50-coredump.conf".source = "${systemd}/example/sysctl.d/50-coredump.conf";
|
||||
"sysctl.d/50-default.conf".source = "${systemd}/example/sysctl.d/50-default.conf";
|
||||
|
||||
"tmpfiles.d".source = (pkgs.symlinkJoin {
|
||||
"tmpfiles.d".source = pkgs.symlinkJoin {
|
||||
name = "tmpfiles.d";
|
||||
paths = cfg.tmpfiles.packages;
|
||||
paths = map (p: p + "/lib/tmpfiles.d") cfg.tmpfiles.packages;
|
||||
postBuild = ''
|
||||
for i in $(cat $pathsPath); do
|
||||
(test -d $i/lib/tmpfiles.d && test $(ls $i/lib/tmpfiles.d/*.conf | wc -l) -ge 1) || (
|
||||
echo "ERROR: The path $i was passed to systemd.tmpfiles.packages but either does not contain the folder lib/tmpfiles.d or if it contains that folder, there are no files ending in .conf in it."
|
||||
(test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || (
|
||||
echo "ERROR: The path '$i' from systemd.tmpfiles.packages contains no *.conf files."
|
||||
exit 1
|
||||
)
|
||||
done
|
||||
'';
|
||||
}) + "/lib/tmpfiles.d";
|
||||
};
|
||||
|
||||
"systemd/system-generators" = { source = hooks "generators" cfg.generators; };
|
||||
"systemd/system-shutdown" = { source = hooks "shutdown" cfg.shutdown; };
|
||||
|
|
|
@ -191,13 +191,14 @@ in
|
|||
};
|
||||
|
||||
requestEncryptionCredentials = mkOption {
|
||||
type = types.bool;
|
||||
type = types.either types.bool (types.listOf types.str);
|
||||
default = true;
|
||||
example = [ "tank" "data" ];
|
||||
description = ''
|
||||
Request encryption keys or passwords for all encrypted datasets on import.
|
||||
For root pools the encryption key can be supplied via both an
|
||||
interactive prompt (keylocation=prompt) and from a file
|
||||
(keylocation=file://).
|
||||
If true on import encryption keys or passwords for all encrypted datasets
|
||||
are requested. To only decrypt selected datasets supply a list of dataset
|
||||
names instead. For root pools the encryption key can be supplied via both
|
||||
an interactive prompt (keylocation=prompt) and from a file (keylocation=file://).
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -419,9 +420,13 @@ in
|
|||
fi
|
||||
poolImported "${pool}" || poolImport "${pool}" # Try one last time, e.g. to import a degraded pool.
|
||||
fi
|
||||
${lib.optionalString cfgZfs.requestEncryptionCredentials ''
|
||||
zfs load-key -a
|
||||
''}
|
||||
${if isBool cfgZfs.requestEncryptionCredentials
|
||||
then optionalString cfgZfs.requestEncryptionCredentials ''
|
||||
zfs load-key -a
|
||||
''
|
||||
else concatMapStrings (fs: ''
|
||||
zfs load-key ${fs}
|
||||
'') cfgZfs.requestEncryptionCredentials}
|
||||
'') rootPools));
|
||||
};
|
||||
|
||||
|
@ -517,9 +522,16 @@ in
|
|||
done
|
||||
poolImported "${pool}" || poolImport "${pool}" # Try one last time, e.g. to import a degraded pool.
|
||||
if poolImported "${pool}"; then
|
||||
${optionalString cfgZfs.requestEncryptionCredentials ''
|
||||
${optionalString (if isBool cfgZfs.requestEncryptionCredentials
|
||||
then cfgZfs.requestEncryptionCredentials
|
||||
else cfgZfs.requestEncryptionCredentials != []) ''
|
||||
${packages.zfsUser}/sbin/zfs list -rHo name,keylocation ${pool} | while IFS=$'\t' read ds kl; do
|
||||
(case "$kl" in
|
||||
(${optionalString (!isBool cfgZfs.requestEncryptionCredentials) ''
|
||||
if ! echo '${concatStringsSep "\n" cfgZfs.requestEncryptionCredentials}' | grep -qFx "$ds"; then
|
||||
continue
|
||||
fi
|
||||
''}
|
||||
case "$kl" in
|
||||
none )
|
||||
;;
|
||||
prompt )
|
||||
|
|
|
@ -1,22 +1,13 @@
|
|||
# This module allows the test driver to connect to the virtual machine
|
||||
# via a root shell attached to port 514.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
||||
|
||||
{
|
||||
|
||||
# This option is a dummy that if used in conjunction with
|
||||
# modules/virtualisation/qemu-vm.nix gets merged with the same option defined
|
||||
# there and only is declared here because some modules use
|
||||
# test-instrumentation.nix but not qemu-vm.nix.
|
||||
#
|
||||
# One particular example are the boot tests where we want instrumentation
|
||||
# within the images but not other stuff like setting up 9p filesystems.
|
||||
options.virtualisation.qemu = { };
|
||||
|
||||
config = {
|
||||
|
||||
systemd.services.backdoor =
|
||||
|
@ -55,7 +46,12 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
|||
systemd.services."serial-getty@hvc0".enable = false;
|
||||
|
||||
# Only use a serial console, no TTY.
|
||||
virtualisation.qemu.consoles = [ qemuSerialDevice ];
|
||||
# NOTE: optionalAttrs
|
||||
# test-instrumentation.nix appears to be used without qemu-vm.nix, so
|
||||
# we avoid defining consoles if not possible.
|
||||
# TODO: refactor such that test-instrumentation can import qemu-vm
|
||||
# or declare virtualisation.qemu.console option in a module that's always imported
|
||||
virtualisation = lib.optionalAttrs (options ? virtualisation.qemu.consoles) { qemu.consoles = [ qemuSerialDevice ]; };
|
||||
|
||||
boot.initrd.preDeviceCommands =
|
||||
''
|
||||
|
|
|
@ -195,12 +195,10 @@ in
|
|||
mailcatcher = handleTest ./mailcatcher.nix {};
|
||||
mariadb-galera-mariabackup = handleTest ./mysql/mariadb-galera-mariabackup.nix {};
|
||||
mariadb-galera-rsync = handleTest ./mysql/mariadb-galera-rsync.nix {};
|
||||
mathics = handleTest ./mathics.nix {};
|
||||
matomo = handleTest ./matomo.nix {};
|
||||
matrix-synapse = handleTest ./matrix-synapse.nix {};
|
||||
mediawiki = handleTest ./mediawiki.nix {};
|
||||
memcached = handleTest ./memcached.nix {};
|
||||
mesos = handleTest ./mesos.nix {};
|
||||
metabase = handleTest ./metabase.nix {};
|
||||
miniflux = handleTest ./miniflux.nix {};
|
||||
minio = handleTest ./minio.nix {};
|
||||
|
@ -269,6 +267,7 @@ in
|
|||
pgjwt = handleTest ./pgjwt.nix {};
|
||||
pgmanage = handleTest ./pgmanage.nix {};
|
||||
php = handleTest ./php {};
|
||||
pinnwand = handleTest ./pinnwand.nix {};
|
||||
plasma5 = handleTest ./plasma5.nix {};
|
||||
plotinus = handleTest ./plotinus.nix {};
|
||||
podman = handleTestOn ["x86_64-linux"] ./podman.nix {};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "bitcoind";
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
maintainers = with maintainers; [ _1000101 ];
|
||||
};
|
||||
|
||||
machine = { ... }: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "blockbook-frontend";
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
maintainers = with maintainers; [ _1000101 ];
|
||||
};
|
||||
|
||||
machine = { ... }: {
|
||||
|
|
|
@ -33,7 +33,7 @@ let
|
|||
in {
|
||||
name = "dokuwiki";
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
maintainers = with maintainers; [ _1000101 ];
|
||||
};
|
||||
machine = { ... }: {
|
||||
services.dokuwiki."site1.local" = {
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
import ./make-test.nix ({ pkgs, ... }: {
|
||||
name = "mathics";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ benley ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
machine = { ... }: {
|
||||
services.mathics.enable = true;
|
||||
services.mathics.port = 8888;
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
startAll;
|
||||
$machine->waitForUnit("mathics.service");
|
||||
$machine->waitForOpenPort(8888);
|
||||
$machine->succeed("curl http://localhost:8888/");
|
||||
'';
|
||||
})
|
|
@ -1,92 +0,0 @@
|
|||
import ./make-test.nix ({ pkgs, ...} : rec {
|
||||
name = "mesos";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ offline kamilchm cstrahan ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
master = { ... }: {
|
||||
networking.firewall.enable = false;
|
||||
services.zookeeper.enable = true;
|
||||
services.mesos.master = {
|
||||
enable = true;
|
||||
zk = "zk://master:2181/mesos";
|
||||
};
|
||||
};
|
||||
|
||||
slave = { ... }: {
|
||||
networking.firewall.enable = false;
|
||||
networking.nat.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
services.mesos = {
|
||||
slave = {
|
||||
enable = true;
|
||||
master = "master:5050";
|
||||
dockerRegistry = registry;
|
||||
executorEnvironmentVariables = {
|
||||
PATH = "/run/current-system/sw/bin";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
simpleDocker = pkgs.dockerTools.buildImage {
|
||||
name = "echo";
|
||||
tag = "latest";
|
||||
contents = [ pkgs.stdenv.shellPackage pkgs.coreutils ];
|
||||
config = {
|
||||
Env = [
|
||||
# When shell=true, mesos invokes "sh -c '<cmd>'", so make sure "sh" is
|
||||
# on the PATH.
|
||||
"PATH=${pkgs.stdenv.shellPackage}/bin:${pkgs.coreutils}/bin"
|
||||
];
|
||||
Entrypoint = [ "echo" ];
|
||||
};
|
||||
};
|
||||
|
||||
registry = pkgs.runCommand "registry" { } ''
|
||||
mkdir -p $out
|
||||
cp ${simpleDocker} $out/echo:latest.tar
|
||||
'';
|
||||
|
||||
testFramework = pkgs.pythonPackages.buildPythonPackage {
|
||||
name = "mesos-tests";
|
||||
propagatedBuildInputs = [ pkgs.mesos ];
|
||||
catchConflicts = false;
|
||||
src = ./mesos_test.py;
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
installPhase = ''
|
||||
install -Dvm 0755 $src $out/bin/mesos_test.py
|
||||
|
||||
echo "done" > test.result
|
||||
tar czf $out/test.tar.gz test.result
|
||||
'';
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
startAll;
|
||||
$master->waitForUnit("zookeeper.service");
|
||||
$master->waitForUnit("mesos-master.service");
|
||||
$slave->waitForUnit("docker.service");
|
||||
$slave->waitForUnit("mesos-slave.service");
|
||||
$master->waitForOpenPort(2181);
|
||||
$master->waitForOpenPort(5050);
|
||||
$slave->waitForOpenPort(5051);
|
||||
|
||||
# is slave registered?
|
||||
$master->waitUntilSucceeds("curl -s --fail http://master:5050/master/slaves".
|
||||
" | grep -q \"\\\"hostname\\\":\\\"slave\\\"\"");
|
||||
|
||||
# try to run docker image
|
||||
$master->succeed("${pkgs.mesos}/bin/mesos-execute --master=master:5050".
|
||||
" --resources=\"cpus:0.1;mem:32\" --name=simple-docker".
|
||||
" --containerizer=mesos --docker_image=echo:latest".
|
||||
" --shell=true --command=\"echo done\" | grep -q TASK_FINISHED");
|
||||
|
||||
# simple command with .tar.gz uri
|
||||
$master->succeed("${testFramework}/bin/mesos_test.py master ".
|
||||
"${testFramework}/test.tar.gz");
|
||||
'';
|
||||
})
|
|
@ -1,72 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
import uuid
|
||||
import time
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
import sys
|
||||
|
||||
from mesos.interface import Scheduler
|
||||
from mesos.native import MesosSchedulerDriver
|
||||
from mesos.interface import mesos_pb2
|
||||
|
||||
def log(msg):
|
||||
process = subprocess.Popen("systemd-cat", stdin=subprocess.PIPE)
|
||||
(out,err) = process.communicate(msg)
|
||||
|
||||
class NixosTestScheduler(Scheduler):
|
||||
def __init__(self):
|
||||
self.master_ip = sys.argv[1]
|
||||
self.download_uri = sys.argv[2]
|
||||
|
||||
def resourceOffers(self, driver, offers):
|
||||
log("XXX got resource offer")
|
||||
|
||||
offer = offers[0]
|
||||
task = self.new_task(offer)
|
||||
uri = task.command.uris.add()
|
||||
uri.value = self.download_uri
|
||||
task.command.value = "cat test.result"
|
||||
driver.launchTasks(offer.id, [task])
|
||||
|
||||
def statusUpdate(self, driver, update):
|
||||
log("XXX status update")
|
||||
if update.state == mesos_pb2.TASK_FAILED:
|
||||
log("XXX test task failed with message: " + update.message)
|
||||
driver.stop()
|
||||
sys.exit(1)
|
||||
elif update.state == mesos_pb2.TASK_FINISHED:
|
||||
driver.stop()
|
||||
sys.exit(0)
|
||||
|
||||
def new_task(self, offer):
|
||||
task = mesos_pb2.TaskInfo()
|
||||
id = uuid.uuid4()
|
||||
task.task_id.value = str(id)
|
||||
task.slave_id.value = offer.slave_id.value
|
||||
task.name = "task {}".format(str(id))
|
||||
|
||||
cpus = task.resources.add()
|
||||
cpus.name = "cpus"
|
||||
cpus.type = mesos_pb2.Value.SCALAR
|
||||
cpus.scalar.value = 0.1
|
||||
|
||||
mem = task.resources.add()
|
||||
mem.name = "mem"
|
||||
mem.type = mesos_pb2.Value.SCALAR
|
||||
mem.scalar.value = 32
|
||||
|
||||
return task
|
||||
|
||||
if __name__ == '__main__':
|
||||
log("XXX framework started")
|
||||
|
||||
framework = mesos_pb2.FrameworkInfo()
|
||||
framework.user = "root"
|
||||
framework.name = "nixos-test-framework"
|
||||
driver = MesosSchedulerDriver(
|
||||
NixosTestScheduler(),
|
||||
framework,
|
||||
sys.argv[1] + ":5050"
|
||||
)
|
||||
driver.run()
|
|
@ -20,12 +20,24 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
|
|||
{ fsType = "tmpfs";
|
||||
options = [ "mode=1777" "noauto" ];
|
||||
};
|
||||
# Tests https://discourse.nixos.org/t/how-to-make-a-derivations-executables-have-the-s-permission/8555
|
||||
"/user-mount/point" = {
|
||||
device = "/user-mount/source";
|
||||
fsType = "none";
|
||||
options = [ "bind" "rw" "user" "noauto" ];
|
||||
};
|
||||
"/user-mount/denied-point" = {
|
||||
device = "/user-mount/denied-source";
|
||||
fsType = "none";
|
||||
options = [ "bind" "rw" "noauto" ];
|
||||
};
|
||||
};
|
||||
systemd.automounts = singleton
|
||||
{ wantedBy = [ "multi-user.target" ];
|
||||
where = "/tmp2";
|
||||
};
|
||||
users.users.sybil = { isNormalUser = true; group = "wheel"; };
|
||||
users.users.alice = { isNormalUser = true; };
|
||||
security.sudo = { enable = true; wheelNeedsPassword = false; };
|
||||
boot.kernel.sysctl."vm.swappiness" = 1;
|
||||
boot.kernelParams = [ "vsyscall=emulate" ];
|
||||
|
@ -112,6 +124,26 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
|
|||
machine.succeed("touch /tmp2/x")
|
||||
machine.succeed("grep '/tmp2 tmpfs' /proc/mounts")
|
||||
|
||||
with subtest(
|
||||
"Whether mounting by a user is possible with the `user` option in fstab (#95444)"
|
||||
):
|
||||
machine.succeed("mkdir -p /user-mount/source")
|
||||
machine.succeed("touch /user-mount/source/file")
|
||||
machine.succeed("chmod -R a+Xr /user-mount/source")
|
||||
machine.succeed("mkdir /user-mount/point")
|
||||
machine.succeed("chown alice:users /user-mount/point")
|
||||
machine.succeed("su - alice -c 'mount /user-mount/point'")
|
||||
machine.succeed("su - alice -c 'ls /user-mount/point/file'")
|
||||
with subtest(
|
||||
"Whether mounting by a user is denied without the `user` option in fstab"
|
||||
):
|
||||
machine.succeed("mkdir -p /user-mount/denied-source")
|
||||
machine.succeed("touch /user-mount/denied-source/file")
|
||||
machine.succeed("chmod -R a+Xr /user-mount/denied-source")
|
||||
machine.succeed("mkdir /user-mount/denied-point")
|
||||
machine.succeed("chown alice:users /user-mount/denied-point")
|
||||
machine.fail("su - alice -c 'mount /user-mount/denied-point'")
|
||||
|
||||
with subtest("shell-vars"):
|
||||
machine.succeed('[ -n "$NIX_PATH" ]')
|
||||
|
||||
|
|
|
@ -172,20 +172,6 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
|
|||
"echo 'use testdb; select test_id from tests;' | sudo -u testuser mysql -u testuser -N | grep 42"
|
||||
)
|
||||
|
||||
# Check if TokuDB plugin works
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; create table tokudb (test_id INT, PRIMARY KEY (test_id)) ENGINE = TokuDB;' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; insert into tokudb values (25);' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; select test_id from tokudb;' | sudo -u testuser mysql -u testuser -N | grep 25"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; drop table tokudb;' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
|
||||
# Check if RocksDB plugin works
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; create table rocksdb (test_id INT, PRIMARY KEY (test_id)) ENGINE = RocksDB;' | sudo -u testuser mysql -u testuser"
|
||||
|
@ -199,5 +185,19 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
|
|||
mariadb.succeed(
|
||||
"echo 'use testdb; drop table rocksdb;' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
'' + pkgs.stdenv.lib.optionalString pkgs.stdenv.isx86_64 ''
|
||||
# Check if TokuDB plugin works
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; create table tokudb (test_id INT, PRIMARY KEY (test_id)) ENGINE = TokuDB;' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; insert into tokudb values (25);' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; select test_id from tokudb;' | sudo -u testuser mysql -u testuser -N | grep 25"
|
||||
)
|
||||
mariadb.succeed(
|
||||
"echo 'use testdb; drop table tokudb;' | sudo -u testuser mysql -u testuser"
|
||||
)
|
||||
'';
|
||||
})
|
||||
|
|
86
nixos/tests/pinnwand.nix
Normal file
86
nixos/tests/pinnwand.nix
Normal file
|
@ -0,0 +1,86 @@
|
|||
import ./make-test-python.nix ({ pkgs, ...}:
|
||||
let
|
||||
pythonEnv = pkgs.python3.withPackages (py: with py; [ appdirs toml ]);
|
||||
|
||||
port = 8000;
|
||||
baseUrl = "http://server:${toString port}";
|
||||
|
||||
configureSteck = pkgs.writeScript "configure.py" ''
|
||||
#!${pythonEnv.interpreter}
|
||||
import appdirs
|
||||
import toml
|
||||
import os
|
||||
|
||||
CONFIG = {
|
||||
"base": "${baseUrl}/",
|
||||
"confirm": False,
|
||||
"magic": True,
|
||||
"ignore": True
|
||||
}
|
||||
|
||||
os.makedirs(appdirs.user_config_dir('steck'))
|
||||
with open(os.path.join(appdirs.user_config_dir('steck'), 'steck.toml'), "w") as fd:
|
||||
toml.dump(CONFIG, fd)
|
||||
'';
|
||||
in
|
||||
{
|
||||
name = "pinnwand";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers =[ hexa ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = { config, ... }:
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
port
|
||||
];
|
||||
|
||||
services.pinnwand = {
|
||||
enable = true;
|
||||
port = port;
|
||||
};
|
||||
};
|
||||
|
||||
client = { pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.steck ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
server.wait_for_unit("pinnwand.service")
|
||||
client.wait_for_unit("network.target")
|
||||
|
||||
# create steck.toml config file
|
||||
client.succeed("${configureSteck}")
|
||||
|
||||
# wait until the server running pinnwand is reachable
|
||||
client.wait_until_succeeds("ping -c1 server")
|
||||
|
||||
# make sure pinnwand is listening
|
||||
server.wait_until_succeeds("ss -lnp | grep ${toString port}")
|
||||
|
||||
# send the contents of /etc/machine-id
|
||||
response = client.succeed("steck paste /etc/machine-id")
|
||||
|
||||
# parse the steck response
|
||||
raw_url = None
|
||||
removal_link = None
|
||||
for line in response.split("\n"):
|
||||
if line.startswith("View link:"):
|
||||
raw_url = f"${baseUrl}/raw/{line.split('/')[-1]}"
|
||||
if line.startswith("Removal link:"):
|
||||
removal_link = line.split(":", 1)[1]
|
||||
|
||||
# check whether paste matches what we sent
|
||||
client.succeed(f"curl {raw_url} > /tmp/machine-id")
|
||||
client.succeed("diff /tmp/machine-id /etc/machine-id")
|
||||
|
||||
# remove paste and check that it's not available any more
|
||||
client.succeed(f"curl {removal_link}")
|
||||
client.fail(f"curl --fail {raw_url}")
|
||||
'';
|
||||
})
|
|
@ -1,7 +1,7 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "trezord";
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
maintainers = with maintainers; [ mmahut maintainers."1000101" ];
|
||||
maintainers = with maintainers; [ mmahut _1000101 ];
|
||||
};
|
||||
nodes = {
|
||||
machine = { ... }: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "trickster";
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
maintainers = with maintainers; [ maintainers."1000101" ];
|
||||
maintainers = with maintainers; [ _1000101 ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
|
|
|
@ -4,7 +4,7 @@ import ./make-test-python.nix (
|
|||
{
|
||||
name = "xandikos";
|
||||
|
||||
meta.maintainers = [ lib.maintainers."0x4A6F" ];
|
||||
meta.maintainers = with lib.maintainers; [ _0x4A6F ];
|
||||
|
||||
nodes = {
|
||||
xandikos_client = {};
|
||||
|
|
|
@ -46,6 +46,17 @@ let
|
|||
"zpool destroy rpool",
|
||||
"udevadm settle",
|
||||
)
|
||||
|
||||
machine.succeed(
|
||||
'echo password | zpool create -o altroot="/tmp/mnt" '
|
||||
+ "-O encryption=aes-256-gcm -O keyformat=passphrase rpool /dev/vdb1",
|
||||
"zfs create -o mountpoint=legacy rpool/root",
|
||||
"mount -t zfs rpool/root /tmp/mnt",
|
||||
"udevadm settle",
|
||||
"umount /tmp/mnt",
|
||||
"zpool destroy rpool",
|
||||
"udevadm settle",
|
||||
)
|
||||
'' + extraTest;
|
||||
|
||||
};
|
||||
|
@ -57,18 +68,6 @@ in {
|
|||
|
||||
unstable = makeZfsTest "unstable" {
|
||||
enableUnstable = true;
|
||||
extraTest = ''
|
||||
machine.succeed(
|
||||
'echo password | zpool create -o altroot="/tmp/mnt" '
|
||||
+ "-O encryption=aes-256-gcm -O keyformat=passphrase rpool /dev/vdb1",
|
||||
"zfs create -o mountpoint=legacy rpool/root",
|
||||
"mount -t zfs rpool/root /tmp/mnt",
|
||||
"udevadm settle",
|
||||
"umount /tmp/mnt",
|
||||
"zpool destroy rpool",
|
||||
"udevadm settle",
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
installer = (import ./installer.nix { }).zfsroot;
|
||||
|
|
28
pkgs/applications/audio/bchoppr/default.nix
Normal file
28
pkgs/applications/audio/bchoppr/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ stdenv, fetchFromGitHub, pkg-config, cairo, libX11, lv2 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bchoppr";
|
||||
version = "1.6.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sjaehn";
|
||||
repo = pname;
|
||||
rev = "${version}";
|
||||
sha256 = "16b0sg7q2b8l4y4bp5s3yzsj9j6jayjy2mlvqkby6l7hcgjcj493";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ cairo libX11 lv2 ];
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/sjaehn/BChoppr;
|
||||
description = "An audio stream chopping LV2 plugin";
|
||||
maintainers = [ maintainers.magnetophon ];
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl3Plus;
|
||||
};
|
||||
}
|
28
pkgs/applications/audio/bschaffl/default.nix
Normal file
28
pkgs/applications/audio/bschaffl/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ stdenv, fetchFromGitHub, pkg-config, cairo, libX11, lv2 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bschaffl";
|
||||
version = "0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sjaehn";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1pcch7j1wgsb77mjy58hl3z43p83dv0vcmyh129m9k216b09gy29";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ cairo libX11 lv2 ];
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/sjaehn/BSchaffl";
|
||||
description = "Pattern-controlled MIDI amp & time stretch LV2 plugin";
|
||||
maintainers = [ maintainers.magnetophon ];
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "BSlizr";
|
||||
version = "1.2.6";
|
||||
version = "1.2.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sjaehn";
|
||||
repo = pname;
|
||||
rev = "${version}";
|
||||
sha256 = "1l0znwvvqd2s24c652q54pkizlh86mvmr8h0qqp9xma0i575fcrh";
|
||||
sha256 = "1f7xrljvsy7a1p8c7wln2zhwarl3ara7gbjxkpyh47wfdpigpdb0";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
, pkgconfig
|
||||
, cmake
|
||||
, llvm
|
||||
, emscripten
|
||||
# TODO: put back when it builds again
|
||||
# , emscripten
|
||||
, openssl
|
||||
, libsndfile
|
||||
, libmicrohttpd
|
||||
|
@ -20,13 +21,13 @@ with stdenv.lib.strings;
|
|||
|
||||
let
|
||||
|
||||
version = "unstable-2020-06-08";
|
||||
version = "unstable-2020-08-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "grame-cncm";
|
||||
repo = "faust";
|
||||
rev = "f0037e289987818b65d3f6fb1ad943aaad2a2b28";
|
||||
sha256 = "0h08902rgx7rhzpng4h1qw8i2nzv50f79vrlbzdk5d35wa4zibh4";
|
||||
rev = "b6045f4592384076d3b383d116e602a95a000eb3";
|
||||
sha256 = "1wcpilwnkc7rrbv9gbkj5hb7kamkh8nrc3r4hbcvbz5ar2pfc6d5";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
@ -46,7 +47,7 @@ let
|
|||
inherit src;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkgconfig cmake vim which ];
|
||||
buildInputs = [ llvm emscripten openssl libsndfile libmicrohttpd gnutls libtasn1 p11-kit ];
|
||||
buildInputs = [ llvm /*emscripten*/ openssl libsndfile libmicrohttpd gnutls libtasn1 p11-kit ];
|
||||
|
||||
|
||||
passthru = {
|
||||
|
|
|
@ -1,26 +1,34 @@
|
|||
{ stdenv, fetchFromGitHub
|
||||
, llvm, qt48Full, qrencode, libmicrohttpd, libjack2, alsaLib, faust, curl
|
||||
, bc, coreutils, which
|
||||
, bc, coreutils, which, libsndfile, pkg-config
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "faustlive";
|
||||
version = "2017-12-05";
|
||||
version = "2.5.4";
|
||||
src = fetchFromGitHub {
|
||||
owner = "grame-cncm";
|
||||
repo = "faustlive";
|
||||
rev = "281fcb852dcd94f8c57ade1b2a7a3937542e1b2d";
|
||||
sha256 = "0sw44yd9928rid9ib0b5mx2x129m7zljrayfm6jz6hrwdc5q3k9a";
|
||||
rev = version;
|
||||
sha256 = "0npn8fvq8iafyamq4wrj1k1bmk4xd0my2sp3gi5jdjfx6hc1sm3n";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
llvm qt48Full qrencode libmicrohttpd libjack2 alsaLib faust curl
|
||||
bc coreutils which
|
||||
bc coreutils which libsndfile pkg-config
|
||||
];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
preBuild = "patchShebangs Build/Linux/buildversion";
|
||||
postPatch = "cd Build";
|
||||
|
||||
installPhase = ''
|
||||
install -d "$out/bin"
|
||||
install -d "$out/share/applications"
|
||||
install FaustLive/FaustLive "$out/bin"
|
||||
install rsrc/FaustLive.desktop "$out/share/applications"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A standalone just-in-time Faust compiler";
|
||||
|
|
30
pkgs/applications/audio/freqtweak/default.nix
Normal file
30
pkgs/applications/audio/freqtweak/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ stdenv, fetchFromGitHub, autoconf, automake, pkg-config, fftwFloat, libjack2, libsigcxx, libxml2, wxGTK }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "freqtweak";
|
||||
version = "unstable-2019-08-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "essej";
|
||||
repo = pname;
|
||||
rev = "d4205337558d36657a4ee6b3afb29358aa18c0fd";
|
||||
sha256 = "10cq27mdgrrc54a40al9ahi0wqd0p2c1wxbdg518q8pzfxaxs5fi";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoconf automake pkg-config ];
|
||||
buildInputs = [ fftwFloat libjack2 libsigcxx libxml2 wxGTK ];
|
||||
|
||||
preConfigure = ''
|
||||
sh autogen.sh
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://essej.net/freqtweak/;
|
||||
description = "Realtime audio frequency spectral manipulation";
|
||||
maintainers = [ maintainers.magnetophon ];
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl2Plus;
|
||||
};
|
||||
}
|
27
pkgs/applications/audio/geonkick/default.nix
Normal file
27
pkgs/applications/audio/geonkick/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ stdenv, fetchFromGitLab, cmake, pkg-config, redkite, libsndfile, rapidjson, libjack2, lv2, libX11, cairo }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "geonkick";
|
||||
version = "2.3.3";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "iurie-sw";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0h1abb6q2bmi01a3v37adkc4zc03j47jpvffz8p2lpp33xhljghs";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
|
||||
buildInputs = [ redkite libsndfile rapidjson libjack2 lv2 libX11 cairo ];
|
||||
|
||||
cmakeFlags = [ "-DGKICK_REDKITE_SDK_PATH=${redkite}" ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://gitlab.com/iurie-sw/geonkick";
|
||||
description = "A free software percussion synthesizer";
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
maintainers = [ stdenv.lib.maintainers.magnetophon ];
|
||||
};
|
||||
}
|
47
pkgs/applications/audio/gwc/default.nix
Normal file
47
pkgs/applications/audio/gwc/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, alsaLib
|
||||
, libpulseaudio
|
||||
, gtk2
|
||||
, hicolor-icon-theme
|
||||
, libsndfile
|
||||
, fftw
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gwc";
|
||||
version = "0.22-04";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "AlisterH";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "0xvfra32dchnnyf9kj5s5xmqhln8jdrc9f0040hjr2dsb58y206p";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
alsaLib
|
||||
libpulseaudio
|
||||
gtk2
|
||||
hicolor-icon-theme
|
||||
libsndfile
|
||||
fftw
|
||||
];
|
||||
|
||||
enableParallelBuilding = false; # Fails to generate machine.h in time.
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "GUI application for removing noise (hiss, pops and clicks) from audio files";
|
||||
homepage = "https://github.com/AlisterH/gwc/";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ magnetophon ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
43
pkgs/applications/audio/kapitonov-plugins-pack/default.nix
Normal file
43
pkgs/applications/audio/kapitonov-plugins-pack/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ stdenv, fetchFromGitHub, faust, meson, ninja, pkg-config
|
||||
, boost, cairo, fftw, gnome3, ladspa-sdk, libxcb, lv2, xcbutilwm
|
||||
, zita-convolver, zita-resampler
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "kapitonov-plugins-pack";
|
||||
version = "1.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "olegkapitonov";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1mxi7b1vrzg25x85lqk8c77iziqrqyz18mqkfjlz09sxp5wfs9w4";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
faust
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
cairo
|
||||
fftw
|
||||
ladspa-sdk
|
||||
libxcb
|
||||
lv2
|
||||
xcbutilwm
|
||||
zita-convolver
|
||||
zita-resampler
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Set of LADSPA and LV2 plugins for guitar sound processing";
|
||||
homepage = https://github.com/olegkapitonov/Kapitonov-Plugins-Pack;
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ magnetophon ];
|
||||
};
|
||||
}
|
40
pkgs/applications/audio/mamba/default.nix
Normal file
40
pkgs/applications/audio/mamba/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, pkgconfig
|
||||
, cairo
|
||||
, libX11
|
||||
, libjack2
|
||||
, liblo
|
||||
, libsigcxx
|
||||
, libsmf
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mamba";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "brummer10";
|
||||
repo = "Mamba";
|
||||
rev = "v${version}";
|
||||
sha256 = "1wa3f9c4l239mpxa7nxx8hajy4icn40vpvaxq5l1qzskl74w072d";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [ ./fix-build.patch ];
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ cairo libX11 libjack2 liblo libsigcxx libsmf ];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/brummer10/Mamba";
|
||||
description = "Virtual MIDI keyboard for Jack Audio Connection Kit";
|
||||
license = licenses.bsd0;
|
||||
maintainers = with maintainers; [ magnetophon orivej ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
10
pkgs/applications/audio/mamba/fix-build.patch
Normal file
10
pkgs/applications/audio/mamba/fix-build.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/libxputty/Build/Makefile
|
||||
+++ b/libxputty/Build/Makefile
|
||||
@@ -20,1 +20,1 @@
|
||||
- LDFLAGS += -fPIC `pkg-config --static --cflags --libs cairo x11` -lm
|
||||
+ LDFLAGS += -fPIC `pkg-config --cflags --libs cairo x11` -lm
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -84,1 +83,1 @@ ifneq ("$(wildcard ./$(BUILD_DIR))","")
|
||||
- update-desktop-database
|
||||
+ update-desktop-database || true
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
mkDerivation rec {
|
||||
pname = "padthv1";
|
||||
version = "0.9.15";
|
||||
version = "0.9.16";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/padthv1/${pname}-${version}.tar.gz";
|
||||
sha256 = "18ma429kamifcvjmsv0hysxk7qn2r9br4fia929bvfccapck98y1";
|
||||
sha256 = "1f2v60dpja0rnml60g463fjiz0f84v32yjwpvr56z79h1i6fssmv";
|
||||
};
|
||||
|
||||
buildInputs = [ libjack2 alsaLib libsndfile liblo lv2 qt5.qtbase qt5.qttools fftw ];
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sfizz";
|
||||
version = "0.3.2";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sfztools";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1px22x9lb6wyqfbv1jg1sbl1rsnwrzs8sm4dnas1w4ifchiv3ymd";
|
||||
sha256 = "0zpmvmh7n0064rxfqxb7z9rnz493k7yq7nl0vxppqnasg97jn5f3";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,5 @@ rustPlatform.buildRustPackage rec {
|
|||
changelog = "https://github.com/Rigellute/spotify-tui/releases/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ jwijenbergh ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
|
67
pkgs/applications/audio/uhhyou.lv2/default.nix
Normal file
67
pkgs/applications/audio/uhhyou.lv2/default.nix
Normal file
|
@ -0,0 +1,67 @@
|
|||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, python3
|
||||
, fftw
|
||||
, libGL
|
||||
, libX11
|
||||
, libjack2
|
||||
, liblo
|
||||
, lv2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
# this is what upstream calls the package, see:
|
||||
# https://github.com/ryukau/LV2Plugins#uhhyou-plugins-lv2
|
||||
pname = "uhhyou.lv2";
|
||||
version = "unstable-2020-07-31";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ryukau";
|
||||
repo = "LV2Plugins";
|
||||
rev = "6189be67acaeb95452f8adab73a731d94a7b6f47";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "049gigx2s89z8vf17gscs00c150lmcdwya311nbrwa18fz4bx242";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config python3 ];
|
||||
|
||||
buildInputs = [ fftw libGL libX11 libjack2 liblo lv2 ];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
prePatch = ''
|
||||
patchShebangs generate-ttl.sh
|
||||
cp patch/NanoVG.cpp lib/DPF/dgl/src/NanoVG.cpp
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Audio plugins for Linux";
|
||||
longDescription = ''
|
||||
Plugin List:
|
||||
- CubicPadSynth
|
||||
- EnvelopedSine
|
||||
- EsPhaser
|
||||
- FDNCymbal
|
||||
- FoldShaper
|
||||
- IterativeSinCluster
|
||||
- L3Reverb
|
||||
- L4Reverb
|
||||
- LatticeReverb
|
||||
- LightPadSynth
|
||||
- ModuloShaper
|
||||
- OddPowShaper
|
||||
- SevenDelay
|
||||
- SoftClipper
|
||||
- SyncSawSynth
|
||||
- TrapezoidSynth
|
||||
- WaveCymbal
|
||||
'';
|
||||
homepage = "https://github.com/ryukau/LV2Plugins/";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.magnetophon ];
|
||||
};
|
||||
}
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "btcdeb";
|
||||
version = "0.2.19";
|
||||
pname = "btcdeb-unstable";
|
||||
version = "200806";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kallewoof";
|
||||
repo = pname;
|
||||
rev = "fb2dace4cd115dc9529a81515cee855b8ce94784";
|
||||
sha256 = "0l0niamcjxmgyvc6w0wiygfgwsjam3ypv8mvjglgsj50gyv1vnb3";
|
||||
owner = "bitcoin-core";
|
||||
repo = "btcdeb";
|
||||
rev = "f6708c397c64894c9f9e31bea2d22285d9462de7";
|
||||
sha256 = "0qkmf89z2n7s95vhw3n9vh9dbi14zy4vqw3ffdh1w911jwm5ry3z";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{ stdenv, makeWrapper, fetchurl, unzip, atomEnv, makeDesktopItem, buildFHSUserEnv, gtk2 }:
|
||||
|
||||
let
|
||||
version = "0.11.1";
|
||||
pname = "mist";
|
||||
|
||||
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Browse and use Ðapps on the Ethereum network";
|
||||
homepage = "https://github.com/ethereum/mist";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [];
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
};
|
||||
|
||||
urlVersion = builtins.replaceStrings ["."] ["-"] version;
|
||||
|
||||
desktopItem = makeDesktopItem rec {
|
||||
name = "Mist";
|
||||
exec = "mist";
|
||||
icon = "mist";
|
||||
desktopName = name;
|
||||
genericName = "Mist Browser";
|
||||
categories = "Network;";
|
||||
};
|
||||
|
||||
mist = stdenv.lib.appendToName "unwrapped" (stdenv.mkDerivation {
|
||||
inherit pname version meta;
|
||||
|
||||
src = {
|
||||
i686-linux = fetchurl {
|
||||
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux32-${urlVersion}.zip";
|
||||
sha256 = "1ffzp9aa0g6w3d5pzp69fljk3sd51cbqdgxa1x16vj106sqm0gj7";
|
||||
};
|
||||
x86_64-linux = fetchurl {
|
||||
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux64-${urlVersion}.zip";
|
||||
sha256 = "0yx4x72l8gk68yh9saki48zgqx8k92xnkm79dc651wdpd5c25cz3";
|
||||
};
|
||||
}.${stdenv.hostPlatform.system} or throwSystem;
|
||||
|
||||
buildInputs = [ unzip makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/lib/mist $out/bin
|
||||
unzip -d $out/lib/mist $src
|
||||
ln -s $out/lib/mist/mist $out/bin
|
||||
fixupPhase
|
||||
mkdir -p $out/share/applications
|
||||
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${atomEnv.libPath}:${gtk2}/lib:$out/lib/mist" \
|
||||
$out/lib/mist/mist
|
||||
'';
|
||||
});
|
||||
in
|
||||
buildFHSUserEnv {
|
||||
name = "mist";
|
||||
inherit meta;
|
||||
|
||||
targetPkgs = pkgs: with pkgs; [
|
||||
mist
|
||||
];
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p "$out/share/applications"
|
||||
cp "${desktopItem}/share/applications/"* $out/share/applications
|
||||
'';
|
||||
|
||||
runScript = "mist";
|
||||
}
|
|
@ -12,13 +12,13 @@ with stdenv.lib;
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "monero-gui";
|
||||
version = "0.16.0.2";
|
||||
version = "0.16.0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "monero-project";
|
||||
repo = "monero-gui";
|
||||
rev = "v${version}";
|
||||
sha256 = "1b1m8vhs0hdh81ysm8s8vfwqskqsihylb51wz16kc98ba40r9gqg";
|
||||
sha256 = "0iwjp8x5swy8i8pzrlm5v55awhm54cf48pm1vz98lcq361lhfzk6";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ qmake pkgconfig wrapQtAppsHook ];
|
||||
|
|
59
pkgs/applications/blockchains/mycrypto/default.nix
Normal file
59
pkgs/applications/blockchains/mycrypto/default.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{ lib, appimageTools, fetchurl, makeDesktopItem
|
||||
, gsettings-desktop-schemas, gtk2
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "MyCrypto";
|
||||
version = "1.7.12";
|
||||
sha256 = "0zmdmkli9zxygrcvrd4lbi0xqyq32dqlkxby8lsjknj1nd6l26n3";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/mycryptohq/mycrypto/releases/download/${version}/linux-x86-64_${version}_MyCrypto.AppImage";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
inherit name src;
|
||||
};
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = pname;
|
||||
desktopName = pname;
|
||||
comment = "MyCrypto is a free, open-source interface for interacting with the blockchain";
|
||||
exec = pname;
|
||||
icon = "mycrypto";
|
||||
categories = "Finance;";
|
||||
};
|
||||
|
||||
in appimageTools.wrapType2 rec {
|
||||
inherit name src;
|
||||
|
||||
profile = ''
|
||||
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk2}/share/gsettings-schemas/${gtk2.name}:$XDG_DATA_DIRS
|
||||
'';
|
||||
|
||||
multiPkgs = null; # no p32bit needed
|
||||
extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
|
||||
|
||||
extraInstallCommands = ''
|
||||
mv $out/bin/{${name},${pname}}
|
||||
|
||||
mkdir -p $out/share
|
||||
cp -rt $out/share ${desktopItem}/share/applications ${appimageContents}/usr/share/icons
|
||||
chmod -R +w $out/share
|
||||
mv $out/share/icons/hicolor/{0x0,256x256}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A free, open-source interface for interacting with the blockchain";
|
||||
longDescription = ''
|
||||
MyCrypto is an open-source, client-side tool for generating ether wallets,
|
||||
handling ERC-20 tokens, and interacting with the blockchain more easily.
|
||||
'';
|
||||
homepage = "https://mycrypto.com";
|
||||
license = licenses.mit;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ oxalica ];
|
||||
};
|
||||
}
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
version = "nc0.20.0";
|
||||
version = "nc0.20.1";
|
||||
name = "namecoin" + toString (optional (!withGui) "d") + "-" + version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "namecoin";
|
||||
repo = "namecoin-core";
|
||||
rev = version;
|
||||
sha256 = "115nlsq5g169mj4qjmkhxx1bnx740871zqyng9zbm2y4i0xf71c4";
|
||||
sha256 = "1wpfp9y95lmfg2nk1xqzchwck1wk6gwkya1rj07mf5in9jngxk9z";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
@ -21,8 +21,6 @@ rustPlatform.buildRustPackage rec {
|
|||
|
||||
cargoSha256 = "1xliragihwjfc5qmfm0ng519bw8a28m1w1yqcl9mpk8zywiybaah";
|
||||
|
||||
verifyCargoDeps = true;
|
||||
|
||||
cargoPatches = [ ./lock.patch ];
|
||||
|
||||
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
, withGTK3 ? true, gtk3-x11 ? null, gsettings-desktop-schemas ? null
|
||||
, withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null
|
||||
, withCsrc ? true
|
||||
, srcRepo ? false, autoconf ? null, automake ? null, texinfo ? null
|
||||
, srcRepo ? false, autoreconfHook ? null, texinfo ? null
|
||||
, siteStart ? ./site-start.el
|
||||
, nativeComp ? false
|
||||
, toolkit ? (
|
||||
|
@ -56,6 +56,15 @@ in stdenv.mkDerivation {
|
|||
rm -fr .git
|
||||
'')
|
||||
|
||||
''
|
||||
substituteInPlace lisp/international/mule-cmds.el \
|
||||
--replace /usr/share/locale ${gettext}/share/locale
|
||||
|
||||
for makefile_in in $(find . -name Makefile.in -print); do
|
||||
substituteInPlace $makefile_in --replace /bin/pwd pwd
|
||||
done
|
||||
''
|
||||
|
||||
# Make native compilation work both inside and outside of nix build
|
||||
(lib.optionalString nativeComp (let
|
||||
libPath = lib.concatStringsSep ":" [
|
||||
|
@ -78,7 +87,7 @@ in stdenv.mkDerivation {
|
|||
LIBRARY_PATH = if nativeComp then "${lib.getLib stdenv.cc.libc}/lib" else "";
|
||||
|
||||
nativeBuildInputs = [ pkgconfig makeWrapper ]
|
||||
++ lib.optionals srcRepo [ autoconf automake texinfo ]
|
||||
++ lib.optionals srcRepo [ autoreconfHook texinfo ]
|
||||
++ lib.optional (withX && (withGTK3 || withXwidgets)) wrapGAppsHook;
|
||||
|
||||
buildInputs =
|
||||
|
@ -107,24 +116,13 @@ in stdenv.mkDerivation {
|
|||
(if withNS
|
||||
then [ "--disable-ns-self-contained" ]
|
||||
else if withX
|
||||
then [ "--with-x-toolkit=${toolkit}" "--with-xft" ]
|
||||
then [ "--with-x-toolkit=${toolkit}" "--with-xft" "--with-cairo" ]
|
||||
else [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
|
||||
"--with-gif=no" "--with-tiff=no" ])
|
||||
++ lib.optional withXwidgets "--with-xwidgets"
|
||||
++ lib.optional nativeComp "--with-nativecomp"
|
||||
;
|
||||
|
||||
preConfigure = lib.optionalString srcRepo ''
|
||||
./autogen.sh
|
||||
'' + ''
|
||||
substituteInPlace lisp/international/mule-cmds.el \
|
||||
--replace /usr/share/locale ${gettext}/share/locale
|
||||
|
||||
for makefile_in in $(find . -name Makefile.in -print); do
|
||||
substituteInPlace $makefile_in --replace /bin/pwd pwd
|
||||
done
|
||||
'';
|
||||
|
||||
installTargets = [ "tags" "install" ];
|
||||
|
||||
postInstall = ''
|
||||
|
|
|
@ -20,6 +20,5 @@ rustPlatform.buildRustPackage {
|
|||
homepage = "https://github.com/Luz/hexdino";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.luz ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,5 +9,6 @@
|
|||
kak-fzf = pkgs.callPackage ./kak-fzf.nix { };
|
||||
kak-plumb = pkgs.callPackage ./kak-plumb.nix { };
|
||||
kak-powerline = pkgs.callPackage ./kak-powerline.nix { };
|
||||
kak-prelude = pkgs.callPackage ./kak-prelude.nix { };
|
||||
kak-vertical-selection = pkgs.callPackage ./kak-vertical-selection.nix { };
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@ assert stdenv.lib.asserts.assertOneOf "fzf" fzf.pname [ "fzf" "skim" ];
|
|||
|
||||
stdenv.mkDerivation {
|
||||
name = "kak-fzf";
|
||||
version = "2019-07-16";
|
||||
version = "2020-05-24";
|
||||
src = fetchFromGitHub {
|
||||
owner = "andreyorst";
|
||||
repo = "fzf.kak";
|
||||
rev = "ede90d3e02bceb714f997adfcbab8260b42e0a19";
|
||||
sha256 = "18w90j3fpk2ddn68497s33n66aap8phw5636y1r7pqsa641zdxcv";
|
||||
rev = "b2aeb26473962ab0bf3b51ba5c81c50c1d8253d3";
|
||||
sha256 = "0bg845i814xh4y688p2zx726rsg0pd6nb4a7qv2fckmk639f4wzc";
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
|
|
25
pkgs/applications/editors/kakoune/plugins/kak-prelude.nix
Normal file
25
pkgs/applications/editors/kakoune/plugins/kak-prelude.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ stdenv, fetchFromGitHub }:
|
||||
stdenv.mkDerivation {
|
||||
name = "kak-prelude";
|
||||
version = "2020-03-15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "alexherbo2";
|
||||
repo = "prelude.kak";
|
||||
rev = "05b2642b1e014bd46423f9d738cc38a624947b63";
|
||||
sha256 = "180p8hq8z7mznzd9w9ma5as3ijs7zbzcj96prcpswqg263a0b329";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/kak/autoload/plugins
|
||||
cp -r rc $out/share/kak/autoload/plugins/auto-pairs
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib;
|
||||
{ description = "Prelude of shell blocks for Kakoune.";
|
||||
homepage = "https://github.com/alexherbo2/prelude.kak";
|
||||
license = licenses.unlicense;
|
||||
maintainers = with maintainers; [ buffet ];
|
||||
platform = platforms.all;
|
||||
};
|
||||
}
|
|
@ -20,6 +20,14 @@ let
|
|||
));
|
||||
|
||||
pyEnv = python.withPackages(ps: [ ps.pynvim ps.msgpack ]);
|
||||
|
||||
# FIXME: this is verry messy and strange.
|
||||
# see https://github.com/NixOS/nixpkgs/pull/80528
|
||||
luv = lua.pkgs.luv;
|
||||
luvpath = with builtins ; if stdenv.isDarwin
|
||||
then "${luv.libluv}/lib/lua/${lua.luaversion}/libluv.${head (match "([0-9.]+).*" luv.version)}.dylib"
|
||||
else "${luv}/lib/lua/${lua.luaversion}/luv.so";
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "neovim-unwrapped";
|
||||
|
@ -47,7 +55,7 @@ in
|
|||
libtermkey
|
||||
libuv
|
||||
libvterm-neovim
|
||||
lua.pkgs.luv.libluv
|
||||
luv.libluv
|
||||
msgpack
|
||||
ncurses
|
||||
neovimLuaEnv
|
||||
|
@ -88,10 +96,8 @@ in
|
|||
cmakeFlags = [
|
||||
"-DGPERF_PRG=${gperf}/bin/gperf"
|
||||
"-DLUA_PRG=${neovimLuaEnv.interpreter}"
|
||||
"-DLIBLUV_LIBRARY=${luvpath}"
|
||||
]
|
||||
# FIXME: this is verry messy and strange.
|
||||
++ optional (!stdenv.isDarwin) "-DLIBLUV_LIBRARY=${lua.pkgs.luv}/lib/lua/${lua.luaversion}/luv.so"
|
||||
++ optional (stdenv.isDarwin) "-DLIBLUV_LIBRARY=${lua.pkgs.luv.libluv}/lib/lua/${lua.luaversion}/libluv.dylib"
|
||||
++ optional doCheck "-DBUSTED_PRG=${neovimLuaEnv}/bin/busted"
|
||||
++ optional (!lua.pkgs.isLuaJIT) "-DPREFER_LUA=ON"
|
||||
;
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
{ stdenv, mkDerivation, fetchFromGitHub, cmake, pkgconfig, makeWrapper
|
||||
, boost, xercesc
|
||||
, qtbase, qttools, qtwebkit, qtxmlpatterns
|
||||
, python3, python3Packages
|
||||
, boost, xercesc, hunspell, zlib, pcre16
|
||||
, qtbase, qttools, qtwebengine, qtxmlpatterns
|
||||
, python3Packages
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "sigil";
|
||||
version = "0.9.14";
|
||||
version = "1.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
sha256 = "0fmfbfpnmhclbbv9cbr1xnv97si6ls7331kk3ix114iqkngqwgl1";
|
||||
rev = version;
|
||||
repo = "Sigil";
|
||||
owner = "Sigil-Ebook";
|
||||
rev = version;
|
||||
sha256 = "02bkyi9xpaxdcivm075y3praxgvfay9z0189gvr6g8yc3ml1miyr";
|
||||
};
|
||||
|
||||
pythonPath = with python3Packages; [ lxml ];
|
||||
|
@ -20,8 +20,9 @@ mkDerivation rec {
|
|||
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
||||
|
||||
buildInputs = [
|
||||
boost xercesc qtbase qttools qtwebkit qtxmlpatterns
|
||||
python3Packages.lxml ];
|
||||
boost xercesc qtbase qttools qtwebengine qtxmlpatterns
|
||||
python3Packages.lxml
|
||||
];
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
||||
|
|
|
@ -1,27 +1,90 @@
|
|||
{ stdenv, fetchurl, gdal, wxGTK30, proj, libiodbc, lzma,
|
||||
libharu, opencv2, vigra, postgresql, Cocoa,
|
||||
unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }:
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
# native
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
# not native
|
||||
, gdal
|
||||
, wxGTK31-gtk3
|
||||
, proj_5
|
||||
, dxflib
|
||||
, curl
|
||||
, libiodbc
|
||||
, lzma
|
||||
, libharu
|
||||
, opencv
|
||||
, vigra
|
||||
, postgresql
|
||||
, Cocoa
|
||||
, unixODBC
|
||||
, poppler
|
||||
, hdf4
|
||||
, hdf5
|
||||
, netcdf
|
||||
, sqlite
|
||||
, qhull
|
||||
, giflib
|
||||
, libsvm
|
||||
, fftw
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "saga";
|
||||
version = "7.6.3";
|
||||
version = "7.7.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%20${stdenv.lib.versions.major version}/SAGA%20-%20${version}/saga-${version}.tar.gz";
|
||||
sha256 = "1nmvrlcpcm2pas9pnav13iydnym9d8yqqnwq47lm0j6b0a2wy9zk";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
# Upstream's gnerated ./configure is not reliable
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
configureFlags = [
|
||||
"--with-system-svm"
|
||||
# hdf is no detected otherwise
|
||||
"HDF5_LIBS=-l${hdf5}/lib"
|
||||
"HDF5_CFLAGS=-I${hdf5.dev}/include"
|
||||
];
|
||||
buildInputs = [
|
||||
curl
|
||||
dxflib
|
||||
fftw
|
||||
libsvm
|
||||
hdf5
|
||||
gdal
|
||||
wxGTK31-gtk3
|
||||
proj_5
|
||||
libharu
|
||||
opencv
|
||||
vigra
|
||||
postgresql
|
||||
libiodbc
|
||||
lzma
|
||||
qhull
|
||||
giflib
|
||||
]
|
||||
# See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
|
||||
# for why the have additional buildInputs on darwin
|
||||
buildInputs = [ gdal wxGTK30 proj libharu opencv2 vigra postgresql libiodbc lzma
|
||||
qhull giflib ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin
|
||||
[ Cocoa unixODBC poppler hdf4.out hdf5 netcdf sqlite ];
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [
|
||||
Cocoa
|
||||
unixODBC
|
||||
poppler
|
||||
netcdf
|
||||
sqlite
|
||||
];
|
||||
|
||||
patches = [
|
||||
# See https://sourceforge.net/p/saga-gis/bugs/280/
|
||||
./opencv4.patch
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%207/SAGA%20-%207.6.3/saga-7.6.3.tar.gz";
|
||||
sha256 = "0f1qy2y929gd9y7h45bkv9x71xapbzyn06v6wqivjaiydsi1qycb";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "System for Automated Geoscientific Analyses";
|
||||
homepage = "http://www.saga-gis.org";
|
||||
|
|
14
pkgs/applications/gis/saga/opencv4.patch
Normal file
14
pkgs/applications/gis/saga/opencv4.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
--- a/src/tools/imagery/imagery_opencv/Makefile.am
|
||||
+++ b/src/tools/imagery/imagery_opencv/Makefile.am
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
if HAVE_CV
|
||||
DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
|
||||
-CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
|
||||
+CXX_INCS = -I$(top_srcdir)/src/saga_core `pkg-config opencv4 --cflags`
|
||||
AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
|
||||
-AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv --libs`
|
||||
+AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv4 --libs`
|
||||
pkglib_LTLIBRARIES = libimagery_opencv.la
|
||||
libimagery_opencv_la_SOURCES =\
|
||||
MLB_Interface.cpp\
|
|
@ -19,6 +19,5 @@ rustPlatform.buildRustPackage rec {
|
|||
homepage = "https://jblindsay.github.io/ghrg/WhiteboxTools/index.html";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.mpickering ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ let
|
|||
else throw "ImageMagick is not supported on this platform.";
|
||||
|
||||
cfg = {
|
||||
version = "7.0.10-25";
|
||||
sha256 = "15y07kgy4mx3qyxsbd9g6s2yaa2mxnfvfzas35jw0vz6qjjyaw5c";
|
||||
version = "7.0.10-27";
|
||||
sha256 = "1fqwbg2ws6ix3bymx7ncb4k4f6bg8q44n9xnlvngjapflnrmhcph";
|
||||
patches = [];
|
||||
};
|
||||
in
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue