mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-29 08:38:18 +03:00
Merge branch 'master' into costrouc/dask-distributed
This commit is contained in:
commit
ed130935c8
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@ -21,7 +21,8 @@
|
||||
/pkgs/top-level/default.nix @nbp @Ericson2314
|
||||
/pkgs/top-level/impure.nix @nbp @Ericson2314
|
||||
/pkgs/top-level/stage.nix @nbp @Ericson2314
|
||||
/pkgs/stdenv
|
||||
/pkgs/stdenv/generic @Ericson2314
|
||||
/pkgs/stdenv/cross @Ericson2314
|
||||
/pkgs/build-support/cc-wrapper @Ericson2314 @orivej
|
||||
/pkgs/build-support/bintools-wrapper @Ericson2314 @orivej
|
||||
/pkgs/build-support/setup-hooks @Ericson2314
|
||||
|
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -43,7 +43,7 @@ See the nixpkgs manual for more details on [standard meta-attributes](https://ni
|
||||
|
||||
## Writing good commit messages
|
||||
|
||||
In addition to writing properly formatted commit messages, it's important to include relevant information so other developers can later understand *why* a change was made. While this information usually can be found by digging code, mailing list archives, pull request discussions or upstream changes, it may require a lot of work.
|
||||
In addition to writing properly formatted commit messages, it's important to include relevant information so other developers can later understand *why* a change was made. While this information usually can be found by digging code, mailing list/Discourse archives, pull request discussions or upstream changes, it may require a lot of work.
|
||||
|
||||
For package version upgrades and such a one-line commit message is usually sufficient.
|
||||
|
||||
|
@ -38,5 +38,4 @@ For pull-requests, please rebase onto nixpkgs `master`.
|
||||
Communication:
|
||||
|
||||
* [Discourse Forum](https://discourse.nixos.org/)
|
||||
* [Mailing list](https://groups.google.com/forum/#!forum/nix-devel)
|
||||
* [IRC - #nixos on freenode.net](irc://irc.freenode.net/#nixos)
|
||||
|
@ -15,6 +15,12 @@ if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.
|
||||
it is safe to upgrade by running it again:
|
||||
|
||||
curl https://nixos.org/nix/install | sh
|
||||
|
||||
For more information, please see the NixOS release notes at
|
||||
https://nixos.org/nixos/manual or locally at
|
||||
${toString ./doc/manual/release-notes}.
|
||||
|
||||
If you need further help, see https://nixos.org/nixos/support.html
|
||||
''
|
||||
|
||||
else
|
||||
|
@ -325,7 +325,7 @@
|
||||
};
|
||||
};
|
||||
}
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
To install it into our environment, you can just run <literal>nix-env -iA
|
||||
@ -347,7 +347,7 @@
|
||||
};
|
||||
};
|
||||
}
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
<literal>pathsToLink</literal> tells Nixpkgs to only link the paths listed
|
||||
@ -383,7 +383,7 @@
|
||||
};
|
||||
};
|
||||
}
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
This provides us with some useful documentation for using our packages.
|
||||
@ -395,15 +395,15 @@
|
||||
{
|
||||
packageOverrides = pkgs: with pkgs; rec {
|
||||
myProfile = writeText "my-profile" ''
|
||||
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
|
||||
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
|
||||
'';
|
||||
myPackages = pkgs.buildEnv {
|
||||
name = "my-packages";
|
||||
paths = [
|
||||
(runCommand "profile" {} ''
|
||||
mkdir -p $out/etc/profile.d
|
||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
mkdir -p $out/etc/profile.d
|
||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
'')
|
||||
aspell
|
||||
bc
|
||||
@ -421,7 +421,7 @@ cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
};
|
||||
};
|
||||
}
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
For this to work fully, you must also have this script sourced when you are
|
||||
@ -438,7 +438,7 @@ if [ -d $HOME/.nix-profile/etc/profile.d ]; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
Now just run <literal>source $HOME/.profile</literal> and you can starting
|
||||
@ -459,16 +459,16 @@ fi
|
||||
{
|
||||
packageOverrides = pkgs: with pkgs; rec {
|
||||
myProfile = writeText "my-profile" ''
|
||||
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
|
||||
export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
|
||||
export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
|
||||
export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
|
||||
'';
|
||||
myPackages = pkgs.buildEnv {
|
||||
name = "my-packages";
|
||||
paths = [
|
||||
(runCommand "profile" {} ''
|
||||
mkdir -p $out/etc/profile.d
|
||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
mkdir -p $out/etc/profile.d
|
||||
cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
'')
|
||||
aspell
|
||||
bc
|
||||
@ -485,17 +485,17 @@ cp ${myProfile} $out/etc/profile.d/my-profile.sh
|
||||
pathsToLink = [ "/share/man" "/share/doc" "/share/info" "/bin" "/etc" ];
|
||||
extraOutputsToInstall = [ "man" "doc" "info" ];
|
||||
postBuild = ''
|
||||
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
$out/bin/install-info $i $out/share/info/dir
|
||||
done
|
||||
fi
|
||||
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
$out/bin/install-info $i $out/share/info/dir
|
||||
done
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
<literal>postBuild</literal> tells Nixpkgs to run a command after building
|
||||
|
@ -30,7 +30,7 @@
|
||||
<section xml:id="sec-cross-packaging">
|
||||
<title>Packaging in a cross-friendly manner</title>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-cross-platform-parameters">
|
||||
<title>Platform parameters</title>
|
||||
|
||||
<para>
|
||||
@ -219,7 +219,7 @@
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-cross-specifying-dependencies">
|
||||
<title>Specifying Dependencies</title>
|
||||
|
||||
<para>
|
||||
@ -304,7 +304,7 @@
|
||||
</note>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-cross-cookbook">
|
||||
<title>Cross packaging cookbook</title>
|
||||
|
||||
<para>
|
||||
@ -317,7 +317,7 @@
|
||||
</para>
|
||||
|
||||
<qandaset>
|
||||
<qandaentry>
|
||||
<qandaentry xml:id="cross-qa-build-c-program-in-build-environment">
|
||||
<question>
|
||||
<para>
|
||||
What if my package's build system needs to build a C program to be run
|
||||
@ -331,7 +331,7 @@
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
<qandaentry>
|
||||
<qandaentry xml:id="cross-qa-fails-to-find-ar">
|
||||
<question>
|
||||
<para>
|
||||
My package fails to find <command>ar</command>.
|
||||
@ -347,7 +347,7 @@
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
<qandaentry>
|
||||
<qandaentry xml:id="cross-testsuite-runs-host-code">
|
||||
<question>
|
||||
<para>
|
||||
My package's testsuite needs to run host platform code.
|
||||
|
@ -1,6 +1,7 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:id="chap-functions">
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xml:id="chap-functions">
|
||||
<title>Functions reference</title>
|
||||
<para>
|
||||
The nixpkgs repository has several utility functions to manipulate Nix
|
||||
@ -30,12 +31,16 @@
|
||||
<para>
|
||||
Example usages:
|
||||
<programlisting>pkgs.foo.override { arg1 = val1; arg2 = val2; ... }</programlisting>
|
||||
<programlisting>import pkgs.path { overlays = [ (self: super: {
|
||||
foo = super.foo.override { barSupport = true ; };
|
||||
})]};</programlisting>
|
||||
<programlisting>mypkg = pkgs.callPackage ./mypkg.nix {
|
||||
mydep = pkgs.mydep.override { ... };
|
||||
}</programlisting>
|
||||
<programlisting>
|
||||
import pkgs.path { overlays = [ (self: super: {
|
||||
foo = super.foo.override { barSupport = true ; };
|
||||
})]};
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
mypkg = pkgs.callPackage ./mypkg.nix {
|
||||
mydep = pkgs.mydep.override { ... };
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -60,9 +65,11 @@
|
||||
|
||||
<para>
|
||||
Example usage:
|
||||
<programlisting>helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
|
||||
separateDebugInfo = true;
|
||||
});</programlisting>
|
||||
<programlisting>
|
||||
helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
|
||||
separateDebugInfo = true;
|
||||
});
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -133,14 +140,16 @@
|
||||
|
||||
<para>
|
||||
Example usage:
|
||||
<programlisting>mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
|
||||
name = "sed-4.2.2-pre";
|
||||
src = fetchurl {
|
||||
url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
|
||||
sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k";
|
||||
};
|
||||
patches = [];
|
||||
});</programlisting>
|
||||
<programlisting>
|
||||
mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
|
||||
name = "sed-4.2.2-pre";
|
||||
src = fetchurl {
|
||||
url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
|
||||
sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k";
|
||||
};
|
||||
patches = [];
|
||||
});
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -180,8 +189,10 @@
|
||||
|
||||
<para>
|
||||
Example usage:
|
||||
<programlisting>f = { a, b }: { result = a+b; }
|
||||
c = lib.makeOverridable f { a = 1; b = 2; }</programlisting>
|
||||
<programlisting>
|
||||
f = { a, b }: { result = a+b; };
|
||||
c = lib.makeOverridable f { a = 1; b = 2; };
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -444,6 +455,7 @@ merge:"diff3"
|
||||
<filename>./bin/start.sh</filename> -- relative paths are supported.
|
||||
</para>
|
||||
</section>
|
||||
<xi:include href="shell.section.xml" />
|
||||
<section xml:id="sec-pkgs-dockerTools">
|
||||
<title>pkgs.dockerTools</title>
|
||||
|
||||
@ -480,29 +492,29 @@ merge:"diff3"
|
||||
<example xml:id='ex-dockerTools-buildImage'>
|
||||
<title>Docker build</title>
|
||||
<programlisting>
|
||||
buildImage {
|
||||
name = "redis"; <co xml:id='ex-dockerTools-buildImage-1' />
|
||||
tag = "latest"; <co xml:id='ex-dockerTools-buildImage-2' />
|
||||
buildImage {
|
||||
name = "redis"; <co xml:id='ex-dockerTools-buildImage-1' />
|
||||
tag = "latest"; <co xml:id='ex-dockerTools-buildImage-2' />
|
||||
|
||||
fromImage = someBaseImage; <co xml:id='ex-dockerTools-buildImage-3' />
|
||||
fromImageName = null; <co xml:id='ex-dockerTools-buildImage-4' />
|
||||
fromImageTag = "latest"; <co xml:id='ex-dockerTools-buildImage-5' />
|
||||
fromImage = someBaseImage; <co xml:id='ex-dockerTools-buildImage-3' />
|
||||
fromImageName = null; <co xml:id='ex-dockerTools-buildImage-4' />
|
||||
fromImageTag = "latest"; <co xml:id='ex-dockerTools-buildImage-5' />
|
||||
|
||||
contents = pkgs.redis; <co xml:id='ex-dockerTools-buildImage-6' />
|
||||
runAsRoot = '' <co xml:id='ex-dockerTools-buildImage-runAsRoot' />
|
||||
#!${stdenv.shell}
|
||||
mkdir -p /data
|
||||
'';
|
||||
contents = pkgs.redis; <co xml:id='ex-dockerTools-buildImage-6' />
|
||||
runAsRoot = '' <co xml:id='ex-dockerTools-buildImage-runAsRoot' />
|
||||
#!${stdenv.shell}
|
||||
mkdir -p /data
|
||||
'';
|
||||
|
||||
config = { <co xml:id='ex-dockerTools-buildImage-8' />
|
||||
Cmd = [ "/bin/redis-server" ];
|
||||
WorkingDir = "/data";
|
||||
Volumes = {
|
||||
"/data" = {};
|
||||
};
|
||||
config = { <co xml:id='ex-dockerTools-buildImage-8' />
|
||||
Cmd = [ "/bin/redis-server" ];
|
||||
WorkingDir = "/data";
|
||||
Volumes = {
|
||||
"/data" = {};
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -521,7 +533,8 @@ merge:"diff3"
|
||||
<callout arearefs='ex-dockerTools-buildImage-2'>
|
||||
<para>
|
||||
<varname>tag</varname> specifies the tag of the resulting image. By
|
||||
default it's <literal>null</literal>, which indicates that the nix output hash will be used as tag.
|
||||
default it's <literal>null</literal>, which indicates that the nix output
|
||||
hash will be used as tag.
|
||||
</para>
|
||||
</callout>
|
||||
<callout arearefs='ex-dockerTools-buildImage-3'>
|
||||
@ -644,15 +657,15 @@ merge:"diff3"
|
||||
<example xml:id='ex-dockerTools-pullImage'>
|
||||
<title>Docker pull</title>
|
||||
<programlisting>
|
||||
pullImage {
|
||||
imageName = "nixos/nix"; <co xml:id='ex-dockerTools-pullImage-1' />
|
||||
imageDigest = "sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b"; <co xml:id='ex-dockerTools-pullImage-2' />
|
||||
finalImageTag = "1.11"; <co xml:id='ex-dockerTools-pullImage-3' />
|
||||
sha256 = "0mqjy3zq2v6rrhizgb9nvhczl87lcfphq9601wcprdika2jz7qh8"; <co xml:id='ex-dockerTools-pullImage-4' />
|
||||
os = "linux"; <co xml:id='ex-dockerTools-pullImage-5' />
|
||||
arch = "x86_64"; <co xml:id='ex-dockerTools-pullImage-6' />
|
||||
}
|
||||
</programlisting>
|
||||
pullImage {
|
||||
imageName = "nixos/nix"; <co xml:id='ex-dockerTools-pullImage-1' />
|
||||
imageDigest = "sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b"; <co xml:id='ex-dockerTools-pullImage-2' />
|
||||
finalImageTag = "1.11"; <co xml:id='ex-dockerTools-pullImage-3' />
|
||||
sha256 = "0mqjy3zq2v6rrhizgb9nvhczl87lcfphq9601wcprdika2jz7qh8"; <co xml:id='ex-dockerTools-pullImage-4' />
|
||||
os = "linux"; <co xml:id='ex-dockerTools-pullImage-5' />
|
||||
arch = "x86_64"; <co xml:id='ex-dockerTools-pullImage-6' />
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<calloutlist>
|
||||
@ -667,16 +680,16 @@ merge:"diff3"
|
||||
<para>
|
||||
<varname>imageDigest</varname> specifies the digest of the image to be
|
||||
downloaded. Skopeo can be used to get the digest of an image, with its
|
||||
<varname>inspect</varname> subcommand. Since a given <varname>imageName</varname>
|
||||
may transparently refer to a manifest list of images which support
|
||||
multiple architectures and/or operating systems, supply the `--override-os`
|
||||
and `--override-arch` arguments to specify exactly which image you
|
||||
want. By default it will match the OS and architecture of the host the
|
||||
command is run on.
|
||||
<varname>inspect</varname> subcommand. Since a given
|
||||
<varname>imageName</varname> may transparently refer to a manifest list
|
||||
of images which support multiple architectures and/or operating systems,
|
||||
supply the `--override-os` and `--override-arch` arguments to specify
|
||||
exactly which image you want. By default it will match the OS and
|
||||
architecture of the host the command is run on.
|
||||
<programlisting>
|
||||
$ nix-shell --packages skopeo jq --command "skopeo --override-os linux --override-arch x86_64 inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'"
|
||||
sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b
|
||||
</programlisting>
|
||||
$ nix-shell --packages skopeo jq --command "skopeo --override-os linux --override-arch x86_64 inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'"
|
||||
sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b
|
||||
</programlisting>
|
||||
This argument is required.
|
||||
</para>
|
||||
</callout>
|
||||
@ -695,16 +708,16 @@ merge:"diff3"
|
||||
</para>
|
||||
</callout>
|
||||
<callout arearefs='ex-dockerTools-pullImage-5'>
|
||||
<para>
|
||||
<varname>os</varname>, if specified, is the operating system of the fetched image.
|
||||
By default it's <literal>linux</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<varname>os</varname>, if specified, is the operating system of the
|
||||
fetched image. By default it's <literal>linux</literal>.
|
||||
</para>
|
||||
</callout>
|
||||
<callout arearefs='ex-dockerTools-pullImage-6'>
|
||||
<para>
|
||||
<varname>arch</varname>, if specified, is the cpu architecture of the fetched image.
|
||||
By default it's <literal>x86_64</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<varname>arch</varname>, if specified, is the cpu architecture of the
|
||||
fetched image. By default it's <literal>x86_64</literal>.
|
||||
</para>
|
||||
</callout>
|
||||
</calloutlist>
|
||||
</section>
|
||||
@ -734,13 +747,13 @@ merge:"diff3"
|
||||
<example xml:id='ex-dockerTools-exportImage'>
|
||||
<title>Docker export</title>
|
||||
<programlisting>
|
||||
exportImage {
|
||||
fromImage = someLayeredImage;
|
||||
fromImageName = null;
|
||||
fromImageTag = null;
|
||||
exportImage {
|
||||
fromImage = someLayeredImage;
|
||||
fromImageName = null;
|
||||
fromImageTag = null;
|
||||
|
||||
name = someLayeredImage.name;
|
||||
}
|
||||
name = someLayeredImage.name;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
@ -771,19 +784,19 @@ merge:"diff3"
|
||||
<example xml:id='ex-dockerTools-shadowSetup'>
|
||||
<title>Shadow base files</title>
|
||||
<programlisting>
|
||||
buildImage {
|
||||
name = "shadow-basic";
|
||||
buildImage {
|
||||
name = "shadow-basic";
|
||||
|
||||
runAsRoot = ''
|
||||
#!${stdenv.shell}
|
||||
${shadowSetup}
|
||||
groupadd -r redis
|
||||
useradd -r -g redis redis
|
||||
mkdir /data
|
||||
chown redis:redis /data
|
||||
'';
|
||||
}
|
||||
</programlisting>
|
||||
runAsRoot = ''
|
||||
#!${stdenv.shell}
|
||||
${shadowSetup}
|
||||
groupadd -r redis
|
||||
useradd -r -g redis redis
|
||||
mkdir /data
|
||||
chown redis:redis /data
|
||||
'';
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
|
@ -1047,6 +1047,19 @@ As you can see, `packunused` finds out that although the testsuite component has
|
||||
no redundant dependencies the library component of `scientific-0.3.5.1` depends
|
||||
on `ghc-prim` which is unused in the library.
|
||||
|
||||
### Using hackage2nix with nixpkgs
|
||||
|
||||
Hackage package derivations are found in the
|
||||
[`hackage-packages.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/hackage-packages.nix)
|
||||
file within `nixpkgs` and are used as the initial package set for
|
||||
`haskellPackages`. The `hackage-packages.nix` file is not meant to be edited
|
||||
by hand, but rather autogenerated by [`hackage2nix`](https://github.com/NixOS/cabal2nix/tree/master/hackage2nix),
|
||||
which by default uses the [`configuration-hackage2nix.yaml`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-hackage2nix.yaml)
|
||||
file to generate all the derivations.
|
||||
|
||||
To modify the contents `configuration-hackage2nix.yaml`, follow the
|
||||
instructions on [`hackage2nix`](https://github.com/NixOS/cabal2nix/tree/master/hackage2nix).
|
||||
|
||||
## Other resources
|
||||
|
||||
- The Youtube video [Nix Loves Haskell](https://www.youtube.com/watch?v=BsBhi_r-OeE)
|
||||
|
@ -15,15 +15,18 @@ stdenv.mkDerivation {
|
||||
buildPhase = "ant";
|
||||
}
|
||||
</programlisting>
|
||||
Note that <varname>jdk</varname> is an alias for the OpenJDK.
|
||||
Note that <varname>jdk</varname> is an alias for the OpenJDK (self-built
|
||||
where available, or pre-built via Zulu). Platforms with OpenJDK not (yet) in
|
||||
Nixpkgs (<literal>Aarch32</literal>, <literal>Aarch64</literal>) point to the
|
||||
(unfree) <literal>oraclejdk</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
JAR files that are intended to be used by other packages should be installed
|
||||
in <filename>$out/share/java</filename>. The OpenJDK has a stdenv setup hook
|
||||
that adds any JARs in the <filename>share/java</filename> directories of the
|
||||
build inputs to the <envar>CLASSPATH</envar> environment variable. For
|
||||
instance, if the package <literal>libfoo</literal> installs a JAR named
|
||||
in <filename>$out/share/java</filename>. JDKs have a stdenv setup hook that
|
||||
add any JARs in the <filename>share/java</filename> directories of the build
|
||||
inputs to the <envar>CLASSPATH</envar> environment variable. For instance, if
|
||||
the package <literal>libfoo</literal> installs a JAR named
|
||||
<filename>foo.jar</filename> in its <filename>share/java</filename>
|
||||
directory, and another package declares the attribute
|
||||
<programlisting>
|
||||
@ -59,6 +62,16 @@ installPhase =
|
||||
on the JDK at runtime.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Note all JDKs passthru <literal>home</literal>, so if your application
|
||||
requires environment variables like <envar>JAVA_HOME</envar> being set, that
|
||||
can be done in a generic fashion with the <literal>--set</literal> argument
|
||||
of <literal>makeWrapper</literal>:
|
||||
<programlisting>
|
||||
--set JAVA_HOME ${jdk.home}
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is possible to use a different Java compiler than <command>javac</command>
|
||||
from the OpenJDK. For instance, to use the GNU Java Compiler:
|
||||
|
@ -14,7 +14,7 @@ project.
|
||||
|
||||
The package set also provides support for multiple Node.js versions. The policy
|
||||
is that a new package should be added to the collection for the latest stable LTS
|
||||
release (which is currently 6.x), unless there is an explicit reason to support
|
||||
release (which is currently 8.x), unless there is an explicit reason to support
|
||||
a different release.
|
||||
|
||||
If your package uses native addons, you need to examine what kind of native
|
||||
@ -26,7 +26,7 @@ build system it uses. Here are some examples:
|
||||
|
||||
After you have identified the correct system, you need to override your package
|
||||
expression while adding in build system as a build input. For example, `dat`
|
||||
requires `node-gyp-build`, so we override its expression in `default-v6.nix`:
|
||||
requires `node-gyp-build`, so we override its expression in `default-v8.nix`:
|
||||
|
||||
```nix
|
||||
dat = nodePackages.dat.override (oldAttrs: {
|
||||
@ -36,14 +36,14 @@ dat = nodePackages.dat.override (oldAttrs: {
|
||||
|
||||
To add a package from NPM to nixpkgs:
|
||||
|
||||
1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update
|
||||
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json`
|
||||
for packages depending on Node.js 4.x)
|
||||
1. Modify `pkgs/development/node-packages/node-packages-v8.json` to add, update
|
||||
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v10.json`
|
||||
for packages depending on Node.js 10.x)
|
||||
2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
|
||||
3. Build your new package to test your changes:
|
||||
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
|
||||
To build against a specific Node.js version (e.g. 4.x):
|
||||
`nix-build -A nodePackages_4_x.<new-or-updated-package>`
|
||||
To build against a specific Node.js version (e.g. 10.x):
|
||||
`nix-build -A nodePackages_10_x.<new-or-updated-package>`
|
||||
4. Add and commit all modified and generated files.
|
||||
|
||||
For more information about the generation process, consult the
|
||||
|
@ -645,9 +645,15 @@ in python.withPackages(ps: [ps.blaze])).env
|
||||
|
||||
#### `buildPythonApplication` function
|
||||
|
||||
The `buildPythonApplication` function is practically the same as `buildPythonPackage`.
|
||||
The difference is that `buildPythonPackage` by default prefixes the names of the packages with the version of the interpreter.
|
||||
Because this is irrelevant for applications, the prefix is omitted.
|
||||
The `buildPythonApplication` function is practically the same as
|
||||
`buildPythonPackage`. The main purpose of this function is to build a Python
|
||||
package where one is interested only in the executables, and not importable
|
||||
modules. For that reason, when adding this package to a `python.buildEnv`, the
|
||||
modules won't be made available.
|
||||
|
||||
Another difference is that `buildPythonPackage` by default prefixes the names of
|
||||
the packages with the version of the interpreter. Because this is irrelevant for
|
||||
applications, the prefix is omitted.
|
||||
|
||||
#### `toPythonApplication` function
|
||||
|
||||
@ -1068,4 +1074,5 @@ Following rules are desired to be respected:
|
||||
* Make sure libraries build for all Python interpreters.
|
||||
* By default we enable tests. Make sure the tests are found and, in the case of libraries, are passing for all interpreters. If certain tests fail they can be disabled individually. Try to avoid disabling the tests altogether. In any case, when you disable tests, leave a comment explaining why.
|
||||
* Commit names of Python libraries should reflect that they are Python libraries, so write for example `pythonPackages.numpy: 1.11 -> 1.12`.
|
||||
|
||||
* Attribute names in `python-packages.nix` should be normalized according to [PEP 0503](https://www.python.org/dev/peps/pep-0503/#normalized-names).
|
||||
This means that characters should be converted to lowercase and `.` and `_` should be replaced by a single `-` (foo-bar-baz instead of Foo__Bar.baz )
|
||||
|
@ -59,6 +59,11 @@ all crate sources of this package. Currently it is obtained by inserting a
|
||||
fake checksum into the expression and building the package once. The correct
|
||||
checksum can be then take from the failed build.
|
||||
|
||||
When the `Cargo.lock`, provided by upstream, is not in sync with the
|
||||
`Cargo.toml`, it is possible to use `cargoPatches` to update it. All patches
|
||||
added in `cargoPatches` will also be prepended to the patches in `patches` at
|
||||
build-time.
|
||||
|
||||
To install crates with nix there is also an experimental project called
|
||||
[nixcrates](https://github.com/fractalide/nixcrates).
|
||||
|
||||
@ -88,8 +93,8 @@ Now, the file produced by the call to `carnix`, called `hello.nix`, looks like:
|
||||
|
||||
```
|
||||
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
|
||||
{ lib, buildPlatform, buildRustCrate, fetchgit }:
|
||||
let kernel = buildPlatform.parsed.kernel.name;
|
||||
{ lib, stdenv, buildRustCrate, fetchgit }:
|
||||
let kernel = stdenv.buildPlatform.parsed.kernel.name;
|
||||
# ... (content skipped)
|
||||
in
|
||||
rec {
|
||||
@ -117,8 +122,8 @@ following nix file:
|
||||
|
||||
```
|
||||
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
|
||||
{ lib, buildPlatform, buildRustCrate, fetchgit }:
|
||||
let kernel = buildPlatform.parsed.kernel.name;
|
||||
{ lib, stdenv, buildRustCrate, fetchgit }:
|
||||
let kernel = stdenv.buildPlatform.parsed.kernel.name;
|
||||
# ... (content skipped)
|
||||
in
|
||||
rec {
|
||||
|
@ -8,7 +8,7 @@
|
||||
under attribute <varname>texlive</varname>.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-language-texlive-users-guide">
|
||||
<title>User's guide</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -68,7 +68,7 @@ nix-repl> texlive.collection-<TAB>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-language-texlive-known-problems">
|
||||
<title>Known problems</title>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -6,7 +6,7 @@
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:id="chap-multiple-output">
|
||||
<title>Multiple-output packages</title>
|
||||
<section>
|
||||
<section xml:id="sec-multiple-outputs-introduction">
|
||||
<title>Introduction</title>
|
||||
|
||||
<para>
|
||||
@ -38,7 +38,7 @@
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-multiple-outputs-installing">
|
||||
<title>Installing a split package</title>
|
||||
|
||||
<para>
|
||||
@ -84,7 +84,7 @@
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-multiple-outputs-using-split-packages">
|
||||
<title>Using a split package</title>
|
||||
|
||||
<para>
|
||||
@ -102,7 +102,7 @@
|
||||
also added. (See <xref linkend="multiple-output-file-type-groups" />.)
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-multiple-outputs-">
|
||||
<title>Writing a split derivation</title>
|
||||
|
||||
<para>
|
||||
@ -283,7 +283,7 @@
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-multiple-outputs-caveats">
|
||||
<title>Common caveats</title>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -64,7 +64,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "1ian3kwh2vg6hr3ymrv48s04gijs539vzrq62xr76bxbhbwnz2np";
|
||||
};
|
||||
inherit noSysDirs;
|
||||
configureFlags = "--target=arm-linux";
|
||||
configureFlags = [ "--target=arm-linux" ];
|
||||
}
|
||||
---
|
||||
|
||||
@ -78,7 +78,7 @@ Step 2: build kernel headers for the target architecture
|
||||
---
|
||||
{stdenv, fetchurl}:
|
||||
|
||||
assert stdenv.system == "i686-linux";
|
||||
assert stdenv.buildPlatform.system == "i686-linux";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "linux-headers-2.6.13.1-arm";
|
||||
|
@ -181,7 +181,7 @@ $ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
|
||||
</section>
|
||||
<!--============================================================-->
|
||||
<!--
|
||||
<section>
|
||||
<section xml:id="sec-package-notes-gnome">
|
||||
<title>Gnome</title>
|
||||
<para>* Expression is auto-generated</para>
|
||||
<para>* How to update</para>
|
||||
@ -189,7 +189,7 @@ $ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
|
||||
-->
|
||||
<!--============================================================-->
|
||||
<!--
|
||||
<section>
|
||||
<section xml:id="sec-package-notes-gcc">
|
||||
<title>GCC</title>
|
||||
<para>…</para>
|
||||
</section>
|
||||
@ -705,4 +705,62 @@ overrides = super: self: rec {
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
<section xml:id="sec-citrix">
|
||||
<title>Citrix Receiver</title>
|
||||
|
||||
<para>
|
||||
The <link xlink:href="https://www.citrix.com/products/receiver/">Citrix
|
||||
Receiver</link> is a remote desktop viewer which provides access to
|
||||
<link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link>
|
||||
installations.
|
||||
</para>
|
||||
|
||||
<section xml:id="sec-citrix-base">
|
||||
<title>Basic usage</title>
|
||||
|
||||
<para>
|
||||
The tarball archive needs to be downloaded manually as the licenses
|
||||
agreements of the vendor need to be accepted first. This is available at
|
||||
the
|
||||
<link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">download
|
||||
page at citrix.com</link>. Then run <literal>nix-prefetch-url
|
||||
file://$PWD/linuxx64-$version.tar.gz</literal>. With the archive available
|
||||
in the store the package can be built and installed with Nix.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<emphasis>Note: it's recommended to install <literal>Citrix
|
||||
Receiver</literal> using <literal>nix-env -i</literal> or globally to
|
||||
ensure that the <literal>.desktop</literal> files are installed properly
|
||||
into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to
|
||||
open <literal>.ica</literal> files automatically from the browser to start
|
||||
a Citrix connection.</emphasis>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="sec-citrix-custom-certs">
|
||||
<title>Custom certificates</title>
|
||||
|
||||
<para>
|
||||
The <literal>Citrix Receiver</literal> in <literal>nixpkgs</literal> trusts
|
||||
several certificates
|
||||
<link xlink:href="https://curl.haxx.se/docs/caextract.html">from the
|
||||
Mozilla database</link> by default. However several companies using Citrix
|
||||
might require their own corporate certificate. On distros with imperative
|
||||
packaging these certs can be stored easily in
|
||||
<link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>,
|
||||
however this directory is a store path in <literal>nixpkgs</literal>. In
|
||||
order to work around this issue the package provides a simple mechanism to
|
||||
add custom certificates without rebuilding the entire package using
|
||||
<literal>symlinkJoin</literal>:
|
||||
<programlisting>
|
||||
<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
|
||||
let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
|
||||
citrix_receiver.override {
|
||||
inherit extraCerts;
|
||||
}]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
|
@ -29,7 +29,6 @@
|
||||
}
|
||||
</programlisting>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
On darwin libraries are linked using absolute paths, libraries are
|
||||
@ -47,19 +46,19 @@
|
||||
}
|
||||
</programlisting>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Even if the libraries are linked using absolute paths and resolved via
|
||||
their <literal>install_name</literal> correctly, tests can sometimes fail
|
||||
to run binaries. This happens because the <varname>checkPhase</varname>
|
||||
to run binaries. This happens because the <varname>checkPhase</varname>
|
||||
runs before the libraries are installed.
|
||||
</para>
|
||||
<para>
|
||||
This can usually be solved by running the tests after the
|
||||
<varname>installPhase</varname> or alternatively by using
|
||||
<varname>DYLD_LIBRARY_PATH</varname>. More information about this variable
|
||||
can be found in the <citerefentry><refentrytitle>dyld</refentrytitle>
|
||||
can be found in the <citerefentry>
|
||||
<refentrytitle>dyld</refentrytitle>
|
||||
<manvolnum>1</manvolnum></citerefentry> manpage.
|
||||
</para>
|
||||
<programlisting>
|
||||
@ -77,7 +76,6 @@
|
||||
}
|
||||
</programlisting>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Some packages assume xcode is available and use <command>xcrun</command>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<article xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Nixpkgs Release Notes</title>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.14">
|
||||
<title>Release 0.14 (June 4, 2012)</title>
|
||||
|
||||
<para>
|
||||
@ -17,7 +17,7 @@
|
||||
packages by numerous contributors. For details, see the commit logs.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.13">
|
||||
<title>Release 0.13 (February 5, 2010)</title>
|
||||
|
||||
<para>
|
||||
@ -51,7 +51,7 @@
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.12">
|
||||
<title>Release 0.12 (April 24, 2009)</title>
|
||||
|
||||
<para>
|
||||
@ -145,7 +145,7 @@
|
||||
<literal>nix-dev</literal> mailing list.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.11">
|
||||
<title>Release 0.11 (September 11, 2007)</title>
|
||||
|
||||
<para>
|
||||
@ -344,7 +344,7 @@ export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/</prog
|
||||
Bravenboer, Michael Raskin, Wouter den Breejen and Yury G. Kudryashov.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.10">
|
||||
<title>Release 0.10 (October 12, 2006)</title>
|
||||
|
||||
<note>
|
||||
@ -547,7 +547,7 @@ stdenv.mkDerivation {
|
||||
Bravenboer, Merijn de Jonge, Rob Vermaas and Roy van den Broek.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.9">
|
||||
<title>Release 0.9 (January 31, 2006)</title>
|
||||
|
||||
<para>
|
||||
@ -676,7 +676,7 @@ stdenv.mkDerivation {
|
||||
Martin Bravenboer, Rob Vermaas and Roy van den Broek.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.8">
|
||||
<title>Release 0.8 (April 11, 2005)</title>
|
||||
|
||||
<para>
|
||||
@ -700,7 +700,7 @@ stdenv.mkDerivation {
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="release-notes-0.7">
|
||||
<title>Release 0.7 (March 14, 2005)</title>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -6,18 +6,20 @@
|
||||
<title>Reviewing contributions</title>
|
||||
<warning>
|
||||
<para>
|
||||
The following section is a draft, and the policy for reviewing is still being
|
||||
discussed in issues such as <link
|
||||
The following section is a draft, and the policy for reviewing is still
|
||||
being discussed in issues such as
|
||||
<link
|
||||
xlink:href="https://github.com/NixOS/nixpkgs/issues/11166">#11166
|
||||
</link> and <link
|
||||
</link> and
|
||||
<link
|
||||
xlink:href="https://github.com/NixOS/nixpkgs/issues/20836">#20836
|
||||
</link>.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
The nixpkgs project receives a fairly high number of contributions via
|
||||
GitHub pull-requests. Reviewing and approving these is an important task and
|
||||
a way to contribute to the project.
|
||||
The nixpkgs project receives a fairly high number of contributions via GitHub
|
||||
pull-requests. Reviewing and approving these is an important task and a way
|
||||
to contribute to the project.
|
||||
</para>
|
||||
<para>
|
||||
The high change rate of nixpkgs makes any pull request that remains open for
|
||||
@ -40,10 +42,10 @@
|
||||
to respect every community member and their work.
|
||||
</para>
|
||||
<para>
|
||||
GitHub provides reactions as a simple and quick way to provide
|
||||
feedback to pull-requests or any comments. The thumb-down reaction should be
|
||||
used with care and if possible accompanied with some explanation so the
|
||||
submitter has directions to improve their contribution.
|
||||
GitHub provides reactions as a simple and quick way to provide feedback to
|
||||
pull-requests or any comments. The thumb-down reaction should be used with
|
||||
care and if possible accompanied with some explanation so the submitter has
|
||||
directions to improve their contribution.
|
||||
</para>
|
||||
<para>
|
||||
Pull-request reviews should include a list of what has been reviewed in a
|
||||
@ -54,7 +56,7 @@
|
||||
meant as examples. Their usage is optional and the reviewer is free to adapt
|
||||
them to their liking.
|
||||
</para>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions-package-updates">
|
||||
<title>Package updates</title>
|
||||
|
||||
<para>
|
||||
@ -117,8 +119,8 @@
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
License can change with version updates, so it should be checked to match
|
||||
the upstream license.
|
||||
License can change with version updates, so it should be checked to
|
||||
match the upstream license.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@ -143,8 +145,8 @@
|
||||
<listitem>
|
||||
<para>
|
||||
Pull-requests are often targeted to the master or staging branch, and
|
||||
building the pull-request locally when it is submitted can trigger
|
||||
many source builds.
|
||||
building the pull-request locally when it is submitted can trigger many
|
||||
source builds.
|
||||
</para>
|
||||
<para>
|
||||
It is possible to rebase the changes on nixos-unstable or
|
||||
@ -206,7 +208,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<example>
|
||||
<example xml:id="reviewing-contributions-sample-package-update">
|
||||
<title>Sample template for a package update review</title>
|
||||
<screen>
|
||||
##### Reviewed points
|
||||
@ -224,7 +226,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</screen>
|
||||
</example>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions-new-packages">
|
||||
<title>New packages</title>
|
||||
|
||||
<para>
|
||||
@ -318,7 +320,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<example>
|
||||
<example xml:id="reviewing-contributions-sample-new-package">
|
||||
<title>Sample template for a new package review</title>
|
||||
<screen>
|
||||
##### Reviewed points
|
||||
@ -344,7 +346,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</screen>
|
||||
</example>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions-module-updates">
|
||||
<title>Module updates</title>
|
||||
|
||||
<para>
|
||||
@ -441,7 +443,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<example>
|
||||
<example xml:id="reviewing-contributions-sample-module-update">
|
||||
<title>Sample template for a module update review</title>
|
||||
<screen>
|
||||
##### Reviewed points
|
||||
@ -462,7 +464,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</screen>
|
||||
</example>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions-new-modules">
|
||||
<title>New modules</title>
|
||||
|
||||
<para>
|
||||
@ -540,7 +542,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<example>
|
||||
<example xml:id="reviewing-contributions-sample-new-module">
|
||||
<title>Sample template for a new module review</title>
|
||||
<screen>
|
||||
##### Reviewed points
|
||||
@ -562,7 +564,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
</screen>
|
||||
</example>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions-other-submissions">
|
||||
<title>Other submissions</title>
|
||||
|
||||
<para>
|
||||
@ -583,7 +585,7 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
|
||||
pull requests fitting this category.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="reviewing-contributions--merging-pull-requests">
|
||||
<title>Merging pull-requests</title>
|
||||
|
||||
<para>
|
||||
@ -606,9 +608,11 @@ policy.
|
||||
|
||||
<para>
|
||||
In a case a contributor leaves definitively the Nix community, he should
|
||||
create an issue or notify the mailing list with references of packages and
|
||||
modules he maintains so the maintainership can be taken over by other
|
||||
contributors.
|
||||
create an issue or post on
|
||||
<link
|
||||
xlink:href="https://discourse.nixos.org">Discourse</link> with
|
||||
references of packages and modules he maintains so the maintainership can be
|
||||
taken over by other contributors.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
@ -212,7 +212,7 @@ genericBuild
|
||||
platforms relative to the new derivation's, and whether they are propagated.
|
||||
The platform distinctions are motivated by cross compilation; see
|
||||
<xref linkend="chap-cross"/> for exactly what each platform means.
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-ignored-build-platform">
|
||||
<para>
|
||||
The build platform is ignored because it is a mere implementation detail
|
||||
of the package satisfying the dependency: As a general programming
|
||||
@ -233,7 +233,7 @@ genericBuild
|
||||
out only for dependencies whose host platform matches the new derivation's
|
||||
build platform–i.e. which run on the platform where the new derivation
|
||||
will be built.
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-native-dependencies-in-path">
|
||||
<para>
|
||||
Currently, that means for native builds all dependencies are put on the
|
||||
<envar>PATH</envar>. But in the future that may not be the case for sake
|
||||
@ -280,7 +280,7 @@ genericBuild
|
||||
<link xlink:href="https://en.wikipedia.org/wiki/Natural_deduction">Natural
|
||||
Deduction</link> using the inference rules. This probably seems a bit
|
||||
obtuse, but so is the bash code that actually implements it!
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-find-inputs-location">
|
||||
<para>
|
||||
The <function>findInputs</function> function, currently residing in
|
||||
<filename>pkgs/stdenv/generic/setup.sh</filename>, implements the
|
||||
@ -836,9 +836,10 @@ passthru = {
|
||||
These can optionally be compressed using <command>gzip</command>
|
||||
(<filename>.tar.gz</filename>, <filename>.tgz</filename> or
|
||||
<filename>.tar.Z</filename>), <command>bzip2</command>
|
||||
(<filename>.tar.bz2</filename> or <filename>.tbz2</filename>) or
|
||||
<command>xz</command> (<filename>.tar.xz</filename> or
|
||||
<filename>.tar.lzma</filename>).
|
||||
(<filename>.tar.bz2</filename>, <filename>.tbz2</filename> or
|
||||
<filename>.tbz</filename>) or <command>xz</command>
|
||||
(<filename>.tar.xz</filename>, <filename>.tar.lzma</filename> or
|
||||
<filename>.txz</filename>).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -1111,7 +1112,7 @@ passthru = {
|
||||
By default, the configure phase applies some special hackery to all
|
||||
files called <filename>ltmain.sh</filename> before running the configure
|
||||
script in order to improve the purity of Libtool-based packages
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-sys-lib-search-path">
|
||||
<para>
|
||||
It clears the
|
||||
<varname>sys_lib_<replaceable>*</replaceable>search_path</varname>
|
||||
@ -1150,7 +1151,7 @@ passthru = {
|
||||
or a subset to control exactly which platform flags are passed.
|
||||
Compilers and other tools should use this to also pass the target
|
||||
platform, for example.
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-build-time-guessing-impurity">
|
||||
<para>
|
||||
Eventually these will be passed when in native builds too, to improve
|
||||
determinism: build-time guessing, as is done today, is a risk of
|
||||
@ -1739,6 +1740,29 @@ set debug-file-directory ~/.nix-profile/lib/debug
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<varname>installCheckTarget</varname>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The make target that runs the install tests. Defaults to
|
||||
<literal>installcheck</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<varname>installCheckFlags</varname> / <varname>installCheckFlagsArray</varname>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
A list of strings passed as additional flags to <command>make</command>.
|
||||
Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
|
||||
but only used by the installCheck phase.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<varname>installCheckInputs</varname>
|
||||
@ -2189,7 +2213,7 @@ addEnvHooks "$hostOffset" myBashFunction
|
||||
<command>clang</command> is to be used. Secondly, this helps packages
|
||||
not get confused when cross-compiling, in which case multiple Bintools
|
||||
Wrappers may simultaneously be in use.
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-stdenv-per-platform-wrapper">
|
||||
<para>
|
||||
Each wrapper targets a single platform, so if binaries for multiple
|
||||
platforms are needed, the underlying binaries must be wrapped multiple
|
||||
|
@ -2,7 +2,7 @@
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:id="chap-submitting-changes">
|
||||
<title>Submitting changes</title>
|
||||
<section>
|
||||
<section xml:id="submitting-changes-making-patches">
|
||||
<title>Making patches</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -205,7 +205,7 @@ Additional information.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="submitting-changes-submitting-changes">
|
||||
<title>Submitting changes</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -253,7 +253,7 @@ Additional information.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="submitting-changes-pull-request-template">
|
||||
<title>Pull Request Template</title>
|
||||
|
||||
<para>
|
||||
@ -269,7 +269,7 @@ Additional information.
|
||||
below:
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-tested-with-sandbox">
|
||||
<title>Tested using sandboxing</title>
|
||||
|
||||
<para>
|
||||
@ -322,7 +322,7 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-platform-diversity">
|
||||
<title>Built on platform(s)</title>
|
||||
|
||||
<para>
|
||||
@ -334,7 +334,7 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-nixos-tests">
|
||||
<title>Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)</title>
|
||||
|
||||
<para>
|
||||
@ -350,7 +350,7 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-tested-compilation">
|
||||
<title>Tested compilation of all pkgs that depend on this change using <command>nox-review</command></title>
|
||||
|
||||
<para>
|
||||
@ -373,7 +373,7 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-tested-execution">
|
||||
<title>Tested execution of all binary files (usually in <filename>./result/bin/</filename>)</title>
|
||||
|
||||
<para>
|
||||
@ -387,8 +387,8 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Meets nixpkgs contribution standards</title>
|
||||
<section xml:id="submitting-changes-contribution-standards">
|
||||
<title>Meets Nixpkgs contribution standards</title>
|
||||
|
||||
<para>
|
||||
The last checkbox is fits
|
||||
@ -402,7 +402,7 @@ Additional information.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="submitting-changes-hotfixing-pull-requests">
|
||||
<title>Hotfixing pull requests</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -430,7 +430,7 @@ Additional information.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="submitting-changes-commit-policy">
|
||||
<title>Commit policy</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -456,7 +456,7 @@ Additional information.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-master-branch">
|
||||
<title>Master branch</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -468,7 +468,7 @@ Additional information.
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-staging-branch">
|
||||
<title>Staging branch</title>
|
||||
|
||||
<itemizedlist>
|
||||
@ -493,7 +493,7 @@ Additional information.
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="submitting-changes-stable-release-branches">
|
||||
<title>Stable release branches</title>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -145,7 +145,7 @@ rec {
|
||||
foldAttrs = op: nul: list_of_attrs:
|
||||
fold (n: a:
|
||||
fold (name: o:
|
||||
o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
|
||||
o // { ${name} = op n.${name} (a.${name} or nul); }
|
||||
) a (attrNames n)
|
||||
) {} list_of_attrs;
|
||||
|
||||
@ -384,11 +384,12 @@ rec {
|
||||
recursiveUpdateUntil = pred: lhs: rhs:
|
||||
let f = attrPath:
|
||||
zipAttrsWith (n: values:
|
||||
let here = attrPath ++ [n]; in
|
||||
if tail values == []
|
||||
|| pred attrPath (head (tail values)) (head values) then
|
||||
|| pred here (head (tail values)) (head values) then
|
||||
head values
|
||||
else
|
||||
f (attrPath ++ [n]) values
|
||||
f here values
|
||||
);
|
||||
in f [] [rhs lhs];
|
||||
|
||||
|
@ -195,9 +195,10 @@ rec {
|
||||
let self = f self // {
|
||||
newScope = scope: newScope (self // scope);
|
||||
callPackage = self.newScope {};
|
||||
# TODO(@Ericson2314): Haromonize argument order of `g` with everything else
|
||||
overrideScope = g:
|
||||
makeScope newScope
|
||||
(self_: let super = f self_; in super // g super self_);
|
||||
(lib.fixedPoints.extends (lib.flip g) f);
|
||||
packages = f;
|
||||
};
|
||||
in self;
|
||||
|
@ -80,7 +80,7 @@ let
|
||||
inherit (strings) concatStrings concatMapStrings concatImapStrings
|
||||
intersperse concatStringsSep concatMapStringsSep
|
||||
concatImapStringsSep makeSearchPath makeSearchPathOutput
|
||||
makeLibraryPath makeBinPath makePerlPath optionalString
|
||||
makeLibraryPath makeBinPath makePerlPath makeFullPerlPath optionalString
|
||||
hasPrefix hasSuffix stringToCharacters stringAsChars escape
|
||||
escapeShellArg escapeShellArgs replaceChars lowerChars
|
||||
upperChars toLower toUpper addContextFrom splitString
|
||||
|
@ -210,6 +210,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
|
||||
fullName = "Common Public License 1.0";
|
||||
};
|
||||
|
||||
curl = {
|
||||
fullName = "MIT/X11 derivate";
|
||||
url = "https://curl.haxx.se/docs/copyright.html";
|
||||
};
|
||||
|
||||
doc = spdx {
|
||||
spdxId = "DOC";
|
||||
fullName = "DOC License";
|
||||
@ -541,6 +546,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
|
||||
fullName = "Public Domain";
|
||||
};
|
||||
|
||||
purdueBsd = {
|
||||
fullName = " Purdue BSD-Style License"; # also know as lsof license
|
||||
url = https://enterprise.dejacode.com/licenses/public/purdue-bsd;
|
||||
};
|
||||
|
||||
qpl = spdx {
|
||||
spdxId = "QPL-1.0";
|
||||
fullName = "Q Public License 1.0";
|
||||
@ -613,6 +623,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
|
||||
fullName = "Vim License";
|
||||
};
|
||||
|
||||
virtualbox-puel = {
|
||||
fullName = "Oracle VM VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)";
|
||||
url = "https://www.virtualbox.org/wiki/VirtualBox_PUEL";
|
||||
free = false;
|
||||
};
|
||||
|
||||
vsl10 = spdx {
|
||||
spdxId = "VSL-1.0";
|
||||
fullName = "Vovida Software License v1.0";
|
||||
@ -643,6 +659,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
|
||||
fullName = "wxWindows Library Licence, Version 3.1";
|
||||
};
|
||||
|
||||
xfig = {
|
||||
fullName = "xfig";
|
||||
url = "http://mcj.sourceforge.net/authors.html#xfig";
|
||||
};
|
||||
|
||||
zlib = spdx {
|
||||
spdxId = "Zlib";
|
||||
fullName = "zlib License";
|
||||
|
@ -1,2 +1,2 @@
|
||||
# Expose the minimum required version for evaluating Nixpkgs
|
||||
"1.11"
|
||||
"2.0"
|
||||
|
@ -192,29 +192,53 @@ rec {
|
||||
(concatMap (m: map (config: { inherit (m) file; inherit config; }) (pushDownProperties m.config)) modules);
|
||||
|
||||
mergeModules' = prefix: options: configs:
|
||||
listToAttrs (map (name: {
|
||||
let
|
||||
/* byName is like foldAttrs, but will look for attributes to merge in the
|
||||
specified attribute name.
|
||||
|
||||
byName "foo" (module: value: ["module.hidden=${module.hidden},value=${value}"])
|
||||
[
|
||||
{
|
||||
hidden="baz";
|
||||
foo={qux="bar"; gla="flop";};
|
||||
}
|
||||
{
|
||||
hidden="fli";
|
||||
foo={qux="gne"; gli="flip";};
|
||||
}
|
||||
]
|
||||
===>
|
||||
{
|
||||
gla = [ "module.hidden=baz,value=flop" ];
|
||||
gli = [ "module.hidden=fli,value=flip" ];
|
||||
qux = [ "module.hidden=baz,value=bar" "module.hidden=fli,value=gne" ];
|
||||
}
|
||||
*/
|
||||
byName = attr: f: modules: foldl' (acc: module:
|
||||
foldl' (inner: name:
|
||||
inner // { ${name} = (acc.${name} or []) ++ (f module module.${attr}.${name}); }
|
||||
) acc (attrNames module.${attr})
|
||||
) {} modules;
|
||||
# an attrset 'name' => list of submodules that declare ‘name’.
|
||||
declsByName = byName "options"
|
||||
(module: option: [{ inherit (module) file; options = option; }])
|
||||
options;
|
||||
# an attrset 'name' => list of submodules that define ‘name’.
|
||||
defnsByName = byName "config" (module: value:
|
||||
map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
|
||||
) configs;
|
||||
# extract the definitions for each loc
|
||||
defnsByName' = byName "config"
|
||||
(module: value: [{ inherit (module) file; inherit value; }])
|
||||
configs;
|
||||
in
|
||||
(flip mapAttrs declsByName (name: decls:
|
||||
# We're descending into attribute ‘name’.
|
||||
inherit name;
|
||||
value =
|
||||
let
|
||||
loc = prefix ++ [name];
|
||||
# Get all submodules that declare ‘name’.
|
||||
decls = concatMap (m:
|
||||
if m.options ? ${name}
|
||||
then [ { inherit (m) file; options = m.options.${name}; } ]
|
||||
else []
|
||||
) options;
|
||||
# Get all submodules that define ‘name’.
|
||||
defns = concatMap (m:
|
||||
if m.config ? ${name}
|
||||
then map (config: { inherit (m) file; inherit config; })
|
||||
(pushDownProperties m.config.${name})
|
||||
else []
|
||||
) configs;
|
||||
defns = defnsByName.${name} or [];
|
||||
defns' = defnsByName'.${name} or [];
|
||||
nrOptions = count (m: isOption m.options) decls;
|
||||
# Extract the definitions for this loc
|
||||
defns' = map (m: { inherit (m) file; value = m.config.${name}; })
|
||||
(filter (m: m.config ? ${name}) configs);
|
||||
in
|
||||
if nrOptions == length decls then
|
||||
let opt = fixupOptionType loc (mergeOptionDecls loc decls);
|
||||
@ -226,8 +250,8 @@ rec {
|
||||
in
|
||||
throw "The option `${showOption loc}' in `${firstOption.file}' is a prefix of options in `${firstNonOption.file}'."
|
||||
else
|
||||
mergeModules' loc decls defns;
|
||||
}) (concatMap (m: attrNames m.options) options))
|
||||
mergeModules' loc decls defns
|
||||
))
|
||||
// { _definedNames = map (m: { inherit (m) file; names = attrNames m.config; }) configs; };
|
||||
|
||||
/* Merge multiple option declarations into a single declaration. In
|
||||
|
@ -126,6 +126,15 @@ rec {
|
||||
*/
|
||||
makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl";
|
||||
|
||||
/* Construct a perl search path recursively including all dependencies (such as $PERL5LIB)
|
||||
|
||||
Example:
|
||||
pkgs = import <nixpkgs> { }
|
||||
makeFullPerlPath [ pkgs.perlPackages.CGI ]
|
||||
=> "/nix/store/fddivfrdc1xql02h9q500fpnqy12c74n-perl-CGI-4.38/lib/perl5/site_perl:/nix/store/8hsvdalmsxqkjg0c5ifigpf31vc4vsy2-perl-HTML-Parser-3.72/lib/perl5/site_perl:/nix/store/zhc7wh0xl8hz3y3f71nhlw1559iyvzld-perl-HTML-Tagset-3.20/lib/perl5/site_perl"
|
||||
*/
|
||||
makeFullPerlPath = deps: makePerlPath (lib.misc.closePropagation deps);
|
||||
|
||||
/* Depending on the boolean `cond', return either the given string
|
||||
or the empty string. Useful to concatenate against a bigger string.
|
||||
|
||||
|
@ -36,7 +36,7 @@ in rec {
|
||||
cygwin = filterDoubles predicates.isCygwin;
|
||||
darwin = filterDoubles predicates.isDarwin;
|
||||
freebsd = filterDoubles predicates.isFreeBSD;
|
||||
# Should be better, but MinGW is unclear, and HURD is bit-rotted.
|
||||
# Should be better, but MinGW is unclear.
|
||||
gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; });
|
||||
illumos = filterDoubles predicates.isSunOS;
|
||||
linux = filterDoubles predicates.isLinux;
|
||||
@ -44,5 +44,5 @@ in rec {
|
||||
openbsd = filterDoubles predicates.isOpenBSD;
|
||||
unix = filterDoubles predicates.isUnix;
|
||||
|
||||
mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux"];
|
||||
mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "powerpc64le-linux"];
|
||||
}
|
||||
|
@ -8,6 +8,14 @@ rec {
|
||||
#
|
||||
# Linux
|
||||
#
|
||||
powernv = {
|
||||
config = "powerpc64le-unknown-linux-gnu";
|
||||
platform = platforms.powernv;
|
||||
};
|
||||
musl-power = {
|
||||
config = "powerpc64le-unknown-linux-musl";
|
||||
platform = platforms.powernv;
|
||||
};
|
||||
|
||||
sheevaplug = rec {
|
||||
config = "armv5tel-unknown-linux-gnueabi";
|
||||
|
@ -20,7 +20,7 @@ in rec {
|
||||
cygwin = [ patterns.isCygwin ];
|
||||
darwin = [ patterns.isDarwin ];
|
||||
freebsd = [ patterns.isFreeBSD ];
|
||||
# Should be better, but MinGW is unclear, and HURD is bit-rotted.
|
||||
# Should be better, but MinGW is unclear.
|
||||
gnu = [
|
||||
{ kernel = parse.kernels.linux; abi = abis.gnu; }
|
||||
{ kernel = parse.kernels.linux; abi = abis.gnueabi; }
|
||||
|
@ -11,6 +11,7 @@ rec {
|
||||
isi686 = { cpu = cpuTypes.i686; };
|
||||
isx86_64 = { cpu = cpuTypes.x86_64; };
|
||||
isPowerPC = { cpu = cpuTypes.powerpc; };
|
||||
isPower = { cpu = { family = "power"; }; };
|
||||
isx86 = { cpu = { family = "x86"; }; };
|
||||
isAarch32 = { cpu = { family = "arm"; bits = 32; }; };
|
||||
isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
|
||||
@ -26,14 +27,13 @@ rec {
|
||||
|
||||
isBSD = { kernel = { families = { inherit (kernelFamilies) bsd; }; }; };
|
||||
isDarwin = { kernel = { families = { inherit (kernelFamilies) darwin; }; }; };
|
||||
isUnix = [ isBSD isDarwin isLinux isSunOS isHurd isCygwin ];
|
||||
isUnix = [ isBSD isDarwin isLinux isSunOS isCygwin ];
|
||||
|
||||
isMacOS = { kernel = kernels.macos; };
|
||||
isiOS = { kernel = kernels.ios; };
|
||||
isLinux = { kernel = kernels.linux; };
|
||||
isSunOS = { kernel = kernels.solaris; };
|
||||
isFreeBSD = { kernel = kernels.freebsd; };
|
||||
isHurd = { kernel = kernels.hurd; };
|
||||
isNetBSD = { kernel = kernels.netbsd; };
|
||||
isOpenBSD = { kernel = kernels.openbsd; };
|
||||
isWindows = { kernel = kernels.windows; };
|
||||
|
@ -90,6 +90,8 @@ rec {
|
||||
mips64el = { bits = 64; significantByte = littleEndian; family = "mips"; };
|
||||
|
||||
powerpc = { bits = 32; significantByte = bigEndian; family = "power"; };
|
||||
powerpc64 = { bits = 64; significantByte = bigEndian; family = "power"; };
|
||||
powerpc64le = { bits = 64; significantByte = littleEndian; family = "power"; };
|
||||
|
||||
riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
|
||||
riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
|
||||
@ -170,7 +172,6 @@ rec {
|
||||
macos = { execFormat = macho; families = { inherit darwin; }; name = "darwin"; };
|
||||
ios = { execFormat = macho; families = { inherit darwin; }; };
|
||||
freebsd = { execFormat = elf; families = { inherit bsd; }; };
|
||||
hurd = { execFormat = elf; families = { }; };
|
||||
linux = { execFormat = elf; families = { }; };
|
||||
netbsd = { execFormat = elf; families = { inherit bsd; }; };
|
||||
none = { execFormat = unknown; families = { }; };
|
||||
@ -257,8 +258,6 @@ rec {
|
||||
"2" = # We only do 2-part hacks for things Nix already supports
|
||||
if elemAt l 1 == "cygwin"
|
||||
then { cpu = elemAt l 0; kernel = "windows"; abi = "cygnus"; }
|
||||
else if elemAt l 1 == "gnu"
|
||||
then { cpu = elemAt l 0; kernel = "hurd"; abi = "gnu"; }
|
||||
else { cpu = elemAt l 0; kernel = elemAt l 1; };
|
||||
"3" = # Awkwards hacks, beware!
|
||||
if elemAt l 1 == "apple"
|
||||
|
@ -20,6 +20,22 @@ rec {
|
||||
kernelAutoModules = false;
|
||||
};
|
||||
|
||||
powernv = {
|
||||
name = "PowerNV";
|
||||
kernelArch = "powerpc";
|
||||
kernelBaseConfig = "powernv_defconfig";
|
||||
kernelTarget = "zImage";
|
||||
kernelInstallTarget = "install";
|
||||
kernelFile = "vmlinux";
|
||||
kernelAutoModules = true;
|
||||
# avoid driver/FS trouble arising from unusual page size
|
||||
kernelExtraConfig = ''
|
||||
PPC_64K_PAGES n
|
||||
PPC_4K_PAGES y
|
||||
IPV6 y
|
||||
'';
|
||||
};
|
||||
|
||||
##
|
||||
## ARM
|
||||
##
|
||||
@ -458,5 +474,6 @@ rec {
|
||||
"armv7l-linux" = armv7l-hf-multiplatform;
|
||||
"aarch64-linux" = aarch64-multiplatform;
|
||||
"mipsel-linux" = fuloong2f_n32;
|
||||
"powerpc64le-linux" = powernv;
|
||||
}.${system} or pcBase;
|
||||
}
|
||||
|
@ -213,6 +213,30 @@ runTests {
|
||||
};
|
||||
|
||||
|
||||
# ATTRSETS
|
||||
|
||||
# code from the example
|
||||
testRecursiveUpdateUntil = {
|
||||
expr = recursiveUpdateUntil (path: l: r: path == ["foo"]) {
|
||||
# first attribute set
|
||||
foo.bar = 1;
|
||||
foo.baz = 2;
|
||||
bar = 3;
|
||||
} {
|
||||
#second attribute set
|
||||
foo.bar = 1;
|
||||
foo.quz = 2;
|
||||
baz = 4;
|
||||
};
|
||||
expected = {
|
||||
foo.bar = 1; # 'foo.*' from the second set
|
||||
foo.quz = 2; #
|
||||
bar = 3; # 'bar' from the first set
|
||||
baz = 4; # 'baz' from the second set
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# GENERATORS
|
||||
# these tests assume attributes are converted to lists
|
||||
# in alphabetical order
|
||||
|
@ -22,7 +22,7 @@ in with lib.systems.doubles; lib.runTests {
|
||||
cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]);
|
||||
darwin = assertTrue (mseteq darwin [ "x86_64-darwin" ]);
|
||||
freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]);
|
||||
gnu = assertTrue (mseteq gnu (linux /* ++ hurd ++ kfreebsd ++ ... */));
|
||||
gnu = assertTrue (mseteq gnu (linux /* ++ kfreebsd ++ ... */));
|
||||
illumos = assertTrue (mseteq illumos [ "x86_64-solaris" ]);
|
||||
linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ]);
|
||||
netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]);
|
||||
|
@ -36,18 +36,18 @@ rec {
|
||||
|
||||
/* bitwise “and” */
|
||||
bitAnd = builtins.bitAnd
|
||||
or import ./zip-int-bits.nix
|
||||
(a: b: if a==1 && b==1 then 1 else 0);
|
||||
or (import ./zip-int-bits.nix
|
||||
(a: b: if a==1 && b==1 then 1 else 0));
|
||||
|
||||
/* bitwise “or” */
|
||||
bitOr = builtins.bitOr
|
||||
or import ./zip-int-bits.nix
|
||||
(a: b: if a==1 || b==1 then 1 else 0);
|
||||
or (import ./zip-int-bits.nix
|
||||
(a: b: if a==1 || b==1 then 1 else 0));
|
||||
|
||||
/* bitwise “xor” */
|
||||
bitXor = builtins.bitXor
|
||||
or import ./zip-int-bits.nix
|
||||
(a: b: if a!=b then 1 else 0);
|
||||
or (import ./zip-int-bits.nix
|
||||
(a: b: if a!=b then 1 else 0));
|
||||
|
||||
/* bitwise “not” */
|
||||
bitNot = builtins.sub (-1);
|
||||
|
@ -23,6 +23,11 @@
|
||||
github = "a1russell";
|
||||
name = "Adam Russell";
|
||||
};
|
||||
aanderse = {
|
||||
email = "aaron@fosslib.net";
|
||||
github = "aanderse";
|
||||
name = "Aaron Andersen";
|
||||
};
|
||||
aaronschif = {
|
||||
email = "aaronschif@gmail.com";
|
||||
github = "aaronschif";
|
||||
@ -425,6 +430,11 @@
|
||||
github = "Baughn";
|
||||
name = "Svein Ove Aas";
|
||||
};
|
||||
bb010g = {
|
||||
email = "me@bb010g.com";
|
||||
github = "bb010g";
|
||||
name = "Brayden Banks";
|
||||
};
|
||||
bbarker = {
|
||||
email = "brandon.barker@gmail.com";
|
||||
github = "bbarker";
|
||||
@ -534,6 +544,11 @@
|
||||
github = "bodil";
|
||||
name = "Bodil Stokke";
|
||||
};
|
||||
boj = {
|
||||
email = "brian@uncannyworks.com";
|
||||
github = "boj";
|
||||
name = "Brian Jones";
|
||||
};
|
||||
boothead = {
|
||||
email = "ben@perurbis.com";
|
||||
github = "boothead";
|
||||
@ -668,6 +683,11 @@
|
||||
github = "changlinli";
|
||||
name = "Changlin Li";
|
||||
};
|
||||
CharlesHD = {
|
||||
email = "charleshdespointes@gmail.com";
|
||||
github = "CharlesHD";
|
||||
name = "Charles Huyghues-Despointes";
|
||||
};
|
||||
chaoflow = {
|
||||
email = "flo@chaoflow.net";
|
||||
github = "chaoflow";
|
||||
@ -807,11 +827,21 @@
|
||||
github = "coroa";
|
||||
name = "Jonas Hörsch";
|
||||
};
|
||||
costrouc = {
|
||||
email = "chris.ostrouchov@gmail.com";
|
||||
github = "costrouc";
|
||||
name = "Chris Ostrouchov";
|
||||
};
|
||||
couchemar = {
|
||||
email = "couchemar@yandex.ru";
|
||||
github = "couchemar";
|
||||
name = "Andrey Pavlov";
|
||||
};
|
||||
countingsort = {
|
||||
email = "niclas@countingsort.com";
|
||||
github = "countingsort";
|
||||
name = "Niclas Meyer";
|
||||
};
|
||||
cpages = {
|
||||
email = "page@ruiec.cat";
|
||||
github = "cpages";
|
||||
@ -1377,6 +1407,11 @@
|
||||
github = "fps";
|
||||
name = "Florian Paul Schmidt";
|
||||
};
|
||||
freepotion = {
|
||||
email = "freepotion@protonmail.com";
|
||||
github = "freepotion";
|
||||
name = "Free Potion";
|
||||
};
|
||||
Fresheyeball = {
|
||||
email = "fresheyeball@gmail.com";
|
||||
github = "fresheyeball";
|
||||
@ -1535,6 +1570,11 @@
|
||||
github = "grburst";
|
||||
name = "Julius Elias";
|
||||
};
|
||||
greydot = {
|
||||
email = "lanablack@amok.cc";
|
||||
github = "greydot";
|
||||
name = "Lana Black";
|
||||
};
|
||||
gridaphobe = {
|
||||
email = "eric@seidel.io";
|
||||
github = "gridaphobe";
|
||||
@ -1575,6 +1615,11 @@
|
||||
github = "havvy";
|
||||
name = "Ryan Scheel";
|
||||
};
|
||||
hax404 = {
|
||||
email = "hax404foogit@hax404.de";
|
||||
github = "hax404";
|
||||
name = "Georg Haas";
|
||||
};
|
||||
hbunke = {
|
||||
email = "bunke.hendrik@gmail.com";
|
||||
github = "hbunke";
|
||||
@ -1600,6 +1645,11 @@
|
||||
github = "heel";
|
||||
name = "Sergii Paryzhskyi";
|
||||
};
|
||||
helkafen = {
|
||||
email = "arnaudpourseb@gmail.com";
|
||||
github = "Helkafen";
|
||||
name = "Sébastian Méric de Bellefon";
|
||||
};
|
||||
henrytill = {
|
||||
email = "henrytill@gmail.com";
|
||||
github = "henrytill";
|
||||
@ -1674,6 +1724,11 @@
|
||||
github = "ikervagyok";
|
||||
name = "Balázs Lengyel";
|
||||
};
|
||||
illegalprime = {
|
||||
email = "themichaeleden@gmail.com";
|
||||
github = "illegalprime";
|
||||
name = "Michael Eden";
|
||||
};
|
||||
ilya-kolpakov = {
|
||||
email = "ilya.kolpakov@gmail.com";
|
||||
github = "ilya-kolpakov";
|
||||
@ -1822,6 +1877,11 @@
|
||||
github = "jgillich";
|
||||
name = "Jakob Gillich";
|
||||
};
|
||||
jglukasik = {
|
||||
email = "joseph@jgl.me";
|
||||
github = "jglukasik";
|
||||
name = "Joseph Lukasik";
|
||||
};
|
||||
jhhuh = {
|
||||
email = "jhhuh.note@gmail.com";
|
||||
github = "jhhuh";
|
||||
@ -1842,6 +1902,11 @@
|
||||
github = "jluttine";
|
||||
name = "Jaakko Luttinen";
|
||||
};
|
||||
jmettes = {
|
||||
email = "jonathan@jmettes.com";
|
||||
github = "jmettes";
|
||||
name = "Jonathan Mettes";
|
||||
};
|
||||
Jo = {
|
||||
email = "0x4A6F@shackspace.de";
|
||||
name = "Joachim Ernst";
|
||||
@ -1910,6 +1975,11 @@
|
||||
github = "jonafato";
|
||||
name = "Jon Banafato";
|
||||
};
|
||||
jonathanreeve = {
|
||||
email = "jon.reeve@gmail.com";
|
||||
github = "JonathanReeve";
|
||||
name = "Jonathan Reeve";
|
||||
};
|
||||
joncojonathan = {
|
||||
email = "joncojonathan@gmail.com";
|
||||
github = "joncojonathan";
|
||||
@ -1930,6 +2000,11 @@
|
||||
github = "jpotier";
|
||||
name = "Martin Potier";
|
||||
};
|
||||
jqueiroz = {
|
||||
email = "nixos@johnjq.com";
|
||||
github = "jqueiroz";
|
||||
name = "Jonathan Queiroz";
|
||||
};
|
||||
jraygauthier = {
|
||||
email = "jraygauthier@gmail.com";
|
||||
github = "jraygauthier";
|
||||
@ -2857,10 +2932,10 @@
|
||||
github = "nocoolnametom";
|
||||
name = "Tom Doggett";
|
||||
};
|
||||
nonfreeblob = {
|
||||
email = "nonfreeblob@yandex.com";
|
||||
github = "nonfreeblob";
|
||||
name = "nonfreeblob";
|
||||
noneucat = {
|
||||
email = "andy@lolc.at";
|
||||
github = "noneucat";
|
||||
name = "Andy Chun";
|
||||
};
|
||||
notthemessiah = {
|
||||
email = "brian.cohen.88@gmail.com";
|
||||
@ -3232,6 +3307,11 @@
|
||||
github = "qoelet";
|
||||
name = "Kenny Shen";
|
||||
};
|
||||
qyliss = {
|
||||
email = "hi@alyssa.is";
|
||||
github = "alyssais";
|
||||
name = "Alyssa Ross";
|
||||
};
|
||||
ragge = {
|
||||
email = "r.dahlen@gmail.com";
|
||||
github = "ragnard";
|
||||
@ -3266,6 +3346,11 @@
|
||||
email = "ravloony@gmail.com";
|
||||
name = "Tom Macdonald";
|
||||
};
|
||||
rawkode = {
|
||||
email = "david.andrew.mckay@gmail.com";
|
||||
github = "rawkode";
|
||||
name = "David McKay";
|
||||
};
|
||||
razvan = {
|
||||
email = "razvan.panda@gmail.com";
|
||||
github = "razvan-panda";
|
||||
@ -3311,6 +3396,11 @@
|
||||
github = "relrod";
|
||||
name = "Ricky Elrod";
|
||||
};
|
||||
renatoGarcia = {
|
||||
email = "fgarcia.renato@gmail.com";
|
||||
github = "renatoGarcia";
|
||||
name = "Renato Garcia";
|
||||
};
|
||||
renzo = {
|
||||
email = "renzocarbonara@gmail.com";
|
||||
github = "k0001";
|
||||
@ -3640,6 +3730,11 @@
|
||||
github = "siddharthist";
|
||||
name = "Langston Barrett";
|
||||
};
|
||||
siers = {
|
||||
email = "veinbahs+nixpkgs@gmail.com";
|
||||
github = "siers";
|
||||
name = "Raitis Veinbahs";
|
||||
};
|
||||
sifmelcara = {
|
||||
email = "ming@culpring.com";
|
||||
github = "sifmelcara";
|
||||
@ -3828,6 +3923,11 @@
|
||||
github = "swarren83";
|
||||
name = "Shawn Warren";
|
||||
};
|
||||
swdunlop = {
|
||||
email = "swdunlop@gmail.com";
|
||||
github = "swdunlop";
|
||||
name = "Scott W. Dunlop";
|
||||
};
|
||||
swflint = {
|
||||
email = "swflint@flintfam.org";
|
||||
github = "swflint";
|
||||
|
@ -11,7 +11,7 @@ manual-combined.xml: generated *.xml
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
find . -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \
|
||||
find ../../ -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \
|
||||
xmlformat --config-file "../xmlformat.conf" -i {}
|
||||
|
||||
.PHONY: fix-misc-xml
|
||||
|
@ -50,4 +50,14 @@ $ nix-store --optimise
|
||||
Since this command needs to read the entire Nix store, it can take quite a
|
||||
while to finish.
|
||||
</para>
|
||||
<section xml:id="sect-nixos-gc-boot-entries">
|
||||
<title>NixOS Boot Entries</title>
|
||||
|
||||
<para>
|
||||
If your <filename>/boot</filename> partition runs out of space, after
|
||||
clearing old profiles you must rebuild your system with
|
||||
<literal>nixos-rebuild</literal> to update the <filename>/boot</filename>
|
||||
partition and clear space.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
@ -66,14 +66,15 @@ nixpkgs.config.packageOverrides = pkgs:
|
||||
sets the kernel’s TCP keepalive time to 120 seconds. To see the available
|
||||
parameters, run <command>sysctl -a</command>.
|
||||
</para>
|
||||
<section>
|
||||
<section xml:id="sec-linux-config-customizing">
|
||||
<title>Customize your kernel</title>
|
||||
|
||||
<para>
|
||||
The first step before compiling the kernel is to generate an appropriate
|
||||
<literal>.config</literal> configuration. Either you pass your own config via
|
||||
the <literal>configfile</literal> setting of <literal>linuxManualConfig</literal>:
|
||||
<screen><![CDATA[
|
||||
<literal>.config</literal> configuration. Either you pass your own config
|
||||
via the <literal>configfile</literal> setting of
|
||||
<literal>linuxManualConfig</literal>:
|
||||
<screen><![CDATA[
|
||||
custom-kernel = super.linuxManualConfig {
|
||||
inherit (super) stdenv hostPlatform;
|
||||
inherit (linux_4_9) src;
|
||||
@ -117,7 +118,7 @@ You can edit the config with this snippet (by default <command>make menuconfig</
|
||||
]]></screen>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-linux-config-developing-modules">
|
||||
<title>Developing kernel modules</title>
|
||||
|
||||
<para>
|
||||
|
@ -74,7 +74,7 @@ The unique option `services.httpd.adminAddr' is defined multiple times, in `/etc
|
||||
argument is for: it contains the complete, merged system configuration. That
|
||||
is, <varname>config</varname> is the result of combining the configurations
|
||||
returned by every module
|
||||
<footnote>
|
||||
<footnote xml:id="footnote-nix-is-lazy">
|
||||
<para>
|
||||
If you’re wondering how it’s possible that the (indirect)
|
||||
<emphasis>result</emphasis> of a function is passed as an
|
||||
|
@ -60,7 +60,7 @@
|
||||
# systemctl start display-manager.service
|
||||
</screen>
|
||||
</para>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-x11-graphics-cards-nvidia">
|
||||
<title>NVIDIA Graphics Cards</title>
|
||||
<para>
|
||||
NVIDIA provides a proprietary driver for its graphics cards that has better
|
||||
@ -86,7 +86,7 @@
|
||||
</programlisting>
|
||||
</para>
|
||||
</simplesect>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-x11--graphics-cards-amd">
|
||||
<title>AMD Graphics Cards</title>
|
||||
<para>
|
||||
AMD provides a proprietary driver for its graphics cards that has better 3D
|
||||
@ -106,7 +106,7 @@
|
||||
</programlisting>
|
||||
</para>
|
||||
</simplesect>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-x11-touchpads">
|
||||
<title>Touchpads</title>
|
||||
<para>
|
||||
Support for Synaptics touchpads (found in many laptops such as the Dell
|
||||
@ -123,7 +123,7 @@
|
||||
since NixOS 17.09.
|
||||
</para>
|
||||
</simplesect>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-x11-gtk-and-qt-themes">
|
||||
<title>GTK/Qt themes</title>
|
||||
<para>
|
||||
GTK themes can be installed either to user profile or system-wide (via
|
||||
|
@ -31,7 +31,7 @@
|
||||
(system wide), put them into your
|
||||
<xref linkend="opt-environment.systemPackages"/>.
|
||||
</para>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-xfce-thunar-volumes">
|
||||
<title>Thunar Volume Support</title>
|
||||
<para>
|
||||
To enable <emphasis>Thunar</emphasis> volume support, put
|
||||
@ -41,7 +41,7 @@
|
||||
into your <emphasis>configuration.nix</emphasis>.
|
||||
</para>
|
||||
</simplesect>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-xfce-polkit">
|
||||
<title>Polkit Authentication Agent</title>
|
||||
<para>
|
||||
There is no authentication agent automatically installed alongside Xfce. To
|
||||
@ -50,7 +50,7 @@
|
||||
and login did the trick.
|
||||
</para>
|
||||
</simplesect>
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-xfce-troubleshooting">
|
||||
<title>Troubleshooting</title>
|
||||
<para>
|
||||
Even after enabling udisks2, volume management might not work. Thunar and/or
|
||||
|
@ -90,7 +90,9 @@ let
|
||||
fi
|
||||
${buildPackages.libxslt.bin}/bin/xsltproc \
|
||||
--stringparam revision '${revision}' \
|
||||
-o $out ${./options-to-docbook.xsl} $optionsXML
|
||||
-o intermediate.xml ${./options-to-docbook.xsl} $optionsXML
|
||||
${buildPackages.libxslt.bin}/bin/xsltproc \
|
||||
-o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml
|
||||
'';
|
||||
|
||||
sources = lib.sourceFilesBySuffices ./. [".xml"];
|
||||
|
@ -20,7 +20,7 @@
|
||||
NixOS module system.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-assertions-warnings">
|
||||
<title>Warnings</title>
|
||||
|
||||
<para>
|
||||
@ -44,7 +44,7 @@
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-assertions-assertions">
|
||||
<title>Assertions</title>
|
||||
|
||||
<para>
|
||||
|
@ -17,7 +17,7 @@ config = {
|
||||
definitions in a <emphasis>property</emphasis> to achieve certain effects:
|
||||
</para>
|
||||
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-option-definitions-delaying-conditionals">
|
||||
<title>Delaying Conditionals</title>
|
||||
<para>
|
||||
If a set of option definitions is conditional on the value of another
|
||||
@ -59,7 +59,7 @@ config = {
|
||||
</para>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-option-definitions-setting-priorities">
|
||||
<title>Setting Priorities</title>
|
||||
<para>
|
||||
A module can override the definitions of an option in other modules by
|
||||
@ -76,7 +76,7 @@ services.openssh.enable = mkOverride 10 false;
|
||||
</para>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<simplesect xml:id="sec-option-definitions-merging">
|
||||
<title>Merging Configurations</title>
|
||||
<para>
|
||||
In conjunction with <literal>mkIf</literal>, it is sometimes useful for a
|
||||
|
@ -11,7 +11,7 @@
|
||||
value definitions.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-option-types-basic">
|
||||
<title>Basic Types</title>
|
||||
|
||||
<para>
|
||||
@ -196,7 +196,7 @@
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-option-types-value">
|
||||
<title>Value Types</title>
|
||||
|
||||
<para>
|
||||
@ -257,7 +257,7 @@
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-option-types-composed">
|
||||
<title>Composed Types</title>
|
||||
|
||||
<para>
|
||||
@ -483,7 +483,7 @@ config.mod.two = { foo = 2; bar = "two"; };</screen>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-option-types-extending">
|
||||
<title>Extending types</title>
|
||||
|
||||
<para>
|
||||
@ -543,14 +543,14 @@ nixThings = mkOption {
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="sec-option-types-custom">
|
||||
<title>Custom Types</title>
|
||||
|
||||
<para>
|
||||
Custom types can be created with the <literal>mkOptionType</literal>
|
||||
function. As type creation includes some more complex topics such as
|
||||
submodule handling, it is recommended to get familiar with
|
||||
<filename
|
||||
<filename
|
||||
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/types.nix">types.nix</filename>
|
||||
code before creating a new type.
|
||||
</para>
|
||||
|
@ -10,7 +10,7 @@
|
||||
sources and presenting it in an accessible style would be a worthy
|
||||
contribution to the project.
|
||||
</para>
|
||||
<section>
|
||||
<section xml:id="sec-writing-docs-building-the-manual">
|
||||
<title>Building the Manual</title>
|
||||
|
||||
<para>
|
||||
@ -42,7 +42,7 @@
|
||||
<filename>./result/share/doc/nixos/index.html</filename>.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-writing-docs-editing-docbook-xml">
|
||||
<title>Editing DocBook XML</title>
|
||||
|
||||
<para>
|
||||
@ -76,7 +76,7 @@
|
||||
Issue</link> and someone will handle the conversion to XML for you.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-writing-docs-creating-a-topic">
|
||||
<title>Creating a Topic</title>
|
||||
|
||||
<para>
|
||||
@ -128,7 +128,7 @@
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="sec-writing-docs-adding-a-topic">
|
||||
<title>Adding a Topic to the Book</title>
|
||||
|
||||
<para>
|
||||
|
47
nixos/doc/manual/installation/installing-behind-a-proxy.xml
Normal file
47
nixos/doc/manual/installation/installing-behind-a-proxy.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<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-installing-behind-proxy">
|
||||
<title>Installing behind a proxy</title>
|
||||
|
||||
<para>
|
||||
To install NixOS behind a proxy, do the following before running
|
||||
<literal>nixos-install</literal>.
|
||||
</para>
|
||||
<orderedlist numeration="arabic">
|
||||
<listitem>
|
||||
<para>
|
||||
Update proxy configuration in
|
||||
<literal>/mnt/etc/nixos/configuration.nix</literal> to keep the
|
||||
internet accessible after reboot.
|
||||
</para>
|
||||
<programlisting>
|
||||
networking.proxy.default = "http://user:password@proxy:port/";
|
||||
networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
</programlisting>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Setup the proxy environment variables in the shell where you are
|
||||
running <literal>nixos-install</literal>.
|
||||
</para>
|
||||
<programlisting>
|
||||
# proxy_url="http://user:password@proxy:port/"
|
||||
# export http_proxy="$proxy_url"
|
||||
# export HTTP_PROXY="$proxy_url"
|
||||
# export https_proxy="$proxy_url"
|
||||
# export HTTPS_PROXY="$proxy_url"
|
||||
</programlisting>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
If you are switching networks with different proxy configurations, use the
|
||||
<literal>nesting.clone</literal> option in
|
||||
<literal>configuration.nix</literal> to switch proxies at runtime.
|
||||
Refer to <xref linkend="ch-options" /> for more information.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
@ -326,10 +326,9 @@ Retype new UNIX password: ***
|
||||
</screen>
|
||||
<note>
|
||||
<para>
|
||||
To prevent the password prompt, set
|
||||
<code><xref linkend="opt-users.mutableUsers"/> = false;</code> in
|
||||
<filename>configuration.nix</filename>, which allows unattended
|
||||
installation necessary in automation.
|
||||
For unattended installations, it is possible to use
|
||||
<command>nixos-install --no-root-passwd</command>
|
||||
in order to disable the password prompt entirely.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
@ -444,4 +443,5 @@ $ nix-env -i w3m</screen>
|
||||
<xi:include href="installing-pxe.xml" />
|
||||
<xi:include href="installing-virtualbox-guest.xml" />
|
||||
<xi:include href="installing-from-other-distro.xml" />
|
||||
<xi:include href="installing-behind-a-proxy.xml" />
|
||||
</chapter>
|
||||
|
@ -109,7 +109,7 @@ nixos https://nixos.org/channels/nixos-unstable
|
||||
so in that case you will not be able to go back to your original channel.
|
||||
</para>
|
||||
</warning>
|
||||
<section>
|
||||
<section xml:id="sec-upgrading-automatic">
|
||||
<title>Automatic Upgrades</title>
|
||||
|
||||
<para>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<subtitle>Version <xi:include href="./generated/version" parse="text" />
|
||||
</subtitle>
|
||||
</info>
|
||||
<preface>
|
||||
<preface xml:id="preface">
|
||||
<title>Preface</title>
|
||||
<para>
|
||||
This manual describes how to install, use and extend NixOS, a Linux
|
||||
@ -17,8 +17,8 @@
|
||||
<para>
|
||||
If you encounter problems, please report them on the
|
||||
<literal
|
||||
xlink:href="https://groups.google.com/forum/#!forum/nix-devel">nix-devel</literal>
|
||||
mailing list or on the <link
|
||||
xlink:href="https://discourse.nixos.org">Discourse</literal>
|
||||
or on the <link
|
||||
xlink:href="irc://irc.freenode.net/#nixos">
|
||||
<literal>#nixos</literal> channel on Freenode</link>. Bugs should be
|
||||
reported in
|
||||
|
@ -4,6 +4,7 @@
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:str="http://exslt.org/strings"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:nixos="tag:nixos.org"
|
||||
xmlns="http://docbook.org/ns/docbook"
|
||||
extension-element-prefixes="str"
|
||||
>
|
||||
@ -15,7 +16,7 @@
|
||||
|
||||
|
||||
<xsl:template match="/expr/list">
|
||||
<appendix>
|
||||
<appendix xml:id="appendix-configuration-options">
|
||||
<title>Configuration Options</title>
|
||||
<variablelist xml:id="configuration-variable-list">
|
||||
<xsl:for-each select="attrs">
|
||||
@ -30,10 +31,12 @@
|
||||
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
<xsl:value-of disable-output-escaping="yes"
|
||||
select="attr[@name = 'description']/string/@value" />
|
||||
</para>
|
||||
<nixos:option-description>
|
||||
<para>
|
||||
<xsl:value-of disable-output-escaping="yes"
|
||||
select="attr[@name = 'description']/string/@value" />
|
||||
</para>
|
||||
</nixos:option-description>
|
||||
|
||||
<xsl:if test="attr[@name = 'type']">
|
||||
<para>
|
||||
|
115
nixos/doc/manual/postprocess-option-descriptions.xsl
Normal file
115
nixos/doc/manual/postprocess-option-descriptions.xsl
Normal file
@ -0,0 +1,115 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:str="http://exslt.org/strings"
|
||||
xmlns:exsl="http://exslt.org/common"
|
||||
xmlns:db="http://docbook.org/ns/docbook"
|
||||
xmlns:nixos="tag:nixos.org"
|
||||
extension-element-prefixes="str exsl">
|
||||
<xsl:output method='xml' encoding="UTF-8" />
|
||||
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="break-up-description">
|
||||
<xsl:param name="input" />
|
||||
<xsl:param name="buffer" />
|
||||
|
||||
<!-- Every time we have two newlines following each other, we want to
|
||||
break it into </para><para>. -->
|
||||
<xsl:variable name="parbreak" select="'

'" />
|
||||
|
||||
<!-- Similar to "(head:tail) = input" in Haskell. -->
|
||||
<xsl:variable name="head" select="$input[1]" />
|
||||
<xsl:variable name="tail" select="$input[position() > 1]" />
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$head/self::text() and contains($head, $parbreak)">
|
||||
<!-- If the haystack provided to str:split() directly starts or
|
||||
ends with $parbreak, it doesn't generate a <token/> for that,
|
||||
so we are doing this here. -->
|
||||
<xsl:variable name="splitted-raw">
|
||||
<xsl:if test="starts-with($head, $parbreak)"><token /></xsl:if>
|
||||
<xsl:for-each select="str:split($head, $parbreak)">
|
||||
<token><xsl:value-of select="node()" /></token>
|
||||
</xsl:for-each>
|
||||
<!-- Something like ends-with($head, $parbreak), but there is
|
||||
no ends-with() in XSLT, so we need to use substring(). -->
|
||||
<xsl:if test="
|
||||
substring($head, string-length($head) -
|
||||
string-length($parbreak) + 1) = $parbreak
|
||||
"><token /></xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="splitted"
|
||||
select="exsl:node-set($splitted-raw)/token" />
|
||||
<!-- The buffer we had so far didn't contain any text nodes that
|
||||
contain a $parbreak, so we can put the buffer along with the
|
||||
first token of $splitted into a para element. -->
|
||||
<para xmlns="http://docbook.org/ns/docbook">
|
||||
<xsl:apply-templates select="exsl:node-set($buffer)" />
|
||||
<xsl:apply-templates select="$splitted[1]/node()" />
|
||||
</para>
|
||||
<!-- We have already emitted the first splitted result, so the
|
||||
last result is going to be set as the new $buffer later
|
||||
because its contents may not be directly followed up by a
|
||||
$parbreak. -->
|
||||
<xsl:for-each select="$splitted[position() > 1
|
||||
and position() < last()]">
|
||||
<para xmlns="http://docbook.org/ns/docbook">
|
||||
<xsl:apply-templates select="node()" />
|
||||
</para>
|
||||
</xsl:for-each>
|
||||
<xsl:call-template name="break-up-description">
|
||||
<xsl:with-param name="input" select="$tail" />
|
||||
<xsl:with-param name="buffer" select="$splitted[last()]/node()" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- Either non-text node or one without $parbreak, which we just
|
||||
want to buffer and continue recursing. -->
|
||||
<xsl:when test="$input">
|
||||
<xsl:call-template name="break-up-description">
|
||||
<xsl:with-param name="input" select="$tail" />
|
||||
<!-- This essentially appends $head to $buffer. -->
|
||||
<xsl:with-param name="buffer">
|
||||
<xsl:if test="$buffer">
|
||||
<xsl:for-each select="exsl:node-set($buffer)">
|
||||
<xsl:apply-templates select="." />
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="$head" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- No more $input, just put the remaining $buffer in a para. -->
|
||||
<xsl:otherwise>
|
||||
<para xmlns="http://docbook.org/ns/docbook">
|
||||
<xsl:apply-templates select="exsl:node-set($buffer)" />
|
||||
</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nixos:option-description">
|
||||
<xsl:choose>
|
||||
<!--
|
||||
Only process nodes that are comprised of a single <para/> element,
|
||||
because if that's not the case the description already contains
|
||||
</para><para> in between and we need no further processing.
|
||||
-->
|
||||
<xsl:when test="count(db:para) > 1">
|
||||
<xsl:apply-templates select="node()" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="break-up-description">
|
||||
<xsl:with-param name="input"
|
||||
select="exsl:node-set(db:para/node())" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -8,6 +8,7 @@
|
||||
This section lists the release notes for each stable version of NixOS and
|
||||
current unstable revision.
|
||||
</para>
|
||||
<xi:include href="rl-1903.xml" />
|
||||
<xi:include href="rl-1809.xml" />
|
||||
<xi:include href="rl-1803.xml" />
|
||||
<xi:include href="rl-1709.xml" />
|
||||
|
@ -111,6 +111,12 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
|
||||
<link xlink:href="https://github.com/strongswan/strongswan/blob/master/README_LEGACY.md">stroke configuration interface</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The new <varname>services.elasticsearch-curator</varname> service
|
||||
periodically curates or manages, your Elasticsearch indices and snapshots.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
@ -133,6 +139,50 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
|
||||
seen a complete rewrite. (See above.)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The minimum version of Nix required to evaluate Nixpkgs is now 2.0.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
For users of NixOS 18.03, NixOS 18.03 defaulted to Nix 2.0, but
|
||||
supported using Nix 1.11 by setting <literal>nix.package =
|
||||
pkgs.nix1;</literal>. If this option is set to a Nix 1.11 package, you
|
||||
will need to either unset the option or upgrade it to Nix 2.0.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
For users of NixOS 17.09, you will first need to upgrade Nix by setting
|
||||
<literal>nix.package = pkgs.nixStable2;</literal> and run
|
||||
<command>nixos-rebuild switch</command> as the <literal>root</literal>
|
||||
user.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
For users of a daemon-less Nix installation on Linux or macOS, you can
|
||||
upgrade Nix by running <command>curl https://nixos.org/nix/install |
|
||||
sh</command>, or prior to doing a channel update, running
|
||||
<command>nix-env -iA nix</command>.
|
||||
</para>
|
||||
<para>
|
||||
If you have already run a channel update and Nix is no longer able to
|
||||
evaluate Nixpkgs, the error message printed should provide adequate
|
||||
directions for upgrading Nix.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
For users of the Nix daemon on macOS, you can upgrade Nix by running
|
||||
<command>sudo -i sh -c 'nix-channel --update && nix-env -iA
|
||||
nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl
|
||||
start org.nixos.nix-daemon</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>lib.strict</literal> is removed. Use
|
||||
@ -190,6 +240,49 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
|
||||
which indicates that the nix output hash will be used as tag.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The ELK stack: <varname>elasticsearch</varname>, <varname>logstash</varname> and <varname>kibana</varname>
|
||||
has been upgraded from 2.* to 6.3.*.
|
||||
The 2.* versions have been <link xlink:href="https://www.elastic.co/support/eol">unsupported since last year</link>
|
||||
so they have been removed. You can still use the 5.* versions under the names
|
||||
<varname>elasticsearch5</varname>, <varname>logstash5</varname> and
|
||||
<varname>kibana5</varname>.
|
||||
</para>
|
||||
<para>
|
||||
The elastic beats:
|
||||
<varname>filebeat</varname>, <varname>heartbeat</varname>,
|
||||
<varname>metricbeat</varname> and <varname>packetbeat</varname>
|
||||
have had the same treatment: they now target 6.3.* as well.
|
||||
The 5.* versions are available under the names:
|
||||
<varname>filebeat5</varname>, <varname>heartbeat5</varname>,
|
||||
<varname>metricbeat5</varname> and <varname>packetbeat5</varname>
|
||||
</para>
|
||||
<para>
|
||||
The ELK-6.3 stack now comes with
|
||||
<link xlink:href="https://www.elastic.co/products/x-pack/open">X-Pack by default</link>.
|
||||
Since X-Pack is licensed under the
|
||||
<link xlink:href="https://github.com/elastic/elasticsearch/blob/master/licenses/ELASTIC-LICENSE.txt">Elastic License</link>
|
||||
the ELK packages now have an unfree license. To use them you need to specify
|
||||
<literal>allowUnfree = true;</literal> in your nixpkgs configuration.
|
||||
</para>
|
||||
<para>
|
||||
Fortunately there is also a free variant of the ELK stack without X-Pack.
|
||||
The packages are available under the names:
|
||||
<varname>elasticsearch-oss</varname>, <varname>logstash-oss</varname> and
|
||||
<varname>kibana-oss</varname>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Options
|
||||
<literal>boot.initrd.luks.devices.<replaceable>name</replaceable>.yubikey.ramfsMountPoint</literal>
|
||||
<literal>boot.initrd.luks.devices.<replaceable>name</replaceable>.yubikey.storage.mountPoint</literal>
|
||||
were removed. <literal>luksroot.nix</literal> module never supported more than one YubiKey at
|
||||
a time anyway, hence those options never had any effect. You should be able to remove them
|
||||
from your config without any issues.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
@ -268,6 +361,8 @@ inherit (pkgs.nixos {
|
||||
<literal>lib.traceCallXml</literal> has been deprecated. Please complain
|
||||
if you use the function regularly.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The attribute <literal>lib.nixpkgsVersion</literal> has been deprecated in
|
||||
favor of <literal>lib.version</literal>. Please refer to the discussion in
|
||||
@ -275,6 +370,13 @@ inherit (pkgs.nixos {
|
||||
for further reference.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>lib.recursiveUpdateUntil</literal> was not acting according to its
|
||||
specification. It has been fixed to act according to the docstring, and a
|
||||
test has been added.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The module for <option>security.dhparams</option> has two new options now:
|
||||
@ -412,6 +514,28 @@ inherit (pkgs.nixos {
|
||||
The module option <option>nix.useSandbox</option> is now defaulted to <literal>true</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The config activation script of <literal>nixos-rebuild</literal> now
|
||||
<link xlink:href="https://www.freedesktop.org/software/systemd/man/systemctl.html#Manager%20Lifecycle%20Commands">reloads</link>
|
||||
all user units for each authenticated user.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The default display manager is now LightDM.
|
||||
To use SLiM set <literal>services.xserver.displayManager.slim.enable</literal>
|
||||
to <literal>true</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
NixOS option descriptions are now automatically broken up into individual
|
||||
paragraphs if the text contains two consecutive newlines, so it's no
|
||||
longer necessary to use <code></para><para></code> to start
|
||||
a new paragraph.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
58
nixos/doc/manual/release-notes/rl-1903.xml
Normal file
58
nixos/doc/manual/release-notes/rl-1903.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<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-release-19.03">
|
||||
<title>Release 19.03 (“Koi”, 2019/03/??)</title>
|
||||
|
||||
<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-release-19.03-highlights">
|
||||
<title>Highlights</title>
|
||||
|
||||
<para>
|
||||
In addition to numerous new and upgraded packages, this release has the
|
||||
following highlights:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para />
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<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-release-19.03-new-services">
|
||||
<title>New Services</title>
|
||||
|
||||
<para>
|
||||
The following new services were added since the last release:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para />
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<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-release-19.03-notable-changes">
|
||||
<title>Other Notable Changes</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para />
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
@ -6,16 +6,19 @@
|
||||
, storePaths
|
||||
, volumeLabel
|
||||
, uuid ? "44444444-4444-4444-8888-888888888888"
|
||||
, e2fsprogs
|
||||
, libfaketime
|
||||
, perl
|
||||
}:
|
||||
|
||||
let
|
||||
sdClosureInfo = pkgs.closureInfo { rootPaths = storePaths; };
|
||||
sdClosureInfo = pkgs.buildPackages.closureInfo { rootPaths = storePaths; };
|
||||
in
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "ext4-fs.img";
|
||||
|
||||
nativeBuildInputs = with pkgs; [e2fsprogs.bin libfaketime perl];
|
||||
nativeBuildInputs = [e2fsprogs.bin libfaketime perl];
|
||||
|
||||
buildCommand =
|
||||
''
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ stdenv, perl, pixz, pathsFromGraph
|
||||
|
||||
, # The file name of the resulting tarball
|
||||
fileName ? "nixos-system-${stdenv.system}"
|
||||
fileName ? "nixos-system-${stdenv.hostPlatform.system}"
|
||||
|
||||
, # The files and directories to be placed in the tarball.
|
||||
# This is a list of attribute sets {source, target} where `source'
|
||||
|
@ -1,21 +1,25 @@
|
||||
# QEMU flags shared between various Nix expressions.
|
||||
{ pkgs }:
|
||||
|
||||
let
|
||||
zeroPad = n: if n < 10 then "0${toString n}" else toString n;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
qemuNICFlags = nic: net: machine:
|
||||
[ "-net nic,vlan=${toString nic},macaddr=52:54:00:12:${toString net}:${toString machine},model=virtio"
|
||||
"-net vde,vlan=${toString nic},sock=$QEMU_VDE_SOCKET_${toString net}"
|
||||
[ "-device virtio-net-pci,netdev=vlan${toString nic},mac=52:54:00:12:${zeroPad net}:${zeroPad machine}"
|
||||
"-netdev vde,id=vlan${toString nic},sock=$QEMU_VDE_SOCKET_${toString net}"
|
||||
];
|
||||
|
||||
qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
|
||||
else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
|
||||
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'";
|
||||
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
|
||||
|
||||
qemuBinary = qemuPkg: {
|
||||
"x86_64-linux" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
|
||||
"armv7l-linux" = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
|
||||
"aarch64-linux" = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
|
||||
"x86_64-darwin" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
|
||||
}.${pkgs.stdenv.system} or "${qemuPkg}/bin/qemu-kvm";
|
||||
}.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ in
|
||||
|
||||
environment.variables = mkOption {
|
||||
default = {};
|
||||
example = { EDITOR = "nvim"; VISUAL = "nvim"; };
|
||||
description = ''
|
||||
A set of environment variables used in the global environment.
|
||||
These variables will be set on shell initialisation (e.g. in /etc/profile).
|
||||
@ -70,7 +71,7 @@ in
|
||||
description = ''
|
||||
Shell script code called during global environment initialisation
|
||||
after all variables and profileVariables have been set.
|
||||
This code is asumed to be shell-independent, which means you should
|
||||
This code is assumed to be shell-independent, which means you should
|
||||
stick to pure sh without sh word split.
|
||||
'';
|
||||
type = types.lines;
|
||||
@ -80,7 +81,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Shell script code called during shell initialisation.
|
||||
This code is asumed to be shell-independent, which means you should
|
||||
This code is assumed to be shell-independent, which means you should
|
||||
stick to pure sh without sh word split.
|
||||
'';
|
||||
type = types.lines;
|
||||
@ -90,7 +91,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Shell script code called during login shell initialisation.
|
||||
This code is asumed to be shell-independent, which means you should
|
||||
This code is assumed to be shell-independent, which means you should
|
||||
stick to pure sh without sh word split.
|
||||
'';
|
||||
type = types.lines;
|
||||
@ -100,7 +101,7 @@ in
|
||||
default = "";
|
||||
description = ''
|
||||
Shell script code called during interactive shell initialisation.
|
||||
This code is asumed to be shell-independent, which means you should
|
||||
This code is assumed to be shell-independent, which means you should
|
||||
stick to pure sh without sh word split.
|
||||
'';
|
||||
type = types.lines;
|
||||
|
@ -81,6 +81,12 @@ in
|
||||
description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
|
||||
};
|
||||
|
||||
extraSetup = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out.";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
system = {
|
||||
@ -107,12 +113,7 @@ in
|
||||
"/etc/gtk-3.0"
|
||||
"/lib" # FIXME: remove and update debug-info.nix
|
||||
"/sbin"
|
||||
"/share/applications"
|
||||
"/share/desktop-directories"
|
||||
"/share/emacs"
|
||||
"/share/icons"
|
||||
"/share/menus"
|
||||
"/share/mime"
|
||||
"/share/nano"
|
||||
"/share/org"
|
||||
"/share/themes"
|
||||
@ -132,10 +133,6 @@ in
|
||||
# outputs TODO: note that the tools will often not be linked by default
|
||||
postBuild =
|
||||
''
|
||||
if [ -x $out/bin/update-mime-database -a -w $out/share/mime ]; then
|
||||
XDG_DATA_DIRS=$out/share $out/bin/update-mime-database -V $out/share/mime > /dev/null
|
||||
fi
|
||||
|
||||
if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then
|
||||
$out/bin/gtk-update-icon-cache $out/share/icons/hicolor
|
||||
fi
|
||||
@ -143,17 +140,8 @@ in
|
||||
if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
|
||||
$out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
|
||||
fi
|
||||
|
||||
if [ -x $out/bin/update-desktop-database -a -w $out/share/applications ]; then
|
||||
$out/bin/update-desktop-database $out/share/applications
|
||||
fi
|
||||
|
||||
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
$out/bin/install-info $i $out/share/info/dir
|
||||
done
|
||||
fi
|
||||
|
||||
${config.environment.extraSetup}
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -524,6 +524,8 @@ in {
|
||||
utmp.gid = ids.gids.utmp;
|
||||
adm.gid = ids.gids.adm;
|
||||
input.gid = ids.gids.input;
|
||||
kvm.gid = ids.gids.kvm;
|
||||
render.gid = ids.gids.render;
|
||||
};
|
||||
|
||||
system.activationScripts.users = stringAfter [ "stdio" ]
|
||||
|
22
nixos/modules/config/xdg/autostart.nix
Normal file
22
nixos/modules/config/xdg/autostart.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
xdg.autostart.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to install files to support the
|
||||
<link xlink:href="https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html">XDG Autostart specification</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.xdg.autostart.enable {
|
||||
environment.pathsToLink = [
|
||||
"/etc/xdg/autostart"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
27
nixos/modules/config/xdg/icons.nix
Normal file
27
nixos/modules/config/xdg/icons.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
xdg.icons.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to install files to support the
|
||||
<link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.xdg.icons.enable {
|
||||
environment.pathsToLink = [
|
||||
"/share/icons"
|
||||
"/share/pixmaps"
|
||||
];
|
||||
|
||||
environment.profileRelativeEnvVars = {
|
||||
XCURSOR_PATH = [ "/share/icons" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
25
nixos/modules/config/xdg/menus.nix
Normal file
25
nixos/modules/config/xdg/menus.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
xdg.menus.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to install files to support the
|
||||
<link xlink:href="https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html">XDG Desktop Menu specification</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.xdg.menus.enable {
|
||||
environment.pathsToLink = [
|
||||
"/share/applications"
|
||||
"/share/desktop-directories"
|
||||
"/etc/xdg/menus"
|
||||
"/etc/xdg/menus/applications-merged"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
36
nixos/modules/config/xdg/mime.nix
Normal file
36
nixos/modules/config/xdg/mime.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
xdg.mime.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to install files to support the
|
||||
<link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">XDG Shared MIME-info specification</link> and the
|
||||
<link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html">XDG MIME Applications specification</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.xdg.mime.enable {
|
||||
environment.pathsToLink = [ "/share/mime" ];
|
||||
|
||||
environment.systemPackages = [
|
||||
# this package also installs some useful data, as well as its utilities
|
||||
pkgs.shared-mime-info
|
||||
];
|
||||
|
||||
environment.extraSetup = ''
|
||||
if [ -w $out/share/mime ]; then
|
||||
XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null
|
||||
fi
|
||||
|
||||
if [ -w $out/share/applications ]; then
|
||||
${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
@ -23,7 +23,7 @@
|
||||
bridge.</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<section><title>IBus</title>
|
||||
<section xml:id="module-services-input-methods-ibus"><title>IBus</title>
|
||||
|
||||
<para>IBus is an Intelligent Input Bus. It provides full featured and user
|
||||
friendly input method user interface.</para>
|
||||
@ -69,7 +69,7 @@ ibus.engines = with pkgs.ibus-engines; [ table table-others ];
|
||||
as shown above, and also (after running <literal>nixos-rebuild</literal>) the
|
||||
input method must be added from IBus' preference dialog.</para>
|
||||
|
||||
<simplesect>
|
||||
<simplesect xml:id="module-services-input-methods-troubleshooting">
|
||||
<title>Troubleshooting</title>
|
||||
<para>If IBus works in some applications but not others, a likely cause of
|
||||
this is that IBus is depending on a different version of
|
||||
@ -82,7 +82,7 @@ ibus.engines = with pkgs.ibus-engines; [ table table-others ];
|
||||
</simplesect>
|
||||
</section>
|
||||
|
||||
<section><title>Fcitx</title>
|
||||
<section xml:id="module-services-input-methods-fcitx"><title>Fcitx</title>
|
||||
|
||||
<para>Fcitx is an input method framework with extension support. It has three
|
||||
built-in Input Method Engine, Pinyin, QuWei and Table-based input
|
||||
@ -122,7 +122,7 @@ i18n.inputMethod = {
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section><title>Nabi</title>
|
||||
<section xml:id="module-services-input-methods-nabi"><title>Nabi</title>
|
||||
|
||||
<para>Nabi is an easy to use Korean X input method. It allows you to enter
|
||||
phonetic Korean characters (hangul) and pictographic Korean characters
|
||||
@ -136,7 +136,7 @@ i18n.inputMethod = {
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section><title>Uim</title>
|
||||
<section xml:id="module-services-input-methods-uim"><title>Uim</title>
|
||||
|
||||
<para>Uim (short for "universal input method") is a multilingual input method
|
||||
framework. Applications can use it through so-called bridges.</para>
|
||||
|
@ -16,7 +16,7 @@ with lib;
|
||||
];
|
||||
|
||||
# ISO naming.
|
||||
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.iso";
|
||||
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
|
||||
|
||||
isoImage.volumeID = substring 0 11 "NIXOS_ISO";
|
||||
|
||||
|
@ -7,6 +7,63 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
/**
|
||||
* Given a list of `options`, concats the result of mapping each options
|
||||
* to a menuentry for use in grub.
|
||||
*
|
||||
* * defaults: {name, image, params, initrd}
|
||||
* * options: [ option... ]
|
||||
* * option: {name, params, class}
|
||||
*/
|
||||
menuBuilderGrub2 =
|
||||
defaults: options: lib.concatStrings
|
||||
(
|
||||
map
|
||||
(option: ''
|
||||
menuentry '${defaults.name} ${
|
||||
# Name appended to menuentry defaults to params if no specific name given.
|
||||
option.name or (if option ? params then "(${option.params})" else "")
|
||||
}' ${if option ? class then " --class ${option.class}" else ""} {
|
||||
linux ${defaults.image} ${defaults.params} ${
|
||||
option.params or ""
|
||||
}
|
||||
initrd ${defaults.initrd}
|
||||
}
|
||||
'')
|
||||
options
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
* Given a `config`, builds the default options.
|
||||
*/
|
||||
buildMenuGrub2 = config:
|
||||
buildMenuAdditionalParamsGrub2 config ""
|
||||
;
|
||||
|
||||
/**
|
||||
* Given a `config` and params to add to `params`, build a set of default options.
|
||||
* Use this one when creating a variant (e.g. hidpi)
|
||||
*/
|
||||
buildMenuAdditionalParamsGrub2 = config: additional:
|
||||
let
|
||||
finalCfg = {
|
||||
name = "NixOS ${config.system.nixos.label}${config.isoImage.appendToMenuLabel}";
|
||||
params = "init=${config.system.build.toplevel}/init ${additional} ${toString config.boot.kernelParams}";
|
||||
image = "/boot/bzImage";
|
||||
initrd = "/boot/initrd";
|
||||
};
|
||||
in
|
||||
menuBuilderGrub2
|
||||
finalCfg
|
||||
[
|
||||
{ class = "installer"; }
|
||||
{ class = "nomodeset"; params = "nomodeset"; }
|
||||
{ class = "copytoram"; params = "copytoram"; }
|
||||
{ class = "debug"; params = "debug"; }
|
||||
]
|
||||
;
|
||||
|
||||
# Timeout in syslinux is in units of 1/10 of a second.
|
||||
# 0 is used to disable timeouts.
|
||||
syslinuxTimeout = if config.boot.loader.timeout == null then
|
||||
@ -36,6 +93,28 @@ let
|
||||
UI vesamenu.c32
|
||||
MENU TITLE NixOS
|
||||
MENU BACKGROUND /isolinux/background.png
|
||||
MENU RESOLUTION 800 600
|
||||
MENU CLEAR
|
||||
MENU ROWS 6
|
||||
MENU CMDLINEROW -4
|
||||
MENU TIMEOUTROW -3
|
||||
MENU TABMSGROW -2
|
||||
MENU HELPMSGROW -1
|
||||
MENU HELPMSGENDROW -1
|
||||
MENU MARGIN 0
|
||||
|
||||
# FG:AARRGGBB BG:AARRGGBB shadow
|
||||
MENU COLOR BORDER 30;44 #00000000 #00000000 none
|
||||
MENU COLOR SCREEN 37;40 #FF000000 #00E2E8FF none
|
||||
MENU COLOR TABMSG 31;40 #80000000 #00000000 none
|
||||
MENU COLOR TIMEOUT 1;37;40 #FF000000 #00000000 none
|
||||
MENU COLOR TIMEOUT_MSG 37;40 #FF000000 #00000000 none
|
||||
MENU COLOR CMDMARK 1;36;40 #FF000000 #00000000 none
|
||||
MENU COLOR CMDLINE 37;40 #FF000000 #00000000 none
|
||||
MENU COLOR TITLE 1;36;44 #00000000 #00000000 none
|
||||
MENU COLOR UNSEL 37;44 #FF000000 #00000000 none
|
||||
MENU COLOR SEL 7;37;40 #FFFFFFFF #FF5277C3 std
|
||||
|
||||
DEFAULT boot
|
||||
|
||||
LABEL boot
|
||||
@ -76,49 +155,167 @@ let
|
||||
isolinuxCfg = concatStringsSep "\n"
|
||||
([ baseIsolinuxCfg ] ++ optional config.boot.loader.grub.memtest86.enable isolinuxMemtest86Entry);
|
||||
|
||||
# Setup instructions for rEFInd.
|
||||
refind =
|
||||
if targetArch == "x64" then
|
||||
''
|
||||
# Adds rEFInd to the ISO.
|
||||
cp -v ${pkgs.refind}/share/refind/refind_x64.efi $out/EFI/boot/
|
||||
''
|
||||
else
|
||||
"# No refind for ia32"
|
||||
;
|
||||
|
||||
grubMenuCfg = ''
|
||||
#
|
||||
# Menu configuration
|
||||
#
|
||||
|
||||
insmod gfxterm
|
||||
insmod png
|
||||
set gfxpayload=keep
|
||||
|
||||
# Fonts can be loaded?
|
||||
# (This font is assumed to always be provided as a fallback by NixOS)
|
||||
if loadfont (hd0)/EFI/boot/unicode.pf2; then
|
||||
# Use graphical term, it can be either with background image or a theme.
|
||||
# input is "console", while output is "gfxterm".
|
||||
# This enables "serial" input and output only when possible.
|
||||
# Otherwise the failure mode is to not even enable gfxterm.
|
||||
if test "\$with_serial" == "yes"; then
|
||||
terminal_output gfxterm serial
|
||||
terminal_input console serial
|
||||
else
|
||||
terminal_output gfxterm
|
||||
terminal_input console
|
||||
fi
|
||||
else
|
||||
# Sets colors for the non-graphical term.
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
fi
|
||||
|
||||
${ # When there is a theme configured, use it, otherwise use the background image.
|
||||
if (!isNull config.isoImage.grubTheme) then ''
|
||||
# Sets theme.
|
||||
set theme=(hd0)/EFI/boot/grub-theme/theme.txt
|
||||
# Load theme fonts
|
||||
$(find ${config.isoImage.grubTheme} -iname '*.pf2' -printf "loadfont (hd0)/EFI/boot/grub-theme/%P\n")
|
||||
'' else ''
|
||||
if background_image (hd0)/EFI/boot/efi-background.png; then
|
||||
# Black background means transparent background when there
|
||||
# is a background image set... This seems undocumented :(
|
||||
set color_normal=black/black
|
||||
set color_highlight=white/blue
|
||||
else
|
||||
# Falls back again to proper colors.
|
||||
set menu_color_normal=cyan/blue
|
||||
set menu_color_highlight=white/blue
|
||||
fi
|
||||
''}
|
||||
'';
|
||||
|
||||
# The EFI boot image.
|
||||
# Notes about grub:
|
||||
# * Yes, the grubMenuCfg has to be repeated in all submenus. Otherwise you
|
||||
# will get white-on-black console-like text on sub-menus. *sigh*
|
||||
efiDir = pkgs.runCommand "efi-directory" {} ''
|
||||
mkdir -p $out/EFI/boot
|
||||
cp -v ${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${targetArch}.efi $out/EFI/boot/boot${targetArch}.efi
|
||||
mkdir -p $out/loader/entries
|
||||
mkdir -p $out/EFI/boot/
|
||||
|
||||
cat << EOF > $out/loader/entries/nixos-iso.conf
|
||||
title NixOS ${config.system.nixos.label}${config.isoImage.appendToMenuLabel}
|
||||
linux /boot/${config.system.boot.loader.kernelFile}
|
||||
initrd /boot/${config.system.boot.loader.initrdFile}
|
||||
options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
|
||||
MODULES="fat iso9660 part_gpt part_msdos \
|
||||
normal boot linux configfile loopback chain halt \
|
||||
efifwsetup efi_gop efi_uga \
|
||||
ls search search_label search_fs_uuid search_fs_file \
|
||||
gfxmenu gfxterm gfxterm_background gfxterm_menu test all_video loadenv \
|
||||
exfat ext2 ntfs btrfs hfsplus udf \
|
||||
videoinfo png \
|
||||
echo serial \
|
||||
"
|
||||
# Make our own efi program, we can't rely on "grub-install" since it seems to
|
||||
# probe for devices, even with --skip-fs-probe.
|
||||
${pkgs.grub2_efi}/bin/grub-mkimage -o $out/EFI/boot/${if targetArch == "x64" then "bootx64" else "bootx32"}.efi -p /EFI/boot -O ${if targetArch == "x64" then "x86_64" else "i386"}-efi \
|
||||
$MODULES
|
||||
cp ${pkgs.grub2_efi}/share/grub/unicode.pf2 $out/EFI/boot/
|
||||
|
||||
cat <<EOF > $out/EFI/boot/grub.cfg
|
||||
|
||||
# If you want to use serial for "terminal_*" commands, you need to set one up:
|
||||
# Example manual configuration:
|
||||
# → serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
|
||||
# This uses the defaults, and makes the serial terminal available.
|
||||
set with_serial=no
|
||||
if serial; then set with_serial=yes ;fi
|
||||
export with_serial
|
||||
clear
|
||||
set timeout=10
|
||||
${grubMenuCfg}
|
||||
|
||||
#
|
||||
# Menu entries
|
||||
#
|
||||
|
||||
${buildMenuGrub2 config}
|
||||
submenu "HiDPI, Quirks and Accessibility" --class hidpi --class submenu {
|
||||
${grubMenuCfg}
|
||||
submenu "Suggests resolution @720p" --class hidpi-720p {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "video=1280x720@60"}
|
||||
}
|
||||
submenu "Suggests resolution @1080p" --class hidpi-1080p {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "video=1920x1080@60"}
|
||||
}
|
||||
|
||||
# Some laptop and convertibles have the panel installed in an
|
||||
# inconvenient way, rotated away from the keyboard.
|
||||
# Those entries makes it easier to use the installer.
|
||||
submenu "" {return}
|
||||
submenu "Rotate framebuffer Clockwise" --class rotate-90cw {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "fbcon=rotate:1"}
|
||||
}
|
||||
submenu "Rotate framebuffer Upside-Down" --class rotate-180 {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "fbcon=rotate:2"}
|
||||
}
|
||||
submenu "Rotate framebuffer Counter-Clockwise" --class rotate-90ccw {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "fbcon=rotate:3"}
|
||||
}
|
||||
|
||||
# As a proof of concept, mainly. (Not sure it has accessibility merits.)
|
||||
submenu "" {return}
|
||||
submenu "Use black on white" --class accessibility-blakconwhite {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "vt.default_red=0xFF,0xBC,0x4F,0xB4,0x56,0xBC,0x4F,0x00,0xA1,0xCF,0x84,0xCA,0x8D,0xB4,0x84,0x68 vt.default_grn=0xFF,0x55,0xBA,0xBA,0x4D,0x4D,0xB3,0x00,0xA0,0x8F,0xB3,0xCA,0x88,0x93,0xA4,0x68 vt.default_blu=0xFF,0x58,0x5F,0x58,0xC5,0xBD,0xC5,0x00,0xA8,0xBB,0xAB,0x97,0xBD,0xC7,0xC5,0x68"}
|
||||
}
|
||||
|
||||
# Serial access is a must!
|
||||
submenu "" {return}
|
||||
submenu "Serial console=ttyS0,115200n8" --class serial {
|
||||
${grubMenuCfg}
|
||||
${buildMenuAdditionalParamsGrub2 config "console=ttyS0,115200n8"}
|
||||
}
|
||||
}
|
||||
|
||||
menuentry 'rEFInd' --class refind {
|
||||
# UUID is hard-coded in the derivation.
|
||||
search --set=root --no-floppy --fs-uuid 1234-5678
|
||||
chainloader (\$root)/EFI/boot/refind_x64.efi
|
||||
}
|
||||
menuentry 'Firmware Setup' --class settings {
|
||||
fwsetup
|
||||
clear
|
||||
echo ""
|
||||
echo "If you see this message, your EFI system doesn't support this feature."
|
||||
echo ""
|
||||
}
|
||||
menuentry 'Shutdown' --class shutdown {
|
||||
halt
|
||||
}
|
||||
EOF
|
||||
|
||||
# A variant to boot with 'nomodeset'
|
||||
cat << EOF > $out/loader/entries/nixos-iso-nomodeset.conf
|
||||
title NixOS ${config.system.nixos.label}${config.isoImage.appendToMenuLabel}
|
||||
version nomodeset
|
||||
linux /boot/${config.system.boot.loader.kernelFile}
|
||||
initrd /boot/${config.system.boot.loader.initrdFile}
|
||||
options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset
|
||||
EOF
|
||||
|
||||
# A variant to boot with 'copytoram'
|
||||
cat << EOF > $out/loader/entries/nixos-iso-copytoram.conf
|
||||
title NixOS ${config.system.nixos.label}${config.isoImage.appendToMenuLabel}
|
||||
version copytoram
|
||||
linux /boot/${config.system.boot.loader.kernelFile}
|
||||
initrd /boot/${config.system.boot.loader.initrdFile}
|
||||
options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} copytoram
|
||||
EOF
|
||||
|
||||
# A variant to boot with verbose logging to the console
|
||||
cat << EOF > $out/loader/entries/nixos-iso-debug.conf
|
||||
title NixOS ${config.system.nixos.label}${config.isoImage.appendToMenuLabel} (debug)
|
||||
linux /boot/${config.system.boot.loader.kernelFile}
|
||||
initrd /boot/${config.system.boot.loader.initrdFile}
|
||||
options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} loglevel=7
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/loader/loader.conf
|
||||
default nixos-iso
|
||||
timeout ${builtins.toString config.boot.loader.timeout}
|
||||
EOF
|
||||
${refind}
|
||||
'';
|
||||
|
||||
efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; }
|
||||
@ -234,13 +431,31 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
isoImage.splashImage = mkOption {
|
||||
isoImage.efiSplashImage = mkOption {
|
||||
default = pkgs.fetchurl {
|
||||
url = https://raw.githubusercontent.com/NixOS/nixos-artwork/5729ab16c6a5793c10a2913b5a1b3f59b91c36ee/ideas/grub-splash/grub-nixos-1.png;
|
||||
sha256 = "43fd8ad5decf6c23c87e9026170a13588c2eba249d9013cb9f888da5e2002217";
|
||||
url = https://raw.githubusercontent.com/NixOS/nixos-artwork/a9e05d7deb38a8e005a2b52575a3f59a63a4dba0/bootloader/efi-background.png;
|
||||
sha256 = "18lfwmp8yq923322nlb9gxrh5qikj1wsk6g5qvdh31c4h5b1538x";
|
||||
};
|
||||
description = ''
|
||||
The splash image to use in the bootloader.
|
||||
The splash image to use in the EFI bootloader.
|
||||
'';
|
||||
};
|
||||
|
||||
isoImage.splashImage = mkOption {
|
||||
default = pkgs.fetchurl {
|
||||
url = https://raw.githubusercontent.com/NixOS/nixos-artwork/a9e05d7deb38a8e005a2b52575a3f59a63a4dba0/bootloader/isolinux/bios-boot.png;
|
||||
sha256 = "1wp822zrhbg4fgfbwkr7cbkr4labx477209agzc0hr6k62fr6rxd";
|
||||
};
|
||||
description = ''
|
||||
The splash image to use in the legacy-boot bootloader.
|
||||
'';
|
||||
};
|
||||
|
||||
isoImage.grubTheme = mkOption {
|
||||
default = pkgs.nixos-grub2-theme;
|
||||
type = types.nullOr (types.either types.path types.package);
|
||||
description = ''
|
||||
The grub2 theme used for UEFI boot.
|
||||
'';
|
||||
};
|
||||
|
||||
@ -318,7 +533,7 @@ in
|
||||
options = [ "allow_other" "cow" "nonempty" "chroot=/mnt-root" "max_files=32768" "hide_meta_files" "dirs=/nix/.rw-store=rw:/nix/.ro-store=ro" ];
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = [ "squashfs" "iso9660" "usb-storage" "uas" ];
|
||||
boot.initrd.availableKernelModules = [ "squashfs" "iso9660" "uas" ];
|
||||
|
||||
boot.blacklistedKernelModules = [ "nouveau" ];
|
||||
|
||||
@ -358,6 +573,9 @@ in
|
||||
{ source = "${pkgs.syslinux}/share/syslinux";
|
||||
target = "/isolinux";
|
||||
}
|
||||
{ source = config.isoImage.efiSplashImage;
|
||||
target = "/EFI/boot/efi-background.png";
|
||||
}
|
||||
{ source = config.isoImage.splashImage;
|
||||
target = "/isolinux/background.png";
|
||||
}
|
||||
@ -371,13 +589,14 @@ in
|
||||
{ source = "${efiDir}/EFI";
|
||||
target = "/EFI";
|
||||
}
|
||||
{ source = "${efiDir}/loader";
|
||||
target = "/loader";
|
||||
}
|
||||
] ++ optionals config.boot.loader.grub.memtest86.enable [
|
||||
{ source = "${pkgs.memtest86plus}/memtest.bin";
|
||||
target = "/boot/memtest.bin";
|
||||
}
|
||||
] ++ optionals (!isNull config.isoImage.grubTheme) [
|
||||
{ source = config.isoImage.grubTheme;
|
||||
target = "/EFI/boot/grub-theme";
|
||||
}
|
||||
];
|
||||
|
||||
boot.loader.timeout = 10;
|
||||
|
@ -16,7 +16,8 @@ in
|
||||
];
|
||||
|
||||
assertions = lib.singleton {
|
||||
assertion = pkgs.stdenv.system == "aarch64-linux";
|
||||
assertion = pkgs.stdenv.hostPlatform.system == "aarch64-linux"
|
||||
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
|
||||
message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " +
|
||||
"it cannot be cross compiled";
|
||||
};
|
||||
|
@ -16,7 +16,8 @@ in
|
||||
];
|
||||
|
||||
assertions = lib.singleton {
|
||||
assertion = pkgs.stdenv.system == "armv7l-linux";
|
||||
assertion = pkgs.stdenv.hostPlatform.system == "armv7l-linux"
|
||||
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
|
||||
message = "sd-image-armv7l-multiplatform.nix can be only built natively on ARMv7; " +
|
||||
"it cannot be cross compiled";
|
||||
};
|
||||
|
@ -16,7 +16,8 @@ in
|
||||
];
|
||||
|
||||
assertions = lib.singleton {
|
||||
assertion = pkgs.stdenv.system == "armv6l-linux";
|
||||
assertion = pkgs.stdenv.hostPlatform.system == "armv6l-linux"
|
||||
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
|
||||
message = "sd-image-raspberrypi.nix can be only built natively on ARMv6; " +
|
||||
"it cannot be cross compiled";
|
||||
};
|
||||
|
@ -12,18 +12,17 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
rootfsImage = import ../../../lib/make-ext4-fs.nix {
|
||||
inherit pkgs;
|
||||
rootfsImage = pkgs.callPackage ../../../lib/make-ext4-fs.nix ({
|
||||
inherit (config.sdImage) storePaths;
|
||||
volumeLabel = "NIXOS_SD";
|
||||
} // optionalAttrs (config.sdImage.rootPartitionUUID != null) {
|
||||
uuid = config.sdImage.rootPartitionUUID;
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
options.sdImage = {
|
||||
imageName = mkOption {
|
||||
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.img";
|
||||
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img";
|
||||
description = ''
|
||||
Name of the generated image file.
|
||||
'';
|
||||
@ -94,16 +93,16 @@ in
|
||||
|
||||
sdImage.storePaths = [ config.system.build.toplevel ];
|
||||
|
||||
system.build.sdImage = pkgs.stdenv.mkDerivation {
|
||||
system.build.sdImage = pkgs.callPackage ({ stdenv, dosfstools, e2fsprogs, mtools, libfaketime, utillinux }: stdenv.mkDerivation {
|
||||
name = config.sdImage.imageName;
|
||||
|
||||
buildInputs = with pkgs; [ dosfstools e2fsprogs mtools libfaketime utillinux ];
|
||||
nativeBuildInputs = [ dosfstools e2fsprogs mtools libfaketime utillinux ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/nix-support $out/sd-image
|
||||
export img=$out/sd-image/${config.sdImage.imageName}
|
||||
|
||||
echo "${pkgs.stdenv.system}" > $out/nix-support/system
|
||||
echo "${pkgs.stdenv.buildPlatform.system}" > $out/nix-support/system
|
||||
echo "file sd-image $img" >> $out/nix-support/hydra-build-products
|
||||
|
||||
# Create the image file sized to fit /boot and /, plus 20M of slack
|
||||
@ -138,7 +137,7 @@ in
|
||||
(cd boot; mcopy -bpsvm -i ../bootpart.img ./* ::)
|
||||
dd conv=notrunc if=bootpart.img of=$img seek=$START count=$SECTORS
|
||||
'';
|
||||
};
|
||||
}) {};
|
||||
|
||||
boot.postBootCommands = ''
|
||||
# On the first boot do some maintenance tasks
|
||||
|
@ -25,10 +25,9 @@ with lib;
|
||||
|
||||
# !!! Hack - attributes expected by other modules.
|
||||
environment.systemPackages = [ pkgs.grub2_efi ]
|
||||
++ (if pkgs.stdenv.system == "aarch64-linux"
|
||||
++ (if pkgs.stdenv.hostPlatform.system == "aarch64-linux"
|
||||
then []
|
||||
else [ pkgs.grub2 pkgs.syslinux ]);
|
||||
system.boot.loader.kernelFile = pkgs.stdenv.platform.kernelTarget;
|
||||
|
||||
fileSystems."/" =
|
||||
{ fsType = "tmpfs";
|
||||
@ -86,7 +85,7 @@ with lib;
|
||||
|
||||
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
||||
#!ipxe
|
||||
kernel ${pkgs.stdenv.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
|
||||
kernel ${pkgs.stdenv.hostPlatform.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
|
||||
initrd initrd
|
||||
boot
|
||||
'';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
x86_64-linux = "/nix/store/0d60i73mcv8z1m8d2m74yfn84980gfsa-nix-2.0.4";
|
||||
i686-linux = "/nix/store/6ssafj2s5a2g9x28yld7b70vwd6vw6lb-nix-2.0.4";
|
||||
aarch64-linux = "/nix/store/3wwch7bp7n7xsl8apgy2a4b16yzyij1z-nix-2.0.4";
|
||||
x86_64-darwin = "/nix/store/771l8i0mz4c8kry8cz3sz8rr3alalckg-nix-2.0.4";
|
||||
x86_64-linux = "/nix/store/h180y3n5k1ypxgm1pcvj243qix5j45zz-nix-2.1.1";
|
||||
i686-linux = "/nix/store/v2y4k4v9ml07jmfq739wyflapg3b7b5k-nix-2.1.1";
|
||||
aarch64-linux = "/nix/store/v485craglq7xm5996ci8qy5dyc17dab0-nix-2.1.1";
|
||||
x86_64-darwin = "/nix/store/lc3ymlix73kaad5srjdgaxp9ngr1sg6g-nix-2.1.1";
|
||||
}
|
||||
|
@ -574,6 +574,10 @@ $bootLoaderConfig
|
||||
# networking.hostName = "nixos"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password\@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Select internationalisation properties.
|
||||
# i18n = {
|
||||
# consoleFont = "Lat2-Terminus16";
|
||||
|
@ -82,6 +82,14 @@ let cfg = config.documentation; in
|
||||
environment.systemPackages = [ pkgs.texinfoInteractive ];
|
||||
environment.pathsToLink = [ "/share/info" ];
|
||||
environment.extraOutputsToInstall = [ "info" ] ++ optional cfg.dev.enable "devinfo";
|
||||
environment.extraSetup = ''
|
||||
if [ -w $out/share/info ]; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
${pkgs.texinfo}/bin/install-info $i $out/share/info/dir
|
||||
done
|
||||
fi
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.doc.enable {
|
||||
|
@ -325,6 +325,10 @@
|
||||
hydron = 298;
|
||||
cfssl = 299;
|
||||
cassandra = 300;
|
||||
qemu-libvirtd = 301;
|
||||
# kvm = 302; # unused
|
||||
# render = 303; # unused
|
||||
zeronet = 304;
|
||||
|
||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||
|
||||
@ -610,6 +614,10 @@
|
||||
hydron = 298;
|
||||
cfssl = 299;
|
||||
cassandra = 300;
|
||||
qemu-libvirtd = 301;
|
||||
kvm = 302; # default udev rules from systemd requires these
|
||||
render = 303; # default udev rules from systemd requires these
|
||||
zeronet = 304;
|
||||
|
||||
# When adding a gid, make sure it doesn't match an existing
|
||||
# uid. Users and groups with the same name should have equal
|
||||
|
@ -76,9 +76,6 @@ in
|
||||
|
||||
config = {
|
||||
|
||||
warnings = lib.optional (options.system.stateVersion.highestPrio > 1000)
|
||||
"You don't have `system.stateVersion` explicitly set. Expect things to break.";
|
||||
|
||||
system.nixos = {
|
||||
# These defaults are set here rather than up there so that
|
||||
# changing them would not rebuild the manual
|
||||
@ -87,7 +84,7 @@ in
|
||||
versionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
|
||||
|
||||
# Note: the first letter is bumped on every release. It's an animal.
|
||||
codeName = "Jellyfish";
|
||||
codeName = "Koi";
|
||||
};
|
||||
|
||||
# Generate /etc/os-release. See
|
||||
|
@ -7,6 +7,10 @@
|
||||
./config/fonts/fontdir.nix
|
||||
./config/fonts/fonts.nix
|
||||
./config/fonts/ghostscript.nix
|
||||
./config/xdg/autostart.nix
|
||||
./config/xdg/icons.nix
|
||||
./config/xdg/menus.nix
|
||||
./config/xdg/mime.nix
|
||||
./config/gnu.nix
|
||||
./config/i18n.nix
|
||||
./config/iproute2.nix
|
||||
@ -247,8 +251,10 @@
|
||||
./services/desktops/gnome3/tracker-miners.nix
|
||||
./services/desktops/profile-sync-daemon.nix
|
||||
./services/desktops/telepathy.nix
|
||||
./services/desktops/zeitgeist.nix
|
||||
./services/development/bloop.nix
|
||||
./services/development/hoogle.nix
|
||||
./services/development/jupyter/default.nix
|
||||
./services/editors/emacs.nix
|
||||
./services/editors/infinoted.nix
|
||||
./services/games/factorio.nix
|
||||
@ -280,6 +286,7 @@
|
||||
./services/hardware/upower.nix
|
||||
./services/hardware/usbmuxd.nix
|
||||
./services/hardware/thermald.nix
|
||||
./services/hardware/undervolt.nix
|
||||
./services/logging/SystemdJournal2Gelf.nix
|
||||
./services/logging/awstats.nix
|
||||
./services/logging/fluentd.nix
|
||||
@ -407,12 +414,14 @@
|
||||
./services/monitoring/cadvisor.nix
|
||||
./services/monitoring/collectd.nix
|
||||
./services/monitoring/das_watchdog.nix
|
||||
./services/monitoring/datadog-agent.nix
|
||||
./services/monitoring/dd-agent/dd-agent.nix
|
||||
./services/monitoring/fusion-inventory.nix
|
||||
./services/monitoring/grafana.nix
|
||||
./services/monitoring/graphite.nix
|
||||
./services/monitoring/hdaps.nix
|
||||
./services/monitoring/heapster.nix
|
||||
./services/monitoring/incron.nix
|
||||
./services/monitoring/longview.nix
|
||||
./services/monitoring/monit.nix
|
||||
./services/monitoring/munin.nix
|
||||
@ -611,6 +620,7 @@
|
||||
./services/networking/xl2tpd.nix
|
||||
./services/networking/xrdp.nix
|
||||
./services/networking/zerobin.nix
|
||||
./services/networking/zeronet.nix
|
||||
./services/networking/zerotierone.nix
|
||||
./services/networking/znc.nix
|
||||
./services/printing/cupsd.nix
|
||||
@ -620,9 +630,11 @@
|
||||
./services/scheduling/fcron.nix
|
||||
./services/scheduling/marathon.nix
|
||||
./services/search/elasticsearch.nix
|
||||
./services/search/elasticsearch-curator.nix
|
||||
./services/search/hound.nix
|
||||
./services/search/kibana.nix
|
||||
./services/search/solr.nix
|
||||
./services/security/certmgr.nix
|
||||
./services/security/cfssl.nix
|
||||
./services/security/clamav.nix
|
||||
./services/security/fail2ban.nix
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
# USB support, especially for booting from USB CD-ROM
|
||||
# drives.
|
||||
"usb_storage"
|
||||
"uas"
|
||||
|
||||
# Firewire support. Not tested.
|
||||
"ohci1394" "sbp2"
|
||||
|
@ -31,7 +31,8 @@ with lib;
|
||||
#services.rogue.enable = true;
|
||||
|
||||
# Disable some other stuff we don't need.
|
||||
security.sudo.enable = false;
|
||||
security.sudo.enable = mkDefault false;
|
||||
services.udisks2.enable = mkDefault false;
|
||||
|
||||
# Automatically log in at the virtual consoles.
|
||||
services.mingetty.autologinUser = "root";
|
||||
|
@ -32,6 +32,8 @@ in
|
||||
environment.etc = optionals (cfg.profiles != {})
|
||||
(mapAttrsToList mkDconfProfile cfg.profiles);
|
||||
|
||||
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
||||
|
||||
environment.variables.GIO_EXTRA_MODULES = optional cfg.enable
|
||||
"${pkgs.gnome3.dconf.lib}/lib/gio/modules";
|
||||
# https://github.com/NixOS/nixpkgs/pull/31891
|
||||
|
@ -40,7 +40,6 @@ in
|
||||
GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" ];
|
||||
XDG_CONFIG_DIRS = [ "/etc/xdg" ];
|
||||
XDG_DATA_DIRS = [ "/share" ];
|
||||
XCURSOR_PATH = [ "/share/icons" ];
|
||||
MOZ_PLUGIN_PATH = [ "/lib/mozilla/plugins" ];
|
||||
LIBEXEC_PATH = [ "/lib/libexec" ];
|
||||
};
|
||||
|
@ -3,7 +3,30 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.zsh.ohMyZsh;
|
||||
|
||||
mkLinkFarmEntry = name: dir:
|
||||
let
|
||||
env = pkgs.buildEnv {
|
||||
name = "zsh-${name}-env";
|
||||
paths = cfg.customPkgs;
|
||||
pathsToLink = "/share/zsh/${dir}";
|
||||
};
|
||||
in
|
||||
{ inherit name; path = "${env}/share/zsh/${dir}"; };
|
||||
|
||||
mkLinkFarmEntry' = name: mkLinkFarmEntry name name;
|
||||
|
||||
custom =
|
||||
if cfg.custom != null then cfg.custom
|
||||
else if length cfg.customPkgs == 0 then null
|
||||
else pkgs.linkFarm "oh-my-zsh-custom" [
|
||||
(mkLinkFarmEntry' "themes")
|
||||
(mkLinkFarmEntry "completions" "site-functions")
|
||||
(mkLinkFarmEntry' "plugins")
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
options = {
|
||||
@ -34,10 +57,19 @@ in
|
||||
};
|
||||
|
||||
custom = mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
default = null;
|
||||
type = with types; nullOr str;
|
||||
description = ''
|
||||
Path to a custom oh-my-zsh package to override config of oh-my-zsh.
|
||||
(Can't be used along with `customPkgs`).
|
||||
'';
|
||||
};
|
||||
|
||||
customPkgs = mkOption {
|
||||
default = [];
|
||||
type = types.listOf types.package;
|
||||
description = ''
|
||||
List of custom packages that should be loaded into `oh-my-zsh`.
|
||||
'';
|
||||
};
|
||||
|
||||
@ -67,7 +99,7 @@ in
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
programs.zsh.interactiveShellInit = with builtins; ''
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
# oh-my-zsh configuration generated by NixOS
|
||||
export ZSH=${cfg.package}/share/oh-my-zsh
|
||||
|
||||
@ -75,8 +107,8 @@ in
|
||||
"plugins=(${concatStringsSep " " cfg.plugins})"
|
||||
}
|
||||
|
||||
${optionalString (stringLength(cfg.custom) > 0)
|
||||
"ZSH_CUSTOM=\"${cfg.custom}\""
|
||||
${optionalString (custom != null)
|
||||
"ZSH_CUSTOM=\"${custom}\""
|
||||
}
|
||||
|
||||
${optionalString (stringLength(cfg.theme) > 0)
|
||||
@ -92,5 +124,15 @@ in
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
'';
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.custom != null -> cfg.customPkgs == [];
|
||||
message = "If `cfg.custom` is set for `ZSH_CUSTOM`, `customPkgs` can't be used!";
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
meta.doc = ./oh-my-zsh.xml;
|
||||
}
|
||||
|
125
nixos/modules/programs/zsh/oh-my-zsh.xml
Normal file
125
nixos/modules/programs/zsh/oh-my-zsh.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<chapter 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="module-programs-zsh-ohmyzsh">
|
||||
|
||||
<title>Oh my ZSH</title>
|
||||
|
||||
<para><literal><link xlink:href="https://ohmyz.sh/">oh-my-zsh</link></literal> is a framework
|
||||
to manage your <link xlink:href="https://www.zsh.org/">ZSH</link> configuration
|
||||
including completion scripts for several CLI tools or custom prompt themes.</para>
|
||||
|
||||
<section xml:id="module-programs-oh-my-zsh-usage"><title>Basic usage</title>
|
||||
<para>The module uses the <literal>oh-my-zsh</literal> package with all available features. The
|
||||
initial setup using Nix expressions is fairly similar to the configuration format
|
||||
of <literal>oh-my-zsh</literal>.
|
||||
|
||||
<programlisting>
|
||||
{
|
||||
programs.ohMyZsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" "python" "man" ];
|
||||
theme = "agnoster";
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
For a detailed explanation of these arguments please refer to the
|
||||
<link xlink:href="https://github.com/robbyrussell/oh-my-zsh/wiki"><literal>oh-my-zsh</literal> docs</link>.
|
||||
</para>
|
||||
<para>The expression generates the needed
|
||||
configuration and writes it into your <literal>/etc/zshrc</literal>.
|
||||
</para></section>
|
||||
|
||||
<section xml:id="module-programs-oh-my-zsh-additions"><title>Custom additions</title>
|
||||
|
||||
<para>Sometimes third-party or custom scripts such as a modified theme may be needed.
|
||||
<literal>oh-my-zsh</literal> provides the
|
||||
<link xlink:href="https://github.com/robbyrussell/oh-my-zsh/wiki/Customization#overriding-internals"><literal>ZSH_CUSTOM</literal></link>
|
||||
environment variable for this which points to a directory with additional scripts.</para>
|
||||
|
||||
<para>The module can do this as well:
|
||||
|
||||
<programlisting>
|
||||
{
|
||||
programs.ohMyZsh.custom = "~/path/to/custom/scripts";
|
||||
}
|
||||
</programlisting>
|
||||
</para></section>
|
||||
|
||||
<section xml:id="module-programs-oh-my-zsh-environments"><title>Custom environments</title>
|
||||
|
||||
<para>There are several extensions for <literal>oh-my-zsh</literal> packaged in <literal>nixpkgs</literal>.
|
||||
One of them is <link xlink:href="https://github.com/spwhitt/nix-zsh-completions">nix-zsh-completions</link>
|
||||
which bundles completion scripts and a plugin for <literal>oh-my-zsh</literal>.</para>
|
||||
|
||||
<para>Rather than using a single mutable path for <literal>ZSH_CUSTOM</literal>, it's also possible to
|
||||
generate this path from a list of Nix packages:
|
||||
|
||||
<programlisting>
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.ohMyZsh.customPkgs = with pkgs; [
|
||||
pkgs.nix-zsh-completions
|
||||
# and even more...
|
||||
];
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
Internally a single store path will be created using <literal>buildEnv</literal>.
|
||||
Please refer to the docs of
|
||||
<link xlink:href="https://nixos.org/nixpkgs/manual/#sec-building-environment"><literal>buildEnv</literal></link>
|
||||
for further reference.</para>
|
||||
|
||||
<para><emphasis>Please keep in mind that this is not compatible with <literal>programs.ohMyZsh.custom</literal>
|
||||
as it requires an immutable store path while <literal>custom</literal> shall remain mutable! An evaluation failure
|
||||
will be thrown if both <literal>custom</literal> and <literal>customPkgs</literal> are set.</emphasis>
|
||||
</para></section>
|
||||
|
||||
<section xml:id="module-programs-oh-my-zsh-packaging-customizations"><title>Package your own customizations</title>
|
||||
|
||||
<para>If third-party customizations (e.g. new themes) are supposed to be added to <literal>oh-my-zsh</literal>
|
||||
there are several pitfalls to keep in mind:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>To comply with the default structure of <literal>ZSH</literal> the entire output needs to be written to
|
||||
<literal>$out/share/zsh.</literal></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Completion scripts are supposed to be stored at <literal>$out/share/zsh/site-functions</literal>. This directory
|
||||
is part of the <literal><link xlink:href="http://zsh.sourceforge.net/Doc/Release/Functions.html">fpath</link></literal>
|
||||
and the package should be compatible with pure <literal>ZSH</literal> setups. The module will automatically link
|
||||
the contents of <literal>site-functions</literal> to completions directory in the proper store path.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>The <literal>plugins</literal> directory needs the structure <literal>pluginname/pluginname.plugin.zsh</literal>
|
||||
as structured in the <link xlink:href="https://github.com/robbyrussell/oh-my-zsh/tree/91b771914bc7c43dd7c7a43b586c5de2c225ceb7/plugins">upstream repo.</link>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
A derivation for <literal>oh-my-zsh</literal> may look like this:
|
||||
<programlisting>
|
||||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "exemplary-zsh-customization-${version}";
|
||||
version = "1.0.0";
|
||||
src = fetchFromGitHub {
|
||||
# path to the upstream repository
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/zsh/site-functions
|
||||
cp {themes,plugins} $out/share/zsh
|
||||
cp completions $out/share/zsh/site-functions
|
||||
'';
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
@ -87,6 +87,19 @@ in
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
|
||||
enableGlobalCompInit = mkOption {
|
||||
default = cfg.enableCompletion;
|
||||
description = ''
|
||||
Enable execution of compinit call for all interactive zsh shells.
|
||||
|
||||
This option can be disabled if the user wants to extend its
|
||||
<literal>fpath</literal> and a custom <literal>compinit</literal>
|
||||
call in the local config is required.
|
||||
'';
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
@ -159,7 +172,7 @@ in
|
||||
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
|
||||
done
|
||||
|
||||
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
||||
${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"}
|
||||
|
||||
${cfge.interactiveShellInit}
|
||||
|
||||
|
@ -219,7 +219,7 @@ with lib;
|
||||
'')
|
||||
|
||||
# Profile splitting
|
||||
(mkRenamedOptionModule [ "virtualization" "growPartition" ] [ "boot" "growPartition" ])
|
||||
(mkRenamedOptionModule [ "virtualisation" "growPartition" ] [ "boot" "growPartition" ])
|
||||
|
||||
# misc/version.nix
|
||||
(mkRenamedOptionModule [ "system" "nixosVersion" ] [ "system" "nixos" "version" ])
|
||||
@ -256,6 +256,8 @@ with lib;
|
||||
(mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
|
||||
(mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
|
||||
(mkRemovedOptionModule [ "virtualisation" "xen" "qemu" ] "You don't need this option anymore, it will work without it.")
|
||||
(mkRemovedOptionModule [ "services" "logstash" "enableWeb" ] "The web interface was removed from logstash")
|
||||
(mkRemovedOptionModule [ "boot" "zfs" "enableLegacyCrypto" ] "The corresponding package was removed from nixpkgs.")
|
||||
|
||||
# ZSH
|
||||
(mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
|
||||
|
@ -11,7 +11,7 @@ retrieval and renewal using the ACME protocol. This is currently only
|
||||
implemented by and for Let's Encrypt. The alternative ACME client
|
||||
<literal>simp_le</literal> is used under the hood.</para>
|
||||
|
||||
<section><title>Prerequisites</title>
|
||||
<section xml:id="module-security-acme-prerequisites"><title>Prerequisites</title>
|
||||
|
||||
<para>You need to have a running HTTP server for verification. The server must
|
||||
have a webroot defined that can serve
|
||||
@ -41,7 +41,7 @@ http {
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Configuring</title>
|
||||
<section xml:id="module-security-acme-configuring"><title>Configuring</title>
|
||||
|
||||
<para>To enable ACME certificate retrieval & renewal for a certificate for
|
||||
<literal>foo.example.com</literal>, add the following in your
|
||||
@ -66,7 +66,7 @@ options for the <link linkend="opt-security.acme.certs">security.acme</link> mod
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Using ACME certificates in Nginx</title>
|
||||
<section xml:id="module-security-acme-nginx"><title>Using ACME certificates in Nginx</title>
|
||||
<para>NixOS supports fetching ACME certificates for you by setting
|
||||
<literal><link linkend="opt-services.nginx.virtualHosts._name_.enableACME">enableACME</link> = true;</literal> in a virtualHost config. We
|
||||
first create self-signed placeholder certificates in place of the
|
||||
|
@ -17,7 +17,7 @@
|
||||
<para>FoundationDB (or "FDB") is an open source, distributed, transactional
|
||||
key-value store.</para>
|
||||
|
||||
<section><title>Configuring and basic setup</title>
|
||||
<section xml:id="module-services-foundationdb-configuring"><title>Configuring and basic setup</title>
|
||||
|
||||
<para>To enable FoundationDB, add the following to your
|
||||
<filename>configuration.nix</filename>:
|
||||
@ -133,7 +133,7 @@ corresponding <option>services.foundationdb.logDir</option> as well.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Scaling processes and backup agents</title>
|
||||
<section xml:id="module-services-foundationdb-scaling"><title>Scaling processes and backup agents</title>
|
||||
|
||||
<para>Scaling the number of server processes is quite easy; simply specify
|
||||
<option>services.foundationdb.serverProcesses</option> to be the number of
|
||||
@ -151,7 +151,7 @@ available backup processes.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Clustering</title>
|
||||
<section xml:id="module-services-foundationdb-clustering"><title>Clustering</title>
|
||||
|
||||
<para>FoundationDB on NixOS works similarly to other Linux systems, so this
|
||||
section will be brief. Please refer to the full FoundationDB documentation for
|
||||
@ -221,7 +221,7 @@ informing all client processes to do the same.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Client connectivity</title>
|
||||
<section xml:id="module-services-foundationdb-connectivity"><title>Client connectivity</title>
|
||||
|
||||
<para>By default, all clients must use the current
|
||||
<command>fdb.cluster</command> file to access a given FoundationDB cluster.
|
||||
@ -232,7 +232,7 @@ to a new node in order to connect, if it is not part of the cluster.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Client authorization and TLS</title>
|
||||
<section xml:id="module-services-foundationdb-authorization"><title>Client authorization and TLS</title>
|
||||
|
||||
<para>By default, any user who can connect to a FoundationDB process with the
|
||||
correct cluster configuration can access anything. FoundationDB uses a
|
||||
@ -270,7 +270,7 @@ on.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Backups and Disaster Recovery</title>
|
||||
<section xml:id="module-services-foundationdb-disaster-recovery"><title>Backups and Disaster Recovery</title>
|
||||
|
||||
<para>The usual rules for doing FoundationDB backups apply on NixOS as written
|
||||
in the FoundationDB manual. However, one important difference is the security
|
||||
@ -316,7 +316,7 @@ $ sudo -u foundationdb fdbbackup status -t default
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Known limitations</title>
|
||||
<section xml:id="module-services-foundationdb-limitations"><title>Known limitations</title>
|
||||
|
||||
<para>The FoundationDB setup for NixOS should currently be considered beta.
|
||||
FoundationDB is not new software, but the NixOS compilation and integration has
|
||||
@ -333,7 +333,7 @@ only undergone fairly basic testing of all the available functionality.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Options</title>
|
||||
<section xml:id="module-services-foundationdb-options"><title>Options</title>
|
||||
|
||||
<para>NixOS's FoundationDB module allows you to configure all of the most
|
||||
relevant configuration options for <command>fdbmonitor</command>, matching it
|
||||
@ -343,7 +343,7 @@ also read the FoundationDB documentation as well.</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section><title>Full documentation</title>
|
||||
<section xml:id="module-services-foundationdb-full-docs"><title>Full documentation</title>
|
||||
|
||||
<para>FoundationDB is a complex piece of software, and requires careful
|
||||
administration to properly use. Full documentation for administration can be
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<para>PostgreSQL is an advanced, free relational database.<!-- MORE --></para>
|
||||
|
||||
<section><title>Configuring</title>
|
||||
<section xml:id="module-services-postgres-configuring"><title>Configuring</title>
|
||||
|
||||
<para>To enable PostgreSQL, add the following to your
|
||||
<filename>configuration.nix</filename>:
|
||||
@ -60,14 +60,14 @@ alice=>
|
||||
</section>
|
||||
|
||||
|
||||
<section><title>Upgrading</title>
|
||||
<section xml:id="module-services-postgres-upgrading"><title>Upgrading</title>
|
||||
|
||||
<para>FIXME: document dump/upgrade/load cycle.</para>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section><title>Options</title>
|
||||
<section xml:id="module-services-postgres-options"><title>Options</title>
|
||||
|
||||
<para>A complete list of options for the PostgreSQL module may be found <link linkend="opt-services.postgresql.enable">here</link>.</para>
|
||||
|
||||
|
@ -32,15 +32,21 @@ with lib;
|
||||
|
||||
environment.systemPackages = [ pkgs.accountsservice ];
|
||||
|
||||
# Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice
|
||||
environment.pathsToLink = [ "/share/accountsservice" ];
|
||||
|
||||
services.dbus.packages = [ pkgs.accountsservice ];
|
||||
|
||||
systemd.packages = [ pkgs.accountsservice ];
|
||||
|
||||
systemd.services.accounts-daemon= {
|
||||
systemd.services.accounts-daemon = {
|
||||
|
||||
wantedBy = [ "graphical.target" ];
|
||||
|
||||
} // (mkIf (!config.users.mutableUsers) {
|
||||
# Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice
|
||||
environment.XDG_DATA_DIRS = "${config.system.path}/share";
|
||||
|
||||
} // (optionalAttrs (!config.users.mutableUsers) {
|
||||
environment.NIXOS_USERS_PURE = "true";
|
||||
});
|
||||
};
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
# the demo agent isn't built by default, but we need it here
|
||||
package = pkgs.geoclue2.override { withDemoAgent = config.services.geoclue2.enableDemoAgent; };
|
||||
in
|
||||
{
|
||||
|
||||
###### interface
|
||||
@ -21,21 +25,42 @@ with lib;
|
||||
'';
|
||||
};
|
||||
|
||||
enableDemoAgent = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to use the GeoClue demo agent. This should be
|
||||
overridden by desktop environments that provide their own
|
||||
agent.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf config.services.geoclue2.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.geoclue2 ];
|
||||
environment.systemPackages = [ package ];
|
||||
|
||||
services.dbus.packages = [ pkgs.geoclue2 ];
|
||||
|
||||
systemd.packages = [ pkgs.geoclue2 ];
|
||||
services.dbus.packages = [ package ];
|
||||
|
||||
systemd.packages = [ package ];
|
||||
|
||||
# this needs to run as a user service, since it's associated with the
|
||||
# user who is making the requests
|
||||
systemd.user.services = mkIf config.services.geoclue2.enableDemoAgent {
|
||||
"geoclue-agent" = {
|
||||
description = "Geoclue agent";
|
||||
script = "${package}/libexec/geoclue-2.0/demos/agent";
|
||||
# this should really be `partOf = [ "geoclue.service" ]`, but
|
||||
# we can't be part of a system service, and the agent should
|
||||
# be okay with the main service coming and going
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
26
nixos/modules/services/desktops/zeitgeist.nix
Normal file
26
nixos/modules/services/desktops/zeitgeist.nix
Normal file
@ -0,0 +1,26 @@
|
||||
# Zeitgeist
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
services.zeitgeist = {
|
||||
enable = mkEnableOption "zeitgeist";
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf config.services.zeitgeist.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.zeitgeist ];
|
||||
|
||||
services.dbus.packages = [ pkgs.zeitgeist ];
|
||||
|
||||
systemd.packages = [ pkgs.zeitgeist ];
|
||||
};
|
||||
}
|
184
nixos/modules/services/development/jupyter/default.nix
Normal file
184
nixos/modules/services/development/jupyter/default.nix
Normal file
@ -0,0 +1,184 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.jupyter;
|
||||
|
||||
# NOTE: We don't use top-level jupyter because we don't
|
||||
# want to pass in JUPYTER_PATH but use .environment instead,
|
||||
# saving a rebuild.
|
||||
package = pkgs.python3.pkgs.notebook;
|
||||
|
||||
kernels = (pkgs.jupyter-kernel.create {
|
||||
definitions = if cfg.kernels != null
|
||||
then cfg.kernels
|
||||
else pkgs.jupyter-kernel.default;
|
||||
});
|
||||
|
||||
notebookConfig = pkgs.writeText "jupyter_config.py" ''
|
||||
${cfg.notebookConfig}
|
||||
|
||||
c.NotebookApp.password = ${cfg.password}
|
||||
'';
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ aborsu ];
|
||||
|
||||
options.services.jupyter = {
|
||||
enable = mkEnableOption "Jupyter development server";
|
||||
|
||||
ip = mkOption {
|
||||
type = types.str;
|
||||
default = "localhost";
|
||||
description = ''
|
||||
IP address Jupyter will be listening on.
|
||||
'';
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8888;
|
||||
description = ''
|
||||
Port number Jupyter will be listening on.
|
||||
'';
|
||||
};
|
||||
|
||||
notebookDir = mkOption {
|
||||
type = types.str;
|
||||
default = "~/";
|
||||
description = ''
|
||||
Root directory for notebooks.
|
||||
'';
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "jupyter";
|
||||
description = ''
|
||||
Name of the user used to run the jupyter service.
|
||||
For security reason, jupyter should really not be run as root.
|
||||
If not set (jupyter), the service will create a jupyter user with appropriate settings.
|
||||
'';
|
||||
example = "aborsu";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "jupyter";
|
||||
description = ''
|
||||
Name of the group used to run the jupyter service.
|
||||
Use this if you want to create a group of users that are able to view the notebook directory's content.
|
||||
'';
|
||||
example = "users";
|
||||
};
|
||||
|
||||
password = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
Password to use with notebook.
|
||||
Can be generated using:
|
||||
In [1]: from notebook.auth import passwd
|
||||
In [2]: passwd('test')
|
||||
Out[2]: 'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'
|
||||
NOTE: you need to keep the single quote inside the nix string.
|
||||
Or you can use a python oneliner:
|
||||
"open('/path/secret_file', 'r', encoding='utf8').read().strip()"
|
||||
It will be interpreted at the end of the notebookConfig.
|
||||
'';
|
||||
example = [
|
||||
"'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'"
|
||||
"open('/path/secret_file', 'r', encoding='utf8').read().strip()"
|
||||
];
|
||||
};
|
||||
|
||||
notebookConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Raw jupyter config.
|
||||
'';
|
||||
};
|
||||
|
||||
kernels = mkOption {
|
||||
type = types.nullOr (types.attrsOf(types.submodule (import ./kernel-options.nix {
|
||||
inherit lib;
|
||||
})));
|
||||
|
||||
default = null;
|
||||
example = literalExample ''
|
||||
{
|
||||
python3 = let
|
||||
env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
|
||||
ipykernel
|
||||
pandas
|
||||
scikitlearn
|
||||
]));
|
||||
in {
|
||||
displayName = "Python 3 for machine learning";
|
||||
argv = [
|
||||
"$ {env.interpreter}"
|
||||
"-m"
|
||||
"ipykernel_launcher"
|
||||
"-f"
|
||||
"{connection_file}"
|
||||
];
|
||||
language = "python";
|
||||
logo32 = "$ {env.sitePackages}/ipykernel/resources/logo-32x32.png";
|
||||
logo64 = "$ {env.sitePackages}/ipykernel/resources/logo-64x64.png";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = "Declarative kernel config
|
||||
|
||||
Kernels can be declared in any language that supports and has the required
|
||||
dependencies to communicate with a jupyter server.
|
||||
In python's case, it means that ipykernel package must always be included in
|
||||
the list of packages of the targeted environment.
|
||||
";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
systemd.services.jupyter = {
|
||||
description = "Jupyter development server";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
# TODO: Patch notebook so we can explicitly pass in a shell
|
||||
path = [ pkgs.bash ]; # needed for sh in cell magic to work
|
||||
|
||||
environment = {
|
||||
JUPYTER_PATH = toString kernels;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
ExecStart = ''${package}/bin/jupyter-notebook \
|
||||
--no-browser \
|
||||
--ip=${cfg.ip} \
|
||||
--port=${toString cfg.port} --port-retries 0 \
|
||||
--notebook-dir=${cfg.notebookDir} \
|
||||
--NotebookApp.config_file=${notebookConfig}
|
||||
'';
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
WorkingDirectory = "~";
|
||||
};
|
||||
};
|
||||
})
|
||||
(mkIf (cfg.enable && (cfg.group == "jupyter")) {
|
||||
users.groups.jupyter = {};
|
||||
})
|
||||
(mkIf (cfg.enable && (cfg.user == "jupyter")) {
|
||||
users.extraUsers.jupyter = {
|
||||
extraGroups = [ cfg.group ];
|
||||
home = "/var/lib/jupyter";
|
||||
createHome = true;
|
||||
useDefaultShell = true; # needed so that the user can start a terminal.
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
# Options that can be used for creating a jupyter kernel.
|
||||
{lib }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
displayName = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = [
|
||||
"Python 3"
|
||||
"Python 3 for Data Science"
|
||||
];
|
||||
description = ''
|
||||
Name that will be shown to the user.
|
||||
'';
|
||||
};
|
||||
|
||||
argv = mkOption {
|
||||
type = types.listOf types.str;
|
||||
example = [
|
||||
"{customEnv.interpreter}"
|
||||
"-m"
|
||||
"ipykernel_launcher"
|
||||
"-f"
|
||||
"{connection_file}"
|
||||
];
|
||||
description = ''
|
||||
Command and arguments to start the kernel.
|
||||
'';
|
||||
};
|
||||
|
||||
language = mkOption {
|
||||
type = types.str;
|
||||
example = "python";
|
||||
description = ''
|
||||
Language of the environment. Typically the name of the binary.
|
||||
'';
|
||||
};
|
||||
|
||||
logo32 = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
example = "{env.sitePackages}/ipykernel/resources/logo-32x32.png";
|
||||
description = ''
|
||||
Path to 32x32 logo png.
|
||||
'';
|
||||
};
|
||||
logo64 = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
example = "{env.sitePackages}/ipykernel/resources/logo-64x64.png";
|
||||
description = ''
|
||||
Path to 64x64 logo png.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
@ -39,7 +39,7 @@
|
||||
starting the Emacs daemon.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-installing">
|
||||
<title>Installing <application>Emacs</application></title>
|
||||
|
||||
<para>
|
||||
@ -49,7 +49,7 @@
|
||||
can be enabled.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-releases">
|
||||
<title>The Different Releases of Emacs</title>
|
||||
|
||||
<para>
|
||||
@ -100,7 +100,7 @@
|
||||
</para>
|
||||
|
||||
</section>
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-adding-packages">
|
||||
<title>Adding Packages to Emacs</title>
|
||||
<para>
|
||||
Emacs includes an entire ecosystem of functionality beyond
|
||||
@ -274,7 +274,7 @@ $ ./result/bin/emacs -q
|
||||
<para>
|
||||
The list of available packages in the various ELPA
|
||||
repositories can be seen with the following commands:
|
||||
<example>
|
||||
<example xml:id="module-services-emacs-querying-packages">
|
||||
<title>Querying Emacs packages</title>
|
||||
<programlisting><![CDATA[
|
||||
nix-env -f "<nixpkgs>" -qaP -A emacsPackagesNg.elpaPackages
|
||||
@ -291,7 +291,7 @@ nix-env -f "<nixpkgs>" -qaP -A emacsPackagesNg.orgPackages
|
||||
(see <xref linkend="sec-declarative-package-mgmt" />). Simply
|
||||
modify your file <filename>configuration.nix</filename> to
|
||||
make it contain:
|
||||
<example>
|
||||
<example xml:id="module-services-emacs-configuration-nix">
|
||||
<title>Custom Emacs in <filename>configuration.nix</filename></title>
|
||||
<programlisting><![CDATA[
|
||||
{
|
||||
@ -319,7 +319,7 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
|
||||
Emacs only for yourself, you can do so by adding it to your
|
||||
<filename>~/.config/nixpkgs/config.nix</filename>
|
||||
(see <link xlink:href="http://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides">Nixpkgs manual</link>):
|
||||
<example>
|
||||
<example xml:id="module-services-emacs-config-nix">
|
||||
<title>Custom Emacs in <filename>~/.config/nixpkgs/config.nix</filename></title>
|
||||
<programlisting><![CDATA[
|
||||
{
|
||||
@ -339,7 +339,7 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-advanced">
|
||||
<title>Advanced Emacs Configuration</title>
|
||||
|
||||
<para>
|
||||
@ -380,7 +380,7 @@ in [...]
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-running">
|
||||
<title>Running Emacs as a Service</title>
|
||||
<para>
|
||||
<productname>NixOS</productname> provides an optional
|
||||
@ -396,7 +396,7 @@ in [...]
|
||||
<filename>modules/services/editors/emacs.nix</filename>
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-enabling">
|
||||
<title>Enabling the Service</title>
|
||||
|
||||
<para>
|
||||
@ -438,7 +438,7 @@ $ systemctl --user start emacs.service # to start the Emacs daemon
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-starting-client">
|
||||
<title>Starting the client</title>
|
||||
<para>
|
||||
Ensure that the emacs server is enabled, either by customizing
|
||||
@ -457,7 +457,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-editor-variable">
|
||||
<title>Configuring the <varname>EDITOR</varname> variable</title>
|
||||
<!--<title><command>emacsclient</command> as the Default Editor</title>-->
|
||||
|
||||
@ -487,7 +487,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-per-user">
|
||||
<title>Per-User Enabling of the Service</title>
|
||||
|
||||
<para>
|
||||
@ -515,14 +515,14 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-configuring">
|
||||
<title>Configuring Emacs</title>
|
||||
|
||||
<para>
|
||||
The Emacs init file should be changed to load the extension
|
||||
packages at startup:
|
||||
|
||||
<example>
|
||||
<example xml:id="module-services-emacs-package-initialisation">
|
||||
<title>Package initialization in <filename>.emacs</filename></title>
|
||||
<programlisting><![CDATA[
|
||||
(require 'package)
|
||||
@ -548,7 +548,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal
|
||||
server-switch-hook, server-done-hook?
|
||||
-->
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-major-mode">
|
||||
<title>A Major Mode for Nix Expressions</title>
|
||||
|
||||
<para>
|
||||
@ -558,7 +558,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section xml:id="module-services-emacs-man-pages">
|
||||
<title>Accessing man pages</title>
|
||||
<para>
|
||||
You can use <function>woman</function> to get completion of all
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user