Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364025
b: refs/heads/nm-containers
c: 7a073c1
h: refs/heads/master
i:
  364023: 6228fc0
  • Loading branch information
grahamc committed Aug 29, 2016
1 parent f5f8a9b commit cc96ede
Show file tree
Hide file tree
Showing 224 changed files with 3,768 additions and 2,204 deletions.
2 changes: 1 addition & 1 deletion [refs]
Expand Up @@ -123,6 +123,6 @@ refs/heads/pkgs/kubernetes/update/1.4.0: 83ee0a0670ba1cdb19ccc9e1a17d2375387acd4
refs/heads/staging-16.09: da8c5d95d81d6279803c6d0bb8e7d03af86be941
refs/heads/gcc-6: a399c55a0f45381e0581597bc87700134d059de6
refs/heads/python3: 3965647f968b4049bd9048cb8ccc285058758a83
refs/heads/nm-containers: c08b9b039a5470a8e6f7d557e65b44363de28f14
refs/heads/nm-containers: 7a073c1c6ddf98752cfe12f719f82dcd09d22079
refs/heads/roundup-9-rollup: db93501852f76f00a284c6c134bddfdf0bf93845
refs/heads/kube-update: 59695890dbdd45c701b63c2b352c59a7cbd98ad2
2 changes: 1 addition & 1 deletion branches/nm-containers/lib/licenses.nix
Expand Up @@ -188,7 +188,7 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {

fdl13 = spdx {
spdxId = "GFDL-1.3";
fullName = "GNU Free Documentation License v1.2";
fullName = "GNU Free Documentation License v1.3";
};

free = {
Expand Down
80 changes: 80 additions & 0 deletions branches/nm-containers/lib/lists.nix
Expand Up @@ -256,6 +256,86 @@ rec {
reverseList = xs:
let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

/* Depth-First Search (DFS) for lists `list != []`.
`before a b == true` means that `b` depends on `a` (there's an
edge from `b` to `a`).
Examples:
listDfs true hasPrefix [ "/home/user" "other" "/" "/home" ]
== { minimal = "/"; # minimal element
visited = [ "/home/user" ]; # seen elements (in reverse order)
rest = [ "/home" "other" ]; # everything else
}
listDfs true hasPrefix [ "/home/user" "other" "/" "/home" "/" ]
== { cycle = "/"; # cycle encountered at this element
loops = [ "/" ]; # and continues to these elements
visited = [ "/" "/home/user" ]; # elements leading to the cycle (in reverse order)
rest = [ "/home" "other" ]; # everything else
*/

listDfs = stopOnCycles: before: list:
let
dfs' = us: visited: rest:
let
c = filter (x: before x us) visited;
b = partition (x: before x us) rest;
in if stopOnCycles && (length c > 0)
then { cycle = us; loops = c; inherit visited rest; }
else if length b.right == 0
then # nothing is before us
{ minimal = us; inherit visited rest; }
else # grab the first one before us and continue
dfs' (head b.right)
([ us ] ++ visited)
(tail b.right ++ b.wrong);
in dfs' (head list) [] (tail list);

/* Sort a list based on a partial ordering using DFS. This
implementation is O(N^2), if your ordering is linear, use `sort`
instead.
`before a b == true` means that `b` should be after `a`
in the result.
Examples:
toposort hasPrefix [ "/home/user" "other" "/" "/home" ]
== { result = [ "/" "/home" "/home/user" "other" ]; }
toposort hasPrefix [ "/home/user" "other" "/" "/home" "/" ]
== { cycle = [ "/home/user" "/" "/" ]; # path leading to a cycle
loops = [ "/" ]; } # loops back to these elements
toposort hasPrefix [ "other" "/home/user" "/home" "/" ]
== { result = [ "other" "/" "/home" "/home/user" ]; }
toposort (a: b: a < b) [ 3 2 1 ] == { result = [ 1 2 3 ]; }
*/

toposort = before: list:
let
dfsthis = listDfs true before list;
toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
in
if length list < 2
then # finish
{ result = list; }
else if dfsthis ? "cycle"
then # there's a cycle, starting from the current vertex, return it
{ cycle = reverseList ([ dfsthis.cycle ] ++ dfsthis.visited);
inherit (dfsthis) loops; }
else if toporest ? "cycle"
then # there's a cycle somewhere else in the graph, return it
toporest
# Slow, but short. Can be made a bit faster with an explicit stack.
else # there are no cycles
{ result = [ dfsthis.minimal ] ++ toporest.result; };

/* Sort a list based on a comparator function which compares two
elements and returns true if the first argument is strictly below
the second argument. The returned list is sorted in an increasing
Expand Down
2 changes: 2 additions & 0 deletions branches/nm-containers/lib/maintainers.nix
Expand Up @@ -249,6 +249,7 @@
mcmtroffaes = "Matthias C. M. Troffaes <matthias.troffaes@gmail.com>";
meditans = "Carlo Nucera <meditans@gmail.com>";
meisternu = "Matt Miemiec <meister@krutt.org>";
mic92 = "Jörg Thalheim <joerg@higgsboson.tk>";
michaelpj = "Michael Peyton Jones <michaelpj@gmail.com>";
michalrus = "Michal Rus <m@michalrus.com>";
michelk = "Michel Kuhlmann <michel@kuhlmanns.info>";
Expand Down Expand Up @@ -353,6 +354,7 @@
ryantm = "Ryan Mulligan <ryan@ryantm.com>";
rycee = "Robert Helgesson <robert@rycee.net>";
ryneeverett = "Ryne Everett <ryneeverett@gmail.com>";
s1lvester = "Markus Silvester <s1lvester@bockhacker.me>";
samuelrivas = "Samuel Rivas <samuelrivas@gmail.com>";
sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
schmitthenner = "Fabian Schmitthenner <development@schmitthenner.eu>";
Expand Down
24 changes: 17 additions & 7 deletions branches/nm-containers/lib/modules.nix
Expand Up @@ -105,23 +105,27 @@ rec {
/* Massage a module into canonical form, that is, a set consisting
of ‘options’, ‘config’ and ‘imports’ attributes. */
unifyModuleSyntax = file: key: m:
let metaSet = if m ? meta
then { meta = m.meta; }
else {};
in
if m ? config || m ? options then
let badAttrs = removeAttrs m ["imports" "options" "config" "key" "_file"]; in
let badAttrs = removeAttrs m ["imports" "options" "config" "key" "_file" "meta"]; in
if badAttrs != {} then
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by assignments to the top-level attributes `config' or `options'."
else
{ file = m._file or file;
key = toString m.key or key;
imports = m.imports or [];
options = m.options or {};
config = m.config or {};
config = mkMerge [ (m.config or {}) metaSet ];
}
else
{ file = m._file or file;
key = toString m.key or key;
imports = m.require or [] ++ m.imports or [];
options = {};
config = removeAttrs m ["key" "_file" "require" "imports"];
config = mkMerge [ (removeAttrs m ["key" "_file" "require" "imports"]) metaSet ];
};

applyIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
Expand Down Expand Up @@ -503,19 +507,25 @@ rec {
/* Return a module that causes a warning to be shown if the
specified option is defined. For example,
mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ]
mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "<replacement instructions>"
causes a warning if the user defines boot.loader.grub.bootDevice.
replacementInstructions is a string that provides instructions on
how to achieve the same functionality without the removed option,
or alternatively a reasoning why the functionality is not needed.
replacementInstructions SHOULD be provided!
*/
mkRemovedOptionModule = optionName:
mkRemovedOptionModule = optionName: replacementInstructions:
{ options, ... }:
{ options = setAttrByPath optionName (mkOption {
visible = false;
});
config.warnings =
let opt = getAttrFromPath optionName options; in
optional opt.isDefined
"The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it.";
optional opt.isDefined ''
The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it.
${replacementInstructions}'';
};

/* Return a module that causes a warning to be shown if the
Expand Down
19 changes: 14 additions & 5 deletions branches/nm-containers/maintainers/scripts/fetch-kde-qt.sh
@@ -1,9 +1,18 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils findutils gnused nix wget

SRCS=
if [ -d "$1" ]; then
SRCS="$(pwd)/$1/srcs.nix"
. "$1/fetch.sh"
else
SRCS="$(pwd)/$(dirname $1)/srcs.nix"
. "$1"
fi

tmp=$(mktemp -d)
pushd $tmp >/dev/null
wget -nH -r -c --no-parent "$@" >/dev/null
wget -nH -r -c --no-parent "${WGET_ARGS[@]}" >/dev/null

csv=$(mktemp)
find . -type f | while read src; do
Expand All @@ -15,8 +24,8 @@ find . -type f | while read src; do
echo "$name,$version,$src,$filename" >>$csv
done

cat <<EOF
# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
cat >"$SRCS" <<EOF
# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
{ fetchurl, mirror }:
{
Expand All @@ -29,7 +38,7 @@ gawk -F , "{ print \$1 }" $csv | sort | uniq | while read name; do
filename=$(gawk -F , "/^$name,$latestVersion,/ { print \$4 }" $csv)
url="${src:2}"
sha256=$(nix-hash --type sha256 --base32 --flat "$src")
cat <<EOF
cat >>"$SRCS" <<EOF
$name = {
version = "$latestVersion";
src = fetchurl {
Expand All @@ -41,7 +50,7 @@ gawk -F , "{ print \$1 }" $csv | sort | uniq | while read name; do
EOF
done

echo "}"
echo "}" >>"$SRCS"

popd >/dev/null
rm -fr $tmp >/dev/null
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions branches/nm-containers/maintainers/scripts/generate-qt.sh

This file was deleted.

Expand Up @@ -25,14 +25,10 @@ effect after you run <command>nixos-rebuild</command>.</para>
<xi:include href="linux-kernel.xml" />
<xi:include href="grsecurity.xml" />

<!-- FIXME: auto-include NixOS module docs -->
<xi:include href="postgresql.xml" />
<xi:include href="gitlab.xml" />
<xi:include href="taskserver.xml" />
<xi:include href="acme.xml" />
<xi:include href="input-methods.xml" />
<xi:include href="emacs.xml" />
<xi:include href="modules.xml" xpointer="xpointer(//section[@id='modules']/*)" />

<!-- Apache; libvirtd virtualisation -->

</part>

11 changes: 10 additions & 1 deletion branches/nm-containers/nixos/doc/manual/default.nix
@@ -1,4 +1,4 @@
{ pkgs, options, version, revision, extraSources ? [] }:
{ pkgs, options, config, version, revision, extraSources ? [] }:

with pkgs;

Expand Down Expand Up @@ -51,6 +51,14 @@ let

sources = lib.sourceFilesBySuffices ./. [".xml"];

modulesDoc = builtins.toFile "modules.xml" ''
<section xmlns:xi="http://www.w3.org/2001/XInclude" id="modules">
${(lib.concatMapStrings (path: ''
<xi:include href="${path}" />
'') (lib.catAttrs "value" config.meta.doc))}
</section>
'';

copySources =
''
cp -prd $sources/* . # */
Expand All @@ -61,6 +69,7 @@ let
cp ${../../modules/security/acme.xml} configuration/acme.xml
cp ${../../modules/i18n/input-method/default.xml} configuration/input-methods.xml
cp ${../../modules/services/editors/emacs.xml} configuration/emacs.xml
ln -s ${modulesDoc} configuration/modules.xml
ln -s ${optionsDocBook} options-db.xml
echo "${version}" > version
'';
Expand Down
35 changes: 35 additions & 0 deletions branches/nm-containers/nixos/doc/manual/release-notes/rl-1603.xml
Expand Up @@ -385,6 +385,41 @@ services.syncthing = {
the github issue</link>.
</para>
</listitem>

<listitem>
<para>
The <literal>services.xserver.startGnuPGAgent</literal> option has been removed.
GnuPG 2.1.x changed the way the gpg-agent works, and that new approach no
longer requires (or even supports) the "start everything as a child of the
agent" scheme we've implemented in NixOS for older versions.
To configure the gpg-agent for your X session, add the following code to
<filename>~/.bashrc</filename> or some file that’s sourced when your shell is started:
<programlisting>
GPG_TTY=$(tty)
export GPG_TTY
</programlisting>
If you want to use gpg-agent for SSH, too, add the following to your session
initialization (e.g. <literal>displayManager.sessionCommands</literal>)
<programlisting>
gpg-connect-agent /bye
unset SSH_AGENT_PID
export SSH_AUTH_SOCK="''${HOME}/.gnupg/S.gpg-agent.ssh"
</programlisting>
and make sure that
<programlisting>
enable-ssh-support
</programlisting>
is included in your <filename>~/.gnupg/gpg-agent.conf</filename>.
You will need to use <command>ssh-add</command> to re-add your ssh keys.
If gpg’s automatic transformation of the private keys to the new format fails,
you will need to re-import your private keyring as well:
<programlisting>
gpg --import ~/.gnupg/secring.gpg
</programlisting>
The <command>gpg-agent(1)</command> man page has more details about this subject,
i.e. in the "EXAMPLES" section.
</para>
</listitem>
</itemizedlist>


Expand Down
9 changes: 9 additions & 0 deletions branches/nm-containers/nixos/lib/utils.nix
Expand Up @@ -2,6 +2,15 @@ pkgs: with pkgs.lib;

rec {

# Check whenever fileSystem is needed for boot
fsNeededForBoot = fs: fs.neededForBoot
|| elem fs.mountPoint [ "/" "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ];

# Check whenever `b` depends on `a` as a fileSystem
# FIXME: it's incorrect to simply use hasPrefix here: "/dev/a" is not a parent of "/dev/ab"
fsBefore = a: b: ((any (x: elem x [ "bind" "move" ]) b.options) && (a.mountPoint == b.device))
|| (hasPrefix a.mountPoint b.mountPoint);

# Escape a path according to the systemd rules, e.g. /dev/xyzzy
# becomes dev-xyzzy. FIXME: slow.
escapeSystemdPath = s:
Expand Down
2 changes: 1 addition & 1 deletion branches/nm-containers/nixos/modules/config/pulseaudio.nix
Expand Up @@ -34,7 +34,7 @@ let
${addModuleIf cfg.zeroconf.publish.enable "module-zeroconf-publish"}
${addModuleIf cfg.zeroconf.discovery.enable "module-zeroconf-discover"}
${addModuleIf cfg.tcp.enable (concatStringsSep " "
([ "load-module module-native-protocol-tcp" ] ++ allAnon ++ ipAnon))}
([ "module-native-protocol-tcp" ] ++ allAnon ++ ipAnon))}
${cfg.extraConfig}
'';
};
Expand Down
Expand Up @@ -62,4 +62,9 @@ in
environment.systemPackages = [ cfg.package gtk2_cache gtk3_cache ];
};

meta = {
maintainers = with lib.maintainers; [ ericsagnes ];
doc = ./default.xml;
};

}

0 comments on commit cc96ede

Please sign in to comment.