Merge branch 'master' into staging

A few trivial conflicts due to *Platforms mass replace.
This commit is contained in:
Vladimír Čunát 2018-09-01 17:37:53 +02:00
commit 2d6179d1e8
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
678 changed files with 49966 additions and 51072 deletions

View file

@ -15,6 +15,12 @@ if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.
it is safe to upgrade by running it again:
curl https://nixos.org/nix/install | sh
For more information, please see the NixOS release notes at
https://nixos.org/nixos/manual or locally at
${toString ./doc/manual/release-notes}.
If you need further help, see https://nixos.org/nixos/support.html
''
else

View file

@ -14,7 +14,7 @@ project.
The package set also provides support for multiple Node.js versions. The policy
is that a new package should be added to the collection for the latest stable LTS
release (which is currently 6.x), unless there is an explicit reason to support
release (which is currently 8.x), unless there is an explicit reason to support
a different release.
If your package uses native addons, you need to examine what kind of native
@ -26,7 +26,7 @@ build system it uses. Here are some examples:
After you have identified the correct system, you need to override your package
expression while adding in build system as a build input. For example, `dat`
requires `node-gyp-build`, so we override its expression in `default-v6.nix`:
requires `node-gyp-build`, so we override its expression in `default-v8.nix`:
```nix
dat = nodePackages.dat.override (oldAttrs: {
@ -36,14 +36,14 @@ dat = nodePackages.dat.override (oldAttrs: {
To add a package from NPM to nixpkgs:
1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json`
for packages depending on Node.js 4.x)
1. Modify `pkgs/development/node-packages/node-packages-v8.json` to add, update
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v10.json`
for packages depending on Node.js 10.x)
2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
3. Build your new package to test your changes:
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
To build against a specific Node.js version (e.g. 4.x):
`nix-build -A nodePackages_4_x.<new-or-updated-package>`
To build against a specific Node.js version (e.g. 10.x):
`nix-build -A nodePackages_10_x.<new-or-updated-package>`
4. Add and commit all modified and generated files.
For more information about the generation process, consult the

View file

@ -1074,4 +1074,5 @@ Following rules are desired to be respected:
* Make sure libraries build for all Python interpreters.
* By default we enable tests. Make sure the tests are found and, in the case of libraries, are passing for all interpreters. If certain tests fail they can be disabled individually. Try to avoid disabling the tests altogether. In any case, when you disable tests, leave a comment explaining why.
* Commit names of Python libraries should reflect that they are Python libraries, so write for example `pythonPackages.numpy: 1.11 -> 1.12`.
* Attribute names in `python-packages.nix` should be normalized according to [PEP 0503](https://www.python.org/dev/peps/pep-0503/#normalized-names).
This means that characters should be converted to lowercase and `.` and `_` should be replaced by a single `-` (foo-bar-baz instead of Foo__Bar.baz )

View file

@ -93,8 +93,8 @@ Now, the file produced by the call to `carnix`, called `hello.nix`, looks like:
```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name;
{ lib, stdenv, buildRustCrate, fetchgit }:
let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped)
in
rec {
@ -122,8 +122,8 @@ following nix file:
```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name;
{ lib, stdenv, buildRustCrate, fetchgit }:
let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped)
in
rec {

View file

@ -78,7 +78,7 @@ Step 2: build kernel headers for the target architecture
---
{stdenv, fetchurl}:
assert stdenv.system == "i686-linux";
assert stdenv.buildPlatform.system == "i686-linux";
stdenv.mkDerivation {
name = "linux-headers-2.6.13.1-arm";

View file

@ -1732,7 +1732,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
Controls whether the installCheck phase is executed. By default it is
skipped, but if <varname>doInstallCheck</varname> is set to true, the
installCheck phase is usually executed. Thus you should set
<programlisting>doInstallCheck = true;</programlisting>
<programlisting>doInstallCheck = true;</programlisting>
in the derivation to enable install checks. The exception is cross
compilation. Cross compiled builds never run tests, no matter how
<varname>doInstallCheck</varname> is set, as the newly-built program
@ -1740,6 +1740,29 @@ set debug-file-directory ~/.nix-profile/lib/debug
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckTarget</varname>
</term>
<listitem>
<para>
The make target that runs the install tests. Defaults to
<literal>installcheck</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckFlags</varname> / <varname>installCheckFlagsArray</varname>
</term>
<listitem>
<para>
A list of strings passed as additional flags to <command>make</command>.
Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
but only used by the installCheck phase.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckInputs</varname>

View file

@ -145,7 +145,7 @@ rec {
foldAttrs = op: nul: list_of_attrs:
fold (n: a:
fold (name: o:
o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
o // { ${name} = op n.${name} (a.${name} or nul); }
) a (attrNames n)
) {} list_of_attrs;

View file

@ -1,2 +1,2 @@
# Expose the minimum required version for evaluating Nixpkgs
"1.11"
"2.0"

View file

@ -192,29 +192,53 @@ rec {
(concatMap (m: map (config: { inherit (m) file; inherit config; }) (pushDownProperties m.config)) modules);
mergeModules' = prefix: options: configs:
listToAttrs (map (name: {
let
/* byName is like foldAttrs, but will look for attributes to merge in the
specified attribute name.
byName "foo" (module: value: ["module.hidden=${module.hidden},value=${value}"])
[
{
hidden="baz";
foo={qux="bar"; gla="flop";};
}
{
hidden="fli";
foo={qux="gne"; gli="flip";};
}
]
===>
{
gla = [ "module.hidden=baz,value=flop" ];
gli = [ "module.hidden=fli,value=flip" ];
qux = [ "module.hidden=baz,value=bar" "module.hidden=fli,value=gne" ];
}
*/
byName = attr: f: modules: foldl' (acc: module:
foldl' (inner: name:
inner // { ${name} = (acc.${name} or []) ++ (f module module.${attr}.${name}); }
) acc (attrNames module.${attr})
) {} modules;
# an attrset 'name' => list of submodules that declare name.
declsByName = byName "options"
(module: option: [{ inherit (module) file; options = option; }])
options;
# an attrset 'name' => list of submodules that define name.
defnsByName = byName "config" (module: value:
map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
) configs;
# extract the definitions for each loc
defnsByName' = byName "config"
(module: value: [{ inherit (module) file; inherit value; }])
configs;
in
(flip mapAttrs declsByName (name: decls:
# We're descending into attribute name.
inherit name;
value =
let
loc = prefix ++ [name];
# Get all submodules that declare name.
decls = concatMap (m:
if m.options ? ${name}
then [ { inherit (m) file; options = m.options.${name}; } ]
else []
) options;
# Get all submodules that define name.
defns = concatMap (m:
if m.config ? ${name}
then map (config: { inherit (m) file; inherit config; })
(pushDownProperties m.config.${name})
else []
) configs;
defns = defnsByName.${name} or [];
defns' = defnsByName'.${name} or [];
nrOptions = count (m: isOption m.options) decls;
# Extract the definitions for this loc
defns' = map (m: { inherit (m) file; value = m.config.${name}; })
(filter (m: m.config ? ${name}) configs);
in
if nrOptions == length decls then
let opt = fixupOptionType loc (mergeOptionDecls loc decls);
@ -226,8 +250,8 @@ rec {
in
throw "The option `${showOption loc}' in `${firstOption.file}' is a prefix of options in `${firstNonOption.file}'."
else
mergeModules' loc decls defns;
}) (concatMap (m: attrNames m.options) options))
mergeModules' loc decls defns
))
// { _definedNames = map (m: { inherit (m) file; names = attrNames m.config; }) configs; };
/* Merge multiple option declarations into a single declaration. In

View file

@ -23,6 +23,11 @@
github = "a1russell";
name = "Adam Russell";
};
aanderse = {
email = "aaron@fosslib.net";
github = "aanderse";
name = "Aaron Andersen";
};
aaronschif = {
email = "aaronschif@gmail.com";
github = "aaronschif";

View file

@ -50,4 +50,14 @@ $ nix-store --optimise
Since this command needs to read the entire Nix store, it can take quite a
while to finish.
</para>
<section xml:id="sect-nixos-gc-boot-entries">
<title>NixOS Boot Entries</title>
<para>
If your <filename>/boot</filename> partition runs out of space, after
clearing old profiles you must rebuild your system with
<literal>nixos-rebuild</literal> to update the <filename>/boot</filename>
partition and clear space.
</para>
</section>
</chapter>

View file

@ -0,0 +1,47 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-installing-behind-proxy">
<title>Installing behind a proxy</title>
<para>
To install NixOS behind a proxy, do the following before running
<literal>nixos-install</literal>.
</para>
<orderedlist numeration="arabic">
<listitem>
<para>
Update proxy configuration in
<literal>/mnt/etc/nixos/configuration.nix</literal> to keep the
internet accessible after reboot.
</para>
<programlisting>
networking.proxy.default = &quot;http://user:password@proxy:port/&quot;;
networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
</programlisting>
</listitem>
<listitem>
<para>
Setup the proxy environment variables in the shell where you are
running <literal>nixos-install</literal>.
</para>
<programlisting>
# proxy_url=&quot;http://user:password@proxy:port/&quot;
# export http_proxy=&quot;$proxy_url&quot;
# export HTTP_PROXY=&quot;$proxy_url&quot;
# export https_proxy=&quot;$proxy_url&quot;
# export HTTPS_PROXY=&quot;$proxy_url&quot;
</programlisting>
</listitem>
</orderedlist>
<note>
<para>
If you are switching networks with different proxy configurations, use the
<literal>nesting.clone</literal> option in
<literal>configuration.nix</literal> to switch proxies at runtime.
Refer to <xref linkend="ch-options" /> for more information.
</para>
</note>
</section>

View file

@ -443,4 +443,5 @@ $ nix-env -i w3m</screen>
<xi:include href="installing-pxe.xml" />
<xi:include href="installing-virtualbox-guest.xml" />
<xi:include href="installing-from-other-distro.xml" />
<xi:include href="installing-behind-a-proxy.xml" />
</chapter>

View file

@ -139,6 +139,50 @@ $ nix-instantiate -E '(import &lt;nixpkgsunstable&gt; {}).gitFull'
seen a complete rewrite. (See above.)
</para>
</listitem>
<listitem>
<para>
The minimum version of Nix required to evaluate Nixpkgs is now 2.0.
</para>
<itemizedlist>
<listitem>
<para>
For users of NixOS 18.03, NixOS 18.03 defaulted to Nix 2.0, but
supported using Nix 1.11 by setting <literal>nix.package =
pkgs.nix1;</literal>. If this option is set to a Nix 1.11 package, you
will need to either unset the option or upgrade it to Nix 2.0.
</para>
</listitem>
<listitem>
<para>
For users of NixOS 17.09, you will first need to upgrade Nix by setting
<literal>nix.package = pkgs.nixStable2;</literal> and run
<command>nixos-rebuild switch</command> as the <literal>root</literal>
user.
</para>
</listitem>
<listitem>
<para>
For users of a daemon-less Nix installation on Linux or macOS, you can
upgrade Nix by running <command>curl https://nixos.org/nix/install |
sh</command>, or prior to doing a channel update, running
<command>nix-env -iA nix</command>.
</para>
<para>
If you have already run a channel update and Nix is no longer able to
evaluate Nixpkgs, the error message printed should provide adequate
directions for upgrading Nix.
</para>
</listitem>
<listitem>
<para>
For users of the Nix daemon on macOS, you can upgrade Nix by running
<command>sudo -i sh -c 'nix-channel --update &amp;&amp; nix-env -iA
nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl
start org.nixos.nix-daemon</command>.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>lib.strict</literal> is removed. Use
@ -477,6 +521,13 @@ inherit (pkgs.nixos {
all user units for each authenticated user.
</para>
</listitem>
<listitem>
<para>
The default display manager is now LightDM.
To use SLiM set <literal>services.xserver.displayManager.slim.enable</literal>
to <literal>true</literal>.
</para>
</listitem>
</itemizedlist>
</section>
</section>

View file

@ -1,7 +1,7 @@
{ stdenv, perl, pixz, pathsFromGraph
, # The file name of the resulting tarball
fileName ? "nixos-system-${stdenv.system}"
fileName ? "nixos-system-${stdenv.hostPlatform.system}"
, # The files and directories to be placed in the tarball.
# This is a list of attribute sets {source, target} where `source'

View file

@ -14,12 +14,12 @@ in
qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'";
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
qemuBinary = qemuPkg: {
"x86_64-linux" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
"armv7l-linux" = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
"aarch64-linux" = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
"x86_64-darwin" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
}.${pkgs.stdenv.system} or "${qemuPkg}/bin/qemu-kvm";
}.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
}

View file

@ -81,6 +81,12 @@ in
description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
};
extraSetup = mkOption {
type = types.lines;
default = "";
description = "Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out.";
};
};
system = {
@ -107,12 +113,7 @@ in
"/etc/gtk-3.0"
"/lib" # FIXME: remove and update debug-info.nix
"/sbin"
"/share/applications"
"/share/desktop-directories"
"/share/emacs"
"/share/icons"
"/share/menus"
"/share/mime"
"/share/nano"
"/share/org"
"/share/themes"
@ -132,10 +133,6 @@ in
# outputs TODO: note that the tools will often not be linked by default
postBuild =
''
if [ -x $out/bin/update-mime-database -a -w $out/share/mime ]; then
XDG_DATA_DIRS=$out/share $out/bin/update-mime-database -V $out/share/mime > /dev/null
fi
if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then
$out/bin/gtk-update-icon-cache $out/share/icons/hicolor
fi
@ -143,17 +140,8 @@ in
if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
$out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
fi
if [ -x $out/bin/update-desktop-database -a -w $out/share/applications ]; then
$out/bin/update-desktop-database $out/share/applications
fi
if [ -x $out/bin/install-info -a -w $out/share/info ]; then
shopt -s nullglob
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
$out/bin/install-info $i $out/share/info/dir
done
fi
${config.environment.extraSetup}
'';
};

View file

@ -0,0 +1,22 @@
{ config, lib, ... }:
with lib;
{
options = {
xdg.autostart.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install files to support the
<link xlink:href="https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html">XDG Autostart specification</link>.
'';
};
};
config = mkIf config.xdg.autostart.enable {
environment.pathsToLink = [
"/etc/xdg/autostart"
];
};
}

View file

@ -0,0 +1,27 @@
{ config, lib, ... }:
with lib;
{
options = {
xdg.icons.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install files to support the
<link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>.
'';
};
};
config = mkIf config.xdg.icons.enable {
environment.pathsToLink = [
"/share/icons"
"/share/pixmaps"
];
environment.profileRelativeEnvVars = {
XCURSOR_PATH = [ "/share/icons" ];
};
};
}

View file

@ -0,0 +1,25 @@
{ config, lib, ... }:
with lib;
{
options = {
xdg.menus.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install files to support the
<link xlink:href="https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html">XDG Desktop Menu specification</link>.
'';
};
};
config = mkIf config.xdg.menus.enable {
environment.pathsToLink = [
"/share/applications"
"/share/desktop-directories"
"/etc/xdg/menus"
"/etc/xdg/menus/applications-merged"
];
};
}

View file

@ -0,0 +1,36 @@
{ config, lib, pkgs, ... }:
with lib;
{
options = {
xdg.mime.enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to install files to support the
<link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">XDG Shared MIME-info specification</link> and the
<link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html">XDG MIME Applications specification</link>.
'';
};
};
config = mkIf config.xdg.mime.enable {
environment.pathsToLink = [ "/share/mime" ];
environment.systemPackages = [
# this package also installs some useful data, as well as its utilities
pkgs.shared-mime-info
];
environment.extraSetup = ''
if [ -w $out/share/mime ]; then
XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null
fi
if [ -w $out/share/applications ]; then
${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
fi
'';
};
}

View file

@ -16,7 +16,7 @@ with lib;
];
# ISO naming.
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.iso";
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
isoImage.volumeID = substring 0 11 "NIXOS_ISO";

View file

@ -16,7 +16,8 @@ in
];
assertions = lib.singleton {
assertion = pkgs.stdenv.system == "aarch64-linux";
assertion = pkgs.stdenv.hostPlatform.system == "aarch64-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " +
"it cannot be cross compiled";
};

View file

@ -16,7 +16,8 @@ in
];
assertions = lib.singleton {
assertion = pkgs.stdenv.system == "armv7l-linux";
assertion = pkgs.stdenv.hostPlatform.system == "armv7l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-armv7l-multiplatform.nix can be only built natively on ARMv7; " +
"it cannot be cross compiled";
};

View file

@ -16,7 +16,8 @@ in
];
assertions = lib.singleton {
assertion = pkgs.stdenv.system == "armv6l-linux";
assertion = pkgs.stdenv.hostPlatform.system == "armv6l-linux"
&& pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
message = "sd-image-raspberrypi.nix can be only built natively on ARMv6; " +
"it cannot be cross compiled";
};

View file

@ -22,7 +22,7 @@ in
{
options.sdImage = {
imageName = mkOption {
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.system}.img";
default = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img";
description = ''
Name of the generated image file.
'';
@ -102,7 +102,7 @@ in
mkdir -p $out/nix-support $out/sd-image
export img=$out/sd-image/${config.sdImage.imageName}
echo "${pkgs.stdenv.system}" > $out/nix-support/system
echo "${pkgs.stdenv.buildPlatform.system}" > $out/nix-support/system
echo "file sd-image $img" >> $out/nix-support/hydra-build-products
# Create the image file sized to fit /boot and /, plus 20M of slack

View file

@ -25,7 +25,7 @@ with lib;
# !!! Hack - attributes expected by other modules.
environment.systemPackages = [ pkgs.grub2_efi ]
++ (if pkgs.stdenv.system == "aarch64-linux"
++ (if pkgs.stdenv.hostPlatform.system == "aarch64-linux"
then []
else [ pkgs.grub2 pkgs.syslinux ]);

4
nixos/modules/installer/tools/nixos-generate-config.pl Normal file → Executable file
View file

@ -574,6 +574,10 @@ $bootLoaderConfig
# networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";

View file

@ -82,6 +82,14 @@ let cfg = config.documentation; in
environment.systemPackages = [ pkgs.texinfoInteractive ];
environment.pathsToLink = [ "/share/info" ];
environment.extraOutputsToInstall = [ "info" ] ++ optional cfg.dev.enable "devinfo";
environment.extraSetup = ''
if [ -w $out/share/info ]; then
shopt -s nullglob
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
${pkgs.texinfo}/bin/install-info $i $out/share/info/dir
done
fi
'';
})
(mkIf cfg.doc.enable {

View file

@ -328,6 +328,7 @@
qemu-libvirtd = 301;
# kvm = 302; # unused
# render = 303; # unused
zeronet = 304;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -616,6 +617,7 @@
qemu-libvirtd = 301;
kvm = 302; # default udev rules from systemd requires these
render = 303; # default udev rules from systemd requires these
zeronet = 304;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

View file

@ -7,6 +7,10 @@
./config/fonts/fontdir.nix
./config/fonts/fonts.nix
./config/fonts/ghostscript.nix
./config/xdg/autostart.nix
./config/xdg/icons.nix
./config/xdg/menus.nix
./config/xdg/mime.nix
./config/gnu.nix
./config/i18n.nix
./config/iproute2.nix
@ -417,6 +421,7 @@
./services/monitoring/graphite.nix
./services/monitoring/hdaps.nix
./services/monitoring/heapster.nix
./services/monitoring/incron.nix
./services/monitoring/longview.nix
./services/monitoring/monit.nix
./services/monitoring/munin.nix
@ -615,6 +620,7 @@
./services/networking/xl2tpd.nix
./services/networking/xrdp.nix
./services/networking/zerobin.nix
./services/networking/zeronet.nix
./services/networking/zerotierone.nix
./services/networking/znc.nix
./services/printing/cupsd.nix

View file

@ -40,7 +40,6 @@ in
GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" ];
XDG_CONFIG_DIRS = [ "/etc/xdg" ];
XDG_DATA_DIRS = [ "/share" ];
XCURSOR_PATH = [ "/share/icons" ];
MOZ_PLUGIN_PATH = [ "/lib/mozilla/plugins" ];
LIBEXEC_PATH = [ "/lib/libexec" ];
};

View file

@ -283,7 +283,7 @@ in
mkdir -p ${cfg.repositoryRoot}
# update all hooks' binary paths
HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 5 -type f -wholename "*git/hooks/*")
HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 6 -type f -wholename "*git/hooks/*")
if [ "$HOOKS" ]
then
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gitea,${gitea.bin}/bin/gitea,g' $HOOKS

View file

@ -10,7 +10,7 @@ let
toYesNo = b: if b then "yes" else "no";
gititShared = with cfg.haskellPackages; gitit + "/share/" + pkgs.stdenv.system + "-" + ghc.name + "/" + gitit.pname + "-" + gitit.version;
gititShared = with cfg.haskellPackages; gitit + "/share/" + pkgs.stdenv.hostPlatform.system + "-" + ghc.name + "/" + gitit.pname + "-" + gitit.version;
gititWithPkgs = hsPkgs: extras: hsPkgs.ghcWithPackages (self: with self; [ gitit ] ++ (extras self));

View file

@ -0,0 +1,98 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.incron;
in
{
options = {
services.incron = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the incron daemon.
Note that commands run under incrontab only support common Nix profiles for the <envar>PATH</envar> provided variable.
'';
};
allow = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
Users allowed to use incrontab.
If empty then no user will be allowed to have their own incrontab.
If <literal>null</literal> then will defer to <option>deny</option>.
If both <option>allow</option> and <option>deny</option> are null
then all users will be allowed to have their own incrontab.
'';
};
deny = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = "Users forbidden from using incrontab.";
};
systab = mkOption {
type = types.lines;
default = "";
description = "The system incrontab contents.";
example = ''
/var/mail IN_CLOSE_WRITE abc $@/$#
/tmp IN_ALL_EVENTS efg $@/$# $&
'';
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.rsync ]";
description = "Extra packages available to the system incrontab.";
};
};
};
config = mkIf cfg.enable {
warnings = optional (cfg.allow != null && cfg.deny != null)
''If `services.incron.allow` is set then `services.incron.deny` will be ignored.'';
environment.systemPackages = [ pkgs.incron ];
security.wrappers.incrontab.source = "${pkgs.incron}/bin/incrontab";
# incron won't read symlinks
environment.etc."incron.d/system" = {
mode = "0444";
text = cfg.systab;
};
environment.etc."incron.allow" = mkIf (cfg.allow != null) {
text = concatStringsSep "\n" cfg.allow;
};
environment.etc."incron.deny" = mkIf (cfg.deny != null) {
text = concatStringsSep "\n" cfg.deny;
};
systemd.services.incron = {
description = "File System Events Scheduler";
wantedBy = [ "multi-user.target" ];
path = cfg.extraPackages;
serviceConfig.PIDFile = "/run/incrond.pid";
serviceConfig.ExecStartPre = "${pkgs.coreutils}/bin/mkdir -m 710 -p /var/spool/incron";
serviceConfig.ExecStart = "${pkgs.incron}/bin/incrond --foreground";
};
};
}

View file

@ -99,7 +99,7 @@ let
nopriv_user=vsftpd
secure_chroot_dir=/var/empty
syslog_enable=YES
${optionalString (pkgs.stdenv.system == "x86_64-linux") ''
${optionalString (pkgs.stdenv.hostPlatform.system == "x86_64-linux") ''
seccomp_sandbox=NO
''}
anon_umask=${cfg.anonymousUmask}

View file

@ -93,10 +93,14 @@ in
config = mkIf cfg.enable {
# copied from <nixos/modules/services/x11/xserver.nix>
# xrdp can run X11 program even if "services.xserver.enable = false"
environment.pathsToLink =
[ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ];
xdg = {
autostart.enable = true;
menus.enable = true;
mime.enable = true;
icons.enable = true;
};
fonts.enableDefaultFonts = mkDefault true;
systemd = {

View file

@ -0,0 +1,102 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.zeronet;
zConfFile = pkgs.writeTextFile {
name = "zeronet.conf";
text = ''
[global]
data_dir = ${cfg.dataDir}
log_dir = ${cfg.logDir}
'' + lib.optionalString (cfg.port != null) ''
ui_port = ${toString cfg.port}
'' + cfg.extraConfig;
};
in with lib; {
options.services.zeronet = {
enable = mkEnableOption "zeronet";
dataDir = mkOption {
type = types.path;
default = "/var/lib/zeronet";
example = "/home/okina/zeronet";
description = "Path to the zeronet data directory.";
};
logDir = mkOption {
type = types.path;
default = "/var/log/zeronet";
example = "/home/okina/zeronet/log";
description = "Path to the zeronet log directory.";
};
port = mkOption {
type = types.nullOr types.int;
default = null;
example = 15441;
description = "Optional zeronet port.";
};
tor = mkOption {
type = types.bool;
default = false;
description = "Use TOR for all zeronet traffic.";
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration. Contents will be added verbatim to the
configuration file at the end.
'';
};
};
config = mkIf cfg.enable {
services.tor = mkIf cfg.tor {
enable = true;
controlPort = 9051;
extraConfig = "CookieAuthentication 1";
};
systemd.services.zeronet = {
description = "zeronet";
after = [ "network.target" (optionalString cfg.tor "tor.service") ];
wantedBy = [ "multi-user.target" ];
preStart = ''
# Ensure folder exists or create it and permissions are correct
mkdir -p ${escapeShellArg cfg.dataDir} ${escapeShellArg cfg.logDir}
chmod 750 ${escapeShellArg cfg.dataDir} ${escapeShellArg cfg.logDir}
chown zeronet:zeronet ${escapeShellArg cfg.dataDir} ${escapeShellArg cfg.logDir}
'';
serviceConfig = {
PermissionsStartOnly = true;
PrivateTmp = "yes";
User = "zeronet";
Group = "zeronet";
ExecStart = "${pkgs.zeronet}/bin/zeronet --config_file ${zConfFile}";
};
};
users = {
groups.zeronet.gid = config.ids.gids.zeronet;
users.zeronet = {
description = "zeronet service user";
home = cfg.dataDir;
createHome = true;
group = "zeronet";
extraGroups = mkIf cfg.tor [ "tor" ];
uid = config.ids.uids.zeronet;
};
};
};
meta.maintainers = with maintainers; [ chiiruno ];
}

View file

@ -188,11 +188,14 @@ in {
wants = [ "systemd-udevd.service" "local-fs.target" ];
# make sure an empty rule file and required directories exist
preStart = ''mkdir -p $(dirname "${cfg.ruleFile}") "${cfg.IPCAccessControlFiles}" && ([ -f "${cfg.ruleFile}" ] || touch ${cfg.ruleFile})'';
preStart = ''
mkdir -p $(dirname "${cfg.ruleFile}") $(dirname "${cfg.auditFilePath}") "${cfg.IPCAccessControlFiles}" \
&& ([ -f "${cfg.ruleFile}" ] || touch ${cfg.ruleFile})
'';
serviceConfig = {
Type = "simple";
ExecStart = ''${pkgs.usbguard}/bin/usbguard-daemon -P -d -k -c ${daemonConfFile}'';
ExecStart = ''${pkgs.usbguard}/bin/usbguard-daemon -P -k -c ${daemonConfFile}'';
Restart = "on-failure";
};
};

View file

@ -142,6 +142,7 @@ in
${getLib pkgs.attr}/lib/libattr*.so* mr,
${getLib pkgs.lz4}/lib/liblz4*.so* mr,
${getLib pkgs.libkrb5}/lib/lib*.so* mr,
${getLib pkgs.keyutils}/lib/libkeyutils*.so* mr,
@{PROC}/sys/kernel/random/uuid r,
@{PROC}/sys/vm/overcommit_memory r,

View file

@ -16,9 +16,11 @@ let
} // (optionalAttrs vhostConfig.enableACME {
sslCertificate = "${acmeDirectory}/${serverName}/fullchain.pem";
sslCertificateKey = "${acmeDirectory}/${serverName}/key.pem";
sslTrustedCertificate = "${acmeDirectory}/${serverName}/full.pem";
}) // (optionalAttrs (vhostConfig.useACMEHost != null) {
sslCertificate = "${acmeDirectory}/${vhostConfig.useACMEHost}/fullchain.pem";
sslCertificateKey = "${acmeDirectory}/${vhostConfig.useACMEHost}/key.pem";
sslTrustedCertificate = "${acmeDirectory}/${vhostConfig.useACMEHost}/full.pem";
})
) cfg.virtualHosts;
enableIPv6 = config.networking.enableIPv6;
@ -228,6 +230,9 @@ let
ssl_certificate ${vhost.sslCertificate};
ssl_certificate_key ${vhost.sslCertificateKey};
''}
${optionalString (hasSSL && vhost.sslTrustedCertificate != null) ''
ssl_trusted_certificate ${vhost.sslTrustedCertificate};
''}
${optionalString (vhost.basicAuthFile != null || vhost.basicAuth != {}) ''
auth_basic secured;

View file

@ -129,6 +129,13 @@ with lib;
description = "Path to server SSL certificate key.";
};
sslTrustedCertificate = mkOption {
type = types.path;
default = null;
example = "/var/root.cert";
description = "Path to root SSL certificate for stapling and client certificates.";
};
http2 = mkOption {
type = types.bool;
default = true;

View file

@ -33,12 +33,17 @@ in
pkgs.xorg.xauth # used by kdesu
pkgs.gtk2 # To get GTK+'s themes.
pkgs.tango-icon-theme
pkgs.shared-mime-info
pkgs.gnome2.gnomeicontheme
pkgs.xorg.xcursorthemes
];
environment.pathsToLink = [ "/etc/enlightenment" "/etc/xdg" "/share/enlightenment" "/share/elementary" "/share/applications" "/share/locale" "/share/icons" "/share/themes" "/share/mime" "/share/desktop-directories" ];
environment.pathsToLink = [
"/etc/enlightenment"
"/share/enlightenment"
"/share/elementary"
"/share/locale"
];
services.xserver.desktopManager.session = [
{ name = "Enlightenment";

View file

@ -33,10 +33,10 @@ let
chmod -R a+w $out/share/gsettings-schemas/nixos-gsettings-overrides
cat - > $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/nixos-defaults.gschema.override <<- EOF
[org.gnome.desktop.background]
picture-uri='${pkgs.nixos-artwork.wallpapers.gnome-dark}/share/artwork/gnome/Gnome_Dark.png'
picture-uri='${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/artwork/gnome/nix-wallpaper-simple-dark-gray.png'
[org.gnome.desktop.screensaver]
picture-uri='${pkgs.nixos-artwork.wallpapers.gnome-dark}/share/artwork/gnome/Gnome_Dark.png'
picture-uri='${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bottom.png'
${cfg.extraGSettingsOverrides}
EOF
@ -132,6 +132,7 @@ in {
fonts.fonts = [ pkgs.dejavu_fonts pkgs.cantarell-fonts ];
services.xserver.displayManager.gdm.enable = mkDefault true;
services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ];
services.xserver.displayManager.sessionCommands = ''
@ -161,6 +162,8 @@ in {
# TODO: Create nautilus-with-extensions package
environment.variables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0";
services.xserver.updateDbusEnvironment = true;
environment.variables.GIO_EXTRA_MODULES = [ "${lib.getLib pkgs.gnome3.dconf}/lib/gio/modules"
"${pkgs.gnome3.glib-networking.out}/lib/gio/modules"
"${pkgs.gnome3.gvfs}/lib/gio/modules" ];

View file

@ -41,9 +41,8 @@ in
# Link some extra directories in /run/current-system/software/share
environment.pathsToLink = [
"/share/desktop-directories"
"/share/icons"
"/share/lumina"
# FIXME: modules should link subdirs of `/share` rather than relying on this
"/share"
];

View file

@ -174,7 +174,10 @@ in
++ lib.optional config.services.colord.enable colord-kde
++ lib.optionals config.services.samba.enable [ kdenetwork-filesharing pkgs.samba ];
environment.pathsToLink = [ "/share" ];
environment.pathsToLink = [
# FIXME: modules should link subdirs of `/share` rather than relying on this
"/share"
];
environment.etc = singleton {
source = xcfg.xkbDir;

View file

@ -59,9 +59,6 @@ in
tango-icon-theme
xfce4-icon-theme
desktop-file-utils
shared-mime-info
# Needed by Xfce's xinitrc script
# TODO: replace with command -v
which
@ -100,8 +97,6 @@ in
environment.pathsToLink = [
"/share/xfce4"
"/share/themes"
"/share/mime"
"/share/desktop-directories"
"/share/gtksourceview-2.0"
];

View file

@ -41,10 +41,12 @@ in
config = mkIf cfg.enable {
services.xserver.displayManager.slim = {
services.xserver.displayManager.lightdm = {
enable = true;
autoLogin = true;
defaultUser = cfg.user;
autoLogin = {
enable = true;
user = cfg.user;
};
};
};

View file

@ -87,7 +87,7 @@ in
}
];
services.xserver.displayManager.slim.enable = false;
services.xserver.displayManager.lightdm.enable = false;
users.users.gdm =
{ name = "gdm";

View file

@ -115,7 +115,7 @@ in
background = mkOption {
type = types.str;
default = "${pkgs.nixos-artwork.wallpapers.gnome-dark}/share/artwork/gnome/Gnome_Dark.png";
default = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bottom.png";
description = ''
The background image or color to use.
'';
@ -191,8 +191,6 @@ in
}
];
services.xserver.displayManager.slim.enable = false;
services.xserver.displayManager.job = {
logToFile = true;

View file

@ -206,8 +206,6 @@ in
}
];
services.xserver.displayManager.slim.enable = false;
services.xserver.displayManager.job = {
logToFile = true;

View file

@ -49,7 +49,7 @@ in
enable = mkOption {
type = types.bool;
default = config.services.xserver.enable;
default = false;
description = ''
Whether to enable SLiM as the display manager.
'';

View file

@ -535,6 +535,15 @@ in
config = mkIf cfg.enable {
services.xserver.displayManager.lightdm.enable =
let dmconf = cfg.displayManager;
default = !( dmconf.auto.enable
|| dmconf.gdm.enable
|| dmconf.sddm.enable
|| dmconf.slim.enable
|| dmconf.xpra.enable );
in mkIf (default) true;
hardware.opengl.enable = mkDefault true;
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
@ -616,8 +625,12 @@ in
]
++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
environment.pathsToLink =
[ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ];
xdg = {
autostart.enable = true;
menus.enable = true;
mime.enable = true;
icons.enable = true;
};
# The default max inotify watches is 8192.
# Nowadays most apps require a good number of inotify watches,

View file

@ -162,6 +162,13 @@ in
description = ''
Additional configurations to build based on the current
configuration which then has a lower priority.
To switch to a cloned configuration (e.g. <literal>child-1</literal>)
at runtime, run
<programlisting>
# sudo /run/current-system/fine-tune/child-1/bin/switch-to-configuration test
</programlisting>
'';
};

View file

@ -38,6 +38,8 @@ let
in
pkgs.writeText "grub-config.xml" (builtins.toXML
{ splashImage = f cfg.splashImage;
splashMode = f cfg.splashMode;
backgroundColor = f cfg.backgroundColor;
grub = f grub;
grubTarget = f (grub.grubTarget or "");
shell = "${pkgs.runtimeShell}";
@ -80,6 +82,8 @@ let
"--output" "$out"
] ++ (optional (cfg.fontSize!=null) "--size ${toString cfg.fontSize}")))
);
defaultSplash = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray-bootloader}/share/artwork/gnome/nix-wallpaper-simple-dark-gray_bootloader.png";
in
{
@ -328,6 +332,31 @@ in
'';
};
backgroundColor = mkOption {
type = types.nullOr types.string;
example = "#7EBAE4";
default = null;
description = ''
Background color to be used for GRUB to fill the areas the image isn't filling.
<note><para>
This options has no effect for GRUB 1.
</para></note>
'';
};
splashMode = mkOption {
type = types.enum [ "normal" "stretch" ];
default = "stretch";
description = ''
Whether to stretch the image or show the image in the top-left corner unstretched.
<note><para>
This options has no effect for GRUB 1.
</para></note>
'';
};
font = mkOption {
type = types.nullOr types.path;
default = "${realGrub}/share/grub/unicode.pf2";
@ -531,9 +560,14 @@ in
sha256 = "14kqdx2lfqvh40h6fjjzqgff1mwk74dmbjvmqphi6azzra7z8d59";
}
# GRUB 1.97 doesn't support gzipped XPMs.
else "${pkgs.nixos-artwork.wallpapers.gnome-dark}/share/artwork/gnome/Gnome_Dark.png");
else defaultSplash);
}
(mkIf (cfg.splashImage == defaultSplash) {
boot.loader.grub.backgroundColor = mkDefault "#2F302F";
boot.loader.grub.splashMode = mkDefault "normal";
})
(mkIf cfg.enable {
boot.loader.grub.devices = optional (cfg.device != "") cfg.device;

View file

@ -51,6 +51,8 @@ my $extraEntries = get("extraEntries");
my $extraEntriesBeforeNixOS = get("extraEntriesBeforeNixOS") eq "true";
my $extraInitrd = get("extraInitrd");
my $splashImage = get("splashImage");
my $splashMode = get("splashMode");
my $backgroundColor = get("backgroundColor");
my $configurationLimit = int(get("configurationLimit"));
my $copyKernels = get("copyKernels") eq "true";
my $timeout = int(get("timeout"));
@ -307,10 +309,15 @@ else {
if ($suffix eq ".jpg") {
$suffix = ".jpeg";
}
if ($backgroundColor) {
$conf .= "
background_color '$backgroundColor'
";
}
copy $splashImage, "$bootPath/background$suffix" or die "cannot copy $splashImage to $bootPath\n";
$conf .= "
insmod " . substr($suffix, 1) . "
if background_image " . $grubBoot->path . "/background$suffix; then
if background_image --mode '$splashMode' " . $grubBoot->path . "/background$suffix; then
set color_normal=white/black
set color_highlight=black/white
else

View file

@ -324,7 +324,7 @@ in
[ "aes" "aes_generic" "blowfish" "twofish"
"serpent" "cbc" "xts" "lrw" "sha1" "sha256" "sha512"
(if pkgs.stdenv.system == "x86_64-linux" then "aes_x86_64" else "aes_i586")
(if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then "aes_x86_64" else "aes_i586")
];
description = ''
A list of cryptographic kernel modules needed to decrypt the root device(s).

View file

@ -263,6 +263,13 @@ checkFS() {
return 0
fi
# Device might be already mounted manually
# e.g. NBD-device or the host filesystem of the file which contains encrypted root fs
if mount | grep -q "^$device on "; then
echo "skip checking already mounted $device"
return 0
fi
# Optionally, skip fsck on journaling filesystems. This option is
# a hack - it's mostly because e2fsck on ext3 takes much longer to
# recover the journal than the ext3 implementation in the kernel

View file

@ -77,7 +77,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "Azure not currently supported on ${pkgs.stdenv.system}";
message = "Azure not currently supported on ${pkgs.stdenv.hostPlatform.system}";
} {
assertion = config.networking.networkmanager.enable == false;
message = "Windows Azure Linux Agent is not compatible with NetworkManager";

View file

@ -26,7 +26,7 @@ in
rm $diskImageBase
popd
'';
diskImageBase = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.system}.raw";
diskImageBase = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw";
buildInputs = [ pkgs.utillinux pkgs.perl ];
exportReferencesGraph =
[ "closure" config.system.build.toplevel ];

View file

@ -14,7 +14,7 @@ in
PATH=$PATH:${pkgs.stdenv.lib.makeBinPath [ pkgs.gnutar pkgs.gzip ]}
pushd $out
mv $diskImage disk.raw
tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.system}.raw.tar.gz disk.raw
tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz disk.raw
rm $out/disk.raw
popd
'';

View file

@ -34,7 +34,7 @@ in
config = mkIf cfg.enable (mkMerge [{
assertions = [{
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "Virtualbox not currently supported on ${pkgs.stdenv.system}";
message = "Virtualbox not currently supported on ${pkgs.stdenv.hostPlatform.system}";
}];
environment.systemPackages = [ kernel.virtualboxGuestAdditions ];

View file

@ -26,21 +26,21 @@ in {
};
vmDerivationName = mkOption {
type = types.str;
default = "nixos-ova-${config.system.nixos.label}-${pkgs.stdenv.system}";
default = "nixos-ova-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
description = ''
The name of the derivation for the VirtualBox appliance.
'';
};
vmName = mkOption {
type = types.str;
default = "NixOS ${config.system.nixos.label} (${pkgs.stdenv.system})";
default = "NixOS ${config.system.nixos.label} (${pkgs.stdenv.hostPlatform.system})";
description = ''
The name of the VirtualBox appliance.
'';
};
vmFileName = mkOption {
type = types.str;
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.system}.ova";
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.ova";
description = ''
The file name of the VirtualBox appliance.
'';
@ -67,10 +67,10 @@ in {
echo "creating VirtualBox VM..."
vmName="${cfg.vmName}";
VBoxManage createvm --name "$vmName" --register \
--ostype ${if pkgs.stdenv.system == "x86_64-linux" then "Linux26_64" else "Linux26"}
--ostype ${if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then "Linux26_64" else "Linux26"}
VBoxManage modifyvm "$vmName" \
--memory ${toString cfg.memorySize} --acpi on --vram 32 \
${optionalString (pkgs.stdenv.system == "i686-linux") "--pae on"} \
${optionalString (pkgs.stdenv.hostPlatform.system == "i686-linux") "--pae on"} \
--nictype1 virtio --nic1 nat \
--audiocontroller ac97 --audio alsa \
--rtcuseutc on \

View file

@ -22,7 +22,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
message = "VMWare guest is not currently supported on ${pkgs.stdenv.system}";
message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
} ];
environment.systemPackages = [ open-vm-tools ];

View file

@ -146,7 +146,7 @@ in
config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isx86_64;
message = "Xen currently not supported on ${pkgs.stdenv.system}";
message = "Xen currently not supported on ${pkgs.stdenv.hostPlatform.system}";
} {
assertion = config.boot.loader.grub.enable && (config.boot.loader.grub.efiSupport == false);
message = "Xen currently does not support EFI boot";

View file

@ -422,6 +422,7 @@ in rec {
tests.yabar = callTest tests/yabar.nix {};
tests.zookeeper = callTest tests/zookeeper.nix {};
tests.morty = callTest tests/morty.nix { };
tests.bcachefs = callTest tests/bcachefs.nix { };
/* Build a bunch of typical closures so that Hydra can keep track of
the evolution of closure sizes. */

38
nixos/tests/bcachefs.nix Normal file
View file

@ -0,0 +1,38 @@
import ./make-test.nix ({ pkgs, ... }: {
name = "bcachefs";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ chiiruno ];
machine = { pkgs, ... }: {
virtualisation.emptyDiskImages = [ 4096 ];
networking.hostId = "deadbeef";
boot.supportedFilesystems = [ "bcachefs" ];
environment.systemPackages = with pkgs; [ parted ];
};
testScript = ''
$machine->succeed("modprobe bcachefs");
$machine->succeed("bcachefs version");
$machine->succeed("ls /dev");
$machine->succeed(
"mkdir /tmp/mnt",
"udevadm settle",
"parted --script /dev/vdb mklabel msdos",
"parted --script /dev/vdb -- mkpart primary 1024M -1s",
"udevadm settle",
# Due to #32279, we cannot use encryption for this test yet
# "echo password | bcachefs format --encrypted /dev/vdb1",
# "echo password | bcachefs unlock /dev/vdb1",
"bcachefs format /dev/vdb1",
"mount -t bcachefs /dev/vdb1 /tmp/mnt",
"udevadm settle",
"bcachefs fs usage /tmp/mnt",
"umount /tmp/mnt",
"udevadm settle"
);
'';
})

View file

@ -11,7 +11,6 @@ import ./make-test.nix ({ pkgs, ...} : {
services.xserver.enable = true;
services.xserver.displayManager.slim.enable = false;
services.xserver.displayManager.gdm = {
enable = true;
autoLogin = {

View file

@ -11,6 +11,7 @@ import ./make-test.nix ({ pkgs, ...} : {
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = false;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.autoLogin.enable = true;
services.xserver.displayManager.lightdm.autoLogin.user = "alice";

View file

@ -233,13 +233,16 @@ let
[ sudo
libxml2.bin
libxslt.bin
desktop-file-utils
docbook5
docbook_xsl_ns
unionfs-fuse
ntp
nixos-artwork.wallpapers.gnome-dark
nixos-artwork.wallpapers.simple-dark-gray-bottom
perlPackages.XMLLibXML
perlPackages.ListCompare
shared-mime-info
texinfo
xorg.lndir
# add curl so that rather than seeing the test attempt to download

View file

@ -6,7 +6,8 @@ let
{ pkgs, ... }:
{ fileSystems = pkgs.lib.mkVMOverride
[ { mountPoint = "/data";
device = "server:/data";
# nfs4 exports the export with fsid=0 as a virtual root directory
device = if (version == 4) then "server:/" else "server:/data";
fsType = "nfs";
options = [ "vers=${toString version}" ];
}

View file

@ -4,7 +4,7 @@ let
version = "0.11.1";
name = "mist";
throwSystem = throw "Unsupported system: ${stdenv.system}";
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
meta = with stdenv.lib; {
description = "Browse and use Ðapps on the Ethereum network";
@ -37,7 +37,7 @@ let
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux64-${urlVersion}.zip";
sha256 = "0yx4x72l8gk68yh9saki48zgqx8k92xnkm79dc651wdpd5c25cz3";
};
}.${stdenv.system} or throwSystem;
}.${stdenv.hostPlatform.system} or throwSystem;
buildInputs = [ unzip makeWrapper ];

View file

@ -11,18 +11,18 @@ stdenv.mkDerivation rec {
version = "1.08";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "http://www.baudline.com/baudline_${version}_linux_x86_64.tar.gz";
sha256 = "09fn0046i69in1jpizkzbaq5ggij0mpflcsparyskm3wh71mbzvr";
}
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "http://www.baudline.com/baudline_${version}_linux_i686.tar.gz";
sha256 = "1waip5pmcf5ffcfvn8lf1rvsaq2ab66imrbfqs777scz7k8fhhjb";
}
else
throw "baudline isn't supported (yet?) on ${stdenv.system}";
throw "baudline isn't supported (yet?) on ${stdenv.hostPlatform.system}";
buildInputs = [ makeWrapper ];

View file

@ -0,0 +1,33 @@
{ stdenv, fetchurl, pkgconfig, deadbeef, gtk3, libxml2 }:
stdenv.mkDerivation rec {
name = "deadbeef-infobar-plugin-${version}";
version = "1.4";
src = fetchurl {
url = "https://bitbucket.org/dsimbiriatin/deadbeef-infobar/downloads/deadbeef-infobar-${version}.tar.gz";
sha256 = "0c9wh3wh1hdww7v96i8cy797la06mylhfi0880k8vwh88079aapf";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ deadbeef gtk3 libxml2 ];
buildFlags = [ "gtk3" ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib/deadbeef
cp gtk3/ddb_infobar_gtk3.so $out/lib/deadbeef
runHook postInstall
'';
meta = with stdenv.lib; {
description = "DeadBeeF Infobar Plugin";
homepage = https://bitbucket.org/dsimbiriatin/deadbeef-infobar;
license = licenses.gpl2Plus;
maintainers = [ maintainers.jtojnar ];
platforms = platforms.linux;
};
}

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl
, flac, expat, libidn, qtbase, qtwebkit, libvorbis }:
assert stdenv.system == "x86_64-linux";
assert stdenv.hostPlatform.system == "x86_64-linux";
stdenv.mkDerivation rec {
version = "beta_1.0.467.4929-r0"; # friendly to nix-env version sorting algo

View file

@ -9,11 +9,11 @@
stdenv.mkDerivation rec {
name = "kid3-${version}";
version = "3.6.1";
version = "3.6.2";
src = fetchurl {
url = "mirror://sourceforge/project/kid3/kid3/${version}/${name}.tar.gz";
sha256 = "1bbnd6jgahdiqmsbw6c3x4h517m50db592fnq1w0v4k5aaav4i26";
sha256 = "19yq39fqj19g98cxd4cdgv0f935ckfw0c43cxaxbf27x5f5dj0yz";
};
buildInputs = with stdenv.lib;

View file

@ -1,4 +1,5 @@
{ stdenv, fetchFromGitHub, chromaprint, fetchpatch, fftw, flac, faad2, mp4v2
{ stdenv, fetchFromGitHub, makeWrapper, chromaprint, fetchpatch
, fftw, flac, faad2, glibcLocales, mp4v2
, libid3tag, libmad, libopus, libshout, libsndfile, libusb1, libvorbis
, pkgconfig, portaudio, portmidi, protobuf, qt4, rubberband, scons, sqlite
, taglib, upower, vampSDK
@ -15,8 +16,10 @@ stdenv.mkDerivation rec {
sha256 = "1fm8lkbnxka4haidf6yr8mb3r6vaxmc97hhrp8pcx0fvq2mnzvy2";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
chromaprint fftw flac faad2 mp4v2 libid3tag libmad libopus libshout libsndfile
chromaprint fftw flac faad2 glibcLocales mp4v2 libid3tag libmad libopus libshout libsndfile
libusb1 libvorbis pkgconfig portaudio portmidi protobuf qt4
rubberband scons sqlite taglib upower vampSDK
];
@ -42,6 +45,11 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
fixupPhase = ''
wrapProgram $out/bin/mixxx \
--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive;
'';
meta = with stdenv.lib; {
homepage = https://mixxx.org;
description = "Digital DJ mixing software";

View file

@ -1,6 +1,5 @@
{ stdenv
, fetchurl, alsaLib
, hostPlatform
}:
stdenv.mkDerivation rec {
@ -13,8 +12,9 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
configureFlags =
stdenv.lib.optional (hostPlatform ? mpg123) "--with-cpu=${hostPlatform.mpg123.cpu}";
configureFlags = stdenv.lib.optional
(stdenv.hostPlatform ? mpg123)
"--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
meta = {
description = "Fast console MPEG Audio Player and decoder library";

View file

@ -43,13 +43,13 @@ let
];
in stdenv.mkDerivation rec {
name = "pulseeffects-${version}";
version = "4.2.8";
version = "4.3.3";
src = fetchFromGitHub {
owner = "wwmm";
repo = "pulseeffects";
rev = "v${version}";
sha256 = "0ckl0640n6lhk0gcmnmwngajkf46rrd8bxfh7xy5sq6qmm01dhdd";
sha256 = "1krfxvwqimfcsv7f2l722ivzz0qdf5h0pmb702mg65qb160zn065";
};
nativeBuildInputs = [

View file

@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
version = "3.1.0";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
if builtins.isNull releasePath then
fetchurl {
url = "https://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86_64.tar.bz2";
@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
}
else
releasePath
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
if builtins.isNull releasePath then
fetchurl {
url = "http://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86.tar.bz2";

View file

@ -3,15 +3,16 @@
, libgcrypt, systemd, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome3 }:
let
# TO UPDATE: just execute the ./update.sh script (won't do anything if there is no update)
# "rev" decides what is actually being downloaded
version = "1.0.80.474.gef6b503e-7";
version = "1.0.88.353.g15c26ea1-14";
# To get the latest stable revision:
# curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=stable' | jq '.download_url,.version,.last_updated'
# To get general information:
# curl -H 'Snap-Device-Series: 16' 'https://api.snapcraft.io/v2/snaps/info/spotify' | jq '.'
# More exapmles of api usage:
# https://github.com/canonical-websites/snapcraft.io/blob/master/webapp/publisher/snaps/views.py
rev = "16";
rev = "19";
deps = [
@ -64,7 +65,7 @@ stdenv.mkDerivation {
# https://community.spotify.com/t5/Desktop-Linux/Redistribute-Spotify-on-Linux-Distributions/td-p/1695334
src = fetchurl {
url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap";
sha512 = "45b7ab574b30fb368e0b6f4dd60addbfd1ddc02173b4f98b31c524eed49073432352a361e75959ce8e2f752231e93c79ca1b538c4bd295c935d1e2e0585d147f";
sha512 = "3a068cbe3c1fca84ae67e28830216f993aa459947517956897c3b3f63063005c9db646960e85185b149747ffc302060c208a7f9968ea69d50a3496067089f3db";
};
buildInputs = [ squashfsTools makeWrapper ];

0
pkgs/applications/audio/spotify/update.sh Normal file → Executable file
View file

View file

@ -7,12 +7,12 @@ stdenv.mkDerivation rec {
name = "transcribe-${version}";
version = "8.40";
src = if stdenv.system == "i686-linux" then
src = if stdenv.hostPlatform.system == "i686-linux" then
fetchzip {
url = "https://www.seventhstring.com/xscribe/downlinux32_old/xscsetup.tar.gz";
sha256 = "1ngidmj9zz8bmv754s5xfsjv7v6xr03vck4kigzq4bpc9b1fdhjq";
}
else if stdenv.system == "x86_64-linux" then
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchzip {
url = "https://www.seventhstring.com/xscribe/downlinux64_old/xsc64setup.tar.gz";
sha256 = "0svzi8svj6zn06gj0hr8mpnhq4416dvb4g5al0gpb1g3paywdaf9";

View file

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
propagatedUserEnvPkgs = [ duplicity ];
PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "lib/nautilus/extensions-3.0";
PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-3.0";
postInstall = ''
glib-compile-schemas $out/share/glib-2.0/schemas

View file

@ -9,15 +9,17 @@ with stdenv.lib;
stdenv.mkDerivation rec {
pname = "lightdm";
version = "1.26.0";
version = "1.28.0";
name = "${pname}-${version}";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "CanonicalLtd";
repo = pname;
rev = version;
sha256 = "1mhj6l025cnf2dzxnbzlk0qa9fm4gj2aw58qh5fl4ky87dp4wdyb";
sha256 = "1mmqy1jdvgc0h0h9gli7n4vdv5p8m5019qjr5ni4h73iz6mjdj2b";
};
nativeBuildInputs = [
@ -73,6 +75,7 @@ stdenv.mkDerivation rec {
meta = {
homepage = https://github.com/CanonicalLtd/lightdm;
description = "A cross-desktop display manager.";
platforms = platforms.linux;
license = licenses.gpl3;
maintainers = with maintainers; [ ocharles wkennington worldofpeace ];

View file

@ -2,7 +2,7 @@
, zlib, jdk, glib, gtk3, libXtst, gsettings-desktop-schemas, webkitgtk
, makeWrapper, ... }:
{ name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }:
{ name, src ? builtins.getAttr stdenv.hostPlatform.system sources, sources ? null, description }:
stdenv.mkDerivation rec {
inherit name src;

View file

@ -27,24 +27,24 @@ rec {
name = "eclipse-cpp-4.7.0";
description = "Eclipse IDE for C/C++ Developers, Oxygen release";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-cpp-oxygen-R-linux-gtk-x86_64.tar.gz;
sha512 = "813c791e739d7d0e2ab242a5bacadca135bbeee20ef97aa830353cd90f63fa6e9c89cfcc6aadf635c742befe035bd6e3f15103013f63c419f6144e86ebde3ed1";
}
else if stdenv.system == "i686-linux" then
else if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-cpp-oxygen-R-linux-gtk.tar.gz;
sha512 = "2b50f4a00306a89cda1aaaa606e62285cacbf93464a9dd3f3319dca3e2c578b802e685de6f78e5e617d269e21271188effe73d41f491a6de946e28795d82db8a";
}
else throw "Unsupported system: ${stdenv.system}";
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
};
eclipse-cpp-37 = buildEclipse {
name = "eclipse-cpp-3.7";
description = "Eclipse IDE for C/C++ Developers";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
sha256 = "14ppc9g9igzvj1pq7jl01vwhzb66nmzbl9wsdl1sf3xnwa9wnqk3";
@ -65,7 +65,7 @@ rec {
name = "eclipse-modeling-4.7";
description = "Eclipse Modeling Tools";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/oxygen/R/eclipse-modeling-oxygen-R-linux-gtk-x86_64.tar.gz;
sha512 = "3b9a7ad4b5d6b77fbdd64e8d323e0adb6c2904763ad042b374b4d87cef8607408cb407e395870fc755d58c0c800e20818adcf456ebe193d76cede16c5fe12271";
@ -81,7 +81,7 @@ rec {
name = "eclipse-modeling-3.6.2";
description = "Eclipse Modeling Tools (includes Incubating components)";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
sha1 = "e96f5f006298f68476f4a15a2be8589158d5cc61";
@ -151,7 +151,7 @@ rec {
name = "eclipse-scala-sdk-4.4.1";
description = "Eclipse IDE for Scala Developers";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl { # tested
url = https://downloads.typesafe.com/scalaide-pack/4.4.1-vfinal-luna-211-20160504/scala-SDK-4.4.1-vfinal-2.11-linux.gtk.x86_64.tar.gz;
sha256 = "4c2d1ac68384e12a11a851cf0fc7757aea087eba69329b21d539382a65340d27";

View file

@ -1,5 +1,4 @@
{ stdenv, fetchurl, lzip
, buildPlatform, hostPlatform
}:
stdenv.mkDerivation (rec {
@ -36,7 +35,7 @@ stdenv.mkDerivation (rec {
maintainers = [ ];
platforms = stdenv.lib.platforms.unix;
};
} // stdenv.lib.optionalAttrs (hostPlatform != buildPlatform) {
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
# This may be moved above during a stdenv rebuild.
preConfigure = ''
configureFlagsArray+=("CC=$CC")

View file

@ -42,7 +42,7 @@ with stdenv; lib.makeOverridable mkDerivation rec {
}
interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2)
if [ "${stdenv.system}" == "x86_64-linux" ]; then
if [ "${stdenv.hostPlatform.system}" == "x86_64-linux" ]; then
target_size=$(get_file_size bin/fsnotifier64)
patchelf --set-interpreter "$interpreter" bin/fsnotifier64
munge_size_hack bin/fsnotifier64 $target_size

View file

@ -8,15 +8,15 @@ let
version = "17.1";
sha256 = if stdenv.system == "x86_64-linux" then "1kddisnvlk48jip6k59mw3wlkrl7rkck2lxpaghn0gfx02cvms5f"
else if stdenv.system == "i686-cygwin" then "1izp42afrlh4yd322ax9w85ki388gnkqfqbw8dwnn4k3j7r5487z"
else throw "Unsupported system: ${stdenv.system}";
sha256 = if stdenv.hostPlatform.system == "x86_64-linux" then "1kddisnvlk48jip6k59mw3wlkrl7rkck2lxpaghn0gfx02cvms5f"
else if stdenv.hostPlatform.system == "i686-cygwin" then "1izp42afrlh4yd322ax9w85ki388gnkqfqbw8dwnn4k3j7r5487z"
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
urlBase = "https://github.com/Kode/KodeStudio/releases/download/v${version}/KodeStudio-";
urlStr = if stdenv.system == "x86_64-linux" then urlBase + "linux64.tar.gz"
else if stdenv.system == "i686-cygwin" then urlBase + "win32.zip"
else throw "Unsupported system: ${stdenv.system}";
urlStr = if stdenv.hostPlatform.system == "x86_64-linux" then urlBase + "linux64.tar.gz"
else if stdenv.hostPlatform.system == "i686-cygwin" then urlBase + "win32.zip"
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
in
@ -47,7 +47,7 @@ in
cp -r ./* $out
'';
postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''
postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ''
# Patch Binaries
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \

View file

@ -1,7 +1,7 @@
{ stdenv, fetchurl, swt, jdk, makeWrapper, alsaLib }:
let metadata = assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
if stdenv.system == "i686-linux" then
let metadata = assert stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux";
if stdenv.hostPlatform.system == "i686-linux" then
{ arch = "x86"; sha256 = "1qmb51k0538pn7gv4nsvhfv33xik4l4af0qmpllkzrikmj8wvzlb"; }
else
{ arch = "x86_64"; sha256 = "12af47jhlrh9aq5b3d13l7cdhlndgnfpy61gz002hajbq7i00ixh"; };

View file

@ -6,7 +6,7 @@
let
verMajor = "1";
verMinor = "1";
verPatch = "442";
verPatch = "456";
version = "${verMajor}.${verMinor}.${verPatch}";
ginVer = "1.5";
gwtVer = "2.7.0";
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
owner = "rstudio";
repo = "rstudio";
rev = "v${version}";
sha256 = "0drqh2brfs9w8dfh4r7j3fsqdsg63s6pvj2bbg5xwwc0yf220ahs";
sha256 = "0hv07qrbjwapbjrkddasglsgk0x5j7qal468i5rv77krsp09s4fz";
};
# Hack RStudio to only use the input R.

View file

@ -6,7 +6,7 @@ in
stdenv.mkDerivation rec {
name = "sublimetext-2.0.2";
src =
if stdenv.system == "i686-linux" then
if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
name = "sublimetext-2.0.2.tar.bz2";
url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2;

View file

@ -13,13 +13,13 @@ let
++ stdenv.lib.optional gksuSupport "/usr/bin/gksudo=${gksu}/bin/gksudo";
in let
archSha256 =
if stdenv.system == "i686-linux" then
if stdenv.hostPlatform.system == "i686-linux" then
x32sha256
else
x64sha256;
arch =
if stdenv.system == "i686-linux" then
if stdenv.hostPlatform.system == "i686-linux" then
"x32"
else
"x64";

View file

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
version = "0.9.53";
src =
if stdenv.system == "x86_64-linux" then
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://www.typora.io/linux/typora_${version}_amd64.deb";
sha256 = "02k6x30l4mbjragqbq5rn663xbw3h4bxzgppfxqf5lwydswldklb";

View file

@ -7,7 +7,6 @@
}
# apple frameworks
, Carbon, Cocoa
, buildPlatform, hostPlatform
}:
let
@ -20,12 +19,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ gettext pkgconfig ];
buildInputs = [ ncurses ]
++ stdenv.lib.optionals hostPlatform.isDarwin [ Carbon Cocoa ];
++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
configureFlags = [
"--enable-multibyte"
"--enable-nls"
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"vim_cv_toupper_broken=no"
"--with-tlib=ncurses"
"vim_cv_terminfo=yes"

View file

@ -9,15 +9,15 @@ let
"i686-linux" = "linux-ia32";
"x86_64-linux" = "linux-x64";
"x86_64-darwin" = "darwin";
}.${stdenv.system};
}.${stdenv.hostPlatform.system};
sha256 = {
"i686-linux" = "1g7kqbz6mrf8ngx2bnwpi9fifq5rjznxgsgwjb532z3nh92ypa8n";
"x86_64-linux" = "02yldycakn5zxj1ji4nmhdyazqlkjqpzdj3g8j501c3j28pgiwjy";
"x86_64-darwin" = "0pnsfkh20mj7pzqw7wlfd98jqc6a1mnsq1iira15n7fafqgj8zpl";
}.${stdenv.system};
}.${stdenv.hostPlatform.system};
archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz";
archive_fmt = if stdenv.hostPlatform.system == "x86_64-darwin" then "zip" else "tar.gz";
rpath = lib.concatStringsSep ":" [
atomEnv.libPath
@ -48,12 +48,12 @@ in
categories = "GNOME;GTK;Utility;TextEditor;Development;";
};
buildInputs = if stdenv.system == "x86_64-darwin"
buildInputs = if stdenv.hostPlatform.system == "x86_64-darwin"
then [ unzip libXScrnSaver libsecret ]
else [ wrapGAppsHook libXScrnSaver libxkbfile libsecret ];
installPhase =
if stdenv.system == "x86_64-darwin" then ''
if stdenv.hostPlatform.system == "x86_64-darwin" then ''
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/Contents/Resources/app/bin/code $out/bin
@ -72,7 +72,7 @@ in
cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png
'';
postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") ''
postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ''
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}" \

View file

@ -2,15 +2,14 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, libheif
, ApplicationServices
, hostPlatform
}:
let
arch =
if stdenv.system == "i686-linux" then "i686"
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
else if stdenv.system == "armv7l-linux" then "armv7l"
else if stdenv.system == "aarch64-linux" then "aarch64"
if stdenv.hostPlatform.system == "i686-linux" then "i686"
else if stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin" then "x86-64"
else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l"
else if stdenv.hostPlatform.system == "aarch64-linux" then "aarch64"
else throw "ImageMagick is not supported on this platform.";
cfg = {
@ -46,7 +45,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib"
]
++ lib.optionals hostPlatform.isMinGW
++ lib.optionals stdenv.hostPlatform.isMinGW
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
;
@ -56,13 +55,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libheif
]
++ lib.optionals (!hostPlatform.isMinGW)
++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 ]
++ lib.optionals (!hostPlatform.isMinGW)
++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ]
;

View file

@ -2,15 +2,14 @@
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp, fftw, libheif, libde265
, ApplicationServices
, hostPlatform
}:
let
arch =
if stdenv.system == "i686-linux" then "i686"
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
else if stdenv.system == "armv7l-linux" then "armv7l"
else if stdenv.system == "aarch64-linux" then "aarch64"
if stdenv.hostPlatform.system == "i686-linux" then "i686"
else if stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin" then "x86-64"
else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l"
else if stdenv.hostPlatform.system == "aarch64-linux" then "aarch64"
else throw "ImageMagick is not supported on this platform.";
cfg = {
@ -20,7 +19,7 @@ let
}
# Freeze version on mingw so we don't need to port the patch too often.
# FIXME: This version has multiple security vulnerabilities
// lib.optionalAttrs (hostPlatform.isMinGW) {
// lib.optionalAttrs (stdenv.hostPlatform.isMinGW) {
version = "6.9.2-0";
sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7";
patches = [(fetchpatch {
@ -58,7 +57,7 @@ stdenv.mkDerivation rec {
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib"
]
++ lib.optionals (hostPlatform.isMinGW)
++ lib.optionals (stdenv.hostPlatform.isMinGW)
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
;
@ -68,13 +67,13 @@ stdenv.mkDerivation rec {
[ zlib fontconfig freetype ghostscript
libpng libtiff libxml2 libheif libde265
]
++ lib.optionals (!hostPlatform.isMinGW)
++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ openexr librsvg openjpeg ]
++ lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 fftw ]
++ lib.optionals (!hostPlatform.isMinGW)
++ lib.optionals (!stdenv.hostPlatform.isMinGW)
[ libX11 libXext libXt libwebp ]
;

View file

@ -0,0 +1,44 @@
{ stdenv
, fetchurl
, cmake
, qtbase
, qtsvg
, qtmultimedia
, qttools
, kdnssd
, karchive
, libsodium
, libmicrohttpd
, giflib
, miniupnpc
}:
stdenv.mkDerivation rec {
name = "drawpile-${version}";
version = "2.0.11";
src = fetchurl {
url = "https://drawpile.net/files/src/drawpile-${version}.tar.gz";
sha256 = "0h018rxhc0lwpqwmlihalz634nd0xaafk4p2b782djjd87irnjpk";
};
buildInputs = [
cmake
qtbase qtsvg qtmultimedia qttools
karchive
# optional deps:
libsodium # ext-auth support
libmicrohttpd # HTTP admin api
giflib # gif animation export support
miniupnpc # automatic port forwarding
kdnssd # local server discovery with Zeroconf
];
configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out .";
meta = with stdenv.lib; {
description = "A collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously";
homepage = https://drawpile.net/;
downloadPage = https://drawpile.net/download/;
license = licenses.gpl3;
maintainers = with maintainers; [ fgaz ];
};
}

Some files were not shown because too many files have changed in this diff Show more