Merge branch 'master' into staging
This commit is contained in:
commit
52e1a198cf
@ -4,7 +4,8 @@
|
|||||||
"jhasse"
|
"jhasse"
|
||||||
],
|
],
|
||||||
"alwaysNotifyForPaths": [
|
"alwaysNotifyForPaths": [
|
||||||
{ "name": "FRidh", "files": ["pkgs/top-level/python-packages.nix", "pkgs/development/interpreters/python/*", "pkgs/development/python-modules/*" ] }
|
{ "name": "FRidh", "files": ["pkgs/top-level/python-packages.nix", "pkgs/development/interpreters/python/*", "pkgs/development/python-modules/*" ] },
|
||||||
|
{ "name": "copumpkin", "files": ["pkgs/stdenv/darwin/*", "pkgs/os-specific/darwin/apple-source-releases/*"] }
|
||||||
],
|
],
|
||||||
"fileBlacklist": ["pkgs/top-level/all-packages.nix"]
|
"fileBlacklist": ["pkgs/top-level/all-packages.nix"]
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ deis = buildGoPackage rec {
|
|||||||
sha256 = "1qv9lxqx7m18029lj8cw3k7jngvxs4iciwrypdy0gd2nnghc68sw";
|
sha256 = "1qv9lxqx7m18029lj8cw3k7jngvxs4iciwrypdy0gd2nnghc68sw";
|
||||||
};
|
};
|
||||||
|
|
||||||
goDeps = ./deps.json; <co xml:id='ex-buildGoPackage-3' />
|
goDeps = ./deps.nix; <co xml:id='ex-buildGoPackage-3' />
|
||||||
|
|
||||||
buildFlags = "--tags release"; <co xml:id='ex-buildGoPackage-4' />
|
buildFlags = "--tags release"; <co xml:id='ex-buildGoPackage-4' />
|
||||||
}
|
}
|
||||||
@ -56,7 +56,9 @@ the following arguments are of special significance to the function:
|
|||||||
<callout arearefs='ex-buildGoPackage-3'>
|
<callout arearefs='ex-buildGoPackage-3'>
|
||||||
<para>
|
<para>
|
||||||
<varname>goDeps</varname> is where the Go dependencies of a Go program are listed
|
<varname>goDeps</varname> is where the Go dependencies of a Go program are listed
|
||||||
in a JSON format described below.
|
as a list of package source identified by Go import path.
|
||||||
|
It could be imported as a separate <varname>deps.nix</varname> file for
|
||||||
|
readability. The dependency data structure is described below.
|
||||||
</para>
|
</para>
|
||||||
</callout>
|
</callout>
|
||||||
|
|
||||||
@ -70,23 +72,32 @@ the following arguments are of special significance to the function:
|
|||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <varname>goDeps</varname> attribute should point to a JSON file that defines which Go libraries
|
<para>The <varname>goDeps</varname> attribute can be imported from a separate
|
||||||
are needed and should be included in <varname>GOPATH</varname> for <varname>buildPhase</varname>.
|
<varname>nix</varname> file that defines which Go libraries are needed and should
|
||||||
|
be included in <varname>GOPATH</varname> for <varname>buildPhase</varname>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<example xml:id='ex-goDeps'><title>deps.json</title>
|
<example xml:id='ex-goDeps'><title>deps.nix</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
[ <co xml:id='ex-goDeps-1' />
|
[ <co xml:id='ex-goDeps-1' />
|
||||||
{
|
{
|
||||||
"goPackagePath": "gopkg.in/yaml.v2", <co xml:id='ex-goDeps-2' />
|
goPackagePath = "gopkg.in/yaml.v2"; <co xml:id='ex-goDeps-2' />
|
||||||
"fetch": {
|
fetch = {
|
||||||
"type": "git", <co xml:id='ex-goDeps-3' />
|
type = "git"; <co xml:id='ex-goDeps-3' />
|
||||||
"url": "https://gopkg.in/yaml.v2",
|
url = "https://gopkg.in/yaml.v2";
|
||||||
"rev": "a83829b6f1293c91addabc89d0571c246397bbf4",
|
rev = "a83829b6f1293c91addabc89d0571c246397bbf4";
|
||||||
"sha256": "1m4dsmk90sbi17571h6pld44zxz7jc4lrnl4f27dpd1l8g5xvjhh"
|
sha256 = "1m4dsmk90sbi17571h6pld44zxz7jc4lrnl4f27dpd1l8g5xvjhh";
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/docopt/docopt-go";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/docopt/docopt-go";
|
||||||
|
rev = "784ddc588536785e7299f7272f39101f7faccc3f";
|
||||||
|
sha256 = "0wwz48jl9fvl1iknvn9dqr4gfy1qs03gxaikrxxp9gry6773v3sj";
|
||||||
|
};
|
||||||
|
}
|
||||||
]
|
]
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
@ -86,6 +86,7 @@
|
|||||||
cko = "Christine Koppelt <christine.koppelt@gmail.com>";
|
cko = "Christine Koppelt <christine.koppelt@gmail.com>";
|
||||||
cleverca22 = "Michael Bishop <cleverca22@gmail.com>";
|
cleverca22 = "Michael Bishop <cleverca22@gmail.com>";
|
||||||
cmcdragonkai = "Roger Qiu <roger.qiu@matrix.ai>";
|
cmcdragonkai = "Roger Qiu <roger.qiu@matrix.ai>";
|
||||||
|
cmfwyp = "cmfwyp <cmfwyp@riseup.net>";
|
||||||
coconnor = "Corey O'Connor <coreyoconnor@gmail.com>";
|
coconnor = "Corey O'Connor <coreyoconnor@gmail.com>";
|
||||||
codsl = "codsl <codsl@riseup.net>";
|
codsl = "codsl <codsl@riseup.net>";
|
||||||
codyopel = "Cody Opel <codyopel@gmail.com>";
|
codyopel = "Cody Opel <codyopel@gmail.com>";
|
||||||
@ -168,6 +169,7 @@
|
|||||||
grahamc = "Graham Christensen <graham@grahamc.com>";
|
grahamc = "Graham Christensen <graham@grahamc.com>";
|
||||||
gridaphobe = "Eric Seidel <eric@seidel.io>";
|
gridaphobe = "Eric Seidel <eric@seidel.io>";
|
||||||
guibert = "David Guibert <david.guibert@gmail.com>";
|
guibert = "David Guibert <david.guibert@gmail.com>";
|
||||||
|
hakuch = "Jesse Haber-Kucharsky <hakuch@gmail.com>";
|
||||||
havvy = "Ryan Scheel <ryan.havvy@gmail.com>";
|
havvy = "Ryan Scheel <ryan.havvy@gmail.com>";
|
||||||
hbunke = "Hendrik Bunke <bunke.hendrik@gmail.com>";
|
hbunke = "Hendrik Bunke <bunke.hendrik@gmail.com>";
|
||||||
hce = "Hans-Christian Esperer <hc@hcesperer.org>";
|
hce = "Hans-Christian Esperer <hc@hcesperer.org>";
|
||||||
|
@ -31,9 +31,9 @@ options = {
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>type</varname></term>
|
<term><varname>type</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The type of the option (see below). It may be omitted,
|
<para>The type of the option (see <xref linkend='sec-option-types' />).
|
||||||
but that’s not advisable since it may lead to errors that are
|
It may be omitted, but that’s not advisable since it may lead to errors
|
||||||
hard to diagnose.</para>
|
that are hard to diagnose.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@ -65,86 +65,4 @@ options = {
|
|||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>Here is a non-exhaustive list of option types:
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.bool</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A Boolean.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.int</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>An integer.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.str</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A string.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.lines</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A string. If there are multiple definitions, they are
|
|
||||||
concatenated, with newline characters in between.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.path</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A path, defined as anything that, when coerced to a
|
|
||||||
string, starts with a slash. This includes derivations.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.package</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A derivation (such as <literal>pkgs.hello</literal>) or a
|
|
||||||
store path (such as
|
|
||||||
<filename>/nix/store/1ifi1cfbfs5iajmvwgrbmrnrw3a147h9-hello-2.10</filename>).</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.listOf</varname> <replaceable>t</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A list of elements of type <replaceable>t</replaceable>
|
|
||||||
(e.g., <literal>types.listOf types.str</literal> is a list of
|
|
||||||
strings). Multiple definitions are concatenated together.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.attrsOf</varname> <replaceable>t</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>A set of elements of type <replaceable>t</replaceable>
|
|
||||||
(e.g., <literal>types.attrsOf types.int</literal> is a set of
|
|
||||||
name/value pairs, the values being integers).</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.nullOr</varname> <replaceable>t</replaceable></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Either the value <literal>null</literal> or something of
|
|
||||||
type <replaceable>t</replaceable>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
You can also create new types using the function
|
|
||||||
<varname>mkOptionType</varname>. See
|
|
||||||
<filename>lib/types.nix</filename> in Nixpkgs for details.</para>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
394
nixos/doc/manual/development/option-types.xml
Normal file
394
nixos/doc/manual/development/option-types.xml
Normal file
@ -0,0 +1,394 @@
|
|||||||
|
<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-option-types">
|
||||||
|
|
||||||
|
<title>Options Types</title>
|
||||||
|
|
||||||
|
<para>Option types are a way to put constraints on the values a module option
|
||||||
|
can take.
|
||||||
|
Types are also responsible of how values are merged in case of multiple
|
||||||
|
value definitions.</para>
|
||||||
|
<section><title>Basic Types</title>
|
||||||
|
|
||||||
|
<para>Basic types are the simplest available types in the module system.
|
||||||
|
Basic types include multiple string types that mainly differ in how
|
||||||
|
definition merging is handled.</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.bool</varname></term>
|
||||||
|
<listitem><para>A boolean, its values can be <literal>true</literal> or
|
||||||
|
<literal>false</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.int</varname></term>
|
||||||
|
<listitem><para>An integer.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.path</varname></term>
|
||||||
|
<listitem><para>A filesystem path, defined as anything that when coerced to
|
||||||
|
a string starts with a slash. Even if derivations can be considered as
|
||||||
|
path, the more specific <literal>types.package</literal> should be
|
||||||
|
preferred.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.package</varname></term>
|
||||||
|
<listitem><para>A derivation or a store path.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<para>String related types:</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.str</varname></term>
|
||||||
|
<listitem><para>A string. Multiple definitions cannot be
|
||||||
|
merged.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.lines</varname></term>
|
||||||
|
<listitem><para>A string. Multiple definitions are concatenated with a new
|
||||||
|
line <literal>"\n"</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.commas</varname></term>
|
||||||
|
<listitem><para>A string. Multiple definitions are concatenated with a comma
|
||||||
|
<literal>","</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.envVar</varname></term>
|
||||||
|
<listitem><para>A string. Multiple definitions are concatenated with a
|
||||||
|
collon <literal>":"</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.separatedString</varname>
|
||||||
|
<replaceable>sep</replaceable></term>
|
||||||
|
<listitem><para>A string with a custom separator
|
||||||
|
<replaceable>sep</replaceable>, e.g. <literal>types.separatedString
|
||||||
|
"|"</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section><title>Composed Types</title>
|
||||||
|
|
||||||
|
<para>Composed types allow to create complex types by taking another type(s)
|
||||||
|
or value(s) as parameter(s).
|
||||||
|
It is possible to compose types multiple times, e.g. <literal>with types;
|
||||||
|
nullOr (enum [ "left" "right" ])</literal>.</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.listOf</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para>A list of <replaceable>t</replaceable> type, e.g.
|
||||||
|
<literal>types.listOf int</literal>. Multiple definitions are merged
|
||||||
|
with list concatenation.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.attrsOf</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para>An attribute set of where all the values are of
|
||||||
|
<replaceable>t</replaceable> type. Multiple definitions result in the
|
||||||
|
joined attribute set.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.loaOf</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para>An attribute set or a list of <replaceable>t</replaceable>
|
||||||
|
type. Multiple definitions are merged according to the
|
||||||
|
value.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.loeOf</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para>A list or an element of <replaceable>t</replaceable> type.
|
||||||
|
Multiple definitions are merged according to the
|
||||||
|
values.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.nullOr</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para><literal>null</literal> or type
|
||||||
|
<replaceable>t</replaceable>. Multiple definitions are merged according
|
||||||
|
to type <replaceable>t</replaceable>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.uniq</varname> <replaceable>t</replaceable></term>
|
||||||
|
<listitem><para>Ensures that type <replaceable>t</replaceable> cannot be
|
||||||
|
merged. It is used to ensure option definitions are declared only
|
||||||
|
once.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.enum</varname> <replaceable>l</replaceable></term>
|
||||||
|
<listitem><para>One element of the list <replaceable>l</replaceable>, e.g.
|
||||||
|
<literal>types.enum [ "left" "right" ]</literal>. Multiple definitions
|
||||||
|
cannot be merged</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.either</varname> <replaceable>t1</replaceable>
|
||||||
|
<replaceable>t2</replaceable></term>
|
||||||
|
<listitem><para>Type <replaceable>t1</replaceable> or type
|
||||||
|
<replaceable>t2</replaceable>, e.g. <literal>with types; either int
|
||||||
|
str</literal>. Multiple definitions cannot be
|
||||||
|
merged.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.submodule</varname> <replaceable>o</replaceable></term>
|
||||||
|
<listitem><para>A set of sub options <replaceable>o</replaceable>.
|
||||||
|
<replaceable>o</replaceable> can be an attribute set or a function
|
||||||
|
returning an attribute set. Submodules are used in composed types to
|
||||||
|
create modular options. Submodule are detailed in <xref
|
||||||
|
linkend='section-option-types-submodule' />.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section xml:id='section-option-types-submodule'><title>Submodule</title>
|
||||||
|
|
||||||
|
<para>Submodule is a very powerful type that defines a set of sub-options that
|
||||||
|
are handled like a separate module.
|
||||||
|
It is especially interesting when used with composed types like
|
||||||
|
<literal>attrsOf</literal> or <literal>listOf</literal>.</para>
|
||||||
|
|
||||||
|
<para>The submodule type take a parameter <replaceable>o</replaceable>, that
|
||||||
|
should be a set, or a function returning a set with an
|
||||||
|
<literal>options</literal> key defining the sub-options.
|
||||||
|
The option set can be defined directly (<xref linkend='ex-submodule-direct'
|
||||||
|
/>) or as reference (<xref linkend='ex-submodule-reference' />).</para>
|
||||||
|
|
||||||
|
<para>Submodule option definitions are type-checked accordingly to the options
|
||||||
|
declarations. It is possible to declare submodule options inside a submodule
|
||||||
|
sub-options for even higher modularity.</para>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-direct'><title>Directly defined submodule</title>
|
||||||
|
<screen>
|
||||||
|
options.mod = mkOption {
|
||||||
|
name = "mod";
|
||||||
|
description = "submodule example";
|
||||||
|
type = with types; listOf (submodule {
|
||||||
|
options = {
|
||||||
|
foo = mkOption {
|
||||||
|
type = int;
|
||||||
|
};
|
||||||
|
bar = mkOption {
|
||||||
|
type = str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};</screen></example>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-reference'><title>Submodule defined as a
|
||||||
|
reference</title>
|
||||||
|
<screen>
|
||||||
|
let
|
||||||
|
modOptions = {
|
||||||
|
options = {
|
||||||
|
foo = mkOption {
|
||||||
|
type = int;
|
||||||
|
};
|
||||||
|
bar = mkOption {
|
||||||
|
type = int;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
options.mod = mkOption {
|
||||||
|
description = "submodule example";
|
||||||
|
type = with types; listOf (submodule modOptions);
|
||||||
|
};</screen></example>
|
||||||
|
|
||||||
|
|
||||||
|
<section><title>Composed with <literal>listOf</literal></title>
|
||||||
|
|
||||||
|
<para>When composed with <literal>listOf</literal>, submodule allows multiple
|
||||||
|
definitions of the submodule option set.</para>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-listof-declaration'><title>Declaration of a list
|
||||||
|
of submodules</title>
|
||||||
|
<screen>
|
||||||
|
options.mod = mkOption {
|
||||||
|
description = "submodule example";
|
||||||
|
type = with types; listOf (submodule {
|
||||||
|
options = {
|
||||||
|
foo = mkOption {
|
||||||
|
type = int;
|
||||||
|
};
|
||||||
|
bar = mkOption {
|
||||||
|
type = str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};</screen></example>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-listof-definition'><title>Definition of a list of
|
||||||
|
submodules</title>
|
||||||
|
<screen>
|
||||||
|
config.mod = [
|
||||||
|
{ foo = 1; bar = "one"; }
|
||||||
|
{ foo = 2; bar = "two"; }
|
||||||
|
];</screen></example>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section><title>Composed with <literal>attrsOf</literal></title>
|
||||||
|
|
||||||
|
<para>When composed with <literal>attrsOf</literal>, submodule allows multiple
|
||||||
|
named definitions of the submodule option set.</para>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-attrsof-declaration'><title>Declaration of
|
||||||
|
attribute sets of submodules</title>
|
||||||
|
<screen>
|
||||||
|
options.mod = mkOption {
|
||||||
|
description = "submodule example";
|
||||||
|
type = with types; attrsOf (submodule {
|
||||||
|
options = {
|
||||||
|
foo = mkOption {
|
||||||
|
type = int;
|
||||||
|
};
|
||||||
|
bar = mkOption {
|
||||||
|
type = str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};</screen></example>
|
||||||
|
|
||||||
|
<example xml:id='ex-submodule-attrsof-definition'><title>Declaration of
|
||||||
|
attribute sets of submodules</title>
|
||||||
|
<screen>
|
||||||
|
config.mod.one = { foo = 1; bar = "one"; };
|
||||||
|
config.mod.two = { foo = 2; bar = "two"; };</screen></example>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section><title>Extending types</title>
|
||||||
|
|
||||||
|
<para>Types are mainly characterized by their <literal>check</literal> and
|
||||||
|
<literal>merge</literal> functions.</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>check</varname></term>
|
||||||
|
<listitem><para>The function to type check the value. Takes a value as
|
||||||
|
parameter and return a boolean.
|
||||||
|
It is possible to extend a type check with the
|
||||||
|
<literal>addCheck</literal> function (<xref
|
||||||
|
linkend='ex-extending-type-check-1' />), or to fully override the
|
||||||
|
check function (<xref linkend='ex-extending-type-check-2' />).</para>
|
||||||
|
|
||||||
|
<example xml:id='ex-extending-type-check-1'><title>Adding a type check</title>
|
||||||
|
<screen>
|
||||||
|
byte = mkOption {
|
||||||
|
description = "An integer between 0 and 255.";
|
||||||
|
type = addCheck (x: x >= 0 && x <= 255) types.int;
|
||||||
|
};</screen></example>
|
||||||
|
|
||||||
|
<example xml:id='ex-extending-type-check-2'><title>Overriding a type
|
||||||
|
check</title>
|
||||||
|
<screen>
|
||||||
|
nixThings = mkOption {
|
||||||
|
description = "words that start with 'nix'";
|
||||||
|
type = types.str // {
|
||||||
|
check = (x: lib.hasPrefix "nix" x)
|
||||||
|
};
|
||||||
|
};</screen></example>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>merge</varname></term>
|
||||||
|
<listitem><para>Function to merge the options values when multiple values
|
||||||
|
are set.
|
||||||
|
The function takes two parameters, <literal>loc</literal> the option path as a
|
||||||
|
list of strings, and <literal>defs</literal> the list of defined values as a
|
||||||
|
list.
|
||||||
|
It is possible to override a type merge function for custom
|
||||||
|
needs.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section><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
|
||||||
|
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/types.nix">types.nix</filename>
|
||||||
|
code before creating a new type.</para>
|
||||||
|
|
||||||
|
<para>The only required parameter is <literal>name</literal>.</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>name</varname></term>
|
||||||
|
<listitem><para>A string representation of the type function name, name
|
||||||
|
usually changes accordingly parameters passed to
|
||||||
|
types.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>check</varname></term>
|
||||||
|
<listitem><para>A function to type check the definition value. Takes the
|
||||||
|
definition value as a parameter and returns a boolean indicating the
|
||||||
|
type check result, <literal>true</literal> for success and
|
||||||
|
<literal>false</literal> for failure.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>merge</varname></term>
|
||||||
|
<listitem><para>A function to merge multiple definitions values. Takes two
|
||||||
|
parameters:</para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable>loc</replaceable></term>
|
||||||
|
<listitem><para>The option path as a list of strings, e.g.
|
||||||
|
<literal>["boot" "loader "grub"
|
||||||
|
"enable"]</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable>defs</replaceable></term>
|
||||||
|
<listitem><para>The list of sets of defined <literal>value</literal>
|
||||||
|
and <literal>file</literal> where the value was defined, e.g.
|
||||||
|
<literal>[ { file = "/foo.nix"; value = 1; } { file = "/bar.nix";
|
||||||
|
value = 2 } ]</literal>. The <literal>merge</literal> function
|
||||||
|
should return the merged value or throw an error in case the
|
||||||
|
values are impossible or not meant to be merged.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>getSubOptions</varname></term>
|
||||||
|
<listitem><para>For composed types that can take a submodule as type
|
||||||
|
parameter, this function generate sub-options documentation. It takes
|
||||||
|
the current option prefix as a list and return the set of sub-options.
|
||||||
|
Usually defined in a recursive manner by adding a term to the prefix,
|
||||||
|
e.g. <literal>prefix: elemType.getSubOptions (prefix ++
|
||||||
|
[<replaceable>"prefix"</replaceable>])</literal> where
|
||||||
|
<replaceable>"prefix"</replaceable> is the newly added
|
||||||
|
prefix.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>getSubModules</varname></term>
|
||||||
|
<listitem><para>For composed types that can take a submodule as type
|
||||||
|
parameter, this function should return the type parameters submodules.
|
||||||
|
If the type parameter is called <literal>elemType</literal>, the
|
||||||
|
function should just recursively look into submodules by returning
|
||||||
|
<literal>elemType.getSubModules;</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>substSubModules</varname></term>
|
||||||
|
<listitem><para>For composed types that can take a submodule as type
|
||||||
|
parameter, this function can be used to substitute the parameter of a
|
||||||
|
submodule type. It takes a module as parameter and return the type with
|
||||||
|
the submodule options substituted. It is usally defined as a type
|
||||||
|
function call with a recursive call to
|
||||||
|
<literal>substSubModules</literal>, e.g for a type
|
||||||
|
<literal>composedType</literal> that take an <literal>elemtype</literal>
|
||||||
|
type parameter, this function should be defined as <literal>m:
|
||||||
|
composedType (elemType.substSubModules m)</literal>.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</section>
|
@ -176,6 +176,7 @@ in {
|
|||||||
</example>
|
</example>
|
||||||
|
|
||||||
<xi:include href="option-declarations.xml" />
|
<xi:include href="option-declarations.xml" />
|
||||||
|
<xi:include href="option-types.xml" />
|
||||||
<xi:include href="option-def.xml" />
|
<xi:include href="option-def.xml" />
|
||||||
<xi:include href="meta-attributes.xml" />
|
<xi:include href="meta-attributes.xml" />
|
||||||
|
|
||||||
|
@ -90,6 +90,22 @@ following incompatible changes:</para>
|
|||||||
Use <literal>security.audit.enable = true;</literal> to explicitly enable it.</para>
|
Use <literal>security.audit.enable = true;</literal> to explicitly enable it.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<literal>pkgs.linuxPackages.virtualbox</literal> now contains only the
|
||||||
|
kernel modules instead of the VirtualBox user space binaries.
|
||||||
|
If you want to reference the user space binaries, you have to use the new
|
||||||
|
<literal>pkgs.virtualbox</literal> instead.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><literal>goPackages</literal> was replaced with separated Go applications
|
||||||
|
in appropriate <literal>nixpkgs</literal> categories. Each Go package uses its own
|
||||||
|
dependency set defined in nix. There's also a new <literal>go2nix</literal>
|
||||||
|
tool introduced to generate Go package definition from its Go source automatically.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,11 @@ following incompatible changes:</para>
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para></para>
|
<para>
|
||||||
|
<literal>gnome</literal> alias has been removed along with
|
||||||
|
<literal>gtk</literal>, <literal>gtkmm</literal> and several others.
|
||||||
|
Now you need to use versioned attributes, like <literal>gnome3</literal>.
|
||||||
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
@ -181,9 +181,11 @@ rec {
|
|||||||
eval $i2=/tmp/xchg/$_basename
|
eval $i2=/tmp/xchg/$_basename
|
||||||
${coreutils}/bin/ls -la $xchg
|
${coreutils}/bin/ls -la $xchg
|
||||||
done
|
done
|
||||||
unset i i2 _basename xchg
|
|
||||||
|
|
||||||
export > $xchg/saved-env
|
unset i i2 _basename
|
||||||
|
export | ${gnugrep}/bin/grep -v '^xchg=' > $xchg/saved-env
|
||||||
|
unset xchg
|
||||||
|
|
||||||
export tests='${testScript}'
|
export tests='${testScript}'
|
||||||
${testDriver}/bin/nixos-test-driver ${vm.config.system.build.vm}/bin/run-*-vm
|
${testDriver}/bin/nixos-test-driver ${vm.config.system.build.vm}/bin/run-*-vm
|
||||||
''; # */
|
''; # */
|
||||||
|
61
nixos/modules/hardware/video/displaylink.nix
Normal file
61
nixos/modules/hardware/video/displaylink.nix
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
enabled = elem "displaylink" config.services.xserver.videoDrivers;
|
||||||
|
|
||||||
|
displaylink = config.boot.kernelPackages.displaylink;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf enabled {
|
||||||
|
|
||||||
|
boot.extraModulePackages = [ displaylink ];
|
||||||
|
|
||||||
|
boot.kernelModules = [ "evdi" ];
|
||||||
|
|
||||||
|
# Those are taken from displaylink-installer.sh and from Arch Linux AUR package.
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{bNumInterfaces}=="*5", TAG+="uaccess"
|
||||||
|
'';
|
||||||
|
|
||||||
|
powerManagement.powerDownCommands = ''
|
||||||
|
#flush any bytes in pipe
|
||||||
|
while read -n 1 -t 1 SUSPEND_RESULT < /tmp/PmMessagesPort_out; do : ; done;
|
||||||
|
|
||||||
|
#suspend DisplayLinkManager
|
||||||
|
echo "S" > /tmp/PmMessagesPort_in
|
||||||
|
|
||||||
|
#wait until suspend of DisplayLinkManager finish
|
||||||
|
read -n 1 -t 10 SUSPEND_RESULT < /tmp/PmMessagesPort_out
|
||||||
|
'';
|
||||||
|
|
||||||
|
powerManagement.resumeCommands = ''
|
||||||
|
#resume DisplayLinkManager
|
||||||
|
echo "R" > /tmp/PmMessagesPort_in
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemd.services.displaylink = {
|
||||||
|
description = "DisplayLink Manager Service";
|
||||||
|
after = [ "display-manager.service" ];
|
||||||
|
wantedBy = [ "graphical.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${displaylink}/bin/DisplayLinkManager";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
preStart = ''
|
||||||
|
mkdir -p /var/log/displaylink
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -527,8 +527,11 @@ EOF
|
|||||||
# Use the GRUB 2 boot loader.
|
# Use the GRUB 2 boot loader.
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
boot.loader.grub.version = 2;
|
boot.loader.grub.version = 2;
|
||||||
|
# boot.loader.grub.efiSupport = true;
|
||||||
|
# boot.loader.grub.efiInstallAsRemovable = true;
|
||||||
|
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
# Define on which hard drive you want to install Grub.
|
# Define on which hard drive you want to install Grub.
|
||||||
# boot.loader.grub.device = "/dev/sda";
|
# boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +274,8 @@
|
|||||||
gocd-server = 252;
|
gocd-server = 252;
|
||||||
terraria = 253;
|
terraria = 253;
|
||||||
mattermost = 254;
|
mattermost = 254;
|
||||||
|
prometheus = 255;
|
||||||
|
telegraf = 256;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
@ -518,6 +520,8 @@
|
|||||||
gocd-server = 252;
|
gocd-server = 252;
|
||||||
terraria = 253;
|
terraria = 253;
|
||||||
mattermost = 254;
|
mattermost = 254;
|
||||||
|
prometheus = 255;
|
||||||
|
#telegraf = 256; # unused
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing
|
# When adding a gid, make sure it doesn't match an existing
|
||||||
# uid. Users and groups with the same name should have equal
|
# uid. Users and groups with the same name should have equal
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
./hardware/video/amdgpu.nix
|
./hardware/video/amdgpu.nix
|
||||||
./hardware/video/ati.nix
|
./hardware/video/ati.nix
|
||||||
./hardware/video/bumblebee.nix
|
./hardware/video/bumblebee.nix
|
||||||
|
./hardware/video/displaylink.nix
|
||||||
./hardware/video/nvidia.nix
|
./hardware/video/nvidia.nix
|
||||||
./hardware/video/webcam/facetimehd.nix
|
./hardware/video/webcam/facetimehd.nix
|
||||||
./i18n/input-method/default.nix
|
./i18n/input-method/default.nix
|
||||||
@ -287,6 +288,8 @@
|
|||||||
./services/monitoring/monit.nix
|
./services/monitoring/monit.nix
|
||||||
./services/monitoring/munin.nix
|
./services/monitoring/munin.nix
|
||||||
./services/monitoring/nagios.nix
|
./services/monitoring/nagios.nix
|
||||||
|
./services/monitoring/prometheus/default.nix
|
||||||
|
./services/monitoring/prometheus/node-exporter.nix
|
||||||
./services/monitoring/riemann.nix
|
./services/monitoring/riemann.nix
|
||||||
./services/monitoring/riemann-dash.nix
|
./services/monitoring/riemann-dash.nix
|
||||||
./services/monitoring/riemann-tools.nix
|
./services/monitoring/riemann-tools.nix
|
||||||
@ -295,6 +298,7 @@
|
|||||||
./services/monitoring/statsd.nix
|
./services/monitoring/statsd.nix
|
||||||
./services/monitoring/systemhealth.nix
|
./services/monitoring/systemhealth.nix
|
||||||
./services/monitoring/teamviewer.nix
|
./services/monitoring/teamviewer.nix
|
||||||
|
./services/monitoring/telegraf.nix
|
||||||
./services/monitoring/ups.nix
|
./services/monitoring/ups.nix
|
||||||
./services/monitoring/uptime.nix
|
./services/monitoring/uptime.nix
|
||||||
./services/monitoring/zabbix-agent.nix
|
./services/monitoring/zabbix-agent.nix
|
||||||
|
@ -15,7 +15,6 @@ with lib;
|
|||||||
(mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "networking" "enableRalinkFirmware" ])
|
(mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "networking" "enableRalinkFirmware" ])
|
||||||
|
|
||||||
(mkRenamedOptionModule [ "services" "cadvisor" "host" ] [ "services" "cadvisor" "listenAddress" ])
|
(mkRenamedOptionModule [ "services" "cadvisor" "host" ] [ "services" "cadvisor" "listenAddress" ])
|
||||||
(mkRenamedOptionModule [ "services" "dockerRegistry" "host" ] [ "services" "dockerRegistry" "listenAddress" ])
|
|
||||||
(mkRenamedOptionModule [ "services" "elasticsearch" "host" ] [ "services" "elasticsearch" "listenAddress" ])
|
(mkRenamedOptionModule [ "services" "elasticsearch" "host" ] [ "services" "elasticsearch" "listenAddress" ])
|
||||||
(mkRenamedOptionModule [ "services" "graphite" "api" "host" ] [ "services" "graphite" "api" "listenAddress" ])
|
(mkRenamedOptionModule [ "services" "graphite" "api" "host" ] [ "services" "graphite" "api" "listenAddress" ])
|
||||||
(mkRenamedOptionModule [ "services" "graphite" "web" "host" ] [ "services" "graphite" "web" "listenAddress" ])
|
(mkRenamedOptionModule [ "services" "graphite" "web" "host" ] [ "services" "graphite" "web" "listenAddress" ])
|
||||||
@ -154,5 +153,7 @@ with lib;
|
|||||||
"See the 16.03 release notes for more information.")
|
"See the 16.03 release notes for more information.")
|
||||||
(mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ] "")
|
(mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ] "")
|
||||||
(mkRemovedOptionModule [ "services" "dovecot2" "package" ] "")
|
(mkRemovedOptionModule [ "services" "dovecot2" "package" ] "")
|
||||||
|
(mkRemovedOptionModule [ "services" "dockerRegistry" ]
|
||||||
|
"docker-registry has been deprecated upstream since a long time.")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -2,19 +2,19 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
meta = {
|
||||||
security.hideProcessInformation = mkEnableOption "" // { description = ''
|
maintainers = [ maintainers.joachifm ];
|
||||||
Restrict access to process information to the owning user. Enabling
|
doc = ./hidepid.xml;
|
||||||
this option implies, among other things, that command-line arguments
|
};
|
||||||
remain private. This option is recommended for most systems, unless
|
|
||||||
there's a legitimate reason for allowing unprivileged users to inspect
|
|
||||||
the process information of other users.
|
|
||||||
|
|
||||||
Members of the group "proc" are exempt from process information hiding.
|
options = {
|
||||||
To allow a service to run without process information hiding, add "proc"
|
security.hideProcessInformation = mkOption {
|
||||||
to its supplementary groups via
|
type = types.bool;
|
||||||
<option>systemd.services.<name?>.serviceConfig.SupplementaryGroups</option>.
|
default = false;
|
||||||
''; };
|
description = ''
|
||||||
|
Restrict process information to the owning user.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.security.hideProcessInformation {
|
config = mkIf config.security.hideProcessInformation {
|
||||||
|
33
nixos/modules/security/hidepid.xml
Normal file
33
nixos/modules/security/hidepid.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<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="sec-hidepid">
|
||||||
|
|
||||||
|
<title>Hiding process information</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Setting
|
||||||
|
<programlisting>
|
||||||
|
security.hideProcessInformation = true;
|
||||||
|
</programlisting>
|
||||||
|
ensures that access to process information is restricted to the
|
||||||
|
owning user. This implies, among other things, that command-line
|
||||||
|
arguments remain private. Unless your deployment relies on unprivileged
|
||||||
|
users being able to inspect the process information of other users, this
|
||||||
|
option should be safe to enable.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Members of the <literal>proc</literal> group are exempt from process
|
||||||
|
information hiding.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
To allow a service <replaceable>foo</replaceable> to run without process information hiding, set
|
||||||
|
<programlisting>
|
||||||
|
systemd.services.<replaceable>foo</replaceable>.serviceConfig.SupplementaryGroups = [ "proc" ];
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</chapter>
|
@ -229,104 +229,107 @@ let
|
|||||||
# module provides the right hooks.
|
# module provides the right hooks.
|
||||||
text = mkDefault
|
text = mkDefault
|
||||||
(''
|
(''
|
||||||
# Account management.
|
# Account management.
|
||||||
account sufficient pam_unix.so
|
account sufficient pam_unix.so
|
||||||
${optionalString use_ldap
|
'' + optionalString use_ldap ''
|
||||||
"account sufficient ${pam_ldap}/lib/security/pam_ldap.so"}
|
account sufficient ${pam_ldap}/lib/security/pam_ldap.so
|
||||||
${optionalString config.krb5.enable
|
'' + optionalString config.krb5.enable ''
|
||||||
"account sufficient ${pam_krb5}/lib/security/pam_krb5.so"}
|
account sufficient ${pam_krb5}/lib/security/pam_krb5.so
|
||||||
|
'' + ''
|
||||||
|
|
||||||
# Authentication management.
|
# Authentication management.
|
||||||
${optionalString cfg.rootOK
|
'' + optionalString cfg.rootOK ''
|
||||||
"auth sufficient pam_rootok.so"}
|
auth sufficient pam_rootok.so
|
||||||
${optionalString cfg.requireWheel
|
'' + optionalString cfg.requireWheel ''
|
||||||
"auth required pam_wheel.so use_uid"}
|
auth required pam_wheel.so use_uid
|
||||||
${optionalString cfg.logFailures
|
'' + optionalString cfg.logFailures ''
|
||||||
"auth required pam_tally.so"}
|
auth required pam_tally.so
|
||||||
${optionalString (config.security.pam.enableSSHAgentAuth && cfg.sshAgentAuth)
|
'' + optionalString (config.security.pam.enableSSHAgentAuth && cfg.sshAgentAuth) ''
|
||||||
"auth sufficient ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so file=~/.ssh/authorized_keys:~/.ssh/authorized_keys2:/etc/ssh/authorized_keys.d/%u"}
|
auth sufficient ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so file=~/.ssh/authorized_keys:~/.ssh/authorized_keys2:/etc/ssh/authorized_keys.d/%u
|
||||||
${optionalString cfg.fprintAuth
|
'' + optionalString cfg.fprintAuth ''
|
||||||
"auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so"}
|
auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so
|
||||||
${optionalString cfg.u2fAuth
|
'' + optionalString cfg.u2fAuth ''
|
||||||
"auth sufficient ${pkgs.pam_u2f}/lib/security/pam_u2f.so"}
|
auth sufficient ${pkgs.pam_u2f}/lib/security/pam_u2f.so
|
||||||
${optionalString cfg.usbAuth
|
'' + optionalString cfg.usbAuth ''
|
||||||
"auth sufficient ${pkgs.pam_usb}/lib/security/pam_usb.so"}
|
auth sufficient ${pkgs.pam_usb}/lib/security/pam_usb.so
|
||||||
'' +
|
''
|
||||||
# Modules in this block require having the password set in PAM_AUTHTOK.
|
|
||||||
# pam_unix is marked as 'sufficient' on NixOS which means nothing will run
|
|
||||||
# after it succeeds. Certain modules need to run after pam_unix
|
|
||||||
# prompts the user for password so we run it once with 'required' at an
|
|
||||||
# earlier point and it will run again with 'sufficient' further down.
|
|
||||||
# We use try_first_pass the second time to avoid prompting password twice
|
|
||||||
(optionalString (cfg.unixAuth && (config.security.pam.enableEcryptfs || cfg.pamMount)) ''
|
|
||||||
auth required pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} likeauth
|
|
||||||
${optionalString config.security.pam.enableEcryptfs
|
|
||||||
"auth optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so unwrap"}
|
|
||||||
${optionalString cfg.pamMount
|
|
||||||
"auth optional ${pkgs.pam_mount}/lib/security/pam_mount.so"}
|
|
||||||
'') + ''
|
|
||||||
${optionalString cfg.unixAuth
|
|
||||||
"auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} likeauth try_first_pass"}
|
|
||||||
${optionalString cfg.otpwAuth
|
|
||||||
"auth sufficient ${pkgs.otpw}/lib/security/pam_otpw.so"}
|
|
||||||
${let oath = config.security.pam.oath; in optionalString cfg.oathAuth
|
|
||||||
"auth sufficient ${pkgs.oathToolkit}/lib/security/pam_oath.so window=${toString oath.window} usersfile=${toString oath.usersFile} digits=${toString oath.digits}"}
|
|
||||||
${optionalString use_ldap
|
|
||||||
"auth sufficient ${pam_ldap}/lib/security/pam_ldap.so use_first_pass"}
|
|
||||||
${optionalString config.krb5.enable ''
|
|
||||||
auth [default=ignore success=1 service_err=reset] ${pam_krb5}/lib/security/pam_krb5.so use_first_pass
|
|
||||||
auth [default=die success=done] ${pam_ccreds}/lib/security/pam_ccreds.so action=validate use_first_pass
|
|
||||||
auth sufficient ${pam_ccreds}/lib/security/pam_ccreds.so action=store use_first_pass
|
|
||||||
''}
|
|
||||||
auth required pam_deny.so
|
|
||||||
|
|
||||||
# Password management.
|
# Modules in this block require having the password set in PAM_AUTHTOK.
|
||||||
password requisite pam_unix.so nullok sha512
|
# pam_unix is marked as 'sufficient' on NixOS which means nothing will run
|
||||||
${optionalString config.security.pam.enableEcryptfs
|
# after it succeeds. Certain modules need to run after pam_unix
|
||||||
"password optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so"}
|
# prompts the user for password so we run it once with 'required' at an
|
||||||
${optionalString cfg.pamMount
|
# earlier point and it will run again with 'sufficient' further down.
|
||||||
"password optional ${pkgs.pam_mount}/lib/security/pam_mount.so"}
|
# We use try_first_pass the second time to avoid prompting password twice
|
||||||
${optionalString use_ldap
|
+ optionalString (cfg.unixAuth && (config.security.pam.enableEcryptfs || cfg.pamMount)) (''
|
||||||
"password sufficient ${pam_ldap}/lib/security/pam_ldap.so"}
|
auth required pam_unix.so ${optionalString cfg.allowNullPassword "nullok "}likeauth
|
||||||
${optionalString config.krb5.enable
|
'' + optionalString config.security.pam.enableEcryptfs ''
|
||||||
"password sufficient ${pam_krb5}/lib/security/pam_krb5.so use_first_pass"}
|
auth optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so unwrap
|
||||||
${optionalString config.services.samba.syncPasswordsByPam
|
'' + optionalString cfg.pamMount ''
|
||||||
"password optional ${pkgs.samba}/lib/security/pam_smbpass.so nullok use_authtok try_first_pass"}
|
auth optional ${pkgs.pam_mount}/lib/security/pam_mount.so
|
||||||
|
'')
|
||||||
|
+ optionalString cfg.unixAuth ''
|
||||||
|
auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok "}likeauth try_first_pass
|
||||||
|
'' + optionalString cfg.otpwAuth ''
|
||||||
|
auth sufficient ${pkgs.otpw}/lib/security/pam_otpw.so
|
||||||
|
'' + (let oath = config.security.pam.oath; in optionalString cfg.oathAuth ''
|
||||||
|
auth sufficient ${pkgs.oathToolkit}/lib/security/pam_oath.so window=${toString oath.window} usersfile=${toString oath.usersFile} digits=${toString oath.digits}
|
||||||
|
'') + optionalString use_ldap ''
|
||||||
|
auth sufficient ${pam_ldap}/lib/security/pam_ldap.so use_first_pass
|
||||||
|
'' + optionalString config.krb5.enable ''
|
||||||
|
auth [default=ignore success=1 service_err=reset] ${pam_krb5}/lib/security/pam_krb5.so use_first_pass
|
||||||
|
auth [default=die success=done] ${pam_ccreds}/lib/security/pam_ccreds.so action=validate use_first_pass
|
||||||
|
auth sufficient ${pam_ccreds}/lib/security/pam_ccreds.so action=store use_first_pass
|
||||||
|
'' + ''
|
||||||
|
auth required pam_deny.so
|
||||||
|
|
||||||
# Session management.
|
# Password management.
|
||||||
${optionalString cfg.setEnvironment ''
|
password requisite pam_unix.so nullok sha512
|
||||||
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
'' + optionalString config.security.pam.enableEcryptfs ''
|
||||||
''}
|
password optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so
|
||||||
session required pam_unix.so
|
'' + optionalString cfg.pamMount ''
|
||||||
${optionalString cfg.setLoginUid
|
password optional ${pkgs.pam_mount}/lib/security/pam_mount.so
|
||||||
"session ${
|
'' + optionalString use_ldap ''
|
||||||
if config.boot.isContainer then "optional" else "required"
|
password sufficient ${pam_ldap}/lib/security/pam_ldap.so
|
||||||
} pam_loginuid.so"}
|
'' + optionalString config.krb5.enable ''
|
||||||
${optionalString cfg.makeHomeDir
|
password sufficient ${pam_krb5}/lib/security/pam_krb5.so use_first_pass
|
||||||
"session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=/etc/skel umask=0022"}
|
'' + optionalString config.services.samba.syncPasswordsByPam ''
|
||||||
${optionalString cfg.updateWtmp
|
password optional ${pkgs.samba}/lib/security/pam_smbpass.so nullok use_authtok try_first_pass
|
||||||
"session required ${pkgs.pam}/lib/security/pam_lastlog.so silent"}
|
'' + ''
|
||||||
${optionalString config.security.pam.enableEcryptfs
|
|
||||||
"session optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so"}
|
# Session management.
|
||||||
${optionalString use_ldap
|
'' + optionalString cfg.setEnvironment ''
|
||||||
"session optional ${pam_ldap}/lib/security/pam_ldap.so"}
|
session required pam_env.so envfile=${config.system.build.pamEnvironment}
|
||||||
${optionalString config.krb5.enable
|
'' + ''
|
||||||
"session optional ${pam_krb5}/lib/security/pam_krb5.so"}
|
session required pam_unix.so
|
||||||
${optionalString cfg.otpwAuth
|
'' + optionalString cfg.setLoginUid ''
|
||||||
"session optional ${pkgs.otpw}/lib/security/pam_otpw.so"}
|
session ${
|
||||||
${optionalString cfg.startSession
|
if config.boot.isContainer then "optional" else "required"
|
||||||
"session optional ${pkgs.systemd}/lib/security/pam_systemd.so"}
|
} pam_loginuid.so
|
||||||
${optionalString cfg.forwardXAuth
|
'' + optionalString cfg.makeHomeDir ''
|
||||||
"session optional pam_xauth.so xauthpath=${pkgs.xorg.xauth}/bin/xauth systemuser=99"}
|
session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=/etc/skel umask=0022
|
||||||
${optionalString (cfg.limits != [])
|
'' + optionalString cfg.updateWtmp ''
|
||||||
"session required ${pkgs.pam}/lib/security/pam_limits.so conf=${makeLimitsConf cfg.limits}"}
|
session required ${pkgs.pam}/lib/security/pam_lastlog.so silent
|
||||||
${optionalString (cfg.showMotd && config.users.motd != null)
|
'' + optionalString config.security.pam.enableEcryptfs ''
|
||||||
"session optional ${pkgs.pam}/lib/security/pam_motd.so motd=${motd}"}
|
session optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so
|
||||||
${optionalString cfg.pamMount
|
'' + optionalString use_ldap ''
|
||||||
"session optional ${pkgs.pam_mount}/lib/security/pam_mount.so"}
|
session optional ${pam_ldap}/lib/security/pam_ldap.so
|
||||||
${optionalString (cfg.enableAppArmor && config.security.apparmor.enable)
|
'' + optionalString config.krb5.enable ''
|
||||||
"session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug"}
|
session optional ${pam_krb5}/lib/security/pam_krb5.so
|
||||||
'');
|
'' + optionalString cfg.otpwAuth ''
|
||||||
|
session optional ${pkgs.otpw}/lib/security/pam_otpw.so
|
||||||
|
'' + optionalString cfg.startSession ''
|
||||||
|
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
|
||||||
|
'' + optionalString cfg.forwardXAuth ''
|
||||||
|
session optional pam_xauth.so xauthpath=${pkgs.xorg.xauth}/bin/xauth systemuser=99
|
||||||
|
'' + optionalString (cfg.limits != []) ''
|
||||||
|
session required ${pkgs.pam}/lib/security/pam_limits.so conf=${makeLimitsConf cfg.limits}
|
||||||
|
'' + optionalString (cfg.showMotd && config.users.motd != null) ''
|
||||||
|
session optional ${pkgs.pam}/lib/security/pam_motd.so motd=${motd}
|
||||||
|
'' + optionalString cfg.pamMount ''
|
||||||
|
session optional ${pkgs.pam_mount}/lib/security/pam_mount.so
|
||||||
|
'' + optionalString (cfg.enableAppArmor && config.security.apparmor.enable) ''
|
||||||
|
session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -74,7 +74,7 @@ in
|
|||||||
Defaults env_keep+=SSH_AUTH_SOCK
|
Defaults env_keep+=SSH_AUTH_SOCK
|
||||||
|
|
||||||
# "root" is allowed to do anything.
|
# "root" is allowed to do anything.
|
||||||
root ALL=(ALL) SETENV: ALL
|
root ALL=(ALL:ALL) SETENV: ALL
|
||||||
|
|
||||||
# Users in the "wheel" group can do anything.
|
# Users in the "wheel" group can do anything.
|
||||||
%wheel ALL=(ALL:ALL) ${if cfg.wheelNeedsPassword then "" else "NOPASSWD: ALL, "}SETENV: ALL
|
%wheel ALL=(ALL:ALL) ${if cfg.wheelNeedsPassword then "" else "NOPASSWD: ALL, "}SETENV: ALL
|
||||||
|
@ -21,13 +21,7 @@ in {
|
|||||||
|
|
||||||
services.mopidy = {
|
services.mopidy = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption "Mopidy, a music player daemon";
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Whether to enable Mopidy, a music player daemon.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
default = "/var/lib/mopidy";
|
default = "/var/lib/mopidy";
|
||||||
|
@ -12,11 +12,7 @@ in {
|
|||||||
|
|
||||||
services.ympd = {
|
services.ympd = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption "ympd, the MPD Web GUI";
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable ympd, the MPD Web GUI.";
|
|
||||||
};
|
|
||||||
|
|
||||||
webPort = mkOption {
|
webPort = mkOption {
|
||||||
type = types.string;
|
type = types.string;
|
||||||
|
@ -98,7 +98,7 @@ in {
|
|||||||
];
|
];
|
||||||
description = ''
|
description = ''
|
||||||
Specifies startup command line arguments to pass to Go.CD agent
|
Specifies startup command line arguments to pass to Go.CD agent
|
||||||
java process. Example contains debug and gcLog arguments.
|
java process.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = mkOption {
|
startupOptions = mkOption {
|
||||||
default = [
|
default = [
|
||||||
"-Xms${cfg.initialJavaHeapSize}"
|
"-Xms${cfg.initialJavaHeapSize}"
|
||||||
"-Xmx${cfg.maxJavaHeapMemory}"
|
"-Xmx${cfg.maxJavaHeapMemory}"
|
||||||
@ -103,6 +103,15 @@ in {
|
|||||||
"-Dcruise.server.port=${toString cfg.port}"
|
"-Dcruise.server.port=${toString cfg.port}"
|
||||||
"-Dcruise.server.ssl.port=${toString cfg.sslPort}"
|
"-Dcruise.server.ssl.port=${toString cfg.sslPort}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Specifies startup command line arguments to pass to Go.CD server
|
||||||
|
java process.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
default = [ ];
|
||||||
example = [
|
example = [
|
||||||
"-X debug"
|
"-X debug"
|
||||||
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
|
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
|
||||||
@ -169,7 +178,8 @@ in {
|
|||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.git}/bin/git config --global --add http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
|
${pkgs.git}/bin/git config --global --add http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
|
||||||
${pkgs.jre}/bin/java -server ${concatStringsSep " " cfg.extraOptions} \
|
${pkgs.jre}/bin/java -server ${concatStringsSep " " cfg.startupOptions} \
|
||||||
|
${concatStringsSep " " cfg.extraOptions} \
|
||||||
-jar ${pkgs.gocd-server}/go-server/go.jar
|
-jar ${pkgs.gocd-server}/go-server/go.jar
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -66,16 +66,16 @@ let
|
|||||||
enabled = false;
|
enabled = false;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
collectd = {
|
collectd = [{
|
||||||
enabled = false;
|
enabled = false;
|
||||||
typesdb = "${pkgs.collectd}/share/collectd/types.db";
|
typesdb = "${pkgs.collectd}/share/collectd/types.db";
|
||||||
database = "collectd_db";
|
database = "collectd_db";
|
||||||
port = 25826;
|
port = 25826;
|
||||||
};
|
}];
|
||||||
|
|
||||||
opentsdb = {
|
opentsdb = [{
|
||||||
enabled = false;
|
enabled = false;
|
||||||
};
|
}];
|
||||||
|
|
||||||
continuous_queries = {
|
continuous_queries = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
@ -171,6 +171,11 @@ in
|
|||||||
mkdir -m 0770 -p ${cfg.dataDir}
|
mkdir -m 0770 -p ${cfg.dataDir}
|
||||||
if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi
|
if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi
|
||||||
'';
|
'';
|
||||||
|
postStart = mkBefore ''
|
||||||
|
until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://127.0.0.1${toString configOptions.http.bind-address}'/ping; do
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraUsers = optional (cfg.user == "influxdb") {
|
users.extraUsers = optional (cfg.user == "influxdb") {
|
||||||
|
@ -90,6 +90,7 @@ in {
|
|||||||
${optionalString cfg.storageDriverSecure "-storage_driver_secure"}
|
${optionalString cfg.storageDriverSecure "-storage_driver_secure"}
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
TimeoutStartSec=300;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
418
nixos/modules/services/monitoring/prometheus/default.nix
Normal file
418
nixos/modules/services/monitoring/prometheus/default.nix
Normal file
@ -0,0 +1,418 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus;
|
||||||
|
promUser = "prometheus";
|
||||||
|
promGroup = "prometheus";
|
||||||
|
|
||||||
|
# Get a submodule without any embedded metadata:
|
||||||
|
_filter = x: filterAttrs (k: v: k != "_module") x;
|
||||||
|
|
||||||
|
# Pretty-print JSON to a file
|
||||||
|
writePrettyJSON = name: x:
|
||||||
|
pkgs.runCommand name { } ''
|
||||||
|
echo '${builtins.toJSON x}' | ${pkgs.jq}/bin/jq . > $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
# This becomes the main config file
|
||||||
|
promConfig = {
|
||||||
|
global = cfg.globalConfig;
|
||||||
|
rule_files = cfg.ruleFiles ++ [
|
||||||
|
(pkgs.writeText "prometheus.rules" (concatStringsSep "\n" cfg.rules))
|
||||||
|
];
|
||||||
|
scrape_configs = cfg.scrapeConfigs;
|
||||||
|
};
|
||||||
|
|
||||||
|
cmdlineArgs = cfg.extraFlags ++ [
|
||||||
|
"-storage.local.path=${cfg.dataDir}/metrics"
|
||||||
|
"-config.file=${writePrettyJSON "prometheus.yml" promConfig}"
|
||||||
|
"-web.listen-address=${cfg.listenAddress}"
|
||||||
|
];
|
||||||
|
|
||||||
|
promTypes.globalConfig = types.submodule {
|
||||||
|
options = {
|
||||||
|
scrape_interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "1m";
|
||||||
|
description = ''
|
||||||
|
How frequently to scrape targets by default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
scrape_timeout = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "10s";
|
||||||
|
description = ''
|
||||||
|
How long until a scrape request times out.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
evaluation_interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "1m";
|
||||||
|
description = ''
|
||||||
|
How frequently to evaluate rules by default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
labels = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
The labels to add to any timeseries that this Prometheus instance
|
||||||
|
scrapes.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.scrape_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
job_name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The job name assigned to scraped metrics by default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
scrape_interval = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
How frequently to scrape targets from this job. Defaults to the
|
||||||
|
globally configured default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
scrape_timeout = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Per-target timeout when scraping this job. Defaults to the
|
||||||
|
globally configured default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
metrics_path = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/metrics";
|
||||||
|
description = ''
|
||||||
|
The HTTP resource path on which to fetch metrics from targets.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
scheme = mkOption {
|
||||||
|
type = types.enum ["http" "https"];
|
||||||
|
default = "http";
|
||||||
|
description = ''
|
||||||
|
The URL scheme with which to fetch metrics from targets.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
basic_auth = mkOption {
|
||||||
|
type = types.nullOr (types.submodule {
|
||||||
|
options = {
|
||||||
|
username = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
HTTP username
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
password = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
HTTP password
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Optional http login credentials for metrics scraping.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
dns_sd_configs = mkOption {
|
||||||
|
type = types.listOf promTypes.dns_sd_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
List of DNS service discovery configurations.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
consul_sd_configs = mkOption {
|
||||||
|
type = types.listOf promTypes.consul_sd_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
List of Consul service discovery configurations.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
file_sd_configs = mkOption {
|
||||||
|
type = types.listOf promTypes.file_sd_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
List of file service discovery configurations.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
static_configs = mkOption {
|
||||||
|
type = types.listOf promTypes.static_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
List of labeled target groups for this job.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
relabel_configs = mkOption {
|
||||||
|
type = types.listOf promTypes.relabel_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
List of relabel configurations.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.static_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
targets = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
The targets specified by the target group.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
labels = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
description = ''
|
||||||
|
Labels assigned to all metrics scraped from the targets.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.dns_sd_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
names = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
A list of DNS SRV record names to be queried.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
refresh_interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "30s";
|
||||||
|
description = ''
|
||||||
|
The time after which the provided names are refreshed.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.consul_sd_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
server = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Consul server to query.";
|
||||||
|
};
|
||||||
|
token = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Consul token";
|
||||||
|
};
|
||||||
|
datacenter = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Consul datacenter";
|
||||||
|
};
|
||||||
|
scheme = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Consul scheme";
|
||||||
|
};
|
||||||
|
username = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Consul username";
|
||||||
|
};
|
||||||
|
password = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Consul password";
|
||||||
|
};
|
||||||
|
|
||||||
|
services = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
A list of services for which targets are retrieved.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
tag_separator = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = ",";
|
||||||
|
description = ''
|
||||||
|
The string by which Consul tags are joined into the tag label.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.file_sd_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
files = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
Patterns for files from which target groups are extracted. Refer
|
||||||
|
to the Prometheus documentation for permitted filename patterns
|
||||||
|
and formats.
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
refresh_interval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "30s";
|
||||||
|
description = ''
|
||||||
|
Refresh interval to re-read the files.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
promTypes.relabel_config = types.submodule {
|
||||||
|
options = {
|
||||||
|
source_labels = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
The source labels select values from existing labels. Their content
|
||||||
|
is concatenated using the configured separator and matched against
|
||||||
|
the configured regular expression.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
separator = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = ";";
|
||||||
|
description = ''
|
||||||
|
Separator placed between concatenated source label values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
target_label = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Label to which the resulting value is written in a replace action.
|
||||||
|
It is mandatory for replace actions.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
regex = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Regular expression against which the extracted value is matched.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
replacement = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Replacement value against which a regex replace is performed if the
|
||||||
|
regular expression matches.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
action = mkOption {
|
||||||
|
type = types.enum ["replace" "keep" "drop"];
|
||||||
|
description = ''
|
||||||
|
Action to perform based on regex matching.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
services.prometheus = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the Prometheus monitoring daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
listenAddress = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "0.0.0.0:9090";
|
||||||
|
description = ''
|
||||||
|
Address to listen on for the web interface, API, and telemetry.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "/var/lib/prometheus";
|
||||||
|
description = ''
|
||||||
|
Directory to store Prometheus metrics data.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraFlags = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Extra commandline options when launching Prometheus.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
globalConfig = mkOption {
|
||||||
|
type = promTypes.globalConfig;
|
||||||
|
default = {};
|
||||||
|
apply = _filter;
|
||||||
|
description = ''
|
||||||
|
Parameters that are valid in all configuration contexts. They
|
||||||
|
also serve as defaults for other configuration sections
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
rules = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Alerting and/or Recording rules to evaluate at runtime.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ruleFiles = mkOption {
|
||||||
|
type = types.listOf types.path;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Any additional rules files to include in this configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
scrapeConfigs = mkOption {
|
||||||
|
type = types.listOf promTypes.scrape_config;
|
||||||
|
default = [];
|
||||||
|
apply = x: map _filter x;
|
||||||
|
description = ''
|
||||||
|
A list of scrape configurations.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
users.extraGroups.${promGroup}.gid = config.ids.gids.prometheus;
|
||||||
|
users.extraUsers.${promUser} = {
|
||||||
|
description = "Prometheus daemon user";
|
||||||
|
uid = config.ids.uids.prometheus;
|
||||||
|
group = promGroup;
|
||||||
|
home = cfg.dataDir;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
systemd.services.prometheus = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
script = ''
|
||||||
|
#!/bin/sh
|
||||||
|
exec ${pkgs.prometheus}/bin/prometheus \
|
||||||
|
${concatStringsSep " \\\n " cmdlineArgs}
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
User = promUser;
|
||||||
|
Restart = "always";
|
||||||
|
WorkingDirectory = cfg.dataDir;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus.nodeExporter;
|
||||||
|
cmdlineArgs = cfg.extraFlags ++ [
|
||||||
|
"-web.listen-address=${cfg.listenAddress}"
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
services.prometheus.nodeExporter = {
|
||||||
|
enable = mkEnableOption "prometheus node exporter";
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 9100;
|
||||||
|
description = ''
|
||||||
|
Port to listen on.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
listenAddress = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
default = "0.0.0.0";
|
||||||
|
description = ''
|
||||||
|
Address to listen on.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
enabledCollectors = mkOption {
|
||||||
|
type = types.listOf types.string;
|
||||||
|
default = [];
|
||||||
|
example = ''[ "systemd" ]'';
|
||||||
|
description = ''
|
||||||
|
Collectors to enable, additionally to the defaults.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraFlags = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Extra commandline options when launching the node exporter.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.services.prometheus-node-exporter = {
|
||||||
|
description = "Prometheus exporter for machine metrics";
|
||||||
|
unitConfig.Documentation = "https://github.com/prometheus/node_exporter";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
script = ''
|
||||||
|
exec ${pkgs.prometheus-node-exporter}/bin/node_exporter \
|
||||||
|
${optionalString (cfg.enabledCollectors != [])
|
||||||
|
''-collectors.enabled ${concatStringsSep "," cfg.enabledCollectors}''} \
|
||||||
|
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||||
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
User = "nobody";
|
||||||
|
Restart = "always";
|
||||||
|
PrivateTmp = true;
|
||||||
|
WorkingDirectory = /tmp;
|
||||||
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
71
nixos/modules/services/monitoring/telegraf.nix
Normal file
71
nixos/modules/services/monitoring/telegraf.nix
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.telegraf;
|
||||||
|
|
||||||
|
configFile = pkgs.runCommand "config.toml" {
|
||||||
|
buildInputs = [ pkgs.remarshal ];
|
||||||
|
} ''
|
||||||
|
remarshal -if json -of toml \
|
||||||
|
< ${pkgs.writeText "config.json" (builtins.toJSON cfg.extraConfig)} \
|
||||||
|
> $out
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
###### interface
|
||||||
|
options = {
|
||||||
|
services.telegraf = {
|
||||||
|
enable = mkEnableOption "telegraf server";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.telegraf;
|
||||||
|
defaultText = "pkgs.telegraf";
|
||||||
|
description = "Which telegraf derivation to use";
|
||||||
|
type = types.package;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
default = {};
|
||||||
|
description = "Extra configuration options for telegraf";
|
||||||
|
type = types.attrs;
|
||||||
|
example = {
|
||||||
|
outputs = {
|
||||||
|
influxdb = {
|
||||||
|
urls = ["http://localhost:8086"];
|
||||||
|
database = "telegraf";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
inputs = {
|
||||||
|
statsd = {
|
||||||
|
service_address = ":8125";
|
||||||
|
delete_timings = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
config = mkIf config.services.telegraf.enable {
|
||||||
|
systemd.services.telegraf = {
|
||||||
|
description = "Telegraf Agent";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart=''${cfg.package}/bin/telegraf -config "${configFile}"'';
|
||||||
|
ExecReload="${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
|
User = "telegraf";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraUsers = [{
|
||||||
|
name = "telegraf";
|
||||||
|
uid = config.ids.uids.telegraf;
|
||||||
|
description = "telegraf daemon user";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
@ -10,7 +10,8 @@ let
|
|||||||
|
|
||||||
interfaces = attrValues config.networking.interfaces;
|
interfaces = attrValues config.networking.interfaces;
|
||||||
|
|
||||||
enableDHCP = config.networking.useDHCP || any (i: i.useDHCP == true) interfaces;
|
enableDHCP = config.networking.dhcpcd.enable &&
|
||||||
|
(config.networking.useDHCP || any (i: i.useDHCP == true) interfaces);
|
||||||
|
|
||||||
# Don't start dhcpcd on explicitly configured interfaces or on
|
# Don't start dhcpcd on explicitly configured interfaces or on
|
||||||
# interfaces that are part of a bridge, bond or sit device.
|
# interfaces that are part of a bridge, bond or sit device.
|
||||||
@ -85,6 +86,15 @@ in
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
networking.dhcpcd.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable dhcpcd for device configuration. This is mainly to
|
||||||
|
explicitly disable dhcpcd (for example when using networkd).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
networking.dhcpcd.persistent = mkOption {
|
networking.dhcpcd.persistent = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -51,11 +51,15 @@ in
|
|||||||
|
|
||||||
path = [ pkgs.haveged ];
|
path = [ pkgs.haveged ];
|
||||||
|
|
||||||
serviceConfig =
|
serviceConfig = {
|
||||||
{ Type = "forking";
|
ExecStart = "${pkgs.haveged}/bin/haveged -F -w ${toString cfg.refill_threshold} -v 1";
|
||||||
ExecStart = "${pkgs.haveged}/sbin/haveged -w ${toString cfg.refill_threshold} -v 1";
|
SuccessExitStatus = 143;
|
||||||
PIDFile = "/run/haveged.pid";
|
PrivateTmp = true;
|
||||||
};
|
PrivateDevices = true;
|
||||||
|
PrivateNetwork = true;
|
||||||
|
ProtectSystem = "full";
|
||||||
|
ProtectHome = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,6 @@ let
|
|||||||
|
|
||||||
poolName = "tt-rss";
|
poolName = "tt-rss";
|
||||||
phpfpmSocketName = "/var/run/phpfpm/${poolName}.sock";
|
phpfpmSocketName = "/var/run/phpfpm/${poolName}.sock";
|
||||||
virtualHostName = "tt-rss";
|
|
||||||
|
|
||||||
tt-rss-config = pkgs.writeText "config.php" ''
|
tt-rss-config = pkgs.writeText "config.php" ''
|
||||||
<?php
|
<?php
|
||||||
@ -34,10 +33,10 @@ let
|
|||||||
define('MYSQL_CHARSET', 'UTF8');
|
define('MYSQL_CHARSET', 'UTF8');
|
||||||
|
|
||||||
define('DB_TYPE', '${cfg.database.type}');
|
define('DB_TYPE', '${cfg.database.type}');
|
||||||
define('DB_HOST', '${cfg.database.host}');
|
define('DB_HOST', '${optionalString (cfg.database.host != null) cfg.database.host}');
|
||||||
define('DB_USER', '${cfg.database.user}');
|
define('DB_USER', '${cfg.database.user}');
|
||||||
define('DB_NAME', '${cfg.database.name}');
|
define('DB_NAME', '${cfg.database.name}');
|
||||||
define('DB_PASS', '${escape ["'" "\\"] cfg.database.password}');
|
define('DB_PASS', '${optionalString (cfg.database.password != null) (escape ["'" "\\"] cfg.database.password)}');
|
||||||
define('DB_PORT', '${toString dbPort}');
|
define('DB_PORT', '${toString dbPort}');
|
||||||
|
|
||||||
define('AUTH_AUTO_CREATE', ${boolToString cfg.auth.autoCreate});
|
define('AUTH_AUTO_CREATE', ${boolToString cfg.auth.autoCreate});
|
||||||
@ -91,12 +90,21 @@ let
|
|||||||
|
|
||||||
enable = mkEnableOption "tt-rss";
|
enable = mkEnableOption "tt-rss";
|
||||||
|
|
||||||
|
root = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "/var/lib/tt-rss";
|
||||||
|
example = "/var/lib/tt-rss";
|
||||||
|
description = ''
|
||||||
|
Root of the application.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "nginx";
|
default = "nginx";
|
||||||
example = "nginx";
|
example = "nginx";
|
||||||
description = ''
|
description = ''
|
||||||
User account under which both the service and the web-application run.
|
User account under which both the update daemon and the web-application run.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -110,17 +118,13 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Re-enable after https://github.com/NixOS/nixpkgs/pull/15862 is merged
|
virtualHost = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
# virtualHost = mkOption {
|
default = "tt-rss";
|
||||||
# type = types.str;
|
description = ''
|
||||||
# default = "${virtualHostName}";
|
Name of the nginx virtualhost to use and setup. If null, do not setup any virtualhost.
|
||||||
# description = ''
|
'';
|
||||||
# Name of existing nginx virtual host that is used to run web-application.
|
};
|
||||||
# If not specified a host will be created automatically with
|
|
||||||
# default values.
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
|
|
||||||
database = {
|
database = {
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
@ -132,10 +136,10 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
host = mkOption {
|
host = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
default = "localhost";
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
Host of the database.
|
Host of the database. Leave null to use Unix domain socket.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -362,7 +366,7 @@ let
|
|||||||
|
|
||||||
singleUserMode = mkOption {
|
singleUserMode = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = false;
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
Operate in single user mode, disables all functionality related to
|
Operate in single user mode, disables all functionality related to
|
||||||
@ -445,17 +449,15 @@ let
|
|||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = let
|
config = mkIf cfg.enable {
|
||||||
root = "/var/lib/tt-rss";
|
|
||||||
in mkIf cfg.enable {
|
|
||||||
|
|
||||||
services.phpfpm.poolConfigs = if cfg.pool == "${poolName}" then {
|
services.phpfpm.poolConfigs = mkIf (cfg.pool == "${poolName}") {
|
||||||
"${poolName}" = ''
|
"${poolName}" = ''
|
||||||
listen = "${phpfpmSocketName}";
|
listen = "${phpfpmSocketName}";
|
||||||
listen.owner = nginx
|
listen.owner = nginx
|
||||||
listen.group = nginx
|
listen.group = nginx
|
||||||
listen.mode = 0600
|
listen.mode = 0600
|
||||||
user = nginx
|
user = ${cfg.user}
|
||||||
pm = dynamic
|
pm = dynamic
|
||||||
pm.max_children = 75
|
pm.max_children = 75
|
||||||
pm.start_servers = 10
|
pm.start_servers = 10
|
||||||
@ -464,36 +466,26 @@ let
|
|||||||
pm.max_requests = 500
|
pm.max_requests = 500
|
||||||
catch_workers_output = 1
|
catch_workers_output = 1
|
||||||
'';
|
'';
|
||||||
} else {};
|
};
|
||||||
|
|
||||||
# TODO: Re-enable after https://github.com/NixOS/nixpkgs/pull/15862 is merged
|
services.nginx.virtualHosts = mkIf (cfg.virtualHost != null) {
|
||||||
|
"${cfg.virtualHost}" = {
|
||||||
|
root = "${cfg.root}";
|
||||||
|
|
||||||
# services.nginx.virtualHosts = if cfg.virtualHost == "${virtualHostName}" then {
|
locations."/" = {
|
||||||
# "${virtualHostName}" = {
|
index = "index.php";
|
||||||
# root = "${root}";
|
};
|
||||||
# extraConfig = ''
|
|
||||||
# access_log /var/log/nginx-${virtualHostName}-access.log;
|
|
||||||
# error_log /var/log/nginx-${virtualHostName}-error.log;
|
|
||||||
# '';
|
|
||||||
|
|
||||||
# locations."/" = {
|
locations."~ \.php$" = {
|
||||||
# extraConfig = ''
|
extraConfig = ''
|
||||||
# index index.php;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
# '';
|
fastcgi_pass unix:${phpfpmSocketName};
|
||||||
# };
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME ${cfg.root}/$fastcgi_script_name;
|
||||||
# locations."~ \.php$" = {
|
'';
|
||||||
# extraConfig = ''
|
};
|
||||||
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
};
|
||||||
# fastcgi_pass unix:${phpfpmSocketName};
|
};
|
||||||
# fastcgi_index index.php;
|
|
||||||
# fastcgi_param SCRIPT_FILENAME ${root}/$fastcgi_script_name;
|
|
||||||
|
|
||||||
# include ${pkgs.nginx}/conf/fastcgi_params;
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# } else {};
|
|
||||||
|
|
||||||
|
|
||||||
systemd.services.tt-rss = let
|
systemd.services.tt-rss = let
|
||||||
@ -503,35 +495,34 @@ let
|
|||||||
description = "Tiny Tiny RSS feeds update daemon";
|
description = "Tiny Tiny RSS feeds update daemon";
|
||||||
|
|
||||||
preStart = let
|
preStart = let
|
||||||
callSql = if cfg.database.type == "pgsql" then (e: ''
|
callSql = e:
|
||||||
${optionalString (cfg.database.password != null)
|
if cfg.database.type == "pgsql" then ''
|
||||||
"PGPASSWORD=${cfg.database.password}"} ${pkgs.postgresql95}/bin/psql \
|
${optionalString (cfg.database.password != null) "PGPASSWORD=${cfg.database.password}"} \
|
||||||
-U ${cfg.database.user} \
|
${pkgs.postgresql95}/bin/psql \
|
||||||
-h ${cfg.database.host} \
|
-U ${cfg.database.user} \
|
||||||
--port ${toString dbPort} \
|
${optionalString (cfg.database.host != null) "-h ${cfg.database.host} --port ${toString dbPort}"} \
|
||||||
-c '${e}' \
|
-c '${e}' \
|
||||||
${cfg.database.name}'')
|
${cfg.database.name}''
|
||||||
|
|
||||||
else if cfg.database.type == "mysql" then (e: ''
|
else if cfg.database.type == "mysql" then ''
|
||||||
echo '${e}' | ${pkgs.mysql}/bin/mysql \
|
echo '${e}' | ${pkgs.mysql}/bin/mysql \
|
||||||
${optionalString (cfg.database.password != null)
|
-u ${cfg.database.user} \
|
||||||
"-p${cfg.database.password}"} \
|
${optionalString (cfg.database.password != null) "-p${cfg.database.password}"} \
|
||||||
-u ${cfg.database.user} \
|
${optionalString (cfg.database.host != null) "-h ${cfg.database.host} -P ${toString dbPort}"} \
|
||||||
-h ${cfg.database.host} \
|
${cfg.database.name}''
|
||||||
-P ${toString dbPort} \
|
|
||||||
${cfg.database.name}'')
|
|
||||||
|
|
||||||
else "";
|
else "";
|
||||||
|
|
||||||
in ''
|
in ''
|
||||||
rm -rf "${root}/*"
|
rm -rf "${cfg.root}/*"
|
||||||
mkdir -m 755 -p "${root}"
|
mkdir -m 755 -p "${cfg.root}"
|
||||||
cp -r "${pkgs.tt-rss}/"* "${root}"
|
cp -r "${pkgs.tt-rss}/"* "${cfg.root}"
|
||||||
ln -sf "${tt-rss-config}" "${root}/config.php"
|
ln -sf "${tt-rss-config}" "${cfg.root}/config.php"
|
||||||
chown -R "${cfg.user}" "${root}"
|
chown -R "${cfg.user}" "${cfg.root}"
|
||||||
chmod -R 755 "${root}"
|
chmod -R 755 "${cfg.root}"
|
||||||
'' + (optionalString (cfg.database.type == "pgsql") ''
|
''
|
||||||
|
|
||||||
|
+ (optionalString (cfg.database.type == "pgsql") ''
|
||||||
exists=$(${callSql "select count(*) > 0 from pg_tables where tableowner = user"} \
|
exists=$(${callSql "select count(*) > 0 from pg_tables where tableowner = user"} \
|
||||||
| tail -n+3 | head -n-2 | sed -e 's/[ \n\t]*//')
|
| tail -n+3 | head -n-2 | sed -e 's/[ \n\t]*//')
|
||||||
|
|
||||||
@ -540,8 +531,9 @@ let
|
|||||||
else
|
else
|
||||||
echo 'The database contains some data. Leaving it as it is.'
|
echo 'The database contains some data. Leaving it as it is.'
|
||||||
fi;
|
fi;
|
||||||
'') + (optionalString (cfg.database.type == "mysql") ''
|
'')
|
||||||
|
|
||||||
|
+ (optionalString (cfg.database.type == "mysql") ''
|
||||||
exists=$(${callSql "select count(*) > 0 from information_schema.tables where table_schema = schema()"} \
|
exists=$(${callSql "select count(*) > 0 from information_schema.tables where table_schema = schema()"} \
|
||||||
| tail -n+2 | sed -e 's/[ \n\t]*//')
|
| tail -n+2 | sed -e 's/[ \n\t]*//')
|
||||||
|
|
||||||
@ -554,7 +546,7 @@ let
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "${cfg.user}";
|
User = "${cfg.user}";
|
||||||
ExecStart = "${pkgs.php}/bin/php /var/lib/tt-rss/update.php --daemon";
|
ExecStart = "${pkgs.php}/bin/php ${cfg.root}/update.php --daemon";
|
||||||
StandardOutput = "syslog";
|
StandardOutput = "syslog";
|
||||||
StandardError = "syslog";
|
StandardError = "syslog";
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
|
@ -69,7 +69,7 @@ in
|
|||||||
services.xserver.updateDbusEnvironment = true;
|
services.xserver.updateDbusEnvironment = true;
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
[ pkgs.gtk.out # To get GTK+'s themes and gtk-update-icon-cache
|
[ pkgs.gtk2.out # To get GTK+'s themes and gtk-update-icon-cache
|
||||||
pkgs.hicolor_icon_theme
|
pkgs.hicolor_icon_theme
|
||||||
pkgs.tango-icon-theme
|
pkgs.tango-icon-theme
|
||||||
pkgs.shared_mime_info
|
pkgs.shared_mime_info
|
||||||
@ -100,6 +100,7 @@ in
|
|||||||
pkgs.xfce.tumbler # found via dbus
|
pkgs.xfce.tumbler # found via dbus
|
||||||
]
|
]
|
||||||
++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager
|
++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager
|
||||||
|
++ optional config.networking.networkmanager.enable pkgs.networkmanagerapplet
|
||||||
++ optionals (!cfg.noDesktop)
|
++ optionals (!cfg.noDesktop)
|
||||||
[ pkgs.xfce.xfce4panel
|
[ pkgs.xfce.xfce4panel
|
||||||
pkgs.xfce.xfdesktop
|
pkgs.xfce.xfdesktop
|
||||||
|
@ -46,13 +46,15 @@ let
|
|||||||
[Seat:*]
|
[Seat:*]
|
||||||
xserver-command = ${xserverWrapper}
|
xserver-command = ${xserverWrapper}
|
||||||
session-wrapper = ${dmcfg.session.script}
|
session-wrapper = ${dmcfg.session.script}
|
||||||
|
${optionalString (elem defaultSessionName dmcfg.session.names) ''
|
||||||
|
user-session = ${defaultSessionName}
|
||||||
|
''}
|
||||||
${optionalString cfg.greeter.enable ''
|
${optionalString cfg.greeter.enable ''
|
||||||
greeter-session = ${cfg.greeter.name}
|
greeter-session = ${cfg.greeter.name}
|
||||||
''}
|
''}
|
||||||
${optionalString cfg.autoLogin.enable ''
|
${optionalString cfg.autoLogin.enable ''
|
||||||
autologin-user = ${cfg.autoLogin.user}
|
autologin-user = ${cfg.autoLogin.user}
|
||||||
autologin-user-timeout = ${toString cfg.autoLogin.timeout}
|
autologin-user-timeout = ${toString cfg.autoLogin.timeout}
|
||||||
autologin-session = ${defaultSessionName}
|
|
||||||
''}
|
''}
|
||||||
${cfg.extraSeatDefaults}
|
${cfg.extraSeatDefaults}
|
||||||
'';
|
'';
|
||||||
|
@ -55,7 +55,7 @@ let
|
|||||||
inherit (cfg)
|
inherit (cfg)
|
||||||
version extraConfig extraPerEntryConfig extraEntries
|
version extraConfig extraPerEntryConfig extraEntries
|
||||||
extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels
|
extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels
|
||||||
default fsIdentifier efiSupport gfxmodeEfi gfxmodeBios;
|
default fsIdentifier efiSupport efiInstallAsRemovable gfxmodeEfi gfxmodeBios;
|
||||||
path = (makeBinPath ([
|
path = (makeBinPath ([
|
||||||
pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils pkgs.btrfs-progs
|
pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils pkgs.btrfs-progs
|
||||||
pkgs.utillinux ] ++ (if cfg.efiSupport && (cfg.version == 2) then [pkgs.efibootmgr ] else [])
|
pkgs.utillinux ] ++ (if cfg.efiSupport && (cfg.version == 2) then [pkgs.efibootmgr ] else [])
|
||||||
@ -357,6 +357,44 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
efiInstallAsRemovable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to invoke <literal>grub-install</literal> with
|
||||||
|
<literal>--removable</literal>.</para>
|
||||||
|
|
||||||
|
<para>Unless you turn this on, GRUB will install itself somewhere in
|
||||||
|
<literal>boot.loader.efi.efiSysMountPoint</literal> (exactly where
|
||||||
|
depends on other config variables). If you've set
|
||||||
|
<literal>boot.loader.efi.canTouchEfiVariables</literal> *AND* you
|
||||||
|
are currently booted in UEFI mode, then GRUB will use
|
||||||
|
<literal>efibootmgr</literal> to modify the boot order in the
|
||||||
|
EFI variables of your firmware to include this location. If you are
|
||||||
|
*not* booted in UEFI mode at the time GRUB is being installed, the
|
||||||
|
NVRAM will not be modified, and your system will not find GRUB at
|
||||||
|
boot time. However, GRUB will still return success so you may miss
|
||||||
|
the warning that gets printed ("<literal>efibootmgr: EFI variables
|
||||||
|
are not supported on this system.</literal>").</para>
|
||||||
|
|
||||||
|
<para>If you turn this feature on, GRUB will install itself in a
|
||||||
|
special location within <literal>efiSysMountPoint</literal> (namely
|
||||||
|
<literal>EFI/boot/boot$arch.efi</literal>) which the firmwares
|
||||||
|
are hardcoded to try first, regardless of NVRAM EFI variables.</para>
|
||||||
|
|
||||||
|
<para>To summarize, turn this on if:
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>You are installing NixOS and want it to boot in UEFI mode,
|
||||||
|
but you are currently booted in legacy mode</para></listitem>
|
||||||
|
<listitem><para>You want to make a drive that will boot regardless of
|
||||||
|
the NVRAM state of the computer (like a USB "removable" drive)</para></listitem>
|
||||||
|
<listitem><para>You simply dislike the idea of depending on NVRAM
|
||||||
|
state to make your drive bootable</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
enableCryptodisk = mkOption {
|
enableCryptodisk = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
@ -484,6 +522,14 @@ in
|
|||||||
assertion = !cfg.trustedBoot.enable || cfg.trustedBoot.systemHasTPM == "YES_TPM_is_activated";
|
assertion = !cfg.trustedBoot.enable || cfg.trustedBoot.systemHasTPM == "YES_TPM_is_activated";
|
||||||
message = "Trusted GRUB can break the system! Confirm that the system has an activated TPM by setting 'systemHasTPM'.";
|
message = "Trusted GRUB can break the system! Confirm that the system has an activated TPM by setting 'systemHasTPM'.";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.efiInstallAsRemovable -> cfg.efiSupport;
|
||||||
|
message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn on boot.loader.grub.efiSupport";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.efiInstallAsRemovable -> !config.boot.loader.efi.canTouchEfiVariables;
|
||||||
|
message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn off boot.loader.efi.canTouchEfiVariables";
|
||||||
|
}
|
||||||
] ++ flip concatMap cfg.mirroredBoots (args: [
|
] ++ flip concatMap cfg.mirroredBoots (args: [
|
||||||
{
|
{
|
||||||
assertion = args.devices != [ ];
|
assertion = args.devices != [ ];
|
||||||
|
@ -60,6 +60,7 @@ my $grubTargetEfi = get("grubTargetEfi");
|
|||||||
my $bootPath = get("bootPath");
|
my $bootPath = get("bootPath");
|
||||||
my $storePath = get("storePath");
|
my $storePath = get("storePath");
|
||||||
my $canTouchEfiVariables = get("canTouchEfiVariables");
|
my $canTouchEfiVariables = get("canTouchEfiVariables");
|
||||||
|
my $efiInstallAsRemovable = get("efiInstallAsRemovable");
|
||||||
my $efiSysMountPoint = get("efiSysMountPoint");
|
my $efiSysMountPoint = get("efiSysMountPoint");
|
||||||
my $gfxmodeEfi = get("gfxmodeEfi");
|
my $gfxmodeEfi = get("gfxmodeEfi");
|
||||||
my $gfxmodeBios = get("gfxmodeBios");
|
my $gfxmodeBios = get("gfxmodeBios");
|
||||||
@ -544,13 +545,15 @@ if (($requireNewInstall != 0) && ($efiTarget eq "no" || $efiTarget eq "both")) {
|
|||||||
# install EFI GRUB
|
# install EFI GRUB
|
||||||
if (($requireNewInstall != 0) && ($efiTarget eq "only" || $efiTarget eq "both")) {
|
if (($requireNewInstall != 0) && ($efiTarget eq "only" || $efiTarget eq "both")) {
|
||||||
print STDERR "installing the GRUB $grubVersion EFI boot loader into $efiSysMountPoint...\n";
|
print STDERR "installing the GRUB $grubVersion EFI boot loader into $efiSysMountPoint...\n";
|
||||||
|
my @command = ("$grubEfi/sbin/grub-install", "--recheck", "--target=$grubTargetEfi", "--boot-directory=$bootPath", "--efi-directory=$efiSysMountPoint");
|
||||||
if ($canTouchEfiVariables eq "true") {
|
if ($canTouchEfiVariables eq "true") {
|
||||||
system("$grubEfi/sbin/grub-install", "--recheck", "--target=$grubTargetEfi", "--boot-directory=$bootPath", "--efi-directory=$efiSysMountPoint", "--bootloader-id=$bootloaderId") == 0
|
push @command, "--bootloader-id=$bootloaderId";
|
||||||
or die "$0: installation of GRUB EFI into $efiSysMountPoint failed\n";
|
|
||||||
} else {
|
} else {
|
||||||
system("$grubEfi/sbin/grub-install", "--recheck", "--target=$grubTargetEfi", "--boot-directory=$bootPath", "--efi-directory=$efiSysMountPoint", "--no-nvram") == 0
|
push @command, "--no-nvram";
|
||||||
or die "$0: installation of GRUB EFI into $efiSysMountPoint failed\n";
|
push @command, "--removable" if $efiInstallAsRemovable eq "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(system @command) == 0 or die "$0: installation of GRUB EFI into $efiSysMountPoint failed\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -571,6 +571,16 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.extraConfig = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
example = "DefaultCPUAccounting=yes";
|
||||||
|
description = ''
|
||||||
|
Extra config options for systemd user instances. See man systemd-user.conf for
|
||||||
|
available options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = mkOption {
|
systemd.tmpfiles.rules = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
@ -665,6 +675,11 @@ in
|
|||||||
${config.systemd.extraConfig}
|
${config.systemd.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
"systemd/user.conf".text = ''
|
||||||
|
[Manager]
|
||||||
|
${config.systemd.user.extraConfig}
|
||||||
|
'';
|
||||||
|
|
||||||
"systemd/journald.conf".text = ''
|
"systemd/journald.conf".text = ''
|
||||||
[Journal]
|
[Journal]
|
||||||
RateLimitInterval=${config.services.journald.rateLimitInterval}
|
RateLimitInterval=${config.services.journald.rateLimitInterval}
|
||||||
|
@ -43,7 +43,7 @@ in
|
|||||||
message = "networking.bridges.${n}.rstp is not supported by networkd.";
|
message = "networking.bridges.${n}.rstp is not supported by networkd.";
|
||||||
});
|
});
|
||||||
|
|
||||||
systemd.services.dhcpcd.enable = mkDefault false;
|
networking.dhcpcd.enable = mkDefault false;
|
||||||
|
|
||||||
systemd.services.network-local-commands = {
|
systemd.services.network-local-commands = {
|
||||||
after = [ "systemd-networkd.service" ];
|
after = [ "systemd-networkd.service" ];
|
||||||
|
@ -231,7 +231,7 @@ let
|
|||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = ''
|
description = ''
|
||||||
Whether this interface is virtual and should be created by tunctl.
|
Whether this interface is virtual and should be created by tunctl.
|
||||||
This is mainly useful for creating bridges between a host a virtual
|
This is mainly useful for creating bridges between a host and a virtual
|
||||||
network such as VPN or a virtual machine.
|
network such as VPN or a virtual machine.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
3
nixos/modules/virtualisation/azure-bootstrap-blobs.nix
Normal file
3
nixos/modules/virtualisation/azure-bootstrap-blobs.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"16.03" = "https://nixos.blob.core.windows.net/images/nixos-image-16.03.847.8688c17-x86_64-linux.vhd";
|
||||||
|
}
|
@ -40,13 +40,25 @@ in
|
|||||||
};
|
};
|
||||||
storageDriver =
|
storageDriver =
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
|
type = types.nullOr (types.enum ["aufs" "btrfs" "devicemapper" "overlay" "overlay2" "zfs"]);
|
||||||
default = "devicemapper";
|
default = null;
|
||||||
description =
|
description =
|
||||||
''
|
''
|
||||||
This option determines which Docker storage driver to use.
|
This option determines which Docker storage driver to use. By default
|
||||||
|
it let's docker automatically choose preferred storage driver.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
logDriver =
|
||||||
|
mkOption {
|
||||||
|
type = types.enum ["none" "json-file" "syslog" "journald" "gelf" "fluentd" "awslogs" "splunk" "etwlogs" "gcplogs"];
|
||||||
|
default = "journald";
|
||||||
|
description =
|
||||||
|
''
|
||||||
|
This option determines which Docker log driver to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraOptions =
|
extraOptions =
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.separatedString " ";
|
type = types.separatedString " ";
|
||||||
@ -88,7 +100,12 @@ in
|
|||||||
after = [ "network.target" ] ++ (optional cfg.socketActivation "docker.socket") ;
|
after = [ "network.target" ] ++ (optional cfg.socketActivation "docker.socket") ;
|
||||||
requires = optional cfg.socketActivation "docker.socket";
|
requires = optional cfg.socketActivation "docker.socket";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.docker}/bin/docker daemon --group=docker --storage-driver=${cfg.storageDriver} ${optionalString cfg.socketActivation "--host=fd://"} ${cfg.extraOptions}";
|
ExecStart = ''${pkgs.docker}/bin/dockerd \
|
||||||
|
--group=docker --log-driver=${cfg.logDriver} \
|
||||||
|
${optionalString (cfg.storageDriver != null) "--storage-driver=${cfg.storageDriver}"} \
|
||||||
|
${optionalString cfg.socketActivation "--host=fd://"} \
|
||||||
|
${cfg.extraOptions}
|
||||||
|
'';
|
||||||
# I'm not sure if that limits aren't too high, but it's what
|
# I'm not sure if that limits aren't too high, but it's what
|
||||||
# goes in config bundled with docker itself
|
# goes in config bundled with docker itself
|
||||||
LimitNOFILE = 1048576;
|
LimitNOFILE = 1048576;
|
||||||
|
@ -4,10 +4,15 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.virtualisation.virtualbox.host;
|
cfg = config.virtualisation.virtualbox.host;
|
||||||
virtualbox = config.boot.kernelPackages.virtualbox.override {
|
|
||||||
|
virtualbox = pkgs.virtualbox.override {
|
||||||
inherit (cfg) enableHardening headless;
|
inherit (cfg) enableHardening headless;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
kernelModules = config.boot.kernelPackages.virtualbox.override {
|
||||||
|
inherit virtualbox;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -60,7 +65,7 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [{
|
config = mkIf cfg.enable (mkMerge [{
|
||||||
boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ];
|
boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ];
|
||||||
boot.extraModulePackages = [ virtualbox ];
|
boot.extraModulePackages = [ kernelModules ];
|
||||||
environment.systemPackages = [ virtualbox ];
|
environment.systemPackages = [ virtualbox ];
|
||||||
|
|
||||||
security.setuidOwners = let
|
security.setuidOwners = let
|
||||||
|
@ -34,7 +34,7 @@ in {
|
|||||||
postVM =
|
postVM =
|
||||||
''
|
''
|
||||||
export HOME=$PWD
|
export HOME=$PWD
|
||||||
export PATH=${pkgs.linuxPackages.virtualbox}/bin:$PATH
|
export PATH=${pkgs.virtualbox}/bin:$PATH
|
||||||
|
|
||||||
echo "creating VirtualBox pass-through disk wrapper (no copying invovled)..."
|
echo "creating VirtualBox pass-through disk wrapper (no copying invovled)..."
|
||||||
VBoxManage internalcommands createrawvmdk -filename disk.vmdk -rawdisk $diskImage
|
VBoxManage internalcommands createrawvmdk -filename disk.vmdk -rawdisk $diskImage
|
||||||
|
@ -274,7 +274,7 @@ in rec {
|
|||||||
tests.nfs4 = callTest tests/nfs.nix { version = 4; };
|
tests.nfs4 = callTest tests/nfs.nix { version = 4; };
|
||||||
tests.nsd = callTest tests/nsd.nix {};
|
tests.nsd = callTest tests/nsd.nix {};
|
||||||
tests.openssh = callTest tests/openssh.nix {};
|
tests.openssh = callTest tests/openssh.nix {};
|
||||||
tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
||||||
tests.peerflix = callTest tests/peerflix.nix {};
|
tests.peerflix = callTest tests/peerflix.nix {};
|
||||||
tests.postgresql = callTest tests/postgresql.nix {};
|
tests.postgresql = callTest tests/postgresql.nix {};
|
||||||
tests.printing = callTest tests/printing.nix {};
|
tests.printing = callTest tests/printing.nix {};
|
||||||
|
@ -13,10 +13,6 @@ import ./make-test.nix ({ pkgs, ... } : {
|
|||||||
services.cadvisor.enable = true;
|
services.cadvisor.enable = true;
|
||||||
services.cadvisor.storageDriver = "influxdb";
|
services.cadvisor.storageDriver = "influxdb";
|
||||||
services.influxdb.enable = true;
|
services.influxdb.enable = true;
|
||||||
systemd.services.influxdb.postStart = mkAfter ''
|
|
||||||
${pkgs.curl.bin}/bin/curl -X POST 'http://localhost:8086/db?u=root&p=root' \
|
|
||||||
-d '{"name": "root"}'
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,6 +23,12 @@ import ./make-test.nix ({ pkgs, ... } : {
|
|||||||
$machine->succeed("curl http://localhost:8080/containers/");
|
$machine->succeed("curl http://localhost:8080/containers/");
|
||||||
|
|
||||||
$influxdb->waitForUnit("influxdb.service");
|
$influxdb->waitForUnit("influxdb.service");
|
||||||
|
|
||||||
|
# create influxdb database
|
||||||
|
$influxdb->succeed(q~
|
||||||
|
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"
|
||||||
|
~);
|
||||||
|
|
||||||
$influxdb->waitForUnit("cadvisor.service");
|
$influxdb->waitForUnit("cadvisor.service");
|
||||||
$influxdb->succeed("curl http://localhost:8080/containers/");
|
$influxdb->succeed("curl http://localhost:8080/containers/");
|
||||||
'';
|
'';
|
||||||
|
@ -11,9 +11,6 @@ import ./make-test.nix ({ pkgs, ...} : {
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
# FIXME: The default "devicemapper" storageDriver fails in NixOS VM
|
|
||||||
# tests.
|
|
||||||
virtualisation.docker.storageDriver = "overlay";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,9 +17,6 @@ import ./make-test.nix ({ pkgs, ...} : {
|
|||||||
|
|
||||||
$one->waitForUnit("influxdb.service");
|
$one->waitForUnit("influxdb.service");
|
||||||
|
|
||||||
# Check if admin interface is avalible
|
|
||||||
$one->waitUntilSucceeds("curl -f 127.0.0.1:8083");
|
|
||||||
|
|
||||||
# create database
|
# create database
|
||||||
$one->succeed(q~
|
$one->succeed(q~
|
||||||
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test"
|
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test"
|
||||||
|
@ -36,18 +36,29 @@ in
|
|||||||
# cancel client audio configuration
|
# cancel client audio configuration
|
||||||
$client1->waitForWindow(qr/Audio Tuning Wizard/);
|
$client1->waitForWindow(qr/Audio Tuning Wizard/);
|
||||||
$client2->waitForWindow(qr/Audio Tuning Wizard/);
|
$client2->waitForWindow(qr/Audio Tuning Wizard/);
|
||||||
|
$server->sleep(5); # wait because mumble is slow to register event handlers
|
||||||
$client1->sendKeys("esc");
|
$client1->sendKeys("esc");
|
||||||
$client2->sendKeys("esc");
|
$client2->sendKeys("esc");
|
||||||
|
|
||||||
# cancel client cert configuration
|
# cancel client cert configuration
|
||||||
$client1->waitForWindow(qr/Certificate Management/);
|
$client1->waitForWindow(qr/Certificate Management/);
|
||||||
$client2->waitForWindow(qr/Certificate Management/);
|
$client2->waitForWindow(qr/Certificate Management/);
|
||||||
|
$server->sleep(5); # wait because mumble is slow to register event handlers
|
||||||
$client1->sendKeys("esc");
|
$client1->sendKeys("esc");
|
||||||
$client2->sendKeys("esc");
|
$client2->sendKeys("esc");
|
||||||
|
|
||||||
# accept server certificate
|
# accept server certificate
|
||||||
$client1->waitForWindow(qr/^Mumble$/);
|
$client1->waitForWindow(qr/^Mumble$/);
|
||||||
$client2->waitForWindow(qr/^Mumble$/);
|
$client2->waitForWindow(qr/^Mumble$/);
|
||||||
|
$server->sleep(5); # wait because mumble is slow to register event handlers
|
||||||
|
$client1->sendChars("y");
|
||||||
|
$client2->sendChars("y");
|
||||||
|
$server->sleep(5); # wait because mumble is slow to register event handlers
|
||||||
|
|
||||||
|
# sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
|
||||||
|
$client1->sendKeys("alt-tab");
|
||||||
|
$client2->sendKeys("alt-tab");
|
||||||
|
$server->sleep(5); # wait because mumble is slow to register event handlers
|
||||||
$client1->sendChars("y");
|
$client1->sendChars("y");
|
||||||
$client2->sendChars("y");
|
$client2->sendChars("y");
|
||||||
|
|
||||||
|
29
nixos/tests/prometheus.nix
Normal file
29
nixos/tests/prometheus.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import ./make-test.nix {
|
||||||
|
name = "prometheus";
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
one = { config, pkgs, ... }: {
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
globalConfig = {
|
||||||
|
labels = { foo = "bar"; };
|
||||||
|
};
|
||||||
|
scrapeConfigs = [{
|
||||||
|
job_name = "prometheus";
|
||||||
|
target_groups = [{
|
||||||
|
targets = [ "127.0.0.1:9090" ];
|
||||||
|
labels = { instance = "localhost"; };
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
rules = [ ''testrule = count(up{job="prometheus"})'' ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
startAll;
|
||||||
|
$one->waitForUnit("prometheus.service");
|
||||||
|
$one->waitForOpenPort(9090);
|
||||||
|
$one->succeed("curl -s http://127.0.0.1:9090/metrics");
|
||||||
|
'';
|
||||||
|
}
|
@ -23,9 +23,8 @@ import ./make-test.nix ({ pkgs, ...} : {
|
|||||||
startAll;
|
startAll;
|
||||||
|
|
||||||
$server->waitForUnit("tomcat");
|
$server->waitForUnit("tomcat");
|
||||||
$server->sleep(30); # Dirty, but it takes a while before Tomcat handles to requests properly
|
|
||||||
$client->waitForUnit("network.target");
|
$client->waitForUnit("network.target");
|
||||||
$client->succeed("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
|
$client->waitUntilSucceeds("curl --fail http://server/examples/servlets/servlet/HelloWorldExample");
|
||||||
$client->succeed("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
|
$client->waitUntilSucceeds("curl --fail http://server/examples/jsp/jsp2/simpletag/hello.jsp");
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
@ -144,6 +144,7 @@ let
|
|||||||
"--uart1 0x3F8 4"
|
"--uart1 0x3F8 4"
|
||||||
"--uartmode1 client /run/virtualbox-log-${name}.sock"
|
"--uartmode1 client /run/virtualbox-log-${name}.sock"
|
||||||
"--memory 768"
|
"--memory 768"
|
||||||
|
"--audio none"
|
||||||
] ++ (attrs.vmFlags or []));
|
] ++ (attrs.vmFlags or []));
|
||||||
|
|
||||||
controllerFlags = mkFlags [
|
controllerFlags = mkFlags [
|
||||||
@ -273,9 +274,12 @@ let
|
|||||||
|
|
||||||
sub shutdownVM_${name} {
|
sub shutdownVM_${name} {
|
||||||
$machine->succeed(ru "touch ${sharePath}/shutdown");
|
$machine->succeed(ru "touch ${sharePath}/shutdown");
|
||||||
$machine->waitUntilSucceeds(
|
$machine->execute(
|
||||||
"test ! -e ${sharePath}/shutdown ".
|
'set -e; i=0; '.
|
||||||
" -a ! -e ${sharePath}/boot-done"
|
'while test -e ${sharePath}/shutdown '.
|
||||||
|
' -o -e ${sharePath}/boot-done; do '.
|
||||||
|
'sleep 1; i=$(($i + 1)); [ $i -le 3600 ]; '.
|
||||||
|
'done'
|
||||||
);
|
);
|
||||||
waitForShutdown_${name};
|
waitForShutdown_${name};
|
||||||
}
|
}
|
||||||
@ -386,6 +390,7 @@ in mapAttrs mkVBoxTest {
|
|||||||
$machine->sendKeys("ctrl-q");
|
$machine->sendKeys("ctrl-q");
|
||||||
$machine->sleep(5);
|
$machine->sleep(5);
|
||||||
$machine->screenshot("gui_manager_stopped");
|
$machine->screenshot("gui_manager_stopped");
|
||||||
|
destroyVM_simple;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
simple-cli = ''
|
simple-cli = ''
|
||||||
@ -403,6 +408,7 @@ in mapAttrs mkVBoxTest {
|
|||||||
});
|
});
|
||||||
|
|
||||||
shutdownVM_simple;
|
shutdownVM_simple;
|
||||||
|
destroyVM_simple;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
headless = ''
|
headless = ''
|
||||||
@ -411,6 +417,7 @@ in mapAttrs mkVBoxTest {
|
|||||||
waitForStartup_headless;
|
waitForStartup_headless;
|
||||||
waitForVMBoot_headless;
|
waitForVMBoot_headless;
|
||||||
shutdownVM_headless;
|
shutdownVM_headless;
|
||||||
|
destroyVM_headless;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
host-usb-permissions = ''
|
host-usb-permissions = ''
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, cairo, fftw, gtk, gtkmm, lv2, lvtk, pkgconfig, python }:
|
{ stdenv, fetchurl, cairo, fftw, gtkmm2, lv2, lvtk, pkgconfig, python }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ams-lv2-${version}";
|
name = "ams-lv2-${version}";
|
||||||
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1kqbl7rc3zrs27c5ga0frw3mlpx15sbxzhf04sfbrd9l60535fd5";
|
sha256 = "1kqbl7rc3zrs27c5ga0frw3mlpx15sbxzhf04sfbrd9l60535fd5";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ cairo fftw gtk gtkmm lv2 lvtk pkgconfig python ];
|
buildInputs = [ cairo fftw gtkmm2 lv2 lvtk pkgconfig python ];
|
||||||
|
|
||||||
configurePhase = "python waf configure --prefix=$out";
|
configurePhase = "python waf configure --prefix=$out";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, doxygen, dbus, fftw
|
{ stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, doxygen, dbus, fftw
|
||||||
, fftwSinglePrec, flac, glibc, glibmm, graphviz, gtk, gtkmm, libjack2
|
, fftwSinglePrec, flac, glibc, glibmm, graphviz, gtkmm2, libjack2
|
||||||
, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
|
, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
|
||||||
, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
|
, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
|
||||||
, libusb, libuuid, libxml2, libxslt, lilv-svn, lv2, makeWrapper, pango
|
, libusb, libuuid, libxml2, libxslt, lilv-svn, lv2, makeWrapper, pango
|
||||||
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ alsaLib aubio boost cairomm curl doxygen dbus fftw fftwSinglePrec flac glibc
|
[ alsaLib aubio boost cairomm curl doxygen dbus fftw fftwSinglePrec flac glibc
|
||||||
glibmm graphviz gtk gtkmm libjack2 libgnomecanvas libgnomecanvasmm liblo
|
glibmm graphviz gtkmm2 libjack2 libgnomecanvas libgnomecanvasmm liblo
|
||||||
libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
|
libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
|
||||||
libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv-svn lv2
|
libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv-svn lv2
|
||||||
makeWrapper pango perl pkgconfig python rubberband serd sord-svn sratom suil taglib vampSDK
|
makeWrapper pango perl pkgconfig python rubberband serd sord-svn sratom suil taglib vampSDK
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchFromGitHub, alsaLib, aubio, boost, cairomm, curl, doxygen, dbus, fftw
|
{ stdenv, fetchFromGitHub, alsaLib, aubio, boost, cairomm, curl, doxygen, dbus, fftw
|
||||||
, fftwSinglePrec, flac, glibc, glibmm, graphviz, gtk, gtkmm, libjack2
|
, fftwSinglePrec, flac, glibc, glibmm, graphviz, gtkmm2, libjack2
|
||||||
, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
|
, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
|
||||||
, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
|
, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
|
||||||
, libusb, libuuid, libxml2, libxslt, lilv-svn, lv2, makeWrapper, pango
|
, libusb, libuuid, libxml2, libxslt, lilv-svn, lv2, makeWrapper, pango
|
||||||
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ alsaLib aubio boost cairomm curl doxygen dbus fftw fftwSinglePrec flac glibc
|
[ alsaLib aubio boost cairomm curl doxygen dbus fftw fftwSinglePrec flac glibc
|
||||||
glibmm graphviz gtk gtkmm libjack2 libgnomecanvas libgnomecanvasmm liblo
|
glibmm graphviz gtkmm2 libjack2 libgnomecanvas libgnomecanvasmm liblo
|
||||||
libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
|
libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
|
||||||
libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv-svn lv2
|
libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv-svn lv2
|
||||||
makeWrapper pango perl pkgconfig python rubberband serd sord-svn sratom suil taglib vampSDK
|
makeWrapper pango perl pkgconfig python rubberband serd sord-svn sratom suil taglib vampSDK
|
||||||
|
51
pkgs/applications/audio/asunder/default.nix
Normal file
51
pkgs/applications/audio/asunder/default.nix
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{ stdenv, fetchurl, makeWrapper, gtk2, libcddb, intltool, pkgconfig, cdparanoia
|
||||||
|
, mp3Support ? false, lame
|
||||||
|
, oggSupport ? true, vorbis-tools
|
||||||
|
, flacSupport ? true, flac
|
||||||
|
, opusSupport ? false, opusTools
|
||||||
|
, wavpackSupport ? false, wavpack
|
||||||
|
#, musepackSupport ? false, TODO: mpcenc
|
||||||
|
, monkeysAudioSupport ? false, monkeysAudio
|
||||||
|
#, aacSupport ? false, TODO: neroAacEnc
|
||||||
|
}:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
version = "2.8";
|
||||||
|
name = "asunder-${version}";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "http://littlesvr.ca/asunder/releases/${name}.tar.bz2";
|
||||||
|
sha256 = "1nq9kd4rd4k2kibf57gdbm0zw2gxa234vvvdhxkm8g5bhx5h3iyq";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ gtk2 libcddb intltool pkgconfig makeWrapper ];
|
||||||
|
|
||||||
|
runtimeDeps =
|
||||||
|
optional mp3Support lame ++
|
||||||
|
optional oggSupport vorbis-tools ++
|
||||||
|
optional flacSupport flac ++
|
||||||
|
optional opusSupport opusTools ++
|
||||||
|
optional wavpackSupport wavpack ++
|
||||||
|
optional monkeysAudioSupport monkeysAudio ++
|
||||||
|
[ cdparanoia ];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
wrapProgram "$out/bin/asunder" \
|
||||||
|
--prefix PATH : "${makeBinPath runtimeDeps}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "A graphical Audio CD ripper and encoder for Linux";
|
||||||
|
homepage = http://littlesvr.ca/asunder/index.php;
|
||||||
|
license = licenses.gpl2;
|
||||||
|
maintainers = with maintainers; [ mudri ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
|
||||||
|
longDescription = ''
|
||||||
|
Asunder is a graphical Audio CD ripper and encoder for Linux. You can use
|
||||||
|
it to save tracks from an Audio CD as any of WAV, MP3, OGG, FLAC, Opus,
|
||||||
|
WavPack, Musepack, AAC, and Monkey's Audio files.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, wxGTK30, pkgconfig, gettext, gtk, glib, zlib, perl, intltool,
|
{ stdenv, fetchurl, wxGTK30, pkgconfig, gettext, gtk2, glib, zlib, perl, intltool,
|
||||||
libogg, libvorbis, libmad, alsaLib, libsndfile, soxr, flac, lame, fetchpatch,
|
libogg, libvorbis, libmad, alsaLib, libsndfile, soxr, flac, lame, fetchpatch,
|
||||||
expat, libid3tag, ffmpeg, soundtouch /*, portaudio - given up fighting their portaudio.patch */
|
expat, libid3tag, ffmpeg, soundtouch /*, portaudio - given up fighting their portaudio.patch */
|
||||||
}:
|
}:
|
||||||
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgconfig gettext wxGTK30 expat alsaLib
|
pkgconfig gettext wxGTK30 expat alsaLib
|
||||||
libsndfile soxr libid3tag gtk
|
libsndfile soxr libid3tag gtk2
|
||||||
ffmpeg libmad lame libvorbis flac soundtouch
|
ffmpeg libmad lame libvorbis flac soundtouch
|
||||||
]; #ToDo: detach sbsms
|
]; #ToDo: detach sbsms
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{stdenv, fetchurl, gettext, ncurses
|
{stdenv, fetchurl, gettext, ncurses
|
||||||
, gtkGUI ? false
|
, gtkGUI ? false
|
||||||
, pkgconfig ? null
|
, pkgconfig ? null
|
||||||
, gtk ? null}:
|
, gtk2 ? null}:
|
||||||
|
|
||||||
assert gtkGUI -> pkgconfig != null && gtk != null;
|
assert gtkGUI -> pkgconfig != null && gtk2 != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "aumix-2.9.1";
|
name = "aumix-2.9.1";
|
||||||
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gettext ncurses ]
|
buildInputs = [ gettext ncurses ]
|
||||||
++ (if gtkGUI then [pkgconfig gtk] else []);
|
++ (if gtkGUI then [pkgconfig gtk2] else []);
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Audio mixer for X and the console";
|
description = "Audio mixer for X and the console";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchurl, zlib, guile, libart_lgpl, pkgconfig, intltool
|
{ stdenv, fetchurl, zlib, guile, libart_lgpl, pkgconfig, intltool
|
||||||
, gtk, glib, libogg, libvorbis, libgnomecanvas, gettext, perl }:
|
, gtk2, glib, libogg, libvorbis, libgnomecanvas, gettext, perl }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "beast-0.7.1";
|
name = "beast-0.7.1";
|
||||||
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ zlib guile libart_lgpl pkgconfig intltool gtk glib
|
[ zlib guile libart_lgpl pkgconfig intltool gtk2 glib
|
||||||
libogg libvorbis libgnomecanvas gettext
|
libogg libvorbis libgnomecanvas gettext
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, bzip2, cairo, dpkg, freetype, gdk_pixbuf
|
{ stdenv, fetchurl, alsaLib, bzip2, cairo, dpkg, freetype, gdk_pixbuf
|
||||||
, glib, gtk, harfbuzz, jdk, lib, libX11, libXau, libXcursor, libXdmcp
|
, glib, gtk2, harfbuzz, jdk, lib, libX11, libXau, libXcursor, libXdmcp
|
||||||
, libXext, libXfixes, libXrender, libbsd, libjack2, libpng, libxcb
|
, libXext, libXfixes, libXrender, libbsd, libjack2, libpng, libxcb
|
||||||
, libxkbcommon, libxkbfile, makeWrapper, pixman, xcbutil, xcbutilwm
|
, libxkbcommon, libxkbfile, makeWrapper, pixman, xcbutil, xcbutilwm
|
||||||
, xdg_utils, zenity, zlib }:
|
, xdg_utils, zenity, zlib }:
|
||||||
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
|||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
|
||||||
libPath = lib.makeLibraryPath [
|
libPath = lib.makeLibraryPath [
|
||||||
alsaLib bzip2.out cairo freetype gdk_pixbuf glib gtk harfbuzz
|
alsaLib bzip2.out cairo freetype gdk_pixbuf glib gtk2 harfbuzz
|
||||||
libX11 libXau libXcursor libXdmcp libXext libXfixes libXrender
|
libX11 libXau libXcursor libXdmcp libXext libXfixes libXrender
|
||||||
libbsd libjack2 libpng libxcb libxkbfile pixman xcbutil xcbutilwm
|
libbsd libjack2 libpng libxcb libxkbfile pixman xcbutil xcbutilwm
|
||||||
zlib
|
zlib
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchurl, cairo, expat, fftwSinglePrec, fluidsynth, glib
|
{ stdenv, fetchurl, cairo, expat, fftwSinglePrec, fluidsynth, glib
|
||||||
, gtk, libjack2, ladspaH , libglade, lv2, pkgconfig }:
|
, gtk2, libjack2, ladspaH , libglade, lv2, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "calf-${version}";
|
name = "calf-${version}";
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
cairo expat fftwSinglePrec fluidsynth glib gtk libjack2 ladspaH
|
cairo expat fftwSinglePrec fluidsynth glib gtk2 libjack2 ladspaH
|
||||||
libglade lv2 pkgconfig
|
libglade lv2 pkgconfig
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = stdenv.lib.optional stdenv.isDarwin [
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [
|
||||||
Carbon
|
Carbon
|
||||||
IOKit
|
IOKit
|
||||||
];
|
];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, cmake, fftw, gtkmm, libxcb, lv2, pkgconfig, xorg }:
|
{ stdenv, fetchurl, cmake, fftw, gtkmm2, libxcb, lv2, pkgconfig, xorg }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "eq10q-${version}";
|
name = "eq10q-${version}";
|
||||||
version = "2.0";
|
version = "2.0";
|
||||||
@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "08vlfly0qqrfqiwpn5g5php680icpk97pwnwjadmj5syhgvi0i3h";
|
sha256 = "08vlfly0qqrfqiwpn5g5php680icpk97pwnwjadmj5syhgvi0i3h";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ cmake fftw gtkmm libxcb lv2 pkgconfig xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence ];
|
buildInputs = [ cmake fftw gtkmm2 libxcb lv2 pkgconfig xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence ];
|
||||||
|
|
||||||
installFlags = ''
|
installFlags = ''
|
||||||
DESTDIR=$(out)
|
DESTDIR=$(out)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
, freetype
|
, freetype
|
||||||
, gdk_pixbuf
|
, gdk_pixbuf
|
||||||
, glib
|
, glib
|
||||||
, gtk
|
, gtk2
|
||||||
, pango
|
, pango
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ faust.wrapWithBuildEnv {
|
|||||||
freetype
|
freetype
|
||||||
gdk_pixbuf
|
gdk_pixbuf
|
||||||
glib
|
glib
|
||||||
gtk
|
gtk2
|
||||||
pango
|
pango
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ faust
|
{ faust
|
||||||
, gtk
|
, gtk2
|
||||||
, jack2Full
|
, jack2Full
|
||||||
, opencv
|
, opencv
|
||||||
}:
|
}:
|
||||||
@ -15,7 +15,7 @@ faust.wrapWithBuildEnv {
|
|||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
gtk
|
gtk2
|
||||||
jack2Full
|
jack2Full
|
||||||
opencv
|
opencv
|
||||||
];
|
];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchsvn, autoconf, automake, docbook_xml_dtd_45
|
{ stdenv, fetchsvn, autoconf, automake, docbook_xml_dtd_45
|
||||||
, docbook_xsl, gtkmm, intltool, libgig, libsndfile, libtool, libxslt
|
, docbook_xsl, gtkmm2, intltool, libgig, libsndfile, libtool, libxslt
|
||||||
, pkgconfig }:
|
, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
|||||||
preConfigure = "make -f Makefile.cvs";
|
preConfigure = "make -f Makefile.cvs";
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
autoconf automake docbook_xml_dtd_45 docbook_xsl gtkmm intltool
|
autoconf automake docbook_xml_dtd_45 docbook_xsl gtkmm2 intltool
|
||||||
libgig libsndfile libtool libxslt pkgconfig
|
libgig libsndfile libtool libxslt pkgconfig
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, mpd_clientlib, dbus_glib, audacious, gtk, gsl
|
{ stdenv, fetchurl, pkgconfig, mpd_clientlib, dbus_glib, audacious, gtk2, gsl
|
||||||
, libaudclient }:
|
, libaudclient }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
|
||||||
buildInputs = [ mpd_clientlib dbus_glib audacious gtk gsl libaudclient ];
|
buildInputs = [ mpd_clientlib dbus_glib audacious gtk2 gsl libaudclient ];
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchurl, libtool, intltool, pkgconfig, glib
|
{ stdenv, fetchurl, libtool, intltool, pkgconfig, glib
|
||||||
, gtk, curl, mpd_clientlib, libsoup, gob2, vala_0_23, libunique
|
, gtk2, curl, mpd_clientlib, libsoup, gob2, vala_0_23, libunique
|
||||||
, libSM, libICE, sqlite, hicolor_icon_theme, wrapGAppsHook
|
, libSM, libICE, sqlite, hicolor_icon_theme, wrapGAppsHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libtool intltool pkgconfig glib gtk curl mpd_clientlib libsoup
|
libtool intltool pkgconfig glib gtk2 curl mpd_clientlib libsoup
|
||||||
libunique libmpd gob2 vala_0_23 libSM libICE sqlite hicolor_icon_theme
|
libunique libmpd gob2 vala_0_23 libSM libICE sqlite hicolor_icon_theme
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
];
|
];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchurl, gettext, intltool, pkgconfig, python
|
{ stdenv, fetchurl, gettext, intltool, pkgconfig, python
|
||||||
, avahi, bluez, boost, eigen, fftw, glib, glib_networking
|
, avahi, bluez, boost, eigen, fftw, glib, glib_networking
|
||||||
, glibmm, gsettings_desktop_schemas, gtk, gtkmm, libjack2
|
, glibmm, gsettings_desktop_schemas, gtkmm2, libjack2
|
||||||
, ladspaH, librdf, libsndfile, lilv, lv2, serd, sord, sratom
|
, ladspaH, librdf, libsndfile, lilv, lv2, serd, sord, sratom
|
||||||
, webkitgtk2, wrapGAppsHook, zita-convolver, zita-resampler
|
, webkitgtk2, wrapGAppsHook, zita-convolver, zita-resampler
|
||||||
, optimizationSupport ? false # Enable support for native CPU extensions
|
, optimizationSupport ? false # Enable support for native CPU extensions
|
||||||
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
avahi bluez boost eigen fftw glib glibmm glib_networking.out
|
avahi bluez boost eigen fftw glib glibmm glib_networking.out
|
||||||
gsettings_desktop_schemas gtk gtkmm libjack2 ladspaH librdf
|
gsettings_desktop_schemas gtkmm2 libjack2 ladspaH librdf
|
||||||
libsndfile lilv lv2 serd sord sratom webkitgtk2 zita-convolver
|
libsndfile lilv lv2 serd sord sratom webkitgtk2 zita-convolver
|
||||||
zita-resampler
|
zita-resampler
|
||||||
];
|
];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchsvn, boost, ganv, glibmm, gtk, gtkmm, libjack2, lilv-svn
|
{ stdenv, fetchsvn, boost, ganv, glibmm, gtkmm2, libjack2, lilv-svn
|
||||||
, lv2, makeWrapper, pkgconfig, python, raul, rdflib, serd, sord-svn, sratom
|
, lv2, makeWrapper, pkgconfig, python, raul, rdflib, serd, sord-svn, sratom
|
||||||
, suil
|
, suil
|
||||||
}:
|
}:
|
||||||
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
boost ganv glibmm gtk gtkmm libjack2 lilv-svn lv2 makeWrapper pkgconfig
|
boost ganv glibmm gtkmm2 libjack2 lilv-svn lv2 makeWrapper pkgconfig
|
||||||
python raul serd sord-svn sratom suil
|
python raul serd sord-svn sratom suil
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, libjack2, ladspaH, gtk, alsaLib, libxml2, librdf }:
|
{ stdenv, fetchurl, pkgconfig, libjack2, ladspaH, gtk2, alsaLib, libxml2, librdf }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "jack-rack-1.4.7";
|
name = "jack-rack-1.4.7";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/jack-rack/${name}.tar.bz2";
|
url = "mirror://sourceforge/jack-rack/${name}.tar.bz2";
|
||||||
sha256 = "1lmibx9gicagcpcisacj6qhq6i08lkl5x8szysjqvbgpxl9qg045";
|
sha256 = "1lmibx9gicagcpcisacj6qhq6i08lkl5x8szysjqvbgpxl9qg045";
|
||||||
};
|
};
|
||||||
buildInputs = [ pkgconfig libjack2 ladspaH gtk alsaLib libxml2 librdf ];
|
buildInputs = [ pkgconfig libjack2 ladspaH gtk2 alsaLib libxml2 librdf ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = ''An effects "rack" for the JACK low latency audio API'';
|
description = ''An effects "rack" for the JACK low latency audio API'';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, gtk, libjack2, lilv, lv2, pkgconfig, python
|
{ stdenv, fetchurl, gtk2, libjack2, lilv, lv2, pkgconfig, python
|
||||||
, serd, sord , sratom, suil }:
|
, serd, sord , sratom, suil }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
gtk libjack2 lilv lv2 pkgconfig python serd sord sratom suil
|
gtk2 libjack2 lilv lv2 pkgconfig python serd sord sratom suil
|
||||||
];
|
];
|
||||||
|
|
||||||
configurePhase = "python waf configure --prefix=$out";
|
configurePhase = "python waf configure --prefix=$out";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, gtk, libjack2, libuuid, libxml2
|
{ stdenv, fetchurl, alsaLib, gtk2, libjack2, libuuid, libxml2
|
||||||
, makeWrapper, pkgconfig, readline }:
|
, makeWrapper, pkgconfig, readline }:
|
||||||
|
|
||||||
assert libuuid != null;
|
assert libuuid != null;
|
||||||
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
|||||||
# http://permalink.gmane.org/gmane.linux.redhat.fedora.extras.cvs/822346
|
# http://permalink.gmane.org/gmane.linux.redhat.fedora.extras.cvs/822346
|
||||||
patches = [ ./socket.patch ./gcc-47.patch ];
|
patches = [ ./socket.patch ./gcc-47.patch ];
|
||||||
|
|
||||||
buildInputs = [ alsaLib gtk libjack2 libxml2 makeWrapper
|
buildInputs = [ alsaLib gtk2 libjack2 libxml2 makeWrapper
|
||||||
pkgconfig readline ];
|
pkgconfig readline ];
|
||||||
propagatedBuildInputs = [ libuuid ];
|
propagatedBuildInputs = [ libuuid ];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, intltool, gtk, alsaLib, libglade }:
|
{ stdenv, fetchurl, pkgconfig, intltool, gtk2, alsaLib, libglade }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "lingot-0.9.1";
|
name = "lingot-0.9.1";
|
||||||
@ -10,7 +10,7 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
buildInputs = [ pkgconfig intltool gtk alsaLib libglade ];
|
buildInputs = [ pkgconfig intltool gtk2 alsaLib libglade ];
|
||||||
|
|
||||||
configureFlags = "--disable-jack";
|
configureFlags = "--disable-jack";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, makeWrapper, SDL , alsaLib, gtk, libjack2, ladspaH
|
{ stdenv, fetchurl, makeWrapper, SDL , alsaLib, gtk2, libjack2, ladspaH
|
||||||
, ladspaPlugins, libsamplerate, libsndfile, pkgconfig, libpulseaudio, lame
|
, ladspaPlugins, libsamplerate, libsndfile, pkgconfig, libpulseaudio, lame
|
||||||
, vorbis-tools }:
|
, vorbis-tools }:
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "010rk4mr631s440q9cfgdxx2avgzysr9aq52diwdlbq9cddifli3";
|
sha256 = "010rk4mr631s440q9cfgdxx2avgzysr9aq52diwdlbq9cddifli3";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ SDL alsaLib gtk libjack2 ladspaH libsamplerate libsndfile
|
buildInputs = [ SDL alsaLib gtk2 libjack2 ladspaH libsamplerate libsndfile
|
||||||
pkgconfig libpulseaudio makeWrapper ];
|
pkgconfig libpulseaudio makeWrapper ];
|
||||||
|
|
||||||
configureFlags = "--with-default-ladspa-path=${ladspaPlugins}/lib/ladspa";
|
configureFlags = "--with-default-ladspa-path=${ladspaPlugins}/lib/ladspa";
|
||||||
|
@ -17,7 +17,7 @@ in stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pythonPath = with pythonPackages; [
|
pythonPath = with pythonPackages; [
|
||||||
pygobject gst_python musicbrainzngs
|
pygobject2 gst_python musicbrainzngs
|
||||||
pycdio pyxdg setuptools
|
pycdio pyxdg setuptools
|
||||||
CDDB
|
CDDB
|
||||||
];
|
];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ fetchurl, stdenv, ncurses, pkgconfig, gtk }:
|
{ fetchurl, stdenv, ncurses, pkgconfig, gtk2 }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "mp3info-0.8.5a";
|
name = "mp3info-0.8.5a";
|
||||||
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04";
|
sha256 = "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ncurses pkgconfig gtk ];
|
buildInputs = [ ncurses pkgconfig gtk2 ];
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
|
@ -8,7 +8,9 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ openssl libogg libopus ];
|
buildInputs = [ openssl libogg ];
|
||||||
|
propagatedBuildInputs = [ libopus ];
|
||||||
|
patches = [ ./include-multistream.patch ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "High-level API for decoding and seeking in .opus files";
|
description = "High-level API for decoding and seeking in .opus files";
|
||||||
|
12
pkgs/applications/audio/opusfile/include-multistream.patch
Normal file
12
pkgs/applications/audio/opusfile/include-multistream.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Naur a/include/opusfile.h b/include/opusfile.h
|
||||||
|
--- a/include/opusfile.h 2014-04-29 19:07:09.000000000 +0200
|
||||||
|
+++ b/include/opusfile.h 2016-09-05 17:50:15.147553798 +0200
|
||||||
|
@@ -107,7 +107,7 @@
|
||||||
|
# include <stdarg.h>
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <ogg/ogg.h>
|
||||||
|
-# include <opus_multistream.h>
|
||||||
|
+# include <opus/opus_multistream.h>
|
||||||
|
|
||||||
|
/**@cond PRIVATE*/
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
{ fetchurl, stdenv, pkgconfig, libpulseaudio, gtkmm, libglademm
|
{ fetchurl, stdenv, pkgconfig, libpulseaudio, gtkmm2, libglademm
|
||||||
, dbus_glib, GConf, gconfmm, intltool }:
|
, dbus_glib, GConf, gconfmm, intltool }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1c5b3sb881szavly220q31g7rvpn94wr7ywlk00hqb9zaikml716";
|
sha256 = "1c5b3sb881szavly220q31g7rvpn94wr7ywlk00hqb9zaikml716";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ libpulseaudio gtkmm libglademm dbus_glib gconfmm ];
|
buildInputs = [ libpulseaudio gtkmm2 libglademm dbus_glib gconfmm ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig intltool ];
|
nativeBuildInputs = [ pkgconfig intltool ];
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, alsaLib, boost, dbus_glib, fetchsvn, ganv, glibmm, gtk2
|
{ stdenv, alsaLib, boost, dbus_glib, fetchsvn, ganv, glibmm
|
||||||
, gtkmm, libjack2, pkgconfig, python2
|
, gtkmm2, libjack2, pkgconfig, python2
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
alsaLib boost dbus_glib ganv glibmm gtk2 gtkmm libjack2
|
alsaLib boost dbus_glib ganv glibmm gtkmm2 libjack2
|
||||||
pkgconfig python2
|
pkgconfig python2
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, cmake, gtk, libjack2, libgnomecanvas
|
{ stdenv, fetchurl, alsaLib, cmake, gtk2, libjack2, libgnomecanvas
|
||||||
, libpthreadstubs, libsamplerate, libsndfile, libtool, libxml2
|
, libpthreadstubs, libsamplerate, libsndfile, libtool, libxml2
|
||||||
, pkgconfig, openssl }:
|
, pkgconfig, openssl }:
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ alsaLib cmake gtk libjack2 libgnomecanvas libpthreadstubs
|
[ alsaLib cmake gtk2 libjack2 libgnomecanvas libpthreadstubs
|
||||||
libsamplerate libsndfile libtool libxml2 pkgconfig openssl
|
libsamplerate libsndfile libtool libxml2 pkgconfig openssl
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, gtk, pkgconfig }:
|
{ stdenv, fetchurl, alsaLib, gtk2, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "praat-${version}";
|
name = "praat-${version}";
|
||||||
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
|
|||||||
cp praat $out/bin
|
cp praat $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ alsaLib gtk pkgconfig ];
|
buildInputs = [ alsaLib gtk2 pkgconfig ];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Doing phonetics by computer";
|
description = "Doing phonetics by computer";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ alsaLib, autoconf, automake, dssi, fetchurl, gtk, libjack2
|
{ alsaLib, autoconf, automake, dssi, fetchurl, gtk2, libjack2
|
||||||
, ladspaH, ladspaPlugins, liblo, libmad, libsamplerate, libsndfile
|
, ladspaH, ladspaPlugins, liblo, libmad, libsamplerate, libsndfile
|
||||||
, libtool, libvorbis, lilv, lv2, pkgconfig, qt4, rubberband, serd
|
, libtool, libvorbis, lilv, lv2, pkgconfig, qt4, rubberband, serd
|
||||||
, sord, sratom, stdenv, suil }:
|
, sord, sratom, stdenv, suil }:
|
||||||
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ alsaLib autoconf automake dssi gtk libjack2 ladspaH
|
[ alsaLib autoconf automake dssi gtk2 libjack2 ladspaH
|
||||||
ladspaPlugins liblo libmad libsamplerate libsndfile libtool
|
ladspaPlugins liblo libmad libsamplerate libsndfile libtool
|
||||||
libvorbis lilv lv2 pkgconfig qt4 rubberband serd sord sratom
|
libvorbis lilv lv2 pkgconfig qt4 rubberband serd sord sratom
|
||||||
suil
|
suil
|
||||||
|
@ -9,7 +9,7 @@ assert withGstPlugins -> gst_plugins_base != null
|
|||||||
|
|
||||||
let
|
let
|
||||||
version = "2.6.3";
|
version = "2.6.3";
|
||||||
inherit (pythonPackages) buildPythonApplication python mutagen pygtk pygobject dbus-python;
|
inherit (pythonPackages) buildPythonApplication python mutagen pygtk pygobject2 dbus-python;
|
||||||
in buildPythonApplication {
|
in buildPythonApplication {
|
||||||
# call the package quodlibet and just quodlibet
|
# call the package quodlibet and just quodlibet
|
||||||
name = "quodlibet${stdenv.lib.optionalString withGstPlugins "-with-gst-plugins"}-${version}";
|
name = "quodlibet${stdenv.lib.optionalString withGstPlugins "-with-gst-plugins"}-${version}";
|
||||||
@ -48,7 +48,7 @@ in buildPythonApplication {
|
|||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
mutagen pygtk pygobject dbus-python gst_python intltool
|
mutagen pygtk pygobject2 dbus-python gst_python intltool
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = stdenv.lib.optionalString withGstPlugins ''
|
postInstall = stdenv.lib.optionalString withGstPlugins ''
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, gtkmm, libjack2, pkgconfig }:
|
{ stdenv, fetchurl, alsaLib, gtkmm2, libjack2, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "seq24-${version}";
|
name = "seq24-${version}";
|
||||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patches = [ ./mutex_no_nameclash.patch ];
|
patches = [ ./mutex_no_nameclash.patch ];
|
||||||
|
|
||||||
buildInputs = [ alsaLib gtkmm libjack2 ];
|
buildInputs = [ alsaLib gtkmm2 libjack2 ];
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ fetchurl, stdenv, dpkg, xorg, alsaLib, makeWrapper, openssl, freetype
|
{ fetchurl, stdenv, dpkg, xorg, alsaLib, makeWrapper, openssl, freetype
|
||||||
, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf
|
, glib, pango, cairo, atk, gdk_pixbuf, gtk2, cups, nspr, nss, libpng, GConf
|
||||||
, libgcrypt, systemd, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome }:
|
, libgcrypt, systemd, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome2 }:
|
||||||
|
|
||||||
assert stdenv.system == "x86_64-linux";
|
assert stdenv.system == "x86_64-linux";
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ let
|
|||||||
GConf
|
GConf
|
||||||
gdk_pixbuf
|
gdk_pixbuf
|
||||||
glib
|
glib
|
||||||
gtk
|
gtk2
|
||||||
libgcrypt
|
libgcrypt
|
||||||
libpng
|
libpng
|
||||||
nss
|
nss
|
||||||
@ -83,7 +83,7 @@ stdenv.mkDerivation {
|
|||||||
librarypath="${stdenv.lib.makeLibraryPath deps}:$libdir"
|
librarypath="${stdenv.lib.makeLibraryPath deps}:$libdir"
|
||||||
wrapProgram $out/share/spotify/spotify \
|
wrapProgram $out/share/spotify/spotify \
|
||||||
--prefix LD_LIBRARY_PATH : "$librarypath" \
|
--prefix LD_LIBRARY_PATH : "$librarypath" \
|
||||||
--prefix PATH : "${gnome.zenity}/bin"
|
--prefix PATH : "${gnome2.zenity}/bin"
|
||||||
|
|
||||||
# Desktop file
|
# Desktop file
|
||||||
mkdir -p "$out/share/applications/"
|
mkdir -p "$out/share/applications/"
|
||||||
|
48
pkgs/applications/audio/squishyball/default.nix
Normal file
48
pkgs/applications/audio/squishyball/default.nix
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{ stdenv, autoreconfHook, fetchsvn, flac, libao, libvorbis, ncurses
|
||||||
|
, opusfile, pkgconfig
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "squishyball-${rev}";
|
||||||
|
rev = "19580";
|
||||||
|
|
||||||
|
src = fetchsvn {
|
||||||
|
url = "https://svn.xiph.org/trunk/squishyball";
|
||||||
|
rev = rev;
|
||||||
|
sha256 = "013vq52q9z6kpg9iyc2jnb3m2gihcjblvwpg4yj4wy1q2c05pzqp";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
||||||
|
|
||||||
|
buildInputs = [ flac libao libvorbis ncurses opusfile ];
|
||||||
|
|
||||||
|
patches = [ ./gnu-screen.patch ];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Why doesn’t this happen automagically?
|
||||||
|
mkdir -p $out/share/man/man1
|
||||||
|
cp squishyball.1 $out/share/man/man1
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "A tool to perform sample comparison testing on the command line";
|
||||||
|
longDescription = ''
|
||||||
|
squishyball is a simple command-line utility for performing
|
||||||
|
double-blind A/B, A/B/X or X/X/Y testing on the command line.
|
||||||
|
The user specifies two input files to be compared and uses the
|
||||||
|
keyboard during playback to flip between the randomized samples
|
||||||
|
to perform on-the-fly compar‐ isons. After a predetermined
|
||||||
|
number of trials, squishyball prints the trial results to
|
||||||
|
stdout and exits. Results (stdout) may be redirected to a file
|
||||||
|
without affecting interactive use of the terminal.
|
||||||
|
|
||||||
|
squishyball can also be used to perform casual, non-randomized
|
||||||
|
comparisons of groups of up to ten samples; this is the default
|
||||||
|
mode of operation.
|
||||||
|
'';
|
||||||
|
homepage = https://svn.xiph.org/trunk/squishyball;
|
||||||
|
license = licenses.gpl2Plus;
|
||||||
|
maintainers = with maintainers; [ michalrus ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
20
pkgs/applications/audio/squishyball/gnu-screen.patch
Normal file
20
pkgs/applications/audio/squishyball/gnu-screen.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
diff -Naur a/main.c b/main.c
|
||||||
|
--- a/main.c 2016-09-06 13:37:32.259895631 +0200
|
||||||
|
+++ b/main.c 2016-09-07 01:41:51.014309863 +0200
|
||||||
|
@@ -693,6 +693,11 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set up terminal */
|
||||||
|
+ if (!strncmp(getenv("TERM"), "screen", 6)) {
|
||||||
|
+ char term[256];
|
||||||
|
+ snprintf(term, sizeof(term), "xterm%s", getenv("TERM") + 6);
|
||||||
|
+ setenv("TERM", term, 1);
|
||||||
|
+ }
|
||||||
|
atexit(min_panel_remove);
|
||||||
|
panel_init(pcm, test_files, test_mode, start, end>0 ? end : len, len,
|
||||||
|
beep_mode, restart_mode, tests, running_score);
|
||||||
|
@@ -1170,4 +1175,3 @@
|
||||||
|
fprintf(stderr,"Done.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
-
|
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchurl, fetchgit, ftgl, freefont_ttf, libjack2, mesa_glu, pkgconfig
|
{ stdenv, fetchurl, pkgconfig, fetchgit
|
||||||
, libltc, libsndfile, libsamplerate, xz
|
, libltc, libsndfile, libsamplerate, ftgl, freefont_ttf, libjack2
|
||||||
, lv2, mesa, gtk2, cairo, pango, fftwFloat, zita-convolver }:
|
, mesa_glu, lv2, mesa, gtk2, cairo, pango, fftwFloat, zita-convolver }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "20160619";
|
version = "20160619";
|
||||||
@ -11,15 +11,22 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1ald0c5xbfkdq6g5xwyy8wmbi636m3k3gqrq16kbh46g0kld1as9";
|
sha256 = "1ald0c5xbfkdq6g5xwyy8wmbi636m3k3gqrq16kbh46g0kld1as9";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ xz mesa_glu ftgl freefont_ttf libjack2 libltc libsndfile libsamplerate lv2 mesa gtk2 cairo pango fftwFloat pkgconfig zita-convolver];
|
buildInputs = [
|
||||||
|
mesa_glu ftgl freefont_ttf libjack2 libltc libsndfile libsamplerate
|
||||||
|
lv2 mesa gtk2 cairo pango fftwFloat pkgconfig zita-convolver
|
||||||
|
];
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=$(out)" "FONTFILE=${freefont_ttf}/share/fonts/truetype/FreeSansBold.ttf" "LIBZITACONVOLVER=${zita-convolver}/include/zita-convolver.h" ];
|
makeFlags = [
|
||||||
|
"PREFIX=$(out)"
|
||||||
|
"FONTFILE=${freefont_ttf}/share/fonts/truetype/FreeSansBold.ttf"
|
||||||
|
"LIBZITACONVOLVER=${zita-convolver}/include/zita-convolver.h"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib;
|
meta = with stdenv.lib; {
|
||||||
{ description = "Collection of LV2 plugins by Robin Gareus";
|
description = "Collection of LV2 plugins by Robin Gareus";
|
||||||
homepage = https://github.com/x42/x42-plugins;
|
homepage = https://github.com/x42/x42-plugins;
|
||||||
maintainers = with maintainers; [ magnetophon ];
|
maintainers = with maintainers; [ magnetophon ];
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, alsaLib, autoconf, automake, dssi, gtk, libjack2,
|
{ stdenv, fetchurl, alsaLib, autoconf, automake, dssi, gtk2, libjack2,
|
||||||
ladspaH, ladspaPlugins, liblo, pkgconfig }:
|
ladspaH, ladspaPlugins, liblo, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "00nwv2pqjbmxqdc6xdm0cljq6z05lv4y6bibmhz1kih9lm0lklnk";
|
sha256 = "00nwv2pqjbmxqdc6xdm0cljq6z05lv4y6bibmhz1kih9lm0lklnk";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ alsaLib autoconf automake dssi gtk libjack2 ladspaH
|
buildInputs = [ alsaLib autoconf automake dssi gtk2 libjack2 ladspaH
|
||||||
ladspaPlugins liblo pkgconfig ];
|
ladspaPlugins liblo pkgconfig ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
@ -18,6 +18,14 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "031iv7zrpv27zsvahvfyrm75zdrh7591db56q89k8cjiiy600r1j";
|
sha256 = "031iv7zrpv27zsvahvfyrm75zdrh7591db56q89k8cjiiy600r1j";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchurl {
|
||||||
|
name = "lightdm-gtk-greeter-2.0.1-lightdm-1.19.patch";
|
||||||
|
url = "https://588764.bugs.gentoo.org/attachment.cgi?id=442616";
|
||||||
|
sha256 = "0r383kjkvq9yanjc1lk878xc5g8993pjgxylqhhjb5rkpi1mbfsv";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [ pkgconfig lightdm intltool makeWrapper ]
|
buildInputs = [ pkgconfig lightdm intltool makeWrapper ]
|
||||||
++ (if useGTK2 then [ gtk2 ] else [ gtk3 ]);
|
++ (if useGTK2 then [ gtk2 ] else [ gtk3 ]);
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
ver_branch = "1.18";
|
ver_branch = "1.19";
|
||||||
version = "1.18.1";
|
version = "1.19.4";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "lightdm-${version}";
|
name = "lightdm-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "${meta.homepage}/${ver_branch}/${version}/+download/${name}.tar.xz";
|
url = "${meta.homepage}/${ver_branch}/${version}/+download/${name}.tar.xz";
|
||||||
sha256 = "1yl9zhn9l83bj5mbifkxfw15nqgsjzzhqcrgb81fr290wijqaj45";
|
sha256 = "1l105y07wkl9dj0cjhbs8qh6flpkyfj97wkw0rdd3n624lknvbqf";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./fix-paths.patch ];
|
patches = [ ./fix-paths.patch ];
|
||||||
|
@ -3,25 +3,32 @@
|
|||||||
, coreutils
|
, coreutils
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, findutils
|
, findutils
|
||||||
|
, file
|
||||||
, git
|
, git
|
||||||
|
, glxinfo
|
||||||
, gnugrep
|
, gnugrep
|
||||||
, gnutar
|
, gnutar
|
||||||
, gzip
|
, gzip
|
||||||
, jdk
|
, jdk
|
||||||
|
, libpulseaudio
|
||||||
|
, libX11
|
||||||
, libXrandr
|
, libXrandr
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, pciutils
|
||||||
, pkgsi686Linux
|
, pkgsi686Linux
|
||||||
|
, setxkbmap
|
||||||
, stdenv
|
, stdenv
|
||||||
, unzip
|
, unzip
|
||||||
, which
|
, which
|
||||||
, writeTextFile
|
, writeTextFile
|
||||||
|
, xkeyboard_config
|
||||||
, zlib
|
, zlib
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
version = "2.1.2.0";
|
version = "2.1.3.0";
|
||||||
build = "143.2915827";
|
build = "143.3101438";
|
||||||
|
|
||||||
androidStudio = stdenv.mkDerivation {
|
androidStudio = stdenv.mkDerivation {
|
||||||
name = "android-studio";
|
name = "android-studio";
|
||||||
@ -40,6 +47,12 @@ let
|
|||||||
jdk
|
jdk
|
||||||
which
|
which
|
||||||
|
|
||||||
|
# For Android emulator
|
||||||
|
file
|
||||||
|
glxinfo
|
||||||
|
pciutils
|
||||||
|
setxkbmap
|
||||||
|
|
||||||
# Used during setup wizard
|
# Used during setup wizard
|
||||||
gnutar
|
gnutar
|
||||||
gzip
|
gzip
|
||||||
@ -47,21 +60,26 @@ let
|
|||||||
# Runtime stuff
|
# Runtime stuff
|
||||||
git
|
git
|
||||||
|
|
||||||
]}" --set LD_LIBRARY_PATH "${stdenv.lib.makeLibraryPath [
|
]}" --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
|
||||||
# Gradle wants libstdc++.so.6
|
# Gradle wants libstdc++.so.6
|
||||||
stdenv.cc.cc.lib
|
stdenv.cc.cc.lib
|
||||||
# mksdcard wants 32 bit libstdc++.so.6
|
# mksdcard wants 32 bit libstdc++.so.6
|
||||||
pkgsi686Linux.stdenv.cc.cc.lib
|
pkgsi686Linux.stdenv.cc.cc.lib
|
||||||
|
|
||||||
# aapt wants libz.so.1
|
# aapt wants libz.so.1
|
||||||
zlib
|
zlib
|
||||||
pkgsi686Linux.zlib
|
pkgsi686Linux.zlib
|
||||||
# Support multiple monitors
|
# Support multiple monitors
|
||||||
libXrandr
|
libXrandr
|
||||||
]}"
|
|
||||||
|
# For Android emulator
|
||||||
|
libpulseaudio
|
||||||
|
libX11
|
||||||
|
]}" --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb"
|
||||||
'';
|
'';
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip";
|
url = "https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${build}-linux.zip";
|
||||||
sha256 = "0q61m8yln77valg7y6lyxlml53z387zh6fyfgc22sm3br5ahbams";
|
sha256 = "1xlz3ibqrm4ckw4lgbkzbxvpgg0y8hips9b54p4d15f34i0r8bvj";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{ stdenv, lib, zlib, glib, alsaLib, dbus, gtk, atk, pango, freetype, fontconfig
|
{ stdenv, lib, zlib, glib, alsaLib, dbus, gtk2, atk, pango, freetype, fontconfig
|
||||||
, libgnome_keyring3, gdk_pixbuf, gvfs, cairo, cups, expat, libgpgerror, nspr
|
, libgnome_keyring3, gdk_pixbuf, gvfs, cairo, cups, expat, libgpgerror, nspr
|
||||||
, gconf, nss, xorg, libcap, systemd, libnotify
|
, gconf, nss, xorg, libcap, systemd, libnotify
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
packages = [
|
packages = [
|
||||||
stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
|
stdenv.cc.cc zlib glib dbus gtk2 atk pango freetype libgnome_keyring3
|
||||||
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
|
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
|
||||||
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
|
xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
|
||||||
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
|
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ stdenv, fetchurl, buildEnv, gtk, glib, gdk_pixbuf, alsaLib, nss, nspr, gconf
|
{ stdenv, fetchurl, buildEnv, gtk2, glib, gdk_pixbuf, alsaLib, nss, nspr, gconf
|
||||||
, cups, libgcrypt_1_5, systemd, makeWrapper, dbus }:
|
, cups, libgcrypt_1_5, systemd, makeWrapper, dbus }:
|
||||||
let
|
let
|
||||||
bracketsEnv = buildEnv {
|
bracketsEnv = buildEnv {
|
||||||
name = "env-brackets";
|
name = "env-brackets";
|
||||||
paths = [
|
paths = [
|
||||||
gtk glib gdk_pixbuf stdenv.cc.cc alsaLib nss nspr gconf cups libgcrypt_1_5
|
gtk2 glib gdk_pixbuf stdenv.cc.cc alsaLib nss nspr gconf cups libgcrypt_1_5
|
||||||
dbus systemd.lib
|
dbus systemd.lib
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk
|
{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk2
|
||||||
, contribPlugins ? false, hunspell, gamin, boost
|
, contribPlugins ? false, hunspell, gamin, boost
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p";
|
sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk ]
|
buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk2 ]
|
||||||
++ optionals contribPlugins [ hunspell gamin boost ];
|
++ optionals contribPlugins [ hunspell gamin boost ];
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
patches = [ ./writable-projects.patch ];
|
patches = [ ./writable-projects.patch ];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender, zlib, jdk, glib, gtk, libXtst, webkitgtk2, makeWrapper, ... }:
|
{ stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender, zlib, jdk, glib, gtk2, libXtst, webkitgtk2, makeWrapper, ... }:
|
||||||
|
|
||||||
{ name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }:
|
{ name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
|
makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
|
||||||
--prefix PATH : ${jdk}/bin \
|
--prefix PATH : ${jdk}/bin \
|
||||||
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk libXtst ] ++ stdenv.lib.optional (webkitgtk2 != null) webkitgtk2)} \
|
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk2 libXtst ] ++ stdenv.lib.optional (webkitgtk2 != null) webkitgtk2)} \
|
||||||
--add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
|
--add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
|
||||||
|
|
||||||
# Create desktop item.
|
# Create desktop item.
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
{ stdenv, lib, fetchurl, makeDesktopItem, makeWrapper
|
{ stdenv, lib, fetchurl, makeDesktopItem, makeWrapper
|
||||||
, freetype, fontconfig, libX11, libXext, libXrender, zlib
|
, freetype, fontconfig, libX11, libXext, libXrender, zlib
|
||||||
, glib, gtk, libXtst, jdk
|
, glib, libXtst, jdk
|
||||||
, webkitgtk2 ? null # for internal web browser
|
, webkitgtk2 ? null # for internal web browser
|
||||||
, buildEnv, writeText, runCommand
|
, buildEnv, writeText, runCommand
|
||||||
, callPackage
|
, callPackage
|
||||||
} @ args:
|
}:
|
||||||
|
|
||||||
assert stdenv ? glibc;
|
assert stdenv ? glibc;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
buildEclipse = import ./build-eclipse.nix args;
|
buildEclipse = callPackage ./build-eclipse.nix { };
|
||||||
|
|
||||||
eclipse-sdk-35 = buildEclipse {
|
eclipse-sdk-35 = buildEclipse {
|
||||||
name = "eclipse-sdk-3.5.2";
|
name = "eclipse-sdk-3.5.2";
|
||||||
|
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
|
|||||||
"--enable-mac-app=$$out/Applications"
|
"--enable-mac-app=$$out/Applications"
|
||||||
];
|
];
|
||||||
|
|
||||||
CFLAGS = "-O3";
|
CFLAGS = "-O3 -DMAC_OS_X_VERSION_MAX_ALLOWED=1090";
|
||||||
LDFLAGS = "-O3 -L${ncurses.out}/lib";
|
LDFLAGS = "-O3 -L${ncurses.out}/lib";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://tarballs.nixos.org/cua-mode-2.10.el;
|
url = http://tarballs.nixos.org/cua-mode-2.10.el;
|
||||||
md5 = "5bf5e43f5f38c8383868c7c6c5baca09";
|
sha256 = "01877xjbq0v9wrpcbnhvppdn9wxliwkkjg3dr6k795mjgslwhr1b";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33345,8 +33345,8 @@
|
|||||||
sha256 = "11z3b1xwg6r769w3scd29lqg62fx8mp81g8dbx4klmj3clvyn69i";
|
sha256 = "11z3b1xwg6r769w3scd29lqg62fx8mp81g8dbx4klmj3clvyn69i";
|
||||||
};
|
};
|
||||||
recipeFile = fetchurl {
|
recipeFile = fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/milkypostman/melpa/50751b5f9843fde00505edd281e404ec1d875713/recipes/inherit-local";
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/08b978724ff26b3ea7a134d307d888c80e2a92a9/recipes/inherit-local";
|
||||||
sha256 = "0j785xb72nk04x6jb9x5pdwp3dkalqmy208mvj4ss4fm559qfp3i";
|
sha256 = "1v3q3s6qq64k1f4ck6rfgsy1arnf9cxg2kw6d1ahfrwr4ixsqm87";
|
||||||
name = "inherit-local";
|
name = "inherit-local";
|
||||||
};
|
};
|
||||||
packageRequires = [ emacs ];
|
packageRequires = [ emacs ];
|
||||||
@ -34414,22 +34414,22 @@
|
|||||||
license = lib.licenses.free;
|
license = lib.licenses.free;
|
||||||
};
|
};
|
||||||
}) {};
|
}) {};
|
||||||
jade = callPackage ({ company, emacs, fetchFromGitHub, fetchurl, js2-mode, lib, map, melpaBuild, seq, websocket }:
|
jade = callPackage ({ company, emacs, fetchFromGitHub, fetchurl, js2-mode, lib, melpaBuild, seq, websocket }:
|
||||||
melpaBuild {
|
melpaBuild {
|
||||||
pname = "jade";
|
pname = "jade";
|
||||||
version = "20160808.129";
|
version = "20160913.816";
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "NicolasPetton";
|
owner = "NicolasPetton";
|
||||||
repo = "jade";
|
repo = "jade";
|
||||||
rev = "e5204d18a9a9563af2ba5d5f985d6161a906d7d9";
|
rev = "5d9c5cc88a4601700adba558aab2818591fcf02c";
|
||||||
sha256 = "0l0q4c98jil0scr4spc3z3rgy4xy4w85zrsas1z8w142arvpiw70";
|
sha256 = "1jfwns1jk0ixpxcf2rk49mr008bnnzq8g591vyd31lb5n10kwyc2";
|
||||||
};
|
};
|
||||||
recipeFile = fetchurl {
|
recipeFile = fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/milkypostman/melpa/b989c1bd83f20225314b6e903c5e1df972551c19/recipes/jade";
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/b989c1bd83f20225314b6e903c5e1df972551c19/recipes/jade";
|
||||||
sha256 = "04w7pgn0dkppi6l15rkz8b1bcpw1dsgvvijy81a6i4nkigxxlv4y";
|
sha256 = "04w7pgn0dkppi6l15rkz8b1bcpw1dsgvvijy81a6i4nkigxxlv4y";
|
||||||
name = "jade";
|
name = "jade";
|
||||||
};
|
};
|
||||||
packageRequires = [ company emacs js2-mode map seq websocket ];
|
packageRequires = [ company emacs js2-mode seq websocket ];
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://melpa.org/#/jade";
|
homepage = "https://melpa.org/#/jade";
|
||||||
license = lib.licenses.free;
|
license = lib.licenses.free;
|
||||||
@ -42882,8 +42882,8 @@
|
|||||||
sha256 = "1y5x49mqippngp7ya6y7p8z81anrc644n84wpd7y62yqv8qhz0fp";
|
sha256 = "1y5x49mqippngp7ya6y7p8z81anrc644n84wpd7y62yqv8qhz0fp";
|
||||||
};
|
};
|
||||||
recipeFile = fetchurl {
|
recipeFile = fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/milkypostman/melpa/4de2a8cbf1180ec7ca1648f497538b8dbf7a3945/recipes/nix-buffer";
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/08b978724ff26b3ea7a134d307d888c80e2a92a9/recipes/nix-buffer";
|
||||||
sha256 = "1svx1wg05fajxzjz95dfg072i6nfydr0ir4q1zhdxg1igkffqsml";
|
sha256 = "1fjkf88345v9l2v2mk8a057mw0p0rckf6rjf00y5464dyhh58vcd";
|
||||||
name = "nix-buffer";
|
name = "nix-buffer";
|
||||||
};
|
};
|
||||||
packageRequires = [ emacs f ];
|
packageRequires = [ emacs f ];
|
||||||
|
@ -98,9 +98,6 @@ self:
|
|||||||
# upstream issue: missing file header
|
# upstream issue: missing file header
|
||||||
initsplit = markBroken super.initsplit;
|
initsplit = markBroken super.initsplit;
|
||||||
|
|
||||||
# upstream issue: missing dependency
|
|
||||||
jade = null;
|
|
||||||
|
|
||||||
# upstream issue: missing file header
|
# upstream issue: missing file header
|
||||||
jsfmt = markBroken super.jsfmt;
|
jsfmt = markBroken super.jsfmt;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user