diff --git a/doc/stdenv/cross-compilation.chapter.md b/doc/stdenv/cross-compilation.chapter.md
index f6e61a1af196..3b6e5c34d54d 100644
--- a/doc/stdenv/cross-compilation.chapter.md
+++ b/doc/stdenv/cross-compilation.chapter.md
@@ -78,21 +78,46 @@ If both the dependency and depending packages aren't compilers or other machine-
Finally, if the depending package is a compiler or other machine-code-producing tool, it might need dependencies that run at "emit time". This is for compilers that (regrettably) insist on being built together with their source languages' standard libraries. Assuming build != host != target, a run-time dependency of the standard library cannot be run at the compiler's build time or run time, but only at the run time of code emitted by the compiler.
-Putting this all together, that means we have dependencies in the form "host → target", in at most the following six combinations:
+Putting this all together, that means that we have dependency types of the form "X→ E", which means that the dependency executes on X and emits code for E; each of X and E can be `build`, `host`, or `target`, and E can be `*` to indicate that the dependency is not a compiler-like package.
+
+Dependency types describe the relationships that a package has with each of its transitive dependencies. You could think of attaching one or more dependency types to each of the formal parameters at the top of a package's `.nix` file, as well as to all of *their* formal parameters, and so on. Triples like `(foo, bar, baz)`, on the other hand, are a property of an instantiated derivation -- you could would attach a triple `(mips-linux, mips-linux, sparc-solaris)` to a `.drv` file in `/nix/store`.
+
+Only nine dependency types matter in practice:
#### Possible dependency types {#possible-dependency-types}
-| Dependency’s host platform | Dependency’s target platform |
-|----------------------------|------------------------------|
-| build | build |
-| build | host |
-| build | target |
-| host | host |
-| host | target |
-| target | target |
+| Dependency type | Dependency’s host platform | Dependency’s target platform |
+|-----------------|----------------------------|------------------------------|
+| build → * | build | (none) |
+| build → build | build | build |
+| build → host | build | host |
+| build → target | build | target |
+| host → * | host | (none) |
+| host → host | host | host |
+| host → target | host | target |
+| target → * | target | (none) |
+| target → target | target | target |
+Let's use `g++` as an example to make this table clearer. `g++` is a C++ compiler written in C. Suppose we are building `g++` with a `(build, host, target)` platform triple of `(foo, bar, baz)`. This means we are using a `foo`-machine to build a copy of `g++` which will run on a `bar`-machine and emit binaries for the `baz`-machine.
-Some examples will make this table clearer. Suppose there's some package that is being built with a `(build, host, target)` platform triple of `(foo, bar, baz)`. If it has a build-time library dependency, that would be a "host → build" dependency with a triple of `(foo, foo, *)` (the target platform is irrelevant). If it needs a compiler to be built, that would be a "build → host" dependency with a triple of `(foo, foo, *)` (the target platform is irrelevant). That compiler, would be built with another compiler, also "build → host" dependency, with a triple of `(foo, foo, foo)`.
+* `g++` links against the host platform's `glibc` C library, which is a "host→ *" dependency with a triple of `(bar, bar, *)`. Since it is a library, not a compiler, it has no "target".
+
+* Since `g++` is written in C, the `gcc` compiler used to compile it is a "build→ host" dependency of `g++` with a triple of `(foo, foo, bar)`. This compiler runs on the build platform and emits code for the host platform.
+
+* `gcc` links against the build platform's `glibc` C library, which is a "build→ *" dependency with a triple of `(foo, foo, *)`. Since it is a library, not a compiler, it has no "target".
+
+* This `gcc` is itself compiled by an *earlier* copy of `gcc`. This earlier copy of `gcc` is a "build→ build" dependency of `g++` with a triple of `(foo, foo, foo)`. This "early `gcc`" runs on the build platform and emits code for the build platform.
+
+* `g++` is bundled with `libgcc`, which includes a collection of target-machine routines for exception handling and
+software floating point emulation. `libgcc` would be a "target→ *" dependency with triple `(foo, baz, *)`, because it consists of machine code which gets linked against the output of the compiler that we are building. It is a library, not a compiler, so it has no target of its own.
+
+* `libgcc` is written in C and compiled with `gcc`. The `gcc` that compiles it will be a "build→ target" dependency with triple `(foo, foo, baz)`. It gets compiled *and run* at `g++`-build-time (on platform `foo`), but must emit code for the `baz`-platform.
+
+* `g++` allows inline assembler code, so it depends on access to a copy of the `gas` assembler. This would be a "host→ target" dependency with triple `(foo, bar, baz)`.
+
+* `g++` (and `gcc`) include a library `libgccjit.so`, which wrap the compiler in a library to create a just-in-time compiler. In nixpkgs, this library is in the `libgccjit` package; if C++ required that programs have access to a JIT, `g++` would need to add a "target→ target" dependency for `libgccjit` with triple `(foo, baz, baz)`. This would ensure that the compiler ships with a copy of `libgccjit` which both executes on and generates code for the `baz`-platform.
+
+* If `g++` itself linked against `libgccjit.so` (for example, to allow compile-time-evaluated C++ expressions), then the `libgccjit` package used to provide this functionality would be a "host→ host" dependency of `g++`: it is code which runs on the `host` and emits code for execution on the `host`.
### Cross packaging cookbook {#ssec-cross-cookbook}
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md
index 1d4ca99e3cbe..7019ae89db74 100644
--- a/doc/stdenv/stdenv.chapter.md
+++ b/doc/stdenv/stdenv.chapter.md
@@ -125,7 +125,7 @@ The extension of `PATH` with dependencies, alluded to above, proceeds according
A dependency is said to be **propagated** when some of its other-transitive (non-immediate) downstream dependencies also need it as an immediate dependency.
[^footnote-stdenv-propagated-dependencies]
-It is important to note that dependencies are not necessarily propagated as the same sort of dependency that they were before, but rather as the corresponding sort so that the platform rules still line up. To determine the exact rules for dependency propagation, we start by assigning to each dependency a couple of ternary numbers (`-1` for `build`, `0` for `host`, and `1` for `target`), representing how respectively its host and target platforms are "offset" from the depending derivation’s platforms. The following table summarize the different combinations that can be obtained:
+It is important to note that dependencies are not necessarily propagated as the same sort of dependency that they were before, but rather as the corresponding sort so that the platform rules still line up. To determine the exact rules for dependency propagation, we start by assigning to each dependency a couple of ternary numbers (`-1` for `build`, `0` for `host`, and `1` for `target`) representing its [dependency type](#possible-dependency-types), which captures how its host and target platforms are each "offset" from the depending derivation’s host and target platforms. The following table summarize the different combinations that can be obtained:
| `host → target` | attribute name | offset |
| ------------------- | ------------------- | -------- |
diff --git a/maintainers/team-list.nix b/maintainers/team-list.nix
index effcebf0d799..7d12a82d4921 100644
--- a/maintainers/team-list.nix
+++ b/maintainers/team-list.nix
@@ -108,15 +108,6 @@ with lib.maintainers; {
shortName = "Chia Blockchain";
};
- cleanup = {
- members = [
- ajs124
- ];
- scope = "Cleaning of the nixpkgs source tree.";
- shortName = "Cleanup";
- enableFeatureFreezePing = true;
- };
-
coq = {
members = [
cohencyril
diff --git a/nixos/doc/manual/from_md/installation/installing.chapter.xml b/nixos/doc/manual/from_md/installation/installing.chapter.xml
index db073fa83965..aee0b30a7076 100644
--- a/nixos/doc/manual/from_md/installation/installing.chapter.xml
+++ b/nixos/doc/manual/from_md/installation/installing.chapter.xml
@@ -411,6 +411,13 @@ OK
specify on which disk the GRUB boot loader is to be
installed. Without it, NixOS cannot boot.
+
+ If there are other operating systems running on the
+ machine before installing NixOS, the
+
+ option can be set to true to
+ automatically add them to the grub menu.
+
@@ -436,13 +443,6 @@ OK
-
- If there are other operating systems running on the machine
- before installing NixOS, the
- option can
- be set to true to automatically add them to
- the grub menu.
-
If you need to configure networking for your machine the
configuration options are described in
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
index b4a33777851e..38dd7b3894dd 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
@@ -1780,6 +1780,13 @@
desktop environments as needed.
+
+
+ services.xserver.desktopManager.xfce now
+ includes Xfce’s screen locker,
+ xfce4-screensaver.
+
+
The hadoop package has added support for
diff --git a/nixos/doc/manual/installation/installing.chapter.md b/nixos/doc/manual/installation/installing.chapter.md
index def4f37fbcaa..8a46d68ae3ba 100644
--- a/nixos/doc/manual/installation/installing.chapter.md
+++ b/nixos/doc/manual/installation/installing.chapter.md
@@ -296,6 +296,11 @@ Use the following commands:
specify on which disk the GRUB boot loader is to be installed.
Without it, NixOS cannot boot.
+ : If there are other operating systems running on the machine before
+ installing NixOS, the [](#opt-boot.loader.grub.useOSProber)
+ option can be set to `true` to automatically add them to the grub
+ menu.
+
UEFI systems
: You *must* set the option [](#opt-boot.loader.systemd-boot.enable)
@@ -307,11 +312,6 @@ Use the following commands:
[`boot.loader.systemd-boot`](#opt-boot.loader.systemd-boot.enable)
as well.
- If there are other operating systems running on the machine before
- installing NixOS, the [](#opt-boot.loader.grub.useOSProber)
- option can be set to `true` to automatically add them to the grub
- menu.
-
If you need to configure networking for your machine the
configuration options are described in [](#sec-networking). In
particular, while wifi is supported on the installation image, it is
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md
index 560d80514d6a..82f1b97d5cbd 100644
--- a/nixos/doc/manual/release-notes/rl-2205.section.md
+++ b/nixos/doc/manual/release-notes/rl-2205.section.md
@@ -615,6 +615,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- The polkit service, available at `security.polkit.enable`, is now disabled by default. It will automatically be enabled through services and desktop environments as needed.
+- `services.xserver.desktopManager.xfce` now includes Xfce's screen locker, `xfce4-screensaver`.
+
- The `hadoop` package has added support for `aarch64-linux` and `aarch64-darwin` as of 3.3.1 ([#158613](https://github.com/NixOS/nixpkgs/pull/158613)).
- The `R` package now builds again on `aarch64-darwin` ([#158992](https://github.com/NixOS/nixpkgs/pull/158992)).
diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix
index 37900b0b16f6..16ec47df3a46 100644
--- a/nixos/lib/systemd-lib.nix
+++ b/nixos/lib/systemd-lib.nix
@@ -122,10 +122,15 @@ in rec {
(if isList value then value else [value]))
as));
- generateUnits = generateUnits' true;
-
- generateUnits' = allowCollisions: type: units: upstreamUnits: upstreamWants:
- pkgs.runCommand "${type}-units"
+ generateUnits = { allowCollisions ? true, type, units, upstreamUnits, upstreamWants, packages ? cfg.packages, package ? cfg.package }:
+ let
+ typeDir = ({
+ system = "system";
+ initrd = "system";
+ user = "user";
+ nspawn = "nspawn";
+ }).${type};
+ in pkgs.runCommand "${type}-units"
{ preferLocalBuild = true;
allowSubstitutes = false;
} ''
@@ -133,7 +138,7 @@ in rec {
# Copy the upstream systemd units we're interested in.
for i in ${toString upstreamUnits}; do
- fn=${cfg.package}/example/systemd/${type}/$i
+ fn=${package}/example/systemd/${typeDir}/$i
if ! [ -e $fn ]; then echo "missing $fn"; false; fi
if [ -L $fn ]; then
target="$(readlink "$fn")"
@@ -150,7 +155,7 @@ in rec {
# Copy .wants links, but only those that point to units that
# we're interested in.
for i in ${toString upstreamWants}; do
- fn=${cfg.package}/example/systemd/${type}/$i
+ fn=${package}/example/systemd/${typeDir}/$i
if ! [ -e $fn ]; then echo "missing $fn"; false; fi
x=$out/$(basename $fn)
mkdir $x
@@ -162,14 +167,14 @@ in rec {
done
# Symlink all units provided listed in systemd.packages.
- packages="${toString cfg.packages}"
+ packages="${toString packages}"
# Filter duplicate directories
declare -A unique_packages
for k in $packages ; do unique_packages[$k]=1 ; done
for i in ''${!unique_packages[@]}; do
- for fn in $i/etc/systemd/${type}/* $i/lib/systemd/${type}/*; do
+ for fn in $i/etc/systemd/${typeDir}/* $i/lib/systemd/${typeDir}/*; do
if ! [[ "$fn" =~ .wants$ ]]; then
if [[ -d "$fn" ]]; then
targetDir="$out/$(basename "$fn")"
@@ -270,9 +275,9 @@ in rec {
{ Conflicts = toString config.conflicts; }
// optionalAttrs (config.requisite != [])
{ Requisite = toString config.requisite; }
- // optionalAttrs (config.restartTriggers != [])
+ // optionalAttrs (config ? restartTriggers && config.restartTriggers != [])
{ X-Restart-Triggers = toString config.restartTriggers; }
- // optionalAttrs (config.reloadTriggers != [])
+ // optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
{ X-Reload-Triggers = toString config.reloadTriggers; }
// optionalAttrs (config.description != "") {
Description = config.description; }
@@ -288,45 +293,24 @@ in rec {
};
};
- serviceConfig = { name, config, ... }: {
- config = mkMerge
- [ { # Default path for systemd services. Should be quite minimal.
- path = mkAfter
- [ pkgs.coreutils
- pkgs.findutils
- pkgs.gnugrep
- pkgs.gnused
- systemd
- ];
- environment.PATH = "${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}";
- }
- (mkIf (config.preStart != "")
- { serviceConfig.ExecStartPre =
- [ (makeJobScript "${name}-pre-start" config.preStart) ];
- })
- (mkIf (config.script != "")
- { serviceConfig.ExecStart =
- makeJobScript "${name}-start" config.script + " " + config.scriptArgs;
- })
- (mkIf (config.postStart != "")
- { serviceConfig.ExecStartPost =
- [ (makeJobScript "${name}-post-start" config.postStart) ];
- })
- (mkIf (config.reload != "")
- { serviceConfig.ExecReload =
- makeJobScript "${name}-reload" config.reload;
- })
- (mkIf (config.preStop != "")
- { serviceConfig.ExecStop =
- makeJobScript "${name}-pre-stop" config.preStop;
- })
- (mkIf (config.postStop != "")
- { serviceConfig.ExecStopPost =
- makeJobScript "${name}-post-stop" config.postStop;
- })
- ];
+ serviceConfig = { config, ... }: {
+ config.environment.PATH = mkIf (config.path != []) "${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}";
};
+ stage2ServiceConfig = {
+ imports = [ serviceConfig ];
+ # Default path for systemd services. Should be quite minimal.
+ config.path = mkAfter [
+ pkgs.coreutils
+ pkgs.findutils
+ pkgs.gnugrep
+ pkgs.gnused
+ systemd
+ ];
+ };
+
+ stage1ServiceConfig = serviceConfig;
+
mountConfig = { config, ... }: {
config = {
mountConfig =
@@ -374,12 +358,12 @@ in rec {
# systemd max line length is now 1MiB
# https://github.com/systemd/systemd/commit/e6dde451a51dc5aaa7f4d98d39b8fe735f73d2af
in if stringLength s >= 1048576 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
- ${if def.reloadIfChanged then ''
+ ${if def ? reloadIfChanged && def.reloadIfChanged then ''
X-ReloadIfChanged=true
- '' else if !def.restartIfChanged then ''
+ '' else if (def ? restartIfChanged && !def.restartIfChanged) then ''
X-RestartIfChanged=false
'' else ""}
- ${optionalString (!def.stopIfChanged) "X-StopIfChanged=false"}
+ ${optionalString (def ? stopIfChanged && !def.stopIfChanged) "X-StopIfChanged=false"}
${attrsToSection def.serviceConfig}
'';
};
diff --git a/nixos/lib/systemd-types.nix b/nixos/lib/systemd-types.nix
new file mode 100644
index 000000000000..71962fab2e17
--- /dev/null
+++ b/nixos/lib/systemd-types.nix
@@ -0,0 +1,37 @@
+{ lib, systemdUtils }:
+
+with systemdUtils.lib;
+with systemdUtils.unitOptions;
+with lib;
+
+rec {
+ units = with types;
+ attrsOf (submodule ({ name, config, ... }: {
+ options = concreteUnitOptions;
+ config = { unit = mkDefault (systemdUtils.lib.makeUnit name config); };
+ }));
+
+ services = with types; attrsOf (submodule [ stage2ServiceOptions unitConfig stage2ServiceConfig ]);
+ initrdServices = with types; attrsOf (submodule [ stage1ServiceOptions unitConfig stage1ServiceConfig ]);
+
+ targets = with types; attrsOf (submodule [ stage2CommonUnitOptions unitConfig ]);
+ initrdTargets = with types; attrsOf (submodule [ stage1CommonUnitOptions unitConfig ]);
+
+ sockets = with types; attrsOf (submodule [ stage2SocketOptions unitConfig ]);
+ initrdSockets = with types; attrsOf (submodule [ stage1SocketOptions unitConfig ]);
+
+ timers = with types; attrsOf (submodule [ stage2TimerOptions unitConfig ]);
+ initrdTimers = with types; attrsOf (submodule [ stage1TimerOptions unitConfig ]);
+
+ paths = with types; attrsOf (submodule [ stage2PathOptions unitConfig ]);
+ initrdPaths = with types; attrsOf (submodule [ stage1PathOptions unitConfig ]);
+
+ slices = with types; attrsOf (submodule [ stage2SliceOptions unitConfig ]);
+ initrdSlices = with types; attrsOf (submodule [ stage1SliceOptions unitConfig ]);
+
+ mounts = with types; listOf (submodule [ stage2MountOptions unitConfig mountConfig ]);
+ initrdMounts = with types; listOf (submodule [ stage1MountOptions unitConfig mountConfig ]);
+
+ automounts = with types; listOf (submodule [ stage2AutomountOptions unitConfig automountConfig ]);
+ initrdAutomounts = with types; attrsOf (submodule [ stage1AutomountOptions unitConfig automountConfig ]);
+}
diff --git a/nixos/lib/systemd-unit-options.nix b/nixos/lib/systemd-unit-options.nix
index 8029ba0e3f6c..c9d424d39119 100644
--- a/nixos/lib/systemd-unit-options.nix
+++ b/nixos/lib/systemd-unit-options.nix
@@ -94,7 +94,7 @@ in rec {
};
- commonUnitOptions = sharedOptions // {
+ commonUnitOptions = { options = (sharedOptions // {
description = mkOption {
default = "";
@@ -191,27 +191,6 @@ in rec {
'';
};
- restartTriggers = mkOption {
- default = [];
- type = types.listOf types.unspecified;
- description = ''
- An arbitrary list of items such as derivations. If any item
- in the list changes between reconfigurations, the service will
- be restarted.
- '';
- };
-
- reloadTriggers = mkOption {
- default = [];
- type = types.listOf unitOption;
- description = ''
- An arbitrary list of items such as derivations. If any item
- in the list changes between reconfigurations, the service will
- be reloaded. If anything but a reload trigger changes in the
- unit file, the unit will be restarted instead.
- '';
- };
-
onFailure = mkOption {
default = [];
type = types.listOf unitNameType;
@@ -239,10 +218,39 @@ in rec {
'';
};
+ }); };
+
+ stage2CommonUnitOptions = {
+ imports = [
+ commonUnitOptions
+ ];
+
+ options = {
+ restartTriggers = mkOption {
+ default = [];
+ type = types.listOf types.unspecified;
+ description = ''
+ An arbitrary list of items such as derivations. If any item
+ in the list changes between reconfigurations, the service will
+ be restarted.
+ '';
+ };
+
+ reloadTriggers = mkOption {
+ default = [];
+ type = types.listOf unitOption;
+ description = ''
+ An arbitrary list of items such as derivations. If any item
+ in the list changes between reconfigurations, the service will
+ be reloaded. If anything but a reload trigger changes in the
+ unit file, the unit will be restarted instead.
+ '';
+ };
+ };
};
+ stage1CommonUnitOptions = commonUnitOptions;
-
- serviceOptions = commonUnitOptions // {
+ serviceOptions = { options = {
environment = mkOption {
default = {};
@@ -276,121 +284,164 @@ in rec {
'';
};
- script = mkOption {
- type = types.lines;
- default = "";
- description = "Shell commands executed as the service's main process.";
+ }; };
+
+ stage2ServiceOptions = { name, config, ... }: {
+ imports = [
+ stage2CommonUnitOptions
+ serviceOptions
+ ];
+
+ options = {
+ script = mkOption {
+ type = types.lines;
+ default = "";
+ description = "Shell commands executed as the service's main process.";
+ };
+
+ scriptArgs = mkOption {
+ type = types.str;
+ default = "";
+ description = "Arguments passed to the main process script.";
+ };
+
+ preStart = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Shell commands executed before the service's main process
+ is started.
+ '';
+ };
+
+ postStart = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Shell commands executed after the service's main process
+ is started.
+ '';
+ };
+
+ reload = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Shell commands executed when the service's main process
+ is reloaded.
+ '';
+ };
+
+ preStop = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Shell commands executed to stop the service.
+ '';
+ };
+
+ postStop = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Shell commands executed after the service's main process
+ has exited.
+ '';
+ };
+
+ restartIfChanged = mkOption {
+ type = types.bool;
+ default = true;
+ description = ''
+ Whether the service should be restarted during a NixOS
+ configuration switch if its definition has changed.
+ '';
+ };
+
+ reloadIfChanged = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Whether the service should be reloaded during a NixOS
+ configuration switch if its definition has changed. If
+ enabled, the value of is
+ ignored.
+
+ This option should not be used anymore in favor of
+ which allows more granular
+ control of when a service is reloaded and when a service
+ is restarted.
+ '';
+ };
+
+ stopIfChanged = mkOption {
+ type = types.bool;
+ default = true;
+ description = ''
+ If set, a changed unit is restarted by calling
+ systemctl stop in the old configuration,
+ then systemctl start in the new one.
+ Otherwise, it is restarted in a single step using
+ systemctl restart in the new configuration.
+ The latter is less correct because it runs the
+ ExecStop commands from the new
+ configuration.
+ '';
+ };
+
+ startAt = mkOption {
+ type = with types; either str (listOf str);
+ default = [];
+ example = "Sun 14:00:00";
+ description = ''
+ Automatically start this unit at the given date/time, which
+ must be in the format described in
+ systemd.time
+ 7. This is equivalent
+ to adding a corresponding timer unit with
+ set to the value given here.
+ '';
+ apply = v: if isList v then v else [ v ];
+ };
};
- scriptArgs = mkOption {
- type = types.str;
- default = "";
- description = "Arguments passed to the main process script.";
- };
-
- preStart = mkOption {
- type = types.lines;
- default = "";
- description = ''
- Shell commands executed before the service's main process
- is started.
- '';
- };
-
- postStart = mkOption {
- type = types.lines;
- default = "";
- description = ''
- Shell commands executed after the service's main process
- is started.
- '';
- };
-
- reload = mkOption {
- type = types.lines;
- default = "";
- description = ''
- Shell commands executed when the service's main process
- is reloaded.
- '';
- };
-
- preStop = mkOption {
- type = types.lines;
- default = "";
- description = ''
- Shell commands executed to stop the service.
- '';
- };
-
- postStop = mkOption {
- type = types.lines;
- default = "";
- description = ''
- Shell commands executed after the service's main process
- has exited.
- '';
- };
-
- restartIfChanged = mkOption {
- type = types.bool;
- default = true;
- description = ''
- Whether the service should be restarted during a NixOS
- configuration switch if its definition has changed.
- '';
- };
-
- reloadIfChanged = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Whether the service should be reloaded during a NixOS
- configuration switch if its definition has changed. If
- enabled, the value of is
- ignored.
-
- This option should not be used anymore in favor of
- which allows more granular
- control of when a service is reloaded and when a service
- is restarted.
- '';
- };
-
- stopIfChanged = mkOption {
- type = types.bool;
- default = true;
- description = ''
- If set, a changed unit is restarted by calling
- systemctl stop in the old configuration,
- then systemctl start in the new one.
- Otherwise, it is restarted in a single step using
- systemctl restart in the new configuration.
- The latter is less correct because it runs the
- ExecStop commands from the new
- configuration.
- '';
- };
-
- startAt = mkOption {
- type = with types; either str (listOf str);
- default = [];
- example = "Sun 14:00:00";
- description = ''
- Automatically start this unit at the given date/time, which
- must be in the format described in
- systemd.time
- 7. This is equivalent
- to adding a corresponding timer unit with
- set to the value given here.
- '';
- apply = v: if isList v then v else [ v ];
- };
+ config = mkMerge
+ [ (mkIf (config.preStart != "")
+ { serviceConfig.ExecStartPre =
+ [ (makeJobScript "${name}-pre-start" config.preStart) ];
+ })
+ (mkIf (config.script != "")
+ { serviceConfig.ExecStart =
+ makeJobScript "${name}-start" config.script + " " + config.scriptArgs;
+ })
+ (mkIf (config.postStart != "")
+ { serviceConfig.ExecStartPost =
+ [ (makeJobScript "${name}-post-start" config.postStart) ];
+ })
+ (mkIf (config.reload != "")
+ { serviceConfig.ExecReload =
+ makeJobScript "${name}-reload" config.reload;
+ })
+ (mkIf (config.preStop != "")
+ { serviceConfig.ExecStop =
+ makeJobScript "${name}-pre-stop" config.preStop;
+ })
+ (mkIf (config.postStop != "")
+ { serviceConfig.ExecStopPost =
+ makeJobScript "${name}-post-stop" config.postStop;
+ })
+ ];
+ };
+ stage1ServiceOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ serviceOptions
+ ];
};
- socketOptions = commonUnitOptions // {
+ socketOptions = { options = {
listenStreams = mkOption {
default = [];
@@ -424,10 +475,24 @@ in rec {
'';
};
+ }; };
+
+ stage2SocketOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ socketOptions
+ ];
+ };
+
+ stage1SocketOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ socketOptions
+ ];
};
- timerOptions = commonUnitOptions // {
+ timerOptions = { options = {
timerConfig = mkOption {
default = {};
@@ -443,10 +508,24 @@ in rec {
'';
};
+ }; };
+
+ stage2TimerOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ timerOptions
+ ];
+ };
+
+ stage1TimerOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ timerOptions
+ ];
};
- pathOptions = commonUnitOptions // {
+ pathOptions = { options = {
pathConfig = mkOption {
default = {};
@@ -460,10 +539,24 @@ in rec {
'';
};
+ }; };
+
+ stage2PathOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ pathOptions
+ ];
+ };
+
+ stage1PathOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ pathOptions
+ ];
};
- mountOptions = commonUnitOptions // {
+ mountOptions = { options = {
what = mkOption {
example = "/dev/sda1";
@@ -505,9 +598,23 @@ in rec {
5 for details.
'';
};
+ }; };
+
+ stage2MountOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ mountOptions
+ ];
};
- automountOptions = commonUnitOptions // {
+ stage1MountOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ mountOptions
+ ];
+ };
+
+ automountOptions = { options = {
where = mkOption {
example = "/mnt";
@@ -529,11 +636,23 @@ in rec {
5 for details.
'';
};
+ }; };
+
+ stage2AutomountOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ automountOptions
+ ];
};
- targetOptions = commonUnitOptions;
+ stage1AutomountOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ automountOptions
+ ];
+ };
- sliceOptions = commonUnitOptions // {
+ sliceOptions = { options = {
sliceConfig = mkOption {
default = {};
@@ -547,6 +666,20 @@ in rec {
'';
};
+ }; };
+
+ stage2SliceOptions = {
+ imports = [
+ stage2CommonUnitOptions
+ sliceOptions
+ ];
+ };
+
+ stage1SliceOptions = {
+ imports = [
+ stage1CommonUnitOptions
+ sliceOptions
+ ];
};
}
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix
index ae68c3920c5b..80341dd48fcd 100644
--- a/nixos/lib/utils.nix
+++ b/nixos/lib/utils.nix
@@ -197,5 +197,6 @@ rec {
systemdUtils = {
lib = import ./systemd-lib.nix { inherit lib config pkgs; };
unitOptions = import ./systemd-unit-options.nix { inherit lib systemdUtils; };
+ types = import ./systemd-types.nix { inherit lib systemdUtils; };
};
}
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index d825f4beb301..931201ade293 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -15,6 +15,26 @@ let
mapAttrsToList (n: v: ''${n}=${escapeIfNeccessary (toString v)}'') attrs
);
+ osReleaseContents = {
+ NAME = "NixOS";
+ ID = "nixos";
+ VERSION = "${cfg.release} (${cfg.codeName})";
+ VERSION_CODENAME = toLower cfg.codeName;
+ VERSION_ID = cfg.release;
+ BUILD_ID = cfg.version;
+ PRETTY_NAME = "NixOS ${cfg.release} (${cfg.codeName})";
+ LOGO = "nix-snowflake";
+ HOME_URL = "https://nixos.org/";
+ DOCUMENTATION_URL = "https://nixos.org/learn.html";
+ SUPPORT_URL = "https://nixos.org/community.html";
+ BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
+ };
+
+ initrdReleaseContents = osReleaseContents // {
+ PRETTY_NAME = "${osReleaseContents.PRETTY_NAME} (Initrd)";
+ };
+ initrdRelease = pkgs.writeText "initrd-release" (attrsToText initrdReleaseContents);
+
in
{
imports = [
@@ -119,20 +139,12 @@ in
DISTRIB_DESCRIPTION = "NixOS ${cfg.release} (${cfg.codeName})";
};
- "os-release".text = attrsToText {
- NAME = "NixOS";
- ID = "nixos";
- VERSION = "${cfg.release} (${cfg.codeName})";
- VERSION_CODENAME = toLower cfg.codeName;
- VERSION_ID = cfg.release;
- BUILD_ID = cfg.version;
- PRETTY_NAME = "NixOS ${cfg.release} (${cfg.codeName})";
- LOGO = "nix-snowflake";
- HOME_URL = "https://nixos.org/";
- DOCUMENTATION_URL = "https://nixos.org/learn.html";
- SUPPORT_URL = "https://nixos.org/community.html";
- BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
- };
+ "os-release".text = attrsToText osReleaseContents;
+ };
+
+ boot.initrd.systemd.contents = {
+ "/etc/os-release".source = initrdRelease;
+ "/etc/initrd-release".source = initrdRelease;
};
};
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index c4958c36ea00..d6c65251c628 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -850,7 +850,6 @@
./services/networking/ofono.nix
./services/networking/oidentd.nix
./services/networking/onedrive.nix
- ./services/networking/openfire.nix
./services/networking/openvpn.nix
./services/networking/ostinato.nix
./services/networking/owamp.nix
@@ -1181,6 +1180,7 @@
./system/boot/systemd/nspawn.nix
./system/boot/systemd/tmpfiles.nix
./system/boot/systemd/user.nix
+ ./system/boot/systemd/initrd.nix
./system/boot/timesyncd.nix
./system/boot/tmp.nix
./system/etc/etc-activation.nix
diff --git a/nixos/modules/programs/adb.nix b/nixos/modules/programs/adb.nix
index 83bcfe886aa1..9e9e37f92a87 100644
--- a/nixos/modules/programs/adb.nix
+++ b/nixos/modules/programs/adb.nix
@@ -23,8 +23,7 @@ with lib;
###### implementation
config = mkIf config.programs.adb.enable {
services.udev.packages = [ pkgs.android-udev-rules ];
- # Give platform-tools lower priority so mke2fs+friends are taken from other packages first
- environment.systemPackages = [ (lowPrio pkgs.androidenv.androidPkgs_9_0.platform-tools) ];
+ environment.systemPackages = [ pkgs.android-tools ];
users.groups.adbusers = {};
};
}
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index 195cf87e6a85..72395b2ee869 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -91,6 +91,7 @@ with lib;
(mkRemovedOptionModule [ "services" "shellinabox" ] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [ "services" "gogoclient" ] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [ "services" "virtuoso" ] "The corresponding package was removed from nixpkgs.")
+ (mkRemovedOptionModule [ "services" "openfire" ] "The corresponding package was removed from nixpkgs.")
# Do NOT add any option renames here, see top of the file
];
diff --git a/nixos/modules/services/development/jupyter/default.nix b/nixos/modules/services/development/jupyter/default.nix
index bebb3c3f13f0..4eacc4782a9a 100644
--- a/nixos/modules/services/development/jupyter/default.nix
+++ b/nixos/modules/services/development/jupyter/default.nix
@@ -194,6 +194,7 @@ in {
extraGroups = [ cfg.group ];
home = "/var/lib/jupyter";
createHome = true;
+ isSystemUser = true;
useDefaultShell = true; # needed so that the user can start a terminal.
};
})
diff --git a/nixos/modules/services/monitoring/collectd.nix b/nixos/modules/services/monitoring/collectd.nix
index 8d81737a3ef0..1b9af5857560 100644
--- a/nixos/modules/services/monitoring/collectd.nix
+++ b/nixos/modules/services/monitoring/collectd.nix
@@ -5,36 +5,15 @@ with lib;
let
cfg = config.services.collectd;
- unvalidated_conf = pkgs.writeText "collectd-unvalidated.conf" ''
- BaseDir "${cfg.dataDir}"
- AutoLoadPlugin ${boolToString cfg.autoLoadPlugin}
- Hostname "${config.networking.hostName}"
-
- LoadPlugin syslog
-
- LogLevel "info"
- NotifyLevel "OKAY"
-
-
- ${concatStrings (mapAttrsToList (plugin: pluginConfig: ''
- LoadPlugin ${plugin}
-
- ${pluginConfig}
-
- '') cfg.plugins)}
-
- ${concatMapStrings (f: ''
- Include "${f}"
- '') cfg.include}
-
- ${cfg.extraConfig}
- '';
+ baseDirLine = ''BaseDir "${cfg.dataDir}"'';
+ unvalidated_conf = pkgs.writeText "collectd-unvalidated.conf" cfg.extraConfig;
conf = if cfg.validateConfig then
pkgs.runCommand "collectd.conf" {} ''
echo testing ${unvalidated_conf}
+ cp ${unvalidated_conf} collectd.conf
# collectd -t fails if BaseDir does not exist.
- sed '1s/^BaseDir.*$/BaseDir "."/' ${unvalidated_conf} > collectd.conf
+ substituteInPlace collectd.conf --replace ${lib.escapeShellArgs [ baseDirLine ]} 'BaseDir "."'
${package}/bin/collectd -t -C collectd.conf
cp ${unvalidated_conf} $out
'' else unvalidated_conf;
@@ -123,7 +102,8 @@ in {
extraConfig = mkOption {
default = "";
description = ''
- Extra configuration for collectd.
+ Extra configuration for collectd. Use mkBefore to add lines before the
+ default config, and mkAfter to add them below.
'';
type = lines;
};
@@ -131,6 +111,30 @@ in {
};
config = mkIf cfg.enable {
+ # 1200 is after the default (1000) but before mkAfter (1500).
+ services.collectd.extraConfig = lib.mkOrder 1200 ''
+ ${baseDirLine}
+ AutoLoadPlugin ${boolToString cfg.autoLoadPlugin}
+ Hostname "${config.networking.hostName}"
+
+ LoadPlugin syslog
+
+ LogLevel "info"
+ NotifyLevel "OKAY"
+
+
+ ${concatStrings (mapAttrsToList (plugin: pluginConfig: ''
+ LoadPlugin ${plugin}
+
+ ${pluginConfig}
+
+ '') cfg.plugins)}
+
+ ${concatMapStrings (f: ''
+ Include "${f}"
+ '') cfg.include}
+ '';
+
systemd.tmpfiles.rules = [
"d '${cfg.dataDir}' - ${cfg.user} - - -"
];
diff --git a/nixos/modules/services/networking/kea.nix b/nixos/modules/services/networking/kea.nix
index 17b4eb2e283b..994c511bdc2d 100644
--- a/nixos/modules/services/networking/kea.nix
+++ b/nixos/modules/services/networking/kea.nix
@@ -9,20 +9,26 @@ with lib;
let
cfg = config.services.kea;
+ xor = x: y: (!x && y) || (x && !y);
format = pkgs.formats.json {};
- ctrlAgentConfig = format.generate "kea-ctrl-agent.conf" {
+ chooseNotNull = x: y: if x != null then x else y;
+
+ ctrlAgentConfig = chooseNotNull cfg.ctrl-agent.configFile (format.generate "kea-ctrl-agent.conf" {
Control-agent = cfg.ctrl-agent.settings;
- };
- dhcp4Config = format.generate "kea-dhcp4.conf" {
+ });
+
+ dhcp4Config = chooseNotNull cfg.dhcp4.configFile (format.generate "kea-dhcp4.conf" {
Dhcp4 = cfg.dhcp4.settings;
- };
- dhcp6Config = format.generate "kea-dhcp6.conf" {
+ });
+
+ dhcp6Config = chooseNotNull cfg.dhcp6.configFile (format.generate "kea-dhcp6.conf" {
Dhcp6 = cfg.dhcp6.settings;
- };
- dhcpDdnsConfig = format.generate "kea-dhcp-ddns.conf" {
+ });
+
+ dhcpDdnsConfig = chooseNotNull cfg.dhcp-ddns.configFile (format.generate "kea-dhcp-ddns.conf" {
DhcpDdns = cfg.dhcp-ddns.settings;
- };
+ });
package = pkgs.kea;
in
@@ -45,6 +51,17 @@ in
'';
};
+ configFile = mkOption {
+ type = nullOr path;
+ default = null;
+ description = ''
+ Kea Control Agent configuration as a path, see .
+
+ Takes preference over settings.
+ Most users should prefer using settings instead.
+ '';
+ };
+
settings = mkOption {
type = format.type;
default = null;
@@ -73,6 +90,17 @@ in
'';
};
+ configFile = mkOption {
+ type = nullOr path;
+ default = null;
+ description = ''
+ Kea DHCP4 configuration as a path, see .
+
+ Takes preference over settings.
+ Most users should prefer using settings instead.
+ '';
+ };
+
settings = mkOption {
type = format.type;
default = null;
@@ -122,6 +150,17 @@ in
'';
};
+ configFile = mkOption {
+ type = nullOr path;
+ default = null;
+ description = ''
+ Kea DHCP6 configuration as a path, see .
+
+ Takes preference over settings.
+ Most users should prefer using settings instead.
+ '';
+ };
+
settings = mkOption {
type = format.type;
default = null;
@@ -172,6 +211,17 @@ in
'';
};
+ configFile = mkOption {
+ type = nullOr path;
+ default = null;
+ description = ''
+ Kea DHCP-DDNS configuration as a path, see .
+
+ Takes preference over settings.
+ Most users should prefer using settings instead.
+ '';
+ };
+
settings = mkOption {
type = format.type;
default = null;
@@ -214,6 +264,10 @@ in
}
(mkIf cfg.ctrl-agent.enable {
+ assertions = [{
+ assertion = xor (cfg.ctrl-agent.settings == null) (cfg.ctrl-agent.configFile == null);
+ message = "Either services.kea.ctrl-agent.settings or services.kea.ctrl-agent.configFile must be set to a non-null value.";
+ }];
environment.etc."kea/ctrl-agent.conf".source = ctrlAgentConfig;
@@ -252,6 +306,10 @@ in
})
(mkIf cfg.dhcp4.enable {
+ assertions = [{
+ assertion = xor (cfg.dhcp4.settings == null) (cfg.dhcp4.configFile == null);
+ message = "Either services.kea.dhcp4.settings or services.kea.dhcp4.configFile must be set to a non-null value.";
+ }];
environment.etc."kea/dhcp4-server.conf".source = dhcp4Config;
@@ -295,6 +353,10 @@ in
})
(mkIf cfg.dhcp6.enable {
+ assertions = [{
+ assertion = xor (cfg.dhcp6.settings == null) (cfg.dhcp6.configFile == null);
+ message = "Either services.kea.dhcp6.settings or services.kea.dhcp6.configFile must be set to a non-null value.";
+ }];
environment.etc."kea/dhcp6-server.conf".source = dhcp6Config;
@@ -336,6 +398,10 @@ in
})
(mkIf cfg.dhcp-ddns.enable {
+ assertions = [{
+ assertion = xor (cfg.dhcp-ddns.settings == null) (cfg.dhcp-ddns.configFile == null);
+ message = "Either services.kea.dhcp-ddns.settings or services.kea.dhcp-ddns.configFile must be set to a non-null value.";
+ }];
environment.etc."kea/dhcp-ddns.conf".source = dhcpDdnsConfig;
diff --git a/nixos/modules/services/networking/openfire.nix b/nixos/modules/services/networking/openfire.nix
deleted file mode 100644
index fe0499d52323..000000000000
--- a/nixos/modules/services/networking/openfire.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-{
- ###### interface
-
- options = {
-
- services.openfire = {
-
- enable = mkEnableOption "OpenFire XMPP server";
-
- usePostgreSQL = mkOption {
- type = types.bool;
- default = true;
- description = "
- Whether you use PostgreSQL service for your storage back-end.
- ";
- };
-
- };
-
- };
-
-
- ###### implementation
-
- config = mkIf config.services.openfire.enable {
-
- assertions = singleton
- { assertion = !(config.services.openfire.usePostgreSQL -> config.services.postgresql.enable);
- message = "OpenFire configured to use PostgreSQL but services.postgresql.enable is not enabled.";
- };
-
- systemd.services.openfire = {
- description = "OpenFire XMPP server";
- wantedBy = [ "multi-user.target" ];
- after = [ "networking.target" ] ++
- optional config.services.openfire.usePostgreSQL "postgresql.service";
- path = with pkgs; [ jre openfire coreutils which gnugrep gawk gnused ];
- script = ''
- export HOME=/tmp
- mkdir /var/log/openfire || true
- mkdir /etc/openfire || true
- for i in ${pkgs.openfire}/conf.inst/*; do
- if ! test -f /etc/openfire/$(basename $i); then
- cp $i /etc/openfire/
- fi
- done
- openfire start
- ''; # */
- };
- };
-
-}
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index 3cf92f98c56f..0bb5c1268cac 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -99,6 +99,7 @@ in
ristretto
xfce4-appfinder
xfce4-notifyd
+ xfce4-screensaver
xfce4-screenshooter
xfce4-session
xfce4-settings
@@ -168,5 +169,6 @@ in
xfce4-notifyd
];
+ security.pam.services.xfce4-screensaver.unixAuth = true;
};
}
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 8b011d91563f..1bafec30b53d 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -703,8 +703,12 @@ in
}
];
- system.build =
- { inherit bootStage1 initialRamdisk initialRamdiskSecretAppender extraUtils; };
+ system.build = mkMerge [
+ { inherit bootStage1 initialRamdiskSecretAppender extraUtils; }
+
+ # generated in nixos/modules/system/boot/systemd/initrd.nix
+ (mkIf (!config.boot.initrd.systemd.enable) { inherit initialRamdisk; })
+ ];
system.requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "TMPFS")
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 9a9d35c08db9..096a051f8684 100755
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -12,10 +12,6 @@ for o in $(&1 {logErrFd}>&2
@@ -127,28 +89,20 @@ else
fi
+# Required by the activation script
+install -m 0755 -d /etc /etc/nixos
+install -m 01777 -d /tmp
+
+
# Run the script that performs all configuration activation that does
# not have to be done at boot time.
echo "running activation script..."
$systemConfig/activate
-# Restore the system time from the hardware clock. We do this after
-# running the activation script to be sure that /etc/localtime points
-# at the current time zone.
-if [ -e /dev/rtc ]; then
- hwclock --hctosys
-fi
-
-
# Record the boot configuration.
ln -sfn "$systemConfig" /run/booted-system
-# Prevent the booted system from being garbage-collected. If it weren't
-# a gcroot, if we were running a different kernel, switched system,
-# and garbage collected all, we could not load kernel modules anymore.
-ln -sfn /run/booted-system /nix/var/nix/gcroots/booted-system
-
# Run any user-specified commands.
@shell@ @postBootCommands@
@@ -169,4 +123,4 @@ exec {logOutFd}>&- {logErrFd}>&-
# Start systemd in a clean environment.
echo "starting systemd..."
-exec env - @systemdExecutable@ "$@"
+exec @systemdExecutable@ "$@"
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index f69c5d3d5a64..844a6793c154 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -11,14 +11,7 @@ let
systemd = cfg.package;
inherit (systemdUtils.lib)
- makeUnit
generateUnits
- makeJobScript
- unitConfig
- serviceConfig
- mountConfig
- automountConfig
- commonUnitText
targetToUnit
serviceToUnit
socketToUnit
@@ -185,13 +178,7 @@ in
systemd.units = mkOption {
description = "Definition of systemd units.";
default = {};
- type = with types; attrsOf (submodule (
- { name, config, ... }:
- { options = concreteUnitOptions;
- config = {
- unit = mkDefault (makeUnit name config);
- };
- }));
+ type = systemdUtils.types.units;
};
systemd.packages = mkOption {
@@ -203,37 +190,37 @@ in
systemd.targets = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = targetOptions; } unitConfig] );
+ type = systemdUtils.types.targets;
description = "Definition of systemd target units.";
};
systemd.services = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ]);
+ type = systemdUtils.types.services;
description = "Definition of systemd service units.";
};
systemd.sockets = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ]);
+ type = systemdUtils.types.sockets;
description = "Definition of systemd socket units.";
};
systemd.timers = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ]);
+ type = systemdUtils.types.timers;
description = "Definition of systemd timer units.";
};
systemd.paths = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = pathOptions; } unitConfig ]);
+ type = systemdUtils.types.paths;
description = "Definition of systemd path units.";
};
systemd.mounts = mkOption {
default = [];
- type = with types; listOf (submodule [ { options = mountOptions; } unitConfig mountConfig ]);
+ type = systemdUtils.types.mounts;
description = ''
Definition of systemd mount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
@@ -243,7 +230,7 @@ in
systemd.automounts = mkOption {
default = [];
- type = with types; listOf (submodule [ { options = automountOptions; } unitConfig automountConfig ]);
+ type = systemdUtils.types.automounts;
description = ''
Definition of systemd automount units.
This is a list instead of an attrSet, because systemd mandates the names to be derived from
@@ -253,7 +240,7 @@ in
systemd.slices = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = sliceOptions; } unitConfig] );
+ type = systemdUtils.types.slices;
description = "Definition of slice configurations.";
};
@@ -362,10 +349,11 @@ in
type = types.listOf types.str;
example = [ "systemd-backlight@.service" ];
description = ''
- A list of units to suppress when generating system systemd configuration directory. This has
+ A list of units to skip when generating system systemd configuration directory. This has
priority over upstream units, , and
. The main purpose of this is to
- suppress a upstream systemd unit with any modifications made to it by other NixOS modules.
+ prevent a upstream systemd unit from being added to the initrd with any modifications made to it
+ by other NixOS modules.
'';
};
@@ -482,7 +470,12 @@ in
enabledUnits = filterAttrs (n: v: ! elem n cfg.suppressedSystemUnits) cfg.units;
in ({
- "systemd/system".source = generateUnits "system" enabledUnits enabledUpstreamSystemUnits upstreamSystemWants;
+ "systemd/system".source = generateUnits {
+ type = "system";
+ units = enabledUnits;
+ upstreamUnits = enabledUpstreamSystemUnits;
+ upstreamWants = upstreamSystemWants;
+ };
"systemd/system.conf".text = ''
[Manager]
diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix
new file mode 100644
index 000000000000..30bdc9a3422c
--- /dev/null
+++ b/nixos/modules/system/boot/systemd/initrd.nix
@@ -0,0 +1,417 @@
+{ lib, config, utils, pkgs, ... }:
+
+with lib;
+
+let
+ inherit (utils) systemdUtils escapeSystemdPath;
+ inherit (systemdUtils.lib)
+ generateUnits
+ pathToUnit
+ serviceToUnit
+ sliceToUnit
+ socketToUnit
+ targetToUnit
+ timerToUnit
+ mountToUnit
+ automountToUnit;
+
+
+ cfg = config.boot.initrd.systemd;
+
+ # Copied from fedora
+ upstreamUnits = [
+ "basic.target"
+ "ctrl-alt-del.target"
+ "emergency.service"
+ "emergency.target"
+ "final.target"
+ "halt.target"
+ "initrd-cleanup.service"
+ "initrd-fs.target"
+ "initrd-parse-etc.service"
+ "initrd-root-device.target"
+ "initrd-root-fs.target"
+ "initrd-switch-root.service"
+ "initrd-switch-root.target"
+ "initrd.target"
+ "initrd-udevadm-cleanup-db.service"
+ "kexec.target"
+ "kmod-static-nodes.service"
+ "local-fs-pre.target"
+ "local-fs.target"
+ "multi-user.target"
+ "paths.target"
+ "poweroff.target"
+ "reboot.target"
+ "rescue.service"
+ "rescue.target"
+ "rpcbind.target"
+ "shutdown.target"
+ "sigpwr.target"
+ "slices.target"
+ "sockets.target"
+ "swap.target"
+ "sysinit.target"
+ "sys-kernel-config.mount"
+ "syslog.socket"
+ "systemd-ask-password-console.path"
+ "systemd-ask-password-console.service"
+ "systemd-fsck@.service"
+ "systemd-halt.service"
+ "systemd-hibernate-resume@.service"
+ "systemd-journald-audit.socket"
+ "systemd-journald-dev-log.socket"
+ "systemd-journald.service"
+ "systemd-journald.socket"
+ "systemd-kexec.service"
+ "systemd-modules-load.service"
+ "systemd-poweroff.service"
+ "systemd-random-seed.service"
+ "systemd-reboot.service"
+ "systemd-sysctl.service"
+ "systemd-tmpfiles-setup-dev.service"
+ "systemd-tmpfiles-setup.service"
+ "systemd-udevd-control.socket"
+ "systemd-udevd-kernel.socket"
+ "systemd-udevd.service"
+ "systemd-udev-settle.service"
+ "systemd-udev-trigger.service"
+ "systemd-vconsole-setup.service"
+ "timers.target"
+ "umount.target"
+
+ # TODO: Networking
+ # "network-online.target"
+ # "network-pre.target"
+ # "network.target"
+ # "nss-lookup.target"
+ # "nss-user-lookup.target"
+ # "remote-fs-pre.target"
+ # "remote-fs.target"
+ ] ++ cfg.additionalUpstreamUnits;
+
+ upstreamWants = [
+ "sysinit.target.wants"
+ ];
+
+ enabledUpstreamUnits = filter (n: ! elem n cfg.suppressedUnits) upstreamUnits;
+ enabledUnits = filterAttrs (n: v: ! elem n cfg.suppressedUnits) cfg.units;
+
+ stage1Units = generateUnits {
+ type = "initrd";
+ units = enabledUnits;
+ upstreamUnits = enabledUpstreamUnits;
+ inherit upstreamWants;
+ inherit (cfg) packages package;
+ };
+
+ fileSystems = filter utils.fsNeededForBoot config.system.build.fileSystems;
+
+ fstab = pkgs.writeText "fstab" (lib.concatMapStringsSep "\n"
+ ({ fsType, mountPoint, device, options, autoFormat, autoResize, ... }@fs: let
+ opts = options ++ optional autoFormat "x-systemd.makefs" ++ optional autoResize "x-systemd.growfs";
+ in "${device} /sysroot${mountPoint} ${fsType} ${lib.concatStringsSep "," opts}") fileSystems);
+
+ kernel-name = config.boot.kernelPackages.kernel.name or "kernel";
+ modulesTree = config.system.modulesTree.override { name = kernel-name + "-modules"; };
+ firmware = config.hardware.firmware;
+ # Determine the set of modules that we need to mount the root FS.
+ modulesClosure = pkgs.makeModulesClosure {
+ rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules;
+ kernel = modulesTree;
+ firmware = firmware;
+ allowMissing = false;
+ };
+
+ initrdBinEnv = pkgs.buildEnv {
+ name = "initrd-emergency-env";
+ paths = map getBin cfg.initrdBin;
+ pathsToLink = ["/bin" "/sbin"];
+ # Make recovery easier
+ postBuild = ''
+ ln -s ${cfg.package.util-linux}/bin/mount $out/bin/
+ ln -s ${cfg.package.util-linux}/bin/umount $out/bin/
+ '';
+ };
+
+ initialRamdisk = pkgs.makeInitrdNG {
+ contents = map (path: { object = path; symlink = ""; }) (subtractLists cfg.suppressedStorePaths cfg.storePaths)
+ ++ mapAttrsToList (_: v: { object = v.source; symlink = v.target; }) (filterAttrs (_: v: v.enable) cfg.contents);
+ };
+
+in {
+ options.boot.initrd.systemd = {
+ enable = mkEnableOption ''systemd in initrd.
+
+ Note: This is in very early development and is highly
+ experimental. Most of the features NixOS supports in initrd are
+ not yet supported by the intrd generated with this option.
+ '';
+
+ package = (mkPackageOption pkgs "systemd" {
+ default = "systemdMinimal";
+ }) // {
+ visible = false;
+ };
+
+ contents = mkOption {
+ description = "Set of files that have to be linked into the initrd";
+ example = literalExpression ''
+ {
+ "/etc/hostname".text = "mymachine";
+ }
+ '';
+ visible = false;
+ default = {};
+ type = types.attrsOf (types.submodule ({ config, options, name, ... }: {
+ options = {
+ enable = mkEnableOption "copying of this file to initrd and symlinking it" // { default = true; };
+
+ target = mkOption {
+ type = types.path;
+ description = ''
+ Path of the symlink.
+ '';
+ default = name;
+ };
+
+ text = mkOption {
+ default = null;
+ type = types.nullOr types.lines;
+ description = "Text of the file.";
+ };
+
+ source = mkOption {
+ type = types.path;
+ description = "Path of the source file.";
+ };
+ };
+
+ config = {
+ source = mkIf (config.text != null) (
+ let name' = "initrd-" + baseNameOf name;
+ in mkDerivedConfig options.text (pkgs.writeText name')
+ );
+ };
+ }));
+ };
+
+ storePaths = mkOption {
+ description = ''
+ Store paths to copy into the initrd as well.
+ '';
+ type = types.listOf types.singleLineStr;
+ default = [];
+ };
+
+ suppressedStorePaths = mkOption {
+ description = ''
+ Store paths specified in the storePaths option that
+ should not be copied.
+ '';
+ type = types.listOf types.singleLineStr;
+ default = [];
+ };
+
+ emergencyAccess = mkOption {
+ type = with types; oneOf [ bool singleLineStr ];
+ visible = false;
+ description = ''
+ Set to true for unauthenticated emergency access, and false for
+ no emergency access.
+
+ Can also be set to a hashed super user password to allow
+ authenticated access to the emergency mode.
+ '';
+ default = false;
+ };
+
+ initrdBin = mkOption {
+ type = types.listOf types.package;
+ default = [];
+ visible = false;
+ description = ''
+ Packages to include in /bin for the stage 1 emergency shell.
+ '';
+ };
+
+ additionalUpstreamUnits = mkOption {
+ default = [ ];
+ type = types.listOf types.str;
+ visible = false;
+ example = [ "debug-shell.service" "systemd-quotacheck.service" ];
+ description = ''
+ Additional units shipped with systemd that shall be enabled.
+ '';
+ };
+
+ suppressedUnits = mkOption {
+ default = [ ];
+ type = types.listOf types.str;
+ example = [ "systemd-backlight@.service" ];
+ visible = false;
+ description = ''
+ A list of units to skip when generating system systemd configuration directory. This has
+ priority over upstream units, , and
+ . The main purpose of this is to
+ prevent a upstream systemd unit from being added to the initrd with any modifications made to it
+ by other NixOS modules.
+ '';
+ };
+
+ units = mkOption {
+ description = "Definition of systemd units.";
+ default = {};
+ visible = false;
+ type = systemdUtils.types.units;
+ };
+
+ packages = mkOption {
+ default = [];
+ visible = false;
+ type = types.listOf types.package;
+ example = literalExpression "[ pkgs.systemd-cryptsetup-generator ]";
+ description = "Packages providing systemd units and hooks.";
+ };
+
+ targets = mkOption {
+ default = {};
+ visible = false;
+ type = systemdUtils.types.initrdTargets;
+ description = "Definition of systemd target units.";
+ };
+
+ services = mkOption {
+ default = {};
+ type = systemdUtils.types.initrdServices;
+ visible = false;
+ description = "Definition of systemd service units.";
+ };
+
+ sockets = mkOption {
+ default = {};
+ type = systemdUtils.types.initrdSockets;
+ visible = false;
+ description = "Definition of systemd socket units.";
+ };
+
+ timers = mkOption {
+ default = {};
+ type = systemdUtils.types.initrdTimers;
+ visible = false;
+ description = "Definition of systemd timer units.";
+ };
+
+ paths = mkOption {
+ default = {};
+ type = systemdUtils.types.initrdPaths;
+ visible = false;
+ description = "Definition of systemd path units.";
+ };
+
+ mounts = mkOption {
+ default = [];
+ type = systemdUtils.types.initrdMounts;
+ visible = false;
+ description = ''
+ Definition of systemd mount units.
+ This is a list instead of an attrSet, because systemd mandates the names to be derived from
+ the 'where' attribute.
+ '';
+ };
+
+ automounts = mkOption {
+ default = [];
+ type = systemdUtils.types.automounts;
+ visible = false;
+ description = ''
+ Definition of systemd automount units.
+ This is a list instead of an attrSet, because systemd mandates the names to be derived from
+ the 'where' attribute.
+ '';
+ };
+
+ slices = mkOption {
+ default = {};
+ type = systemdUtils.types.slices;
+ visible = false;
+ description = "Definition of slice configurations.";
+ };
+ };
+
+ config = mkIf (config.boot.initrd.enable && cfg.enable) {
+ system.build = { inherit initialRamdisk; };
+ boot.initrd.systemd = {
+ initrdBin = [pkgs.bash pkgs.coreutils pkgs.kmod cfg.package] ++ config.system.fsPackages;
+
+ contents = {
+ "/init".source = "${cfg.package}/lib/systemd/systemd";
+ "/etc/systemd/system".source = stage1Units;
+
+ "/etc/systemd/system.conf".text = ''
+ [Manager]
+ DefaultEnvironment=PATH=/bin:/sbin
+ '';
+
+ "/etc/fstab".source = fstab;
+
+ "/lib/modules".source = "${modulesClosure}/lib/modules";
+
+ "/etc/modules-load.d/nixos.conf".text = concatStringsSep "\n" config.boot.initrd.kernelModules;
+
+ "/etc/passwd".source = "${pkgs.fakeNss}/etc/passwd";
+ "/etc/shadow".text = "root:${if isBool cfg.emergencyAccess then "!" else cfg.emergencyAccess}:::::::";
+
+ "/bin".source = "${initrdBinEnv}/bin";
+ "/sbin".source = "${initrdBinEnv}/sbin";
+
+ "/etc/sysctl.d/nixos.conf".text = "kernel.modprobe = /sbin/modprobe";
+ };
+
+ storePaths = [
+ # TODO: Limit this to the bare necessities
+ "${cfg.package}/lib"
+
+ "${cfg.package.util-linux}/bin/mount"
+ "${cfg.package.util-linux}/bin/umount"
+ "${cfg.package.util-linux}/bin/sulogin"
+
+ # so NSS can look up usernames
+ "${pkgs.glibc}/lib/libnss_files.so"
+ ];
+
+ targets.initrd.aliases = ["default.target"];
+ units =
+ mapAttrs' (n: v: nameValuePair "${n}.path" (pathToUnit n v)) cfg.paths
+ // mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services
+ // mapAttrs' (n: v: nameValuePair "${n}.slice" (sliceToUnit n v)) cfg.slices
+ // mapAttrs' (n: v: nameValuePair "${n}.socket" (socketToUnit n v)) cfg.sockets
+ // mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets
+ // mapAttrs' (n: v: nameValuePair "${n}.timer" (timerToUnit n v)) cfg.timers
+ // listToAttrs (map
+ (v: let n = escapeSystemdPath v.where;
+ in nameValuePair "${n}.mount" (mountToUnit n v)) cfg.mounts)
+ // listToAttrs (map
+ (v: let n = escapeSystemdPath v.where;
+ in nameValuePair "${n}.automount" (automountToUnit n v)) cfg.automounts);
+
+ services.emergency = mkIf (isBool cfg.emergencyAccess && cfg.emergencyAccess) {
+ environment.SYSTEMD_SULOGIN_FORCE = "1";
+ };
+ # The unit in /run/systemd/generator shadows the unit in
+ # /etc/systemd/system, but will still apply drop-ins from
+ # /etc/systemd/system/foo.service.d/
+ #
+ # We need IgnoreOnIsolate, otherwise the Requires dependency of
+ # a mount unit on its makefs unit causes it to be unmounted when
+ # we isolate for switch-root. Use a dummy package so that
+ # generateUnits will generate drop-ins instead of unit files.
+ packages = [(pkgs.runCommand "dummy" {} ''
+ mkdir -p $out/etc/systemd/system
+ touch $out/etc/systemd/system/systemd-{makefs,growfs}@.service
+ '')];
+ services."systemd-makefs@".unitConfig.IgnoreOnIsolate = true;
+ services."systemd-growfs@".unitConfig.IgnoreOnIsolate = true;
+ };
+ };
+}
diff --git a/nixos/modules/system/boot/systemd/nspawn.nix b/nixos/modules/system/boot/systemd/nspawn.nix
index 0c6822319a5b..bf9995d03cc1 100644
--- a/nixos/modules/system/boot/systemd/nspawn.nix
+++ b/nixos/modules/system/boot/systemd/nspawn.nix
@@ -116,7 +116,13 @@ in {
in
mkMerge [
(mkIf (cfg != {}) {
- environment.etc."systemd/nspawn".source = mkIf (cfg != {}) (generateUnits' false "nspawn" units [] []);
+ environment.etc."systemd/nspawn".source = mkIf (cfg != {}) (generateUnits {
+ allowCollisions = false;
+ type = "nspawn";
+ inherit units;
+ upstreamUnits = [];
+ upstreamWants = [];
+ });
})
{
systemd.targets.multi-user.wants = [ "machines.target" ];
diff --git a/nixos/modules/system/boot/systemd/tmpfiles.nix b/nixos/modules/system/boot/systemd/tmpfiles.nix
index 57d44c8591ed..97d60e9d6527 100644
--- a/nixos/modules/system/boot/systemd/tmpfiles.nix
+++ b/nixos/modules/system/boot/systemd/tmpfiles.nix
@@ -100,5 +100,21 @@ in
'';
})
];
+
+ systemd.tmpfiles.rules = [
+ "d /nix/var 0755 root root - -"
+ "L+ /nix/var/nix/gcroots/booted-system 0755 root root - /run/booted-system"
+ "d /run/lock 0755 root root - -"
+ "d /var/db 0755 root root - -"
+ "L /etc/mtab - - - - ../proc/mounts"
+ "L /var/lock - - - - ../run/lock"
+ # Boot-time cleanup
+ "R! /etc/group.lock - - - - -"
+ "R! /etc/passwd.lock - - - - -"
+ "R! /etc/shadow.lock - - - - -"
+ "R! /etc/mtab* - - - - -"
+ "R! /nix/var/nix/gcroots/tmp - - - - -"
+ "R! /nix/var/nix/temproots - - - - -"
+ ];
};
}
diff --git a/nixos/modules/system/boot/systemd/user.nix b/nixos/modules/system/boot/systemd/user.nix
index e30f83f3457f..4951aef95584 100644
--- a/nixos/modules/system/boot/systemd/user.nix
+++ b/nixos/modules/system/boot/systemd/user.nix
@@ -12,10 +12,6 @@ let
(systemdUtils.lib)
makeUnit
generateUnits
- makeJobScript
- unitConfig
- serviceConfig
- commonUnitText
targetToUnit
serviceToUnit
socketToUnit
@@ -57,48 +53,42 @@ in {
systemd.user.units = mkOption {
description = "Definition of systemd per-user units.";
default = {};
- type = with types; attrsOf (submodule (
- { name, config, ... }:
- { options = concreteUnitOptions;
- config = {
- unit = mkDefault (makeUnit name config);
- };
- }));
+ type = systemdUtils.types.units;
};
systemd.user.paths = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = pathOptions; } unitConfig ]);
+ type = systemdUtils.types.paths;
description = "Definition of systemd per-user path units.";
};
systemd.user.services = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ] );
+ type = systemdUtils.types.services;
description = "Definition of systemd per-user service units.";
};
systemd.user.slices = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = sliceOptions; } unitConfig ] );
+ type = systemdUtils.types.slices;
description = "Definition of systemd per-user slice units.";
};
systemd.user.sockets = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ] );
+ type = systemdUtils.types.sockets;
description = "Definition of systemd per-user socket units.";
};
systemd.user.targets = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = targetOptions; } unitConfig] );
+ type = systemdUtils.types.targets;
description = "Definition of systemd per-user target units.";
};
systemd.user.timers = mkOption {
default = {};
- type = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ] );
+ type = systemdUtils.types.timers;
description = "Definition of systemd per-user timer units.";
};
@@ -119,7 +109,12 @@ in {
];
environment.etc = {
- "systemd/user".source = generateUnits "user" cfg.units upstreamUserUnits [];
+ "systemd/user".source = generateUnits {
+ type = "user";
+ inherit (cfg) units;
+ upstreamUnits = upstreamUserUnits;
+ upstreamWants = [];
+ };
"systemd/user.conf".text = ''
[Manager]
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index d68edd8d7d39..b8afe231dd2e 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -352,7 +352,7 @@ in
unitConfig.DefaultDependencies = false; # needed to prevent a cycle
serviceConfig.Type = "oneshot";
};
- in listToAttrs (map formatDevice (filter (fs: fs.autoFormat) fileSystems)) // {
+ in listToAttrs (map formatDevice (filter (fs: fs.autoFormat && !(utils.fsNeededForBoot fs)) fileSystems)) // {
# Mount /sys/fs/pstore for evacuating panic logs and crashdumps from persistent storage onto the disk using systemd-pstore.
# This cannot be done with the other special filesystems because the pstore module (which creates the mount point) is not loaded then.
"mount-pstore" = {
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 760f69121612..74f6521462b8 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -923,6 +923,8 @@ in
mkVMOverride (cfg.fileSystems //
{
"/".device = cfg.bootDevice;
+ "/".fsType = "ext4";
+ "/".autoFormat = true;
"/tmp" = mkIf config.boot.tmpOnTmpfs
{ device = "tmpfs";
@@ -953,6 +955,28 @@ in
};
} // lib.mapAttrs' mkSharedDir cfg.sharedDirectories);
+ boot.initrd.systemd = lib.mkIf (config.boot.initrd.systemd.enable && cfg.writableStore) {
+ mounts = [{
+ where = "/sysroot/nix/store";
+ what = "overlay";
+ type = "overlay";
+ options = "lowerdir=/sysroot/nix/.ro-store,upperdir=/sysroot/nix/.rw-store/store,workdir=/sysroot/nix/.rw-store/work";
+ wantedBy = ["local-fs.target"];
+ before = ["local-fs.target"];
+ requires = ["sysroot-nix-.ro\\x2dstore.mount" "sysroot-nix-.rw\\x2dstore.mount" "rw-store.service"];
+ after = ["sysroot-nix-.ro\\x2dstore.mount" "sysroot-nix-.rw\\x2dstore.mount" "rw-store.service"];
+ unitConfig.IgnoreOnIsolate = true;
+ }];
+ services.rw-store = {
+ after = ["sysroot-nix-.rw\\x2dstore.mount"];
+ unitConfig.DefaultDependencies = false;
+ serviceConfig = {
+ Type = "oneshot";
+ ExecStart = "/bin/mkdir -p 0755 /sysroot/nix/.rw-store/store /sysroot/nix/.rw-store/work /sysroot/nix/store";
+ };
+ };
+ };
+
swapDevices = mkVMOverride [ ];
boot.initrd.luks.devices = mkVMOverride {};
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index cf4bfecf6f19..dcbdf34e9441 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -514,6 +514,7 @@ in
systemd-confinement = handleTest ./systemd-confinement.nix {};
systemd-cryptenroll = handleTest ./systemd-cryptenroll.nix {};
systemd-escaping = handleTest ./systemd-escaping.nix {};
+ systemd-initrd-simple = handleTest ./systemd-initrd-simple.nix {};
systemd-journal = handleTest ./systemd-journal.nix {};
systemd-machinectl = handleTest ./systemd-machinectl.nix {};
systemd-networkd = handleTest ./systemd-networkd.nix {};
diff --git a/nixos/tests/boot.nix b/nixos/tests/boot.nix
index 8e469a654972..ec2a9f6527c9 100644
--- a/nixos/tests/boot.nix
+++ b/nixos/tests/boot.nix
@@ -42,7 +42,7 @@ let
nodes = { };
testScript =
''
- nodes.machine = create_machine(${machineConfig})
+ machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("nix store verify --no-trust -r --option experimental-features nix-command /run/current-system")
@@ -83,7 +83,7 @@ let
name = "boot-netboot-" + name;
nodes = { };
testScript = ''
- nodes.machine = create_machine(${machineConfig})
+ machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.shutdown()
@@ -138,7 +138,7 @@ in {
if os.system("qemu-img create -f qcow2 -F raw -b ${sdImage} ${mutableImage}") != 0:
raise RuntimeError("Could not create mutable linked image")
- nodes.machine = create_machine(${machineConfig})
+ machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("nix store verify -r --no-trust --option experimental-features nix-command /run/current-system")
diff --git a/nixos/tests/collectd.nix b/nixos/tests/collectd.nix
index 8c9361087661..2480bdb5f917 100644
--- a/nixos/tests/collectd.nix
+++ b/nixos/tests/collectd.nix
@@ -3,11 +3,14 @@ import ./make-test-python.nix ({ pkgs, ... }: {
meta = { };
nodes.machine =
- { pkgs, ... }:
+ { pkgs, lib, ... }:
{
services.collectd = {
enable = true;
+ extraConfig = lib.mkBefore ''
+ Interval 30
+ '';
plugins = {
rrdtool = ''
DataDir "/var/lib/collectd/rrd"
@@ -26,6 +29,8 @@ import ./make-test-python.nix ({ pkgs, ... }: {
machine.succeed(f"rrdinfo {file} | logger")
# check that this file contains a shortterm metric
machine.succeed(f"rrdinfo {file} | grep -F 'ds[shortterm].min = '")
+ # check that interval was set before the plugins
+ machine.succeed(f"rrdinfo {file} | grep -F 'step = 30'")
# check that there are frequent updates
machine.succeed(f"cp {file} before")
machine.wait_until_fails(f"cmp before {file}")
diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix
index ae3f9a80eb33..032ac6527bc7 100644
--- a/nixos/tests/hibernate.nix
+++ b/nixos/tests/hibernate.nix
@@ -39,7 +39,7 @@ in makeTest {
nodes = {
# System configuration used for installing the installedConfig from above.
- nodes.machine = { config, lib, pkgs, ... }: with lib; {
+ machine = { config, lib, pkgs, ... }: with lib; {
imports = [
../modules/profiles/installation-device.nix
../modules/profiles/base.nix
@@ -117,6 +117,11 @@ in makeTest {
resume = create_named_machine("resume")
resume.start()
resume.succeed("grep 'not persisted to disk' /run/test/suspended")
+
+ # Ensure we don't restore from hibernation when booting again
+ resume.crash()
+ resume.wait_for_unit("default.target")
+ resume.fail("grep 'not persisted to disk' /run/test/suspended")
'';
}
diff --git a/nixos/tests/systemd-initrd-simple.nix b/nixos/tests/systemd-initrd-simple.nix
new file mode 100644
index 000000000000..ba62cdf3bbc7
--- /dev/null
+++ b/nixos/tests/systemd-initrd-simple.nix
@@ -0,0 +1,27 @@
+import ./make-test-python.nix ({ lib, pkgs, ... }: {
+ name = "systemd-initrd-simple";
+
+ machine = { pkgs, ... }: {
+ boot.initrd.systemd = {
+ enable = true;
+ emergencyAccess = true;
+ };
+ fileSystems = lib.mkVMOverride {
+ "/".autoResize = true;
+ };
+ };
+
+ testScript = ''
+ import subprocess
+
+ oldAvail = machine.succeed("df --output=avail / | sed 1d")
+ machine.shutdown()
+
+ subprocess.check_call(["qemu-img", "resize", "vm-state-machine/machine.qcow2", "+1G"])
+
+ machine.start()
+ newAvail = machine.succeed("df --output=avail / | sed 1d")
+
+ assert int(oldAvail) < int(newAvail), "File system did not grow"
+ '';
+})
diff --git a/pkgs/applications/audio/foo-yc20/default.nix b/pkgs/applications/audio/foo-yc20/default.nix
deleted file mode 100644
index abb13b021c04..000000000000
--- a/pkgs/applications/audio/foo-yc20/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, libjack2, gtk2, lv2, faust, pkg-config }:
-
-stdenv.mkDerivation {
- version = "unstable-2015-05-21";
- pname = "foo-yc20";
- src = fetchFromGitHub {
- owner = "sampov2";
- repo = "foo-yc20";
- rev = "edd9d14c91229429b14270a181743e1046160ca8";
- sha256 = "0i8261n95n4xic766h70xkrpbvw3sag96n1883ahmg6h7yb94avq";
- };
-
- nativeBuildInputs = [ pkg-config ];
- buildInputs = [ libjack2 gtk2 lv2 faust ];
-
- makeFlags = [ "PREFIX=$(out)" ];
-
- # remove lv2 until https://github.com/sampov2/foo-yc20/issues/6 is resolved
- postInstallFixup = "rm -rf $out/lib/lv2";
-
- meta = with lib; {
- broken = true; # see: https://github.com/sampov2/foo-yc20/issues/7
- description = "A Faust implementation of a 1969 designed Yamaha combo organ, the YC-20";
- homepage = "https://github.com/sampov2/foo-yc20";
- license = with licenses; [ bsd3 lgpl21 mpl11 ];
- maintainers = [ maintainers.magnetophon ];
- platforms = platforms.linux;
- };
-}
diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix
index 8199504839a0..24d1f2cd0f46 100644
--- a/pkgs/applications/blockchains/polkadot/default.nix
+++ b/pkgs/applications/blockchains/polkadot/default.nix
@@ -4,6 +4,7 @@
, llvmPackages
, protobuf
, rustPlatform
+, stdenv
, writeShellScriptBin
, Security
}:
@@ -33,7 +34,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-Gc5WbayQUlsl7Fk8NyLPh2Zg2yrLl3WJqKorNZMLi94=";
- buildInputs = [ Security ];
+ buildInputs = lib.optional stdenv.isDarwin [ Security ];
nativeBuildInputs = [ clang ];
diff --git a/pkgs/applications/emulators/fakenes/build.patch b/pkgs/applications/emulators/fakenes/build.patch
deleted file mode 100644
index 90799d977a14..000000000000
--- a/pkgs/applications/emulators/fakenes/build.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/build/openal.cbd b/build/openal.cbd
-index d18e62d..74af061 100644
---- a/build/openal.cbd
-+++ b/build/openal.cbd
-@@ -23,7 +23,7 @@ CFLAGS += ' -DUSE_OPENAL'
- # --
-
- do ifplat unix
-- LDFLAGS += ' `openal-config --libs`'
-+ LDFLAGS += ' -lopenal'
- else
- LDFLAGS += ' -lOpenAL32'
- done
-diff --git a/build/alleggl.cbd b/build/alleggl.cbd
-index e2708ff..e826371 100644
---- a/build/alleggl.cbd
-+++ b/build/alleggl.cbd
-@@ -22,7 +22,7 @@ CFLAGS += ' -DUSE_ALLEGROGL'
-
- # --
-
--LIBAGL = agl
-+LIBAGL = alleggl
-
- ifopt debug LIBAGL = 'agld'
-
-diff --git a/src/apu.cpp b/src/apu.cpp
-index af59f1c..893a798 100644
---- a/src/apu.cpp
-+++ b/src/apu.cpp
-@@ -1930,7 +1930,7 @@ static void amplify(real& sample)
- gain -= releaseRate;
- }
-
-- real output = (1.0 / max(gain, EPSILON));
-+ real output = (1.0 / MAX(gain, EPSILON));
- output = fixf(output, apu_agc_gain_floor, apu_agc_gain_ceiling);
- sample *= output;
- }
-diff --git a/src/audio.cpp b/src/audio.cpp
-index b9650dc..c21c05e 100644
---- a/src/audio.cpp
-+++ b/src/audio.cpp
-@@ -7,6 +7,7 @@
- You must read and accept the license prior to use. */
-
- #include
-+#include
- #include
- #include
- #include
-@@ -234,7 +235,7 @@ void audio_update(void)
- const unsigned queuedFrames = (audioQueue.size() / audio_channels);
- if(queuedFrames > 0) {
- // Determine how many frames we want to make room for.
-- const unsigned framesToAdd = min(queuedFrames, audio_buffer_size_frames);
-+ const unsigned framesToAdd = MIN(queuedFrames, audio_buffer_size_frames);
- // Make room for the frames in the buffer.
- const unsigned framesToMove = (audioBufferedFrames - framesToAdd);
- if(framesToMove > 0) {
-@@ -258,7 +259,7 @@ void audio_update(void)
- // Determine how many frames are available in the buffer.
- const unsigned bufferableFrames = (audio_buffer_size_frames - audioBufferedFrames);
- // Determine the number of frames to copy to the buffer.
-- const unsigned framesToCopy = min(queuedFrames, bufferableFrames);
-+ const unsigned framesToCopy = MIN(queuedFrames, bufferableFrames);
-
- // Copy frames to the buffer.
- for(unsigned frame = 0; frame < framesToCopy; frame++) {
-diff --git a/src/include/common.h b/src/include/common.h
-index be28795..e2d21d1 100644
---- a/src/include/common.h
-+++ b/src/include/common.h
-@@ -41,8 +41,10 @@ extern "C" {
- #define true TRUE
- #define false FALSE
-
-+/*
- #define min(x,y) MIN((x),(y))
- #define max(x,y) MAX((x),(y))
-+*/
-
- #define true_or_false(x) ((x) ? true : false)
-
diff --git a/pkgs/applications/emulators/fakenes/default.nix b/pkgs/applications/emulators/fakenes/default.nix
deleted file mode 100644
index 6bc4b1480ffc..000000000000
--- a/pkgs/applications/emulators/fakenes/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{lib, stdenv, fetchurl, allegro, openal, libGLU, libGL, zlib, hawknl, freeglut, libX11,
- libXxf86vm, libXcursor, libXpm }:
-
-stdenv.mkDerivation rec {
- pname = "fakenes";
- version = "0.5.9-beta3";
-
- src = fetchurl {
- url = "mirror://sourceforge/fakenes/fakenes-${version}.tar.gz";
- sha256 = "026h67s4pzc1vma59pmzk02iy379255qbai2q74wln9bxqcpniy4";
- };
-
- buildInputs = [ allegro openal libGLU libGL zlib hawknl freeglut libX11
- libXxf86vm libXcursor libXpm ];
-
- hardeningDisable = [ "format" ];
-
- installPhase = ''
- mkdir -p $out/bin
- cp fakenes $out/bin
- '';
-
- NIX_LDFLAGS = "-lX11 -lXxf86vm -lXcursor -lXpm";
-
- patches = [ ./build.patch ];
-
- meta = {
- homepage = "http://fakenes.sourceforge.net/";
- license = lib.licenses.gpl2Plus;
- description = "Portable Open Source NES Emulator";
- platforms = lib.platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/applications/emulators/qmc2/default.nix b/pkgs/applications/emulators/qmc2/default.nix
deleted file mode 100644
index 6c6a52fc65ca..000000000000
--- a/pkgs/applications/emulators/qmc2/default.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ lib, stdenv
-, fetchurl, qttools, pkg-config
-, minizip, zlib
-, qtbase, qtsvg, qtmultimedia, qtwebkit, qttranslations, qtxmlpatterns
-, rsync, SDL2, xwininfo
-, util-linux
-, xorg
-}:
-
-stdenv.mkDerivation rec {
- pname = "qmc2";
- version = "0.195";
-
- src = fetchurl {
- url = "mirror://sourceforge/project/qmc2/qmc2/${version}/${pname}-${version}.tar.gz";
- sha256 = "1dzmjlfk8pdspns6zg1jmd5fqzg8igd4q38cz4a1vf39lx74svns";
- };
-
- preBuild = ''
- patchShebangs scripts
- '';
-
- nativeBuildInputs = [ qttools pkg-config ];
- buildInputs = [ minizip qtbase qtsvg qtmultimedia qtwebkit
- qttranslations qtxmlpatterns rsync SDL2
- xwininfo zlib util-linux xorg.libxcb ];
-
- makeFlags = [ "DESTDIR=$(out)"
- "PREFIX=/"
- "DATADIR=/share/"
- "SYSCONFDIR=/etc" ];
-
- meta = with lib; {
- description = "A Qt frontend for MAME/MESS";
- homepage = "https://qmc2.batcom-it.net";
- license = licenses.gpl2;
- maintainers = [ ];
- platforms = platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/applications/graphics/photivo/default.nix b/pkgs/applications/graphics/photivo/default.nix
deleted file mode 100644
index 338f716e9bbd..000000000000
--- a/pkgs/applications/graphics/photivo/default.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ lib
-, stdenv
-, fetchhg
-, fetchpatch
-, cmake
-, qt4
-, fftw
-, graphicsmagick_q16
-, lcms2
-, lensfun
-, pkg-config
-, libjpeg
-, exiv2
-, liblqr1
-}:
-
-stdenv.mkDerivation {
- pname = "photivo";
- version = "2014-01-25";
-
- src = fetchhg {
- url = "http://code.google.com/p/photivo/";
- rev = "d687864489da";
- sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h";
- };
-
- patches = [
- # Patch fixing build with lensfun >= 0.3, taken from
- # https://www.linuxquestions.org/questions/slackware-14/photivo-4175530230/#post5296578
- (fetchpatch {
- url = "https://www.linuxquestions.org/questions/attachment.php?attachmentid=17287&d=1420577220";
- name = "lensfun-0.3.patch";
- sha256 = "0ys45x4r4bjjlx0zpd5d56rgjz7k8gxili4r4k8zx3zfka4a3zwv";
- })
- ./gcc6.patch
- ];
-
- postPatch = '' # kinda icky
- sed -e '/("@INSTALL@")/d' \
- -e s,@INSTALL@,$out/share/photivo, \
- -i Sources/ptSettings.cpp
- sed '1i#include ' -i Sources/filters/ptFilter_StdCurve.cpp
- '';
-
- nativeBuildInputs = [ cmake pkg-config ];
-
- buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ];
-
- meta = with lib; {
- platforms = platforms.linux;
- license = licenses.gpl3;
- broken = true; # exiv2 0.27.1 FTBFS
- };
-}
diff --git a/pkgs/applications/graphics/photivo/gcc6.patch b/pkgs/applications/graphics/photivo/gcc6.patch
deleted file mode 100644
index e2eb795fc8e2..000000000000
--- a/pkgs/applications/graphics/photivo/gcc6.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git c/Sources/ptImage.cpp i/Sources/ptImage.cpp
-index 9c95093..623c157 100755
---- c/Sources/ptImage.cpp
-+++ i/Sources/ptImage.cpp
-@@ -5291,7 +5291,7 @@ ptImage* ptImage::Box(const uint16_t MaxRadius, float* Mask) {
- NewRow = NewRow < 0? -NewRow : NewRow > Height1? Height1_2-NewRow : NewRow ;
- NewRow *= m_Width;
- for(j = -IntRadius; j <= IntRadius; j++) {
-- if (Dist[abs(i)][abs(j)] < Radius) {
-+ if (Dist[int16_t(abs(i))][int16_t(abs(j))] < Radius) {
- NewCol = Col+j;
- NewCol = NewCol < 0? -NewCol : NewCol > Width1? Width1_2-NewCol : NewCol ;
-
diff --git a/pkgs/applications/misc/lutris/default.nix b/pkgs/applications/misc/lutris/default.nix
index fed9d245c190..0446c694fe0d 100644
--- a/pkgs/applications/misc/lutris/default.nix
+++ b/pkgs/applications/misc/lutris/default.nix
@@ -4,6 +4,7 @@
# build inputs
, atk
+, file
, gdk-pixbuf
, glib-networking
, gnome-desktop
@@ -17,7 +18,7 @@
# check inputs
, xvfb-run
-, nose
+, nose2
, flake8
# python dependencies
@@ -83,13 +84,13 @@ let
in
buildPythonApplication rec {
pname = "lutris-original";
- version = "0.5.9.1";
+ version = "0.5.10";
src = fetchFromGitHub {
owner = "lutris";
repo = "lutris";
rev = "v${version}";
- sha256 = "sha256-ykPJneCKbFKv0x/EDo9PkRb1LkMeFeYzTDmvE3ShNe0=";
+ sha256 = "sha256-PrnULCdQXNZ9OTa00NVyqiTdKRRkAYBcDj7lMwEqkw4=";
};
nativeBuildInputs = [ wrapGAppsHook ];
@@ -103,6 +104,7 @@ buildPythonApplication rec {
libnotify
pango
webkitgtk
+ python_magic
] ++ gstDeps;
propagatedBuildInputs = [
@@ -118,7 +120,13 @@ buildPythonApplication rec {
python_magic
];
- checkInputs = [ xvfb-run nose flake8 ] ++ requiredTools;
+ postPatch = ''
+ substituteInPlace lutris/util/magic.py \
+ --replace "'libmagic.so.1'" "'${lib.getLib file}/lib/libmagic.so.1'"
+ '';
+
+
+ checkInputs = [ xvfb-run nose2 flake8 ] ++ requiredTools;
preCheck = "export HOME=$PWD";
checkPhase = ''
runHook preCheck
@@ -126,12 +134,6 @@ buildPythonApplication rec {
runHook postCheck
'';
- # unhardcodes xrandr and fixes nosetests
- # upstream in progress: https://github.com/lutris/lutris/pull/3754
- patches = [
- ./fixes.patch
- ];
-
# avoid double wrapping
dontWrapGApps = true;
makeWrapperArgs = [
diff --git a/pkgs/applications/misc/lutris/fixes.patch b/pkgs/applications/misc/lutris/fixes.patch
deleted file mode 100644
index 42482453f6a4..000000000000
--- a/pkgs/applications/misc/lutris/fixes.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 821a9500..75affa77 100644
---- a/Makefile
-+++ b/Makefile
-@@ -25,12 +25,12 @@ release: build-source upload upload-ppa
-
- test:
- rm tests/fixtures/pga.db -f
-- nosetests3
-+ nosetests
-
- cover:
- rm tests/fixtures/pga.db -f
- rm tests/coverage/ -rf
-- nosetests3 --with-coverage --cover-package=lutris --cover-html --cover-html-dir=tests/coverage
-+ nosetests --with-coverage --cover-package=lutris --cover-html --cover-html-dir=tests/coverage
-
- pgp-renew:
- osc signkey --extend home:strycore
-diff --git a/lutris/util/graphics/xrandr.py b/lutris/util/graphics/xrandr.py
-index f788c94c..5544dbe9 100644
---- a/lutris/util/graphics/xrandr.py
-+++ b/lutris/util/graphics/xrandr.py
-@@ -5,6 +5,7 @@ from collections import namedtuple
-
- from lutris.util.log import logger
- from lutris.util.system import read_process_output
-+from lutris.util.linux import LINUX_SYSTEM
-
- Output = namedtuple("Output", ("name", "mode", "position", "rotation", "primary", "rate"))
-
-@@ -12,7 +13,7 @@ Output = namedtuple("Output", ("name", "mode", "position", "rotation", "primary"
- def _get_vidmodes():
- """Return video modes from XrandR"""
- logger.debug("Retrieving video modes from XrandR")
-- return read_process_output(["xrandr"]).split("\n")
-+ return read_process_output([LINUX_SYSTEM.get("xrandr")]).split("\n")
-
-
- def get_outputs(): # pylint: disable=too-many-locals
-@@ -76,7 +77,7 @@ def turn_off_except(display):
- for output in get_outputs():
- if output.name != display:
- logger.info("Turning off %s", output[0])
-- subprocess.Popen(["xrandr", "--output", output.name, "--off"])
-+ subprocess.Popen([LINUX_SYSTEM.get("xrandr"), "--output", output.name, "--off"])
-
-
- def get_resolutions():
-@@ -111,7 +112,7 @@ def change_resolution(resolution):
- logger.warning("Resolution %s doesn't exist.", resolution)
- else:
- logger.info("Changing resolution to %s", resolution)
-- subprocess.Popen(["xrandr", "-s", resolution])
-+ subprocess.Popen([LINUX_SYSTEM.get("xrandr"), "-s", resolution])
- else:
- for display in resolution:
- logger.debug("Switching to %s on %s", display.mode, display.name)
-@@ -128,7 +129,7 @@ def change_resolution(resolution):
- logger.info("Switching resolution of %s to %s", display.name, display.mode)
- subprocess.Popen(
- [
-- "xrandr",
-+ LINUX_SYSTEM.get("xrandr"),
- "--output",
- display.name,
- "--mode",
diff --git a/pkgs/applications/networking/cluster/arkade/default.nix b/pkgs/applications/networking/cluster/arkade/default.nix
index e66343270cac..297e12a80a20 100644
--- a/pkgs/applications/networking/cluster/arkade/default.nix
+++ b/pkgs/applications/networking/cluster/arkade/default.nix
@@ -6,18 +6,18 @@
buildGoModule rec {
pname = "arkade";
- version = "0.8.16";
+ version = "0.8.18";
src = fetchFromGitHub {
owner = "alexellis";
repo = "arkade";
rev = version;
- sha256 = "sha256-NiUv7yl1nA7a826FHDF+1MhYscXkQjUpxZo2ZWrL+VQ=";
+ sha256 = "sha256-VQI2eAxOkOkwYkTM/UyyK6lnXFoLFHWE/ekm5qLN9OE=";
};
CGO_ENABLED = 0;
- vendorSha256 = "sha256-ipLVzBkliQSPBZTL5FU8xosTVjxFsUVlAvO0a0q+j2o=";
+ vendorSha256 = "sha256-An52QMjHaHRIicxCBpjgi+S2QeKXhB9rndjV+FIkS3c=";
# Exclude pkg/get: tests downloading of binaries which fail when sandbox=true
subPackages = [
@@ -42,6 +42,6 @@ buildGoModule rec {
homepage = "https://github.com/alexellis/arkade";
description = "Open Source Kubernetes Marketplace";
license = licenses.mit;
- maintainers = with maintainers; [ welteki ];
+ maintainers = with maintainers; [ welteki techknowlogick ];
};
}
diff --git a/pkgs/applications/networking/mailreaders/notbit/default.nix b/pkgs/applications/networking/mailreaders/notbit/default.nix
deleted file mode 100644
index 5c979bde6040..000000000000
--- a/pkgs/applications/networking/mailreaders/notbit/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config,
- gettext, openssl
-}:
-
-with lib;
-
-stdenv.mkDerivation {
- pname = "notbit";
- version = "2018-01-09";
-
- src = fetchFromGitHub {
- owner = "bpeel";
- repo = "notbit";
- rev = "8b5d3d2da8ce54abae2536b4d97641d2c798cff3";
- sha256 = "1623n0lvx42mamvb2vwin5i38hh0nxpxzmkr5188ss2x7m20lmii";
- };
-
- nativeBuildInputs = [ autoreconfHook pkg-config ];
-
- buildInputs = [ openssl gettext ];
-
- meta = {
- description = "A minimal Bitmessage client";
- homepage = "https://github.com/bpeel/notbit";
- license = licenses.mit;
- platforms = platforms.unix;
- maintainers = with maintainers; [ mog ];
- broken = true;
- };
-}
diff --git a/pkgs/applications/science/astronomy/openspace/assets.patch b/pkgs/applications/science/astronomy/openspace/assets.patch
deleted file mode 100644
index 38c17ad4593a..000000000000
--- a/pkgs/applications/science/astronomy/openspace/assets.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-diff --git a/data/assets/scene/solarsystem/planets/jupiter/jup310.asset b/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
-index c15f6d9..1f8ddaf 100755
---- a/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
-+++ b/data/assets/scene/solarsystem/planets/jupiter/jup310.asset
-@@ -1,8 +1,8 @@
--local Kernels = asset.syncedResource({
-- Name = "Jupiter Spice Kernels (jup310)",
-- Type = "TorrentSynchronization",
-- Identifier = "jup310",
-- Magnet = "magnet:?xt=urn:btih:E8B7D7E136DE1C6249158B254BFC8B9ECE2A0539&dn=jup310.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
--})
-+-- local Kernels = asset.syncedResource({
-+-- Name = "Jupiter Spice Kernels (jup310)",
-+-- Type = "TorrentSynchronization",
-+-- Identifier = "jup310",
-+-- Magnet = "magnet:?xt=urn:btih:E8B7D7E136DE1C6249158B254BFC8B9ECE2A0539&dn=jup310.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
-+-- })
-
--asset.export("Kernels", Kernels .. '/jup310.bsp')
-+-- asset.export("Kernels", Kernels .. '/jup310.bsp')
-diff --git a/data/assets/scene/solarsystem/planets/mars/mar097.asset b/data/assets/scene/solarsystem/planets/mars/mar097.asset
-index e77d67d..8d738a6 100755
---- a/data/assets/scene/solarsystem/planets/mars/mar097.asset
-+++ b/data/assets/scene/solarsystem/planets/mars/mar097.asset
-@@ -1,8 +1,8 @@
--local Kernels = asset.syncedResource({
-- Name = "Mars Spice Kernels",
-- Type = "TorrentSynchronization",
-- Identifier = "mat097",
-- Magnet = "magnet:?xt=urn:btih:308F326B9AF864294D73042FBBED33B17291E27E&dn=mar097.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
--})
-+-- local Kernels = asset.syncedResource({
-+-- Name = "Mars Spice Kernels",
-+-- Type = "TorrentSynchronization",
-+-- Identifier = "mat097",
-+-- Magnet = "magnet:?xt=urn:btih:308F326B9AF864294D73042FBBED33B17291E27E&dn=mar097.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
-+-- })
-
--asset.export("Kernels", Kernels .. '/mar097.bsp')
-+-- asset.export("Kernels", Kernels .. '/mar097.bsp')
-diff --git a/data/assets/scene/solarsystem/planets/neptune/nep081.asset b/data/assets/scene/solarsystem/planets/neptune/nep081.asset
-index e9c49ce..cfb5fac 100755
---- a/data/assets/scene/solarsystem/planets/neptune/nep081.asset
-+++ b/data/assets/scene/solarsystem/planets/neptune/nep081.asset
-@@ -1,8 +1,8 @@
--local Kernels = asset.syncedResource({
-- Name = "Neptune Spice Kernels (nep081)",
-- Type = "TorrentSynchronization",
-- Identifier = "nep081",
-- Magnet = "magnet:?xt=urn:btih:A6079CF8D4BF3B6BB38F4F9F633CB7724FF91693&dn=nep081.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
--})
-+-- local Kernels = asset.syncedResource({
-+-- Name = "Neptune Spice Kernels (nep081)",
-+-- Type = "TorrentSynchronization",
-+-- Identifier = "nep081",
-+-- Magnet = "magnet:?xt=urn:btih:A6079CF8D4BF3B6BB38F4F9F633CB7724FF91693&dn=nep081.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
-+-- })
-
--asset.export("Kernels", Kernels .. '/nep081.bsp')
-+-- asset.export("Kernels", Kernels .. '/nep081.bsp')
-diff --git a/data/assets/scene/solarsystem/planets/saturn/sat375.asset b/data/assets/scene/solarsystem/planets/saturn/sat375.asset
-index a55f2ed..f904b3c 100755
---- a/data/assets/scene/solarsystem/planets/saturn/sat375.asset
-+++ b/data/assets/scene/solarsystem/planets/saturn/sat375.asset
-@@ -1,8 +1,8 @@
--local Kernels = asset.syncedResource({
-- Name = "Saturn Spice Kernels (sat375)",
-- Type = "TorrentSynchronization",
-- Identifier = "sat375",
-- Magnet = "magnet:?xt=urn:btih:79083d2069df389e65d7688bb326c7aaf1953845&dn=sat375.bsp"
--})
-+-- local Kernels = asset.syncedResource({
-+-- Name = "Saturn Spice Kernels (sat375)",
-+-- Type = "TorrentSynchronization",
-+-- Identifier = "sat375",
-+-- Magnet = "magnet:?xt=urn:btih:79083d2069df389e65d7688bb326c7aaf1953845&dn=sat375.bsp"
-+-- })
-
--asset.export("Kernels", Kernels .. '/sat375.bsp')
-+-- asset.export("Kernels", Kernels .. '/sat375.bsp')
-diff --git a/data/assets/scene/solarsystem/planets/uranus/ura111.asset b/data/assets/scene/solarsystem/planets/uranus/ura111.asset
-index 665d059..8f95f34 100755
---- a/data/assets/scene/solarsystem/planets/uranus/ura111.asset
-+++ b/data/assets/scene/solarsystem/planets/uranus/ura111.asset
-@@ -1,8 +1,8 @@
--local Kernels = asset.syncedResource({
-- Name = "Uranus Spice Kernels (ura111)",
-- Type = "TorrentSynchronization",
-- Identifier = "ura111",
-- Magnet = "magnet:?xt=urn:btih:26C4903D1A12AE439480F31B45BAEB5781D2B305&dn=ura111.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
--})
-+-- local Kernels = asset.syncedResource({
-+-- Name = "Uranus Spice Kernels (ura111)",
-+-- Type = "TorrentSynchronization",
-+-- Identifier = "ura111",
-+-- Magnet = "magnet:?xt=urn:btih:26C4903D1A12AE439480F31B45BAEB5781D2B305&dn=ura111.bsp&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.ccc.de%3a80%2fannounce"
-+-- })
-
--asset.export("Kernels", Kernels .. '/ura111.bsp')
-+-- asset.export("Kernels", Kernels .. '/ura111.bsp')
diff --git a/pkgs/applications/science/astronomy/openspace/config.patch b/pkgs/applications/science/astronomy/openspace/config.patch
deleted file mode 100644
index 826edea09071..000000000000
--- a/pkgs/applications/science/astronomy/openspace/config.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/openspace.cfg b/openspace.cfg
-index c86830b..e7f89d9 100755
---- a/openspace.cfg
-+++ b/openspace.cfg
-@@ -2,18 +2,21 @@
- -- require('scripts/configuration_helper.lua')
- -- which defines helper functions useful to customize the configuration
-
-+userdir = os.getenv("HOME") .. "/.openspace/"
-+os.execute("mkdir -p " .. userdir)
-+
- return {
- -- Determines which SGCT configuration file is loaded, that is, if there rendering
- -- occurs in a single window, a fisheye projection, or a dome cluster system
-
- -- A regular 1280x720 window
-- SGCTConfig = sgct.config.single{},
-+ -- SGCTConfig = sgct.config.single{},
-
- -- A regular 1920x1080 window
- -- SGCTConfig = sgct.config.single{1920, 1080},
-
- -- A windowed 1920x1080 fullscreen
-- -- SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}, shared=true, name="WV_OBS_SPOUT1"},
-+ SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}, shared=true, name="WV_OBS_SPOUT1"},
-
- -- A 1k fisheye rendering
- -- SGCTConfig = sgct.config.fisheye{1024, 1024},
-@@ -53,15 +56,15 @@ return {
- TASKS = "${DATA}/tasks",
- WEB = "${DATA}/web",
-
-- CACHE = "${BASE}/cache",
-+ CACHE = userdir .. "cache",
- CONFIG = "${BASE}/config",
-- DOCUMENTATION = "${BASE}/documentation",
-- LOGS = "${BASE}/logs",
-+ DOCUMENTATION = userdir .. "documentation",
-+ LOGS = userdir .. "logs",
- MODULES = "${BASE}/modules",
- SCRIPTS = "${BASE}/scripts",
- SHADERS = "${BASE}/shaders",
-- SYNC = "${BASE}/sync",
-- TESTDIR = "${BASE}/tests"
-+ SYNC = userdir .. "sync",
-+ TESTDIR = userdir .. "tests"
- },
- Fonts = {
- Mono = "${FONTS}/Bitstream-Vera-Sans-Mono/VeraMono.ttf",
diff --git a/pkgs/applications/science/astronomy/openspace/constexpr.patch b/pkgs/applications/science/astronomy/openspace/constexpr.patch
deleted file mode 100644
index d9fc91d7c277..000000000000
--- a/pkgs/applications/science/astronomy/openspace/constexpr.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff --git a/include/openspace/util/distanceconversion.h b/include/openspace/util/distanceconversion.h
-index 80a3a96..7059752 100755
---- a/include/openspace/util/distanceconversion.h
-+++ b/include/openspace/util/distanceconversion.h
-@@ -159,24 +159,34 @@ constexpr const char* nameForDistanceUnit(DistanceUnit unit, bool pluralForm = f
- }
-
- constexpr DistanceUnit distanceUnitFromString(const char* unitName) {
-+ int result = -1;
-+
- int i = 0;
- for (const char* val : DistanceUnitNamesSingular) {
- if (ghoul::equal(unitName, val)) {
-- return static_cast(i);
-+ result = i;
-+ break;
- }
- ++i;
- }
-
-- i = 0;
-- for (const char* val : DistanceUnitNamesPlural) {
-- if (ghoul::equal(unitName, val)) {
-- return static_cast(i);
-+ if (result == -1) {
-+ i = 0;
-+ for (const char* val : DistanceUnitNamesPlural) {
-+ if (ghoul::equal(unitName, val)) {
-+ result = i;
-+ break;
-+ }
-+ ++i;
- }
-- ++i;
- }
-
-- ghoul_assert(false, "Unit name is not a valid name");
-- throw ghoul::MissingCaseException();
-+ if (result != -1)
-+ return static_cast(result);
-+ else {
-+ ghoul_assert(false, "Unit name is not a valid name");
-+ throw ghoul::MissingCaseException();
-+ }
- }
-
-
-diff --git a/include/openspace/util/timeconversion.h b/include/openspace/util/timeconversion.h
-index a36c92a..699bca9 100755
---- a/include/openspace/util/timeconversion.h
-+++ b/include/openspace/util/timeconversion.h
-@@ -142,23 +142,32 @@ constexpr const char* nameForTimeUnit(TimeUnit unit, bool pluralForm = false) {
- }
-
- constexpr TimeUnit timeUnitFromString(const char* unitName) {
-+ int result = -1;
-+
- int i = 0;
- for (const char* val : TimeUnitNamesSingular) {
- if (ghoul::equal(unitName, val)) {
-- return static_cast(i);
-+ result = i;
-+ break;
- }
- ++i;
- }
-
-- i = 0;
-- for (const char* val : TimeUnitNamesPlural) {
-- if (ghoul::equal(unitName, val)) {
-- return static_cast(i);
-+ if (result == -1) {
-+ i = 0;
-+ for (const char* val : TimeUnitNamesPlural) {
-+ if (ghoul::equal(unitName, val)) {
-+ result = i;
-+ break;
-+ }
-+ ++i;
- }
-- ++i;
- }
-
-- throw ghoul::MissingCaseException();
-+ if (result != -1)
-+ return static_cast(result);
-+ else
-+ throw ghoul::MissingCaseException();
- }
-
- std::pair simplifyTime(double seconds,
diff --git a/pkgs/applications/science/astronomy/openspace/default.nix b/pkgs/applications/science/astronomy/openspace/default.nix
deleted file mode 100644
index 17c721ac8693..000000000000
--- a/pkgs/applications/science/astronomy/openspace/default.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, cmake
-, curl, boost, gdal, glew, soil
-, libX11, libXi, libXxf86vm, libXcursor, libXrandr, libXinerama }:
-
-stdenv.mkDerivation rec {
- version = "0.11.1";
- pname = "openspace";
-
- src = fetchFromGitHub {
- owner = "OpenSpace";
- repo = "OpenSpace";
- rev = "a65eea61a1b8807ce3d69e9925e75f8e3dfb085d";
- sha256 = "0msqixf30r0d41xmfmzkdfw6w9jkx2ph5clq8xiwrg1jc3z9q7nv";
- fetchSubmodules = true;
- };
-
- nativeBuildInputs = [ cmake makeWrapper ];
- buildInputs = [
- curl boost gdal glew soil
- libX11 libXi libXxf86vm libXcursor libXrandr libXinerama
- ];
-
- glmPlatformH = fetchurl {
- url = "https://raw.githubusercontent.com/g-truc/glm/dd48b56e44d699a022c69155c8672caacafd9e8a/glm/simd/platform.h";
- sha256 = "0y91hlbgn5va7ijg5mz823gqkq9hqxl00lwmdwnf8q2g086rplzw";
- };
-
- # See
- prePatch = ''
- cp ${glmPlatformH} ext/sgct/include/glm/simd/platform.h
- cp ${glmPlatformH} ext/ghoul/ext/glm/glm/simd/platform.h
- '';
-
- patches = [
- # See
- ./vrpn.patch
-
- ./constexpr.patch
- ./config.patch
-
- # WARNING: This patch disables some slow torrents in a very dirty way.
- ./assets.patch
- ];
-
- bundle = "$out/usr/share/openspace";
-
- preConfigure = ''
- cmakeFlagsArray=(
- $cmakeFlagsArray
- "-DCMAKE_BUILD_TYPE="
- "-DCMAKE_INSTALL_PREFIX=${bundle}"
- )
- '';
-
- preInstall = ''
- mkdir -p $out/bin
- mkdir -p ${bundle}
- '';
-
- postInstall = ''
- cp ext/spice/libSpice.so ${bundle}/lib
- cp ext/ghoul/ext/lua/libLua.so ${bundle}/lib
- '';
-
- postFixup = ''
- for bin in ${bundle}/bin/*
- do
- rpath=$(patchelf --print-rpath $bin)
- patchelf --set-rpath $rpath:${bundle}/lib $bin
-
- name=$(basename $bin)
- makeWrapper $bin $out/bin/$name --run "cd ${bundle}"
- done
- '';
-
- meta = {
- description = "Open-source astrovisualization project";
- longDescription = ''
- OpenSpace is open source interactive data visualization software
- designed to visualize the entire known universe and portray our
- ongoing efforts to investigate the cosmos.
-
- WARNING: This build is not very usable for now.
- '';
- homepage = "https://www.openspaceproject.com/";
- license = lib.licenses.mit;
- platforms = lib.platforms.linux;
- broken = true; # fails to build
- };
-}
diff --git a/pkgs/applications/science/astronomy/openspace/vrpn.patch b/pkgs/applications/science/astronomy/openspace/vrpn.patch
deleted file mode 100644
index 9386d0257b7f..000000000000
--- a/pkgs/applications/science/astronomy/openspace/vrpn.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/ext/sgct/src/deps/vrpn/vrpn_Connection.C b/ext/sgct/src/deps/vrpn/vrpn_Connection.C
-index d6ffdc5..f90a2b2 100755
---- a/ext/sgct/src/deps/vrpn/vrpn_Connection.C
-+++ b/ext/sgct/src/deps/vrpn/vrpn_Connection.C
-@@ -2489,7 +2489,7 @@ static int vrpn_start_server(const char *machine, char *server_name, char *args,
- #if defined(sparc) || defined(FreeBSD) || defined(_AIX) || defined(__ANDROID__)
- int status; // doesn't exist on sparc_solaris or FreeBSD
- #else
-- union wait status;
-+ int status;
- #endif
-
- /* Check to see if they called back yet. */
diff --git a/pkgs/applications/science/biology/ncbi-tools/default.nix b/pkgs/applications/science/biology/ncbi-tools/default.nix
deleted file mode 100644
index dff041971ea7..000000000000
--- a/pkgs/applications/science/biology/ncbi-tools/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{stdenv, fetchurl, cpio}:
-
-# The NCBI package only builds on 32bits - on 64bits it breaks because
-# of position dependent code. Debian packagers have written replacement
-# make files(!). Either we use these, or negotiate a version which can
-# be pushed upstream to NCBI.
-#
-# Another note: you may want the older and deprecated C-libs at ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools++/2008/Mar_17_2008/NCBI_C_Toolkit/ncbi_c--Mar_17_2008.tar.gz
-
-stdenv.mkDerivation rec {
- pname = "ncbi_tools";
- version = "Dec_31_2008";
- src = fetchurl {
- url = "ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools++/2008/${version}/ncbi_cxx--${version}.tar.gz";
- sha256 = "1b2v0dcdqn3bysgdkj57sxmd6s0hc9wpnxssviz399g6plhxggbr";
- };
-
- configureFlags = [
- "--without-debug"
- "--with-bin-release"
- "--with-dll"
- "--without-static"
- ];
- buildInputs = [ cpio ];
-
- meta = {
- description = "NCBI Bioinformatics toolbox (incl. BLAST)";
- longDescription = "The NCBI Bioinformatics toolsbox, including command-line utilties, libraries and include files. No X11 support";
- homepage = "http://www.ncbi.nlm.nih.gov/IEB/ToolBox/";
- license = "GPL";
- priority = 5; # zlib.so gives a conflict with zlib
- broken = true;
- };
-}
diff --git a/pkgs/applications/science/logic/jonprl/default.nix b/pkgs/applications/science/logic/jonprl/default.nix
deleted file mode 100644
index 379a9a483540..000000000000
--- a/pkgs/applications/science/logic/jonprl/default.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ fetchgit, lib, stdenv, smlnj, which }:
-
-stdenv.mkDerivation rec {
- pname = "jonprl";
- version = "0.1.0";
-
- src = fetchgit {
- url = "https://github.com/jonsterling/JonPRL.git";
- deepClone = true;
- rev = "refs/tags/v${version}";
- sha256 = "0czs13syvnw8fz24d075n4pmsyfs8rs8c7ksmvd7cgb3h55fvp4p";
- };
-
- buildInputs = [ smlnj which ];
-
- installPhase = ''
- mkdir -p "$out/bin"
- cp bin/.heapimg.* "$out/bin/"
- build/mkexec.sh "${smlnj}/bin/sml" "$out" jonprl
- '';
-
- meta = {
- description = "Proof Refinement Logic - Computational Type Theory";
- longDescription = ''
- An proof refinement logic for computational type theory
- based on Brouwer-realizability & meaning explanations.
- Inspired by Nuprl
- '';
- homepage = "https://github.com/jonsterling/JonPRL";
- license = lib.licenses.mit;
- maintainers = with lib.maintainers; [ puffnfresh ];
- platforms = lib.platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/applications/science/logic/lean2/default.nix b/pkgs/applications/science/logic/lean2/default.nix
deleted file mode 100644
index 24d11c3a5319..000000000000
--- a/pkgs/applications/science/logic/lean2/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, cmake, gmp, mpfr, python2
-, gperftools, ninja, makeWrapper }:
-
-stdenv.mkDerivation {
- pname = "lean2";
- version = "2017-07-22";
-
- src = fetchFromGitHub {
- owner = "leanprover";
- repo = "lean2";
- rev = "34dbd6c3ae612186b8f0f80d12fbf5ae7a059ec9";
- sha256 = "1xv3j487zhh1zf2b4v19xzw63s2sgjhg8d62a0kxxyknfmdf3khl";
- };
-
- nativeBuildInputs = [ cmake makeWrapper ninja ];
- buildInputs = [ gmp mpfr python2 gperftools ];
-
- preConfigure = ''
- patchShebangs bin/leantags
- cd src
- '';
-
- cmakeFlags = [ "-GNinja" ];
-
- postInstall = ''
- wrapProgram $out/bin/linja --prefix PATH : $out/bin:${ninja}/bin
- '';
-
- meta = with lib; {
- description = "Automatic and interactive theorem prover (version with HoTT support)";
- homepage = "http://leanprover.github.io";
- license = licenses.asl20;
- platforms = platforms.unix;
- maintainers = with maintainers; [ thoughtpolice gebner ];
- broken = true;
- };
-}
diff --git a/pkgs/applications/science/logic/otter/default.nix b/pkgs/applications/science/logic/otter/default.nix
deleted file mode 100644
index 2ad066e53f74..000000000000
--- a/pkgs/applications/science/logic/otter/default.nix
+++ /dev/null
@@ -1,53 +0,0 @@
-{lib, stdenv, fetchurl, tcsh, libXaw, libXt, libX11}:
-let
- s = # Generated upstream information
- rec {
- version = "3.3f";
- name = "otter";
- url = "https://www.cs.unm.edu/~mccune/otter/otter-${version}.tar.gz";
- sha256 = "16mc1npl7sk9cmqhrf3ghfmvx29inijw76f1b1lsykllaxjqqb1r";
- };
- buildInputs = [
- tcsh libXaw libXt libX11
- ];
-in
-stdenv.mkDerivation {
- name = "${s.name}-${s.version}";
- inherit buildInputs;
- src = fetchurl {
- inherit (s) url sha256;
- };
-
- hardeningDisable = [ "format" ];
-
- buildPhase = ''
- find . -name Makefile | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g"
- find . -name Makefile | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g"
- find . -perm -0100 -type f | xargs sed -i -e "s@/bin/csh@$(type -P csh)@g"
- find . -perm -0100 -type f | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g"
- find . -perm -0100 -type f | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g"
-
- sed -i -e "s/^XLIBS *=.*/XLIBS=-lXaw -lXt -lX11/" source/formed/Makefile
-
- make all
- make -C examples all
- make -C examples-mace2 all
- make -C source/formed realclean
- make -C source/formed formed
- '';
-
- installPhase = ''
- mkdir -p "$out"/{bin,share/otter}
- cp bin/* source/formed/formed "$out/bin/"
- cp -r examples examples-mace2 documents README* Legal Changelog Contents index.html "$out/share/otter/"
- '';
-
- meta = {
- inherit (s) version;
- description = "A reliable first-order theorem prover";
- license = lib.licenses.publicDomain ;
- maintainers = [lib.maintainers.raskin];
- platforms = lib.platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/applications/science/misc/openmvs/default.nix b/pkgs/applications/science/misc/openmvs/default.nix
deleted file mode 100644
index a92920c5e795..000000000000
--- a/pkgs/applications/science/misc/openmvs/default.nix
+++ /dev/null
@@ -1,77 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, pkg-config
-, cmake
-, eigen
-, opencv
-, ceres-solver
-, cgal
-, boost
-, vcg
-, gmp
-, mpfr
-, glog
-, gflags
-, libjpeg_turbo
-}:
-
-stdenv.mkDerivation {
- pname = "openmvs";
- version = "unstable-2018-05-26";
-
- src = fetchFromGitHub {
- owner = "cdcseacave";
- repo = "openmvs";
- rev = "939033c55b50478339084431aac2c2318041afad";
- sha256 = "12dgkwwfdp24581y3i41gsd1k9hq0aw917q0ja5s0if4qbmc8pni";
- };
-
- buildInputs = [ eigen opencv ceres-solver cgal boost vcg gmp mpfr glog gflags libjpeg_turbo ];
-
- nativeBuildInputs = [ cmake pkg-config ];
-
- preConfigure = ''
- cmakeFlagsArray=(
- $cmakeFlagsArray
- "-DCMAKE_CXX_FLAGS=-std=c++11"
- "-DBUILD_SHARED_LIBS=ON"
- "-DBUILD_STATIC_RUNTIME=ON"
- "-DINSTALL_BIN_DIR=$out/bin"
- "-DVCG_DIR=${vcg}"
- "-DCGAL_ROOT=${cgal}/lib/cmake/CGAL"
- "-DCERES_DIR=${ceres-solver}/lib/cmake/Ceres/"
- )
- '';
-
- postFixup = ''
- rp=$(patchelf --print-rpath $out/bin/DensifyPointCloud)
- patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/DensifyPointCloud
-
- rp=$(patchelf --print-rpath $out/bin/InterfaceVisualSFM)
- patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/InterfaceVisualSFM
-
- rp=$(patchelf --print-rpath $out/bin/ReconstructMesh)
- patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/ReconstructMesh
-
- rp=$(patchelf --print-rpath $out/bin/RefineMesh)
- patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/RefineMesh
-
- rp=$(patchelf --print-rpath $out/bin/TextureMesh)
- patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/TextureMesh
- '';
-
- cmakeDir = "./";
-
- dontUseCmakeBuildDir = true;
-
- meta = with lib; {
- description = "A library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community";
- homepage = "http://cdcseacave.github.io/openMVS/";
- license = licenses.agpl3;
- platforms = platforms.linux;
- maintainers = with maintainers; [ mdaiter ];
- # 20190414-174115: CMake cannot find CGAL which is passed as build input
- broken = true;
- };
-}
diff --git a/pkgs/applications/version-management/bitkeeper/default.nix b/pkgs/applications/version-management/bitkeeper/default.nix
deleted file mode 100644
index c185a4fb759b..000000000000
--- a/pkgs/applications/version-management/bitkeeper/default.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ lib, stdenv, fetchurl, perl, gperf, bison, groff
-, pkg-config, libXft, pcre
-, libtomcrypt, libtommath, lz4 }:
-
-stdenv.mkDerivation rec {
- pname = "bitkeeper";
- version = "7.3.1ce";
-
- src = fetchurl {
- url = "https://www.bitkeeper.org/downloads/${version}/bk-${version}.src.tar.gz";
- sha256 = "0l6jwvcg4s1q00vb01hdv58jgv03l8x5mhjl73cwgfiff80zx147";
- };
-
- hardeningDisable = [ "fortify" ];
-
- enableParallelBuilding = true;
-
- nativeBuildInputs = [ pkg-config ];
- buildInputs = [
- perl gperf bison groff libXft
- pcre libtomcrypt libtommath lz4
- ];
-
- postPatch = ''
- substituteInPlace port/unix_platform.sh \
- --replace /bin/rm rm
- substituteInPlace ./undo.c \
- --replace /bin/cat cat
- '';
-
- sourceRoot = "bk-${version}/src";
- buildPhase = ''
- make -j6 V=1 p
- make image
- '';
-
- installPhase = ''
- ./utils/bk-* $out/bitkeeper
- mkdir -p $out/bin
- $out/bitkeeper/bk links $out/bin
- chmod g-w $out
- '';
-
- meta = {
- description = "A distributed version control system";
- longDescription = ''
- BitKeeper is a fast, enterprise-ready, distributed SCM that
- scales up to very large projects and down to tiny ones.
- '';
- homepage = "https://www.bitkeeper.org/";
- license = lib.licenses.asl20;
- platforms = lib.platforms.linux;
- maintainers = with lib.maintainers; [ wscott thoughtpolice ];
- broken = true; # seems to fail on recent glibc versions
- };
-}
diff --git a/pkgs/applications/version-management/git-and-tools/git-dit/default.nix b/pkgs/applications/version-management/git-and-tools/git-dit/default.nix
deleted file mode 100644
index f1aeda1a5c7b..000000000000
--- a/pkgs/applications/version-management/git-and-tools/git-dit/default.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ lib, stdenv
-, fetchFromGitHub
-, openssl_1_0_2
-, zlib
-, libssh
-, cmake
-, perl
-, pkg-config
-, rustPlatform
-, curl
-, libiconv
-, CoreFoundation
-, Security
-}:
-
-with rustPlatform;
-
-buildRustPackage rec {
- pname = "git-dit";
- version = "0.4.0";
-
- src = fetchFromGitHub {
- owner = "neithernut";
- repo = "git-dit";
- rev = "v${version}";
- sha256 = "1sx6sc2dj3l61gbiqz8vfyhw5w4xjdyfzn1ixz0y8ipm579yc7a2";
- };
-
- cargoSha256 = "1vbcwl4aii0x4l8w9jhm70vi4s95jr138ly65jpkkv26rl6zjiph";
-
- nativeBuildInputs = [
- cmake
- pkg-config
- perl
- ];
-
- buildInputs = [
- openssl_1_0_2
- libssh
- zlib
- ] ++ lib.optionals (stdenv.isDarwin) [
- curl
- libiconv
- CoreFoundation
- Security
- ];
-
- meta = with lib; {
- inherit (src.meta) homepage;
- description = "Decentralized Issue Tracking for git";
- # This has not had a release in years and its cargo vendored dependencies
- # fail to compile. It also depends on an unsupported openssl:
- # https://github.com/NixOS/nixpkgs/issues/77503
- broken = true;
- license = licenses.gpl2;
- maintainers = with maintainers; [ Profpatsch matthiasbeyer ];
- };
-}
diff --git a/pkgs/applications/window-managers/clfswm/default.nix b/pkgs/applications/window-managers/clfswm/default.nix
deleted file mode 100644
index 9984e8788460..000000000000
--- a/pkgs/applications/window-managers/clfswm/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ lib, stdenv, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4
-, makeWrapper }:
-
-stdenv.mkDerivation {
- pname = "clfswm";
- version = "unstable-2016-11-12";
-
- src = fetchgit {
- url = "https://gitlab.common-lisp.net/clfswm/clfswm.git";
- rev = "3c7721dba6339ebb4f8c8d7ce2341740fa86f837";
- sha256 = "0hynzh3a1zr719cxfb0k4cvh5lskzs616hwn7p942isyvhwzhynd";
- };
-
- buildInputs = [
- texinfo4 makeWrapper autoconf
- sbcl
- lispPackages.clx
- lispPackages.cl-ppcre
- xdpyinfo
- ];
-
- patches = [ ./require-clx.patch ];
-
- # Stripping destroys the generated SBCL image
- dontStrip = true;
-
- configurePhase = ''
- substituteInPlace load.lisp --replace \
- ";; (setf *contrib-dir* \"/usr/local/lib/clfswm/\")" \
- "(setf *contrib-dir* \"$out/lib/clfswm/\")"
- '';
-
- installPhase = ''
- mkdir -pv $out/bin
- make DESTDIR=$out install
-
- # Paths in the compressed image $out/bin/clfswm are not
- # recognized by Nix. Add explicit reference here.
- mkdir $out/nix-support
- echo ${xdpyinfo} ${lispPackages.clx} ${lispPackages.cl-ppcre} > $out/nix-support/depends
- '';
-
- meta = with lib; {
- description = "A(nother) Common Lisp FullScreen Window Manager";
- homepage = "https://common-lisp.net/project/clfswm/";
- license = licenses.gpl3;
- maintainers = with maintainers; [ robgssp ];
- platforms = platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/applications/window-managers/clfswm/require-clx.patch b/pkgs/applications/window-managers/clfswm/require-clx.patch
deleted file mode 100644
index ae2234461d25..000000000000
--- a/pkgs/applications/window-managers/clfswm/require-clx.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/load.lisp b/load.lisp
-index c8c4cf0..8c9ca2e 100644
---- a/load.lisp
-+++ b/load.lisp
-@@ -111,6 +111,8 @@ from $XDG_CONFIG_HOME/clfswm/clfswmrc")
- ;;;------------------
- (load-info "Requiring CLX")
-
-+(require 'clx)
-+
- ;;; Loading clisp dynamic module. This part needs clisp >= 2.50
- ;;#+(AND CLISP (not CLX))
- ;;(when (fboundp 'require)
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix
index 5718cadd4ffa..96ea363c811e 100644
--- a/pkgs/build-support/docker/default.nix
+++ b/pkgs/build-support/docker/default.nix
@@ -6,6 +6,7 @@
, coreutils
, e2fsprogs
, fakechroot
+, fakeNss
, fakeroot
, findutils
, go
@@ -747,25 +748,7 @@ rec {
# Useful when packaging binaries that insist on using nss to look up
# username/groups (like nginx).
# /bin/sh is fine to not exist, and provided by another shim.
- fakeNss = symlinkJoin {
- name = "fake-nss";
- paths = [
- (writeTextDir "etc/passwd" ''
- root:x:0:0:root user:/var/empty:/bin/sh
- nobody:x:65534:65534:nobody:/var/empty:/bin/sh
- '')
- (writeTextDir "etc/group" ''
- root:x:0:
- nobody:x:65534:
- '')
- (writeTextDir "etc/nsswitch.conf" ''
- hosts: files dns
- '')
- (runCommand "var-empty" { } ''
- mkdir -p $out/var/empty
- '')
- ];
- };
+ inherit fakeNss; # alias
# This provides a /usr/bin/env, for shell scripts using the
# "#!/usr/bin/env executable" shebang.
diff --git a/pkgs/build-support/fake-nss/default.nix b/pkgs/build-support/fake-nss/default.nix
new file mode 100644
index 000000000000..9e0b60133e00
--- /dev/null
+++ b/pkgs/build-support/fake-nss/default.nix
@@ -0,0 +1,24 @@
+# Provide a /etc/passwd and /etc/group that contain root and nobody.
+# Useful when packaging binaries that insist on using nss to look up
+# username/groups (like nginx).
+# /bin/sh is fine to not exist, and provided by another shim.
+{ symlinkJoin, writeTextDir, runCommand }:
+symlinkJoin {
+ name = "fake-nss";
+ paths = [
+ (writeTextDir "etc/passwd" ''
+ root:x:0:0:root user:/var/empty:/bin/sh
+ nobody:x:65534:65534:nobody:/var/empty:/bin/sh
+ '')
+ (writeTextDir "etc/group" ''
+ root:x:0:
+ nobody:x:65534:
+ '')
+ (writeTextDir "etc/nsswitch.conf" ''
+ hosts: files dns
+ '')
+ (runCommand "var-empty" { } ''
+ mkdir -p $out/var/empty
+ '')
+ ];
+}
diff --git a/pkgs/build-support/kernel/make-initrd-ng-tool.nix b/pkgs/build-support/kernel/make-initrd-ng-tool.nix
new file mode 100644
index 000000000000..66ffc09d43cf
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng-tool.nix
@@ -0,0 +1,9 @@
+{ rustPlatform }:
+
+rustPlatform.buildRustPackage {
+ pname = "make-initrd-ng";
+ version = "0.1.0";
+
+ src = ./make-initrd-ng;
+ cargoLock.lockFile = ./make-initrd-ng/Cargo.lock;
+}
diff --git a/pkgs/build-support/kernel/make-initrd-ng.nix b/pkgs/build-support/kernel/make-initrd-ng.nix
new file mode 100644
index 000000000000..9fd202c44847
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng.nix
@@ -0,0 +1,79 @@
+let
+ # Some metadata on various compression programs, relevant to naming
+ # the initramfs file and, if applicable, generating a u-boot image
+ # from it.
+ compressors = import ./initrd-compressor-meta.nix;
+ # Get the basename of the actual compression program from the whole
+ # compression command, for the purpose of guessing the u-boot
+ # compression type and filename extension.
+ compressorName = fullCommand: builtins.elemAt (builtins.match "([^ ]*/)?([^ ]+).*" fullCommand) 1;
+in
+{ stdenvNoCC, perl, cpio, ubootTools, lib, pkgsBuildHost, makeInitrdNGTool, patchelf, runCommand, glibc
+# Name of the derivation (not of the resulting file!)
+, name ? "initrd"
+
+# Program used to compress the cpio archive; use "cat" for no compression.
+# This can also be a function which takes a package set and returns the path to the compressor,
+# such as `pkgs: "${pkgs.lzop}/bin/lzop"`.
+, compressor ? "gzip"
+, _compressorFunction ?
+ if lib.isFunction compressor then compressor
+ else if ! builtins.hasContext compressor && builtins.hasAttr compressor compressors then compressors.${compressor}.executable
+ else _: compressor
+, _compressorExecutable ? _compressorFunction pkgsBuildHost
+, _compressorName ? compressorName _compressorExecutable
+, _compressorMeta ? compressors.${_compressorName} or {}
+
+# List of arguments to pass to the compressor program, or null to use its defaults
+, compressorArgs ? null
+, _compressorArgsReal ? if compressorArgs == null then _compressorMeta.defaultArgs or [] else compressorArgs
+
+# Filename extension to use for the compressed initramfs. This is
+# included for clarity, but $out/initrd will always be a symlink to
+# the final image.
+# If this isn't guessed, you may want to complete the metadata above and send a PR :)
+, extension ? _compressorMeta.extension or
+ (throw "Unrecognised compressor ${_compressorName}, please specify filename extension")
+
+# List of { object = path_or_derivation; symlink = "/path"; }
+# The paths are copied into the initramfs in their nix store path
+# form, then linked at the root according to `symlink`.
+, contents
+
+# List of uncompressed cpio files to prepend to the initramfs. This
+# can be used to add files in specified paths without them becoming
+# symlinks to store paths.
+, prepend ? []
+
+# Whether to wrap the initramfs in a u-boot image.
+, makeUInitrd ? stdenvNoCC.hostPlatform.linux-kernel.target == "uImage"
+
+# If generating a u-boot image, the architecture to use. The default
+# guess may not align with u-boot's nomenclature correctly, so it can
+# be overridden.
+# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 for a list.
+, uInitrdArch ? stdenvNoCC.hostPlatform.linuxArch
+
+# The name of the compression, as recognised by u-boot.
+# See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L195-204 for a list.
+# If this isn't guessed, you may want to complete the metadata above and send a PR :)
+, uInitrdCompression ? _compressorMeta.ubootName or
+ (throw "Unrecognised compressor ${_compressorName}, please specify uInitrdCompression")
+}: runCommand name {
+ compress = "${_compressorExecutable} ${lib.escapeShellArgs _compressorArgsReal}";
+ passthru = {
+ compressorExecutableFunction = _compressorFunction;
+ compressorArgs = _compressorArgsReal;
+ };
+
+ passAsFile = ["contents"];
+ contents = lib.concatMapStringsSep "\n" ({ object, symlink, ... }: "${object}\n${if symlink == null then "" else symlink}") contents + "\n";
+
+ nativeBuildInputs = [makeInitrdNGTool patchelf glibc cpio];
+} ''
+ mkdir ./root
+ make-initrd-ng "$contentsPath" ./root
+ mkdir "$out"
+ (cd root && find * .[^.*] -exec touch -h -d '@1' '{}' +)
+ (cd root && find * .[^.*] -print0 | sort -z | cpio -o -H newc -R +0:+0 --reproducible --null | eval -- $compress >> "$out/initrd")
+''
diff --git a/pkgs/build-support/kernel/make-initrd-ng/Cargo.lock b/pkgs/build-support/kernel/make-initrd-ng/Cargo.lock
new file mode 100644
index 000000000000..75e732029b51
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "make-initrd-ng"
+version = "0.1.0"
diff --git a/pkgs/build-support/kernel/make-initrd-ng/Cargo.toml b/pkgs/build-support/kernel/make-initrd-ng/Cargo.toml
new file mode 100644
index 000000000000..9076f6b15617
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "make-initrd-ng"
+version = "0.1.0"
+authors = ["Will Fancher "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/pkgs/build-support/kernel/make-initrd-ng/README.md b/pkgs/build-support/kernel/make-initrd-ng/README.md
new file mode 100644
index 000000000000..741eba67e43f
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng/README.md
@@ -0,0 +1,79 @@
+# What is this for?
+
+NixOS's traditional initrd is generated by listing the paths that
+should be included in initrd and copying the full runtime closure of
+those paths into the archive. For most things, like almost any
+executable, this involves copying the entirety of huge packages like
+glibc, when only things like the shared library files are needed. To
+solve this, NixOS does a variety of patchwork to edit the files being
+copied in so they only refer to small, patched up paths. For instance,
+executables and their shared library dependencies are copied into an
+`extraUtils` derivation, and every ELF file is patched to refer to
+files in that output.
+
+The problem with this is that it is often difficult to correctly patch
+some things. For instance, systemd bakes the path to the `mount`
+command into the binary, so patchelf is no help. Instead, it's very
+often easier to simply copy the desired files to their original store
+locations in initrd and not copy their entire runtime closure. This
+does mean that it is the burden of the developer to ensure that all
+necessary dependencies are copied in, as closures won't be
+consulted. However, it is rare that full closures are actually
+desirable, so in the traditional initrd, the developer was likely to
+do manual work on patching the dependencies explicitly anyway.
+
+# How it works
+
+This program is similar to its inspiration (`find-libs` from the
+traditional initrd), except that it also handles symlinks and
+directories according to certain rules. As input, it receives a
+sequence of pairs of paths. The first path is an object to copy into
+initrd. The second path (if not empty) is the path to a symlink that
+should be placed in the initrd, pointing to that object. How that
+object is copied depends on its type.
+
+1. A regular file is copied directly to the same absolute path in the
+ initrd.
+
+ - If it is *also* an ELF file, then all of its direct shared
+ library dependencies are also listed as objects to be copied.
+
+2. A directory's direct children are listed as objects to be copied,
+ and a directory at the same absolute path in the initrd is created.
+
+3. A symlink's target is listed as an object to be copied.
+
+There are a couple of quirks to mention here. First, the term "object"
+refers to the final file path that the developer intends to have
+copied into initrd. This means any parent directory is not considered
+an object just because its child was listed as an object in the
+program input; instead those intermediate directories are simply
+created in support of the target object. Second, shared libraries,
+directory children, and symlink targets aren't immediately recursed,
+because they simply get listed as objects themselves, and are
+therefore traversed when they themselves are processed. Finally,
+symlinks in the intermediate directories leading to an object are
+preserved, meaning an input object `/a/symlink/b` will just result in
+initrd containing `/a/symlink -> /target/b` and `/target/b`, even if
+`/target` has other children. Preserving symlinks in this manner is
+important for things like systemd.
+
+These rules automate the most important and obviously necessary
+copying that needs to be done in most cases, allowing programs and
+configuration files to go unpatched, while keeping the content of the
+initrd to a minimum.
+
+# Why Rust?
+
+- A prototype of this logic was written in Bash, in an attempt to keep
+ with its `find-libs` ancestor, but that program was difficult to
+ write, and ended up taking several minutes to run. This program runs
+ in less than a second, and the code is substantially easier to work
+ with.
+
+- This will not require end users to install a rust toolchain to use
+ NixOS, as long as this tool is cached by Hydra. And if you're
+ bootstrapping NixOS from source, rustc is already required anyway.
+
+- Rust was favored over Python for its type system, and because if you
+ want to go fast, why not go *really fast*?
diff --git a/pkgs/build-support/kernel/make-initrd-ng/src/main.rs b/pkgs/build-support/kernel/make-initrd-ng/src/main.rs
new file mode 100644
index 000000000000..1342734590f7
--- /dev/null
+++ b/pkgs/build-support/kernel/make-initrd-ng/src/main.rs
@@ -0,0 +1,208 @@
+use std::collections::{HashSet, VecDeque};
+use std::env;
+use std::ffi::OsStr;
+use std::fs;
+use std::hash::Hash;
+use std::io::{BufReader, BufRead, Error, ErrorKind};
+use std::os::unix;
+use std::path::{Component, Path, PathBuf};
+use std::process::{Command, Stdio};
+
+struct NonRepeatingQueue {
+ queue: VecDeque,
+ seen: HashSet,
+}
+
+impl NonRepeatingQueue {
+ fn new() -> NonRepeatingQueue {
+ NonRepeatingQueue {
+ queue: VecDeque::new(),
+ seen: HashSet::new(),
+ }
+ }
+}
+
+impl NonRepeatingQueue {
+ fn push_back(&mut self, value: T) -> bool {
+ if self.seen.contains(&value) {
+ false
+ } else {
+ self.seen.insert(value.clone());
+ self.queue.push_back(value);
+ true
+ }
+ }
+
+ fn pop_front(&mut self) -> Option {
+ self.queue.pop_front()
+ }
+}
+
+fn patch_elf, P: AsRef>(mode: S, path: P) -> Result {
+ let output = Command::new("patchelf")
+ .arg(&mode)
+ .arg(&path)
+ .stderr(Stdio::inherit())
+ .output()?;
+ if output.status.success() {
+ Ok(String::from_utf8(output.stdout).expect("Failed to parse output"))
+ } else {
+ Err(Error::new(ErrorKind::Other, format!("failed: patchelf {:?} {:?}", OsStr::new(&mode), OsStr::new(&path))))
+ }
+}
+
+fn copy_file + AsRef, S: AsRef>(
+ source: P,
+ target: S,
+ queue: &mut NonRepeatingQueue>,
+) -> Result<(), Error> {
+ fs::copy(&source, target)?;
+
+ if !Command::new("ldd").arg(&source).output()?.status.success() {
+ //stdout(Stdio::inherit()).stderr(Stdio::inherit()).
+ println!("{:?} is not dynamically linked. Not recursing.", OsStr::new(&source));
+ return Ok(());
+ }
+
+ let rpath_string = patch_elf("--print-rpath", &source)?;
+ let needed_string = patch_elf("--print-needed", &source)?;
+ // Shared libraries don't have an interpreter
+ if let Ok(interpreter_string) = patch_elf("--print-interpreter", &source) {
+ queue.push_back(Box::from(Path::new(&interpreter_string.trim())));
+ }
+
+ let rpath = rpath_string.trim().split(":").map(|p| Box::::from(Path::new(p))).collect::>();
+
+ for line in needed_string.lines() {
+ let mut found = false;
+ for path in &rpath {
+ let lib = path.join(line);
+ if lib.exists() {
+ // No need to recurse. The queue will bring it back round.
+ queue.push_back(Box::from(lib.as_path()));
+ found = true;
+ break;
+ }
+ }
+ if !found {
+ // glibc makes it tricky to make this an error because
+ // none of the files have a useful rpath.
+ println!("Warning: Couldn't satisfy dependency {} for {:?}", line, OsStr::new(&source));
+ }
+ }
+
+ Ok(())
+}
+
+fn queue_dir>(
+ source: P,
+ queue: &mut NonRepeatingQueue>,
+) -> Result<(), Error> {
+ for entry in fs::read_dir(source)? {
+ let entry = entry?;
+ // No need to recurse. The queue will bring us back round here on its own.
+ queue.push_back(Box::from(entry.path().as_path()));
+ }
+
+ Ok(())
+}
+
+fn handle_path(
+ root: &Path,
+ p: &Path,
+ queue: &mut NonRepeatingQueue>,
+) -> Result<(), Error> {
+ let mut source = PathBuf::new();
+ let mut target = Path::new(root).to_path_buf();
+ let mut iter = p.components().peekable();
+ while let Some(comp) = iter.next() {
+ match comp {
+ Component::Prefix(_) => panic!("This tool is not meant for Windows"),
+ Component::RootDir => {
+ target.clear();
+ target.push(root);
+ source.clear();
+ source.push("/");
+ }
+ Component::CurDir => {}
+ Component::ParentDir => {
+ // Don't over-pop the target if the path has too many ParentDirs
+ if source.pop() {
+ target.pop();
+ }
+ }
+ Component::Normal(name) => {
+ target.push(name);
+ source.push(name);
+ let typ = fs::symlink_metadata(&source)?.file_type();
+ if typ.is_file() && !target.exists() {
+ copy_file(&source, &target, queue)?;
+ } else if typ.is_symlink() {
+ let link_target = fs::read_link(&source)?;
+
+ // Create the link, then push its target to the queue
+ if !target.exists() {
+ unix::fs::symlink(&link_target, &target)?;
+ }
+ source.pop();
+ source.push(link_target);
+ while let Some(c) = iter.next() {
+ source.push(c);
+ }
+ let link_target_path = source.as_path();
+ if link_target_path.exists() {
+ queue.push_back(Box::from(link_target_path));
+ }
+ break;
+ } else if typ.is_dir() {
+ if !target.exists() {
+ fs::create_dir(&target)?;
+ }
+
+ // Only recursively copy if the directory is the target object
+ if iter.peek().is_none() {
+ queue_dir(&source, queue)?;
+ }
+ }
+ }
+ }
+ }
+
+ Ok(())
+}
+
+fn main() -> Result<(), Error> {
+ let args: Vec = env::args().collect();
+ let input = fs::File::open(&args[1])?;
+ let output = &args[2];
+ let out_path = Path::new(output);
+
+ let mut queue = NonRepeatingQueue::>::new();
+
+ let mut lines = BufReader::new(input).lines();
+ while let Some(obj) = lines.next() {
+ // Lines should always come in pairs
+ let obj = obj?;
+ let sym = lines.next().unwrap()?;
+
+ let obj_path = Path::new(&obj);
+ queue.push_back(Box::from(obj_path));
+ if !sym.is_empty() {
+ println!("{} -> {}", &sym, &obj);
+ // We don't care about preserving symlink structure here
+ // nearly as much as for the actual objects.
+ let link_string = format!("{}/{}", output, sym);
+ let link_path = Path::new(&link_string);
+ let mut link_parent = link_path.to_path_buf();
+ link_parent.pop();
+ fs::create_dir_all(link_parent)?;
+ unix::fs::symlink(obj_path, link_path)?;
+ }
+ }
+ while let Some(obj) = queue.pop_front() {
+ println!("{:?}", obj);
+ handle_path(out_path, &*obj, &mut queue)?;
+ }
+
+ Ok(())
+}
diff --git a/pkgs/data/documentation/rnrs/r3rs.nix b/pkgs/data/documentation/rnrs/r3rs.nix
deleted file mode 100644
index d252a1680bd7..000000000000
--- a/pkgs/data/documentation/rnrs/r3rs.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ fetchurl, stdenv, texinfo }:
-
-import ./common.nix {
- inherit fetchurl stdenv texinfo;
- revision = 3;
- sha256 = "0knrpkr74s8yn4xcqxkqpgxmzdmzrvahh1n1csqc1wwd2rb4vnpr";
-}
diff --git a/pkgs/desktops/xfce/applications/xfce4-screensaver/default.nix b/pkgs/desktops/xfce/applications/xfce4-screensaver/default.nix
new file mode 100644
index 000000000000..4ac72b02da1a
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/xfce4-screensaver/default.nix
@@ -0,0 +1,49 @@
+{ mkXfceDerivation
+, dbus-glib
+, garcon
+, glib
+, gtk3
+, libX11
+, libXScrnSaver
+, libXrandr
+, libwnck
+, libxfce4ui
+, libxklavier
+, pam
+, systemd
+, xfconf
+, lib
+}:
+
+mkXfceDerivation {
+ category = "apps";
+ pname = "xfce4-screensaver";
+ version = "4.16.0";
+
+ sha256 = "1vblqhhzhv85yd5bz1xg14yli82ys5qrjdcabg3l53glbk61n99p";
+
+ buildInputs = [
+ dbus-glib
+ garcon
+ glib
+ gtk3
+ libX11
+ libXScrnSaver
+ libXrandr
+ libwnck
+ libxfce4ui
+ libxklavier
+ pam
+ systemd
+ xfconf
+ ];
+
+ configureFlags = [ "--without-console-kit" ];
+
+ makeFlags = [ "DBUS_SESSION_SERVICE_DIR=$(out)/etc" ];
+
+ meta = {
+ description = "Screensaver for Xfce";
+ maintainers = with lib.maintainers; [ symphorien ];
+ };
+}
diff --git a/pkgs/desktops/xfce/default.nix b/pkgs/desktops/xfce/default.nix
index 0205a7226398..b181cc29c966 100644
--- a/pkgs/desktops/xfce/default.nix
+++ b/pkgs/desktops/xfce/default.nix
@@ -82,6 +82,8 @@ lib.makeScope pkgs.newScope (self: with self; {
xfce4-terminal = callPackage ./applications/xfce4-terminal { };
+ xfce4-screensaver = callPackage ./applications/xfce4-screensaver { };
+
xfce4-screenshooter = callPackage ./applications/xfce4-screenshooter {
inherit (pkgs.gnome) libsoup;
};
diff --git a/pkgs/development/compilers/aldor/default.nix b/pkgs/development/compilers/aldor/default.nix
deleted file mode 100644
index 11a2904f6086..000000000000
--- a/pkgs/development/compilers/aldor/default.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ fetchFromGitHub, lib, stdenv, gmp, which, flex, bison, makeWrapper
-, autoconf, automake, libtool, jdk, perl }:
-
-stdenv.mkDerivation {
- pname = "aldor";
- version = "1.2.0";
-
- src = fetchFromGitHub {
- owner = "aldorlang";
- repo = "aldor";
- rev = "15471e75f3d65b93150f414ebcaf59a03054b68d";
- sha256 = "sha256-phKCghCeM+/QlxjIxfNQySo+5XMRqfOqlS9kgp07YKc=";
- };
-
- nativeBuildInputs = [ makeWrapper autoconf automake ];
- buildInputs = [ gmp which flex bison libtool jdk perl ];
-
- preConfigure = ''
- cd aldor ;
- ./autogen.sh ;
- '';
-
- postInstall = ''
- for prog in aldor unicl javagen ;
- do
- wrapProgram $out/bin/$prog --set ALDORROOT $out \
- --prefix PATH : ${jdk}/bin \
- --prefix PATH : ${stdenv.cc}/bin ;
- done
- '';
-
- meta = {
- # Please become a maintainer to fix this package
- broken = true;
- homepage = "http://www.aldor.org/";
- description = "Programming language with an expressive type system";
- license = lib.licenses.asl20;
-
- longDescription = ''
- Aldor is a programming language with an expressive type system well-suited
- for mathematical computing and which has been used to develop a number of
- computer algebra libraries. Originally known as A#, Aldor was conceived as
- an extension language for the Axiom system, but is now used more in other settings.
- In Aldor, types and functions are first class values that can be constructed
- and manipulated within programs. Pervasive support for dependent types allows
- static checking of dynamic objects. What does this mean for a normal user? Aldor
- solves many difficulties encountered in widely-used object-oriented programming
- languages. It allows programs to use a natural style, combining the more attractive
- and powerful properties of functional, object-oriented and aspect-oriented styles.
- '';
-
- platforms = lib.platforms.linux;
- };
-}
diff --git a/pkgs/development/compilers/aliceml/default.nix b/pkgs/development/compilers/aliceml/default.nix
deleted file mode 100644
index fe223cacec89..000000000000
--- a/pkgs/development/compilers/aliceml/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{lib, stdenv, gcc, glibc, fetchurl, fetchgit, libtool, autoconf, automake, file, gnumake, which, zsh, m4, pkg-config, perl, gnome2, gtk2, pango, sqlite, libxml2, zlib, gmp, smlnj }:
-
-stdenv.mkDerivation {
- pname = "aliceml";
- version = "1.4-7d44dc8e";
-
- src = fetchgit {
- url = "https://github.com/aliceml/aliceml";
- rev = "7d44dc8e4097c6f85888bbf4ff86d51fe05b0a08";
- sha256 = "1xpvia00cpig0i7qvz29sx7xjic6kd472ng722x4rapz8mjnf8bk";
- fetchSubmodules = true;
- };
-
- gecodeSrc = fetchurl {
- url = "http://www.gecode.org/download/gecode-1.3.1.tar.gz";
- sha256 = "0mgc6llbq166jmlq3alvagqsg3730670zvbwwkdgsqklw70v9355";
- };
-
- nativeBuildInputs = [ autoconf automake ];
- buildInputs = [
- gcc glibc
- libtool gnumake
- file which zsh m4 gtk2 zlib gmp
- gnome2.libgnomecanvas pango sqlite
- libxml2 pkg-config perl smlnj
- ];
-
- makePatch = ./make.patch;
- seamPatch = ./seam.patch;
-
- phases = [ "unpackPhase" "patchPhase" "configurePhase" "buildPhase" ];
-
- patchPhase = ''
- sed -i -e "s@wget ..GECODE_URL. -O - | tar xz@tar xf $gecodeSrc@" make/Makefile
- patch -p1 <$makePatch
- patch -p1 <$seamPatch
- '';
-
- configurePhase = ''
- make -C make setup PREFIX="$out"
- '';
-
- buildPhase = ''
- gmp="${gmp.dev}" zlib="${zlib.dev}" PATH=$PATH:`pwd`/seam-support/install/bin make -C make all PREFIX="$out"
- '';
-
- meta = {
- description = "Functional programming language based on Standard ML";
- longDescription = ''
- Alice ML is a functional programming language based on Standard ML,
- extended with rich support for concurrent, distributed, and constraint
- programming.
- '';
- homepage = "https://www.ps.uni-saarland.de/alice/";
- license = lib.licenses.mit;
- maintainers = [ lib.maintainers.doublec ];
- broken = true;
- };
-}
diff --git a/pkgs/development/compilers/aliceml/make.patch b/pkgs/development/compilers/aliceml/make.patch
deleted file mode 100644
index 78e2b28974e8..000000000000
--- a/pkgs/development/compilers/aliceml/make.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 6a55b06..84a6000 100644
---- a/make/Makefile
-+++ b/make/Makefile
-@@ -387,6 +387,7 @@ configure-seam-linux64:
- ../sources/configure \
- --prefix='$(PREFIX)' \
- --with-warnings=yes \
-+ --with-zlib='$(zlib)' \
- --disable-lightning)
-
- .PHONY: configure-seam-darwin64
-@@ -434,6 +435,7 @@ configure-alice-ll-linux:
- (cd $(PWD)/alice/build && \
- ../sources/vm-seam/configure \
- --prefix='$(PREFIX)' \
-+ --with-gmp='$(gmp)' \
- --with-warnings=yes)
-
- .PHONY: rebuild-alice-ll
diff --git a/pkgs/development/compilers/aliceml/seam.patch b/pkgs/development/compilers/aliceml/seam.patch
deleted file mode 100644
index d489037fef4a..000000000000
--- a/pkgs/development/compilers/aliceml/seam.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Makefile.cvs b/Makefile.cvs
-index b59434a..cd1316f 100644
---- a/seam/sources/Makefile.cvs
-+++ b/seam/sources/Makefile.cvs
-@@ -32,7 +32,7 @@ autotools:
- aclocal -I .
- autoconf
- automake --add-missing
-- cd libltdl; aclocal; autoconf; automake --add-missing
-+ cd libltdl; chmod +w *; aclocal; autoconf; automake --add-missing
-
- lightning:
- rm -rf lightning
diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix
index 65e9eb827605..4fa99f80c8e3 100644
--- a/pkgs/development/compilers/cudatoolkit/default.nix
+++ b/pkgs/development/compilers/cudatoolkit/default.nix
@@ -86,5 +86,9 @@ rec {
gcc = gcc10; # can bump to 11 along with stdenv.cc
};
+ # Make sure to only ever update this to a version that is compatible with the
+ # latest cudnn, nccl, cutensor, etc! It sometimes happens that CUDA versions
+ # are released prior to compatibility with the rest of the ecosystem. And
+ # don't forget to request a review from @NixOS/cuda-maintainers!
cudatoolkit_11 = cudatoolkit_11_5;
}
diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix
deleted file mode 100644
index d8495977e780..000000000000
--- a/pkgs/development/compilers/hhvm/default.nix
+++ /dev/null
@@ -1,68 +0,0 @@
-{ lib, stdenv, fetchgit, cmake, pkg-config, boost, libunwind, libmemcached
-, pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php
-, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
-, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
-, libxslt, freetype, gdb, git, perl, libmysqlclient, gmp, libyaml, libedit
-, libvpx, imagemagick, fribidi, gperf, which, ocamlPackages
-}:
-
-stdenv.mkDerivation rec {
- pname = "hhvm";
- version = "3.23.2";
-
- # use git version since we need submodules
- src = fetchgit {
- url = "https://github.com/facebook/hhvm.git";
- rev = "HHVM-${version}";
- sha256 = "1nic49j8nghx82lgvz0b95r78sqz46qaaqv4nx48p8yrj9ysnd7i";
- fetchSubmodules = true;
- };
-
- nativeBuildInputs = [ cmake pkg-config flex bison ];
- buildInputs =
- [ boost libunwind libmysqlclient libmemcached pcre gdb git perl
- libevent gd curl libxml2 icu openssl zlib php expat libcap
- oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
- libelf uwimap binutils cyrus_sasl pam glog libpng libxslt libkrb5
- gmp libyaml libedit libvpx imagemagick fribidi gperf which
- ocamlPackages.ocaml ocamlPackages.ocamlbuild
- ];
-
- patches = [
- ./flexible-array-members-gcc6.patch
- ];
-
- dontUseCmakeBuildDir = true;
- NIX_LDFLAGS = "-lpam -L${pam}/lib";
-
- # work around broken build system
- NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2";
-
- # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
- # (setting it to an absolute path causes include files to go to $out/$out/include,
- # because the absolute path is interpreted with root at $out).
- cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=include" ];
-
- prePatch = ''
- substituteInPlace ./configure \
- --replace "/usr/bin/env bash" ${stdenv.shell}
- substituteInPlace ./third-party/ocaml/CMakeLists.txt \
- --replace "/bin/bash" ${stdenv.shell}
- perl -pi -e 's/([ \t(])(isnan|isinf)\(/$1std::$2(/g' \
- hphp/runtime/base/*.cpp \
- hphp/runtime/ext/std/*.cpp \
- hphp/runtime/ext_zend_compat/php-src/main/*.cpp \
- hphp/runtime/ext_zend_compat/php-src/main/*.h
- sed '1i#include ' -i third-party/mcrouter/src/mcrouter/lib/cycles/Cycles.h
- patchShebangs .
- '';
-
- meta = {
- description = "High-performance JIT compiler for PHP/Hack";
- homepage = "https://hhvm.com";
- license = "PHP/Zend";
- platforms = [ "x86_64-linux" ];
- maintainers = [ lib.maintainers.thoughtpolice ];
- broken = true; # Since 2018-04-21, see https://hydra.nixos.org/build/73059373
- };
-}
diff --git a/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch b/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch
deleted file mode 100644
index 61b6e5e8d8c3..000000000000
--- a/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/third-party/re2/src/re2/dfa.cc b/third-party/re2/src/re2/dfa.cc
-index 483f678..3aa3610 100644
---- a/third-party/re2/src/re2/dfa.cc
-+++ b/third-party/re2/src/re2/dfa.cc
-@@ -101,8 +101,13 @@ class DFA {
- uint flag_; // Empty string bitfield flags in effect on the way
- // into this state, along with kFlagMatch if this
- // is a matching state.
-- std::atomic next_[]; // Outgoing arrows from State,
-- // one per input byte class
-+// Work around the bug affecting flexible array members in GCC 6.1 and 6.2.
-+// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932)
-+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 6 && __GNUC_MINOR__ >= 1
-+ std::atomic next_[0]; // Outgoing arrows from State, one per input byte class
-+#else
-+ std::atomic next_[]; // Outgoing arrows from State, one per input byte class
-+#endif
- };
-
- enum {
diff --git a/pkgs/development/compilers/ocaml/metaocaml-3.09.nix b/pkgs/development/compilers/ocaml/metaocaml-3.09.nix
deleted file mode 100644
index e13f3006be57..000000000000
--- a/pkgs/development/compilers/ocaml/metaocaml-3.09.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib, stdenv, fetchurl, xlibsWrapper, ncurses }:
-
-stdenv.mkDerivation ({
-
- pname = "metaocaml";
- version = "3.09-alpha-30";
-
- src = fetchurl {
- url = "http://www.metaocaml.org/dist/old/MetaOCaml_309_alpha_030.tar.gz";
- sha256 = "0migbn0zwfb7yb24dy7qfqi19sv3drqcv4369xi7xzpds2cs35fd";
- };
-
- prefixKey = "-prefix ";
- configureFlags = ["-no-tk" "-x11lib" xlibsWrapper];
- buildFlags = [ "world" "bootstrap" "world.opt" ];
- buildInputs = [xlibsWrapper ncurses];
- installTargets = "install installopt";
- patchPhase = ''
- CAT=$(type -tp cat)
- sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
- '';
- postBuild = ''
- mkdir -p $out/include
- ln -sv $out/lib/ocaml/caml $out/include/caml
- '';
-
- meta = {
- homepage = "http://www.metaocaml.org/";
- license = with lib.licenses; [ qpl lgpl2 ];
- description = "A compiled, type-safe, multi-stage programming language";
- broken = true;
- };
-
-})
diff --git a/pkgs/development/embedded/stm32/betaflight/default.nix b/pkgs/development/embedded/stm32/betaflight/default.nix
deleted file mode 100644
index 1ecf9be5d8d0..000000000000
--- a/pkgs/development/embedded/stm32/betaflight/default.nix
+++ /dev/null
@@ -1,64 +0,0 @@
-{ lib, stdenv, fetchFromGitHub
-, gcc-arm-embedded, binutils-arm-embedded, python2
-, skipTargets ? [
- # These targets do not build, for the reasons listed, along with the last version checked.
- # Probably all of the issues with these targets need to be addressed upstream.
- "AG3X" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
- "ALIENWHOOP" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
- "FURYF3" # 3.4.0-rc4: flash region overflow
- "OMNINXT" # 3.4.0-rc4: has not specified a valid STM group, must be one of F1, F3, F405, F411 or F7x5. Have you prepared a valid target.mk?
-]}:
-
-stdenv.mkDerivation rec {
-
- pname = "betaflight";
- version = "3.4.0-rc4";
-
- src = fetchFromGitHub {
- owner = "betaflight";
- repo = "betaflight";
- rev = "8e9e7574481b1abba9354b24f41eb31054943785"; # Always use a commit id here!
- sha256 = "1wyp23p876xbfi9z6gm4xn1nwss3myvrjjjq9pd3s0vf5gkclkg5";
- };
-
- nativeBuildInputs = [
- gcc-arm-embedded binutils-arm-embedded
- python2
- ];
-
- postPatch = ''
- sed -ri "s/REVISION.*=.*git log.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
- sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
-
- substituteInPlace Makefile \
- --replace "--specs=nano.specs" ""
- '';
-
- enableParallelBuilding = true;
-
- preBuild = ''
- buildFlagsArray=(
- "NOBUILD_TARGETS=${toString skipTargets}"
- "GCC_REQUIRED_VERSION=$(arm-none-eabi-gcc -dumpversion)"
- all
- )
- '';
-
- installPhase = ''
- runHook preInstall
-
- mkdir -p $out
- cp obj/*.hex $out
-
- runHook postInstall
- '';
-
- meta = with lib; {
- description = "Flight controller software (firmware) used to fly multi-rotor craft and fixed wing craft";
- homepage = "https://github.com/betaflight/betaflight";
- license = licenses.gpl3;
- maintainers = with maintainers; [ elitak ];
- broken = true;
- };
-
-}
diff --git a/pkgs/development/embedded/stm32/inav/default.nix b/pkgs/development/embedded/stm32/inav/default.nix
deleted file mode 100644
index c1f762e47d86..000000000000
--- a/pkgs/development/embedded/stm32/inav/default.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ lib, stdenv, fetchFromGitHub
-, gcc-arm-embedded, binutils-arm-embedded, ruby
-}:
-
-stdenv.mkDerivation rec {
-
- pname = "inav";
- version = "2.0.0-rc2";
-
- src = fetchFromGitHub {
- owner = "iNavFlight";
- repo = "inav";
- rev = "a8415e89c2956d133d8175827c079bcf3bc3766c"; # Always use a commit id here!
- sha256 = "15zai8qf43b06fmws1sbkmdgip51zp7gkfj7pp9b6gi8giarzq3y";
- };
-
- nativeBuildInputs = [
- gcc-arm-embedded binutils-arm-embedded
- ruby
- ];
-
- postPatch = ''
- sed -ri "s/REVISION.*=.*shell git.*/REVISION = ${builtins.substring 0 10 src.rev}/" Makefile # Simulate abbrev'd rev.
- sed -ri "s/-j *[0-9]+//" Makefile # Eliminate parallel build args in submakes
- sed -ri "s/binary hex/hex/" Makefile # No need for anything besides .hex
-
- substituteInPlace Makefile \
- --replace "--specs=nano.specs" ""
- '';
-
- enableParallelBuilding = true;
-
- preBuild = ''
- buildFlagsArray=(
- all
- )
- '';
-
- installPhase = ''
- runHook preInstall
-
- mkdir -p $out
- cp obj/*.hex $out
-
- runHook postInstall
- '';
-
- meta = with lib; {
- description = "Navigation-enabled flight control software";
- homepage = "https://inavflight.github.io";
- license = licenses.gpl3;
- maintainers = with maintainers; [ elitak ];
- broken = true;
- };
-
-}
diff --git a/pkgs/development/interpreters/pure/default.nix b/pkgs/development/interpreters/pure/default.nix
deleted file mode 100644
index d1c03bba5a31..000000000000
--- a/pkgs/development/interpreters/pure/default.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{ lib, stdenv, fetchurl, makeWrapper,
- libllvm, gmp, mpfr, readline, bison, flex }:
-
-stdenv.mkDerivation rec {
- baseName="pure";
- version="0.68";
- name="${baseName}-${version}";
-
- src = fetchurl {
- url="https://github.com/agraef/pure-lang/releases/download/${name}/${name}.tar.gz";
- sha256="0px6x5ivcdbbp2pz5n1r1cwg1syadklhjw8piqhl63n91i4r7iyb";
- };
-
- nativeBuildInputs = [ makeWrapper ];
- buildInputs = [ bison flex ];
- propagatedBuildInputs = [ libllvm gmp mpfr readline ];
- NIX_LDFLAGS = "-lLLVMJIT";
-
- postPatch = ''
- for f in expr.cc matcher.cc printer.cc symtable.cc parserdefs.hh; do
- sed -i '1i\#include ' $f
- done
- '';
-
- configureFlags = [ "--enable-release" ];
- doCheck = true;
- checkPhase = ''
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libllvm}/lib make check
- '';
- postInstall = ''
- wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${libllvm}/lib
- '';
-
- meta = {
- description = "A modern-style functional programming language based on term rewriting";
- maintainers = with lib.maintainers;
- [
- raskin
- asppsa
- ];
- platforms = with lib.platforms;
- linux;
- license = lib.licenses.gpl3Plus;
- broken = true;
- };
-}
diff --git a/pkgs/development/interpreters/starlark/default.nix b/pkgs/development/interpreters/starlark/default.nix
new file mode 100644
index 000000000000..aa77ceba33b4
--- /dev/null
+++ b/pkgs/development/interpreters/starlark/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildGoModule }:
+buildGoModule rec {
+ pname = "starlark";
+ version = "unstable-2022-03-02";
+
+ src = fetchFromGitHub {
+ owner = "google";
+ repo = "starlark-go";
+ rev = "5411bad688d12781515a91cc032645331b4fc302";
+ sha256 = "sha256-JNsGyGlIVMS5w0W4jHVsrPqqNms3Xfpa4n/XcEWqt6I=";
+ };
+
+ vendorSha256 = "sha256-lgL5o3MQfZekZ++BNESwV0LeoTxwEZfziQAe99zm4RY=";
+
+ ldflags = [ "-s" "-w" ];
+
+ meta = with lib; {
+ homepage = "https://github.com/google/starlark-go";
+ description = "An interpreter for Starlark, implemented in Go";
+ license = licenses.bsd3;
+ maintainers = with maintainers; [ aaronjheng ];
+ };
+}
diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix
index 816b854b99eb..7f00faa76476 100644
--- a/pkgs/development/interpreters/wasmtime/default.nix
+++ b/pkgs/development/interpreters/wasmtime/default.nix
@@ -1,31 +1,41 @@
-{ rustPlatform, fetchFromGitHub, lib, python3, cmake, llvmPackages, clang, stdenv, darwin }:
+{ rustPlatform, fetchFromGitHub, lib, v8 }:
rustPlatform.buildRustPackage rec {
pname = "wasmtime";
- version = "0.21.0";
+ version = "0.35.2";
src = fetchFromGitHub {
owner = "bytecodealliance";
repo = pname;
rev = "v${version}";
- sha256 = "0q7wsnq5zdskxwzsxwm98jfnv2frnwca1dkhwndcn9yyz2gyw57m";
+ sha256 = "sha256-4oZglk7MInLIsvbeCfs4InAcmSmzZp16XL5+8eoYXJk=";
fetchSubmodules = true;
};
- cargoSha256 = "1wlig9gls7s1k1swxwhl82vfga30bady8286livxc4y2zp0vb18w";
+ cargoSha256 = "sha256-IqFOw9bGdM3IEoMeqDlxKfLnZvR80PSnwP9kr1tI/h0=";
- nativeBuildInputs = [ python3 cmake clang ];
- buildInputs = [ llvmPackages.libclang ] ++
- lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
- LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+ # This environment variable is required so that when wasmtime tries
+ # to run tests by using the rusty_v8 crate, it does not try to
+ # download a static v8 build from the Internet, what would break
+ # build hermetism.
+ RUSTY_V8_ARCHIVE = "${v8}/lib/libv8.a";
doCheck = true;
+ checkFlags = [
+ "--skip=cli_tests::run_cwasm"
+ "--skip=commands::compile::test::test_successful_compile"
+ "--skip=commands::compile::test::test_aarch64_flags_compile"
+ "--skip=commands::compile::test::test_unsupported_flags_compile"
+ "--skip=commands::compile::test::test_x64_flags_compile"
+ "--skip=commands::compile::test::test_x64_presets_compile"
+ "--skip=traps::parse_dwarf_info"
+ ];
meta = with lib; {
description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
homepage = "https://github.com/bytecodealliance/wasmtime";
license = licenses.asl20;
maintainers = [ maintainers.matthewbauer ];
- platforms = platforms.unix;
+ platforms = platforms.linux;
};
}
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index bfa1c75b483f..bec478c66bd9 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -86,6 +86,46 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
+ doInstallCheck = true;
+ # preCheck rather than preInstallCheck because this is what pytestCheckHook
+ # calls (coming from the python world)
+ preCheck = ''
+ pushd ../autotest
+ # something has made files here read-only by this point
+ chmod -R u+w .
+
+ export HOME=$(mktemp -d)
+ export PYTHONPATH="$out/${pythonPackages.python.sitePackages}:$PYTHONPATH"
+ '';
+ installCheckInputs = with pythonPackages; [
+ pytestCheckHook
+ pytest-env
+ lxml
+ ];
+ disabledTestPaths = [
+ # tests that attempt to make network requests
+ "gcore/vsis3.py"
+ "gdrivers/gdalhttp.py"
+ "gdrivers/wms.py"
+ ];
+ disabledTests = [
+ # tests that attempt to make network requests
+ "test_jp2openjpeg_45"
+ # tests that require the full proj dataset which we don't package yet
+ # https://github.com/OSGeo/gdal/issues/5523
+ "test_transformer_dem_overrride_srs"
+ "test_osr_ct_options_area_of_interest"
+ ] ++ lib.optionals (!stdenv.isx86_64) [
+ # likely precision-related expecting x87 behaviour
+ "test_jp2openjpeg_22"
+ ] ++ lib.optionals stdenv.isDarwin [
+ # flaky on macos
+ "test_rda_download_queue"
+ ];
+ postCheck = ''
+ popd # ../autotest
+ '';
+
meta = {
description = "Translator library for raster geospatial data formats";
homepage = "https://www.gdal.org/";
diff --git a/pkgs/development/libraries/gdata-sharp/default.nix b/pkgs/development/libraries/gdata-sharp/default.nix
deleted file mode 100644
index 21cb79ba8158..000000000000
--- a/pkgs/development/libraries/gdata-sharp/default.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ lib, stdenv, fetchsvn, pkg-config, mono, dotnetPackages }:
-
-let
- newtonsoft-json = dotnetPackages.NewtonsoftJson;
-in stdenv.mkDerivation {
- pname = "gdata-sharp";
- version = "2.2.0.0";
-
- src = fetchsvn {
- url = "http://google-gdata.googlecode.com/svn/trunk/";
- rev = "1217";
- sha256 = "0b0rvgg3xsbbg2fdrpz0ywsy9rcahlyfskndaagd3yzm83gi6bhk";
- };
-
- nativeBuildInputs = [ pkg-config ];
- buildInputs = [ mono newtonsoft-json ];
-
- sourceRoot = "svn-r1217/clients/cs";
-
- dontStrip = true;
-
- postPatch = ''
- sed -i -e 's#^\(DEFINES=.*\)\(.\)#\1 /r:third_party/Newtonsoft.Json.dll\2#' Makefile
- # carriage return ^
- '';
-
- makeFlags = [ "PREFIX=$(out)" ];
-
- meta = with lib; {
- homepage = "https://code.google.com/archive/p/google-gdata/";
-
- description = "The Google Data APIs";
- longDescription = ''
- The Google Data APIs provide a simple protocol for reading and writing
- data on the web.
- '';
-
- license = licenses.asl20;
- platforms = platforms.linux;
- broken = true;
- };
-}
diff --git a/pkgs/development/libraries/gnutls-kdh/3.5.nix b/pkgs/development/libraries/gnutls-kdh/3.5.nix
deleted file mode 100644
index 015163b32931..000000000000
--- a/pkgs/development/libraries/gnutls-kdh/3.5.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ callPackage, fetchFromGitHub, autoreconfHook, ... } @ args:
-
-callPackage ./generic.nix (args // {
- version = "1.0";
-
- src = fetchFromGitHub {
- owner = "arpa2";
- repo = "gnutls-kdh";
- rev = "ff3bb36f70a746f28554641d466e124098dfcb25";
- sha256 = "1rr3p4r145lnprxn8hqyyzh3qkj3idsbqp08g07ndrhqnxq0k0sw";
- };
-})
diff --git a/pkgs/development/libraries/gnutls-kdh/generic.nix b/pkgs/development/libraries/gnutls-kdh/generic.nix
deleted file mode 100644
index 7b3b4561efb1..000000000000
--- a/pkgs/development/libraries/gnutls-kdh/generic.nix
+++ /dev/null
@@ -1,95 +0,0 @@
-{ config, lib, stdenv, zlib, lzo, libtasn1, nettle, pkg-config, lzip
-, perl, gmp, autogen, libidn, p11-kit, unbound, libiconv
-, guileBindings ? config.gnutls.guile or false, guile
-, tpmSupport ? true, trousers, nettools, gperftools, gperf, gettext, automake
-, bison, texinfo
-
-# Version dependent args
-, version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
-, ...}:
-
-assert guileBindings -> guile != null;
-let
- # XXX: Gnulib's `test-select' fails on FreeBSD:
- # https://hydra.nixos.org/build/2962084/nixlog/1/raw .
- doCheck = !stdenv.isFreeBSD && !stdenv.isDarwin && lib.versionAtLeast version "3.4";
-in
-stdenv.mkDerivation {
- pname = "gnutls-kdh";
- inherit version;
-
- inherit src patches;
-
- outputs = [ "bin" "dev" "out" ];
-
- patchPhase = ''
- # rm -fR ./po
- # substituteInPlace configure "po/Makefile.in" " "
- substituteInPlace doc/manpages/Makefile.in --replace "gnutls_cipher_list.3" " "
- substituteInPlace doc/manpages/Makefile.in --replace "gnutls_cipher_self_test.3" " "
- substituteInPlace doc/manpages/Makefile.in --replace "gnutls_digest_self_test.3" " "
- substituteInPlace doc/manpages/Makefile.in --replace "gnutls_mac_self_test.3" " "
- substituteInPlace doc/manpages/Makefile.in --replace "gnutls_pk_self_test.3" " "
- printf "all: ;\n\ninstall: ;" > "po/Makefile.in"
- printf "all: ;\n\ninstall: ;" > "po/Makefile.in.in"
- '';
-
- postPatch = lib.optionalString (lib.versionAtLeast version "3.4") ''
- sed '2iecho "name constraints tests skipped due to datefudge problems"\nexit 0' \
- -i tests/cert-tests/name-constraints
- '' + postPatch;
-
- preConfigure = "patchShebangs .";
- configureFlags =
- lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
- ++ [
- "--disable-dependency-tracking"
- "--enable-fast-install"
- ] ++ lib.optional guileBindings
- [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ];
-
- # Build of the Guile bindings is not parallel-safe. See
- #
- # for the actual fix. Also an apparent race in the generation of
- # systemkey-args.h.
- enableParallelBuilding = false;
-
- buildInputs = [ lzo lzip nettle libtasn1 libidn p11-kit zlib gmp
- autogen gperftools gperf gettext automake bison texinfo ]
- ++ lib.optional doCheck nettools
- ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
- ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
- ++ [ unbound ]
- ++ lib.optional guileBindings guile;
-
- nativeBuildInputs = [ perl pkg-config ] ++ nativeBuildInputs;
-
- #inherit doCheck;
- doCheck = false;
-
- # Fixup broken libtool and pkg-config files
- preFixup = lib.optionalString (!stdenv.isDarwin) ''
- sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
- -e 's,-lz,-L${zlib.out}/lib -lz,' \
- -e 's,-L${gmp.dev}/lib,-L${gmp.out}/lib,' \
- -e 's,-lgmp,-L${gmp.out}/lib -lgmp,' \
- -i $out/lib/*.la "$dev/lib/pkgconfig/gnutls.pc"
- '';
-
- meta = with lib; {
- description = "GnuTLS with additional TLS-KDH ciphers: Kerberos + Diffie-Hellman";
-
- longDescription = ''
- The ARPA2 project aims to add security. This is an enhanced
- version of GnuTLS, a project that aims to develop a library which
- provides a secure layer, over a reliable transport
- layer. It adds TLS-KDH ciphers: Kerberos + Diffie-Hellman.
- '';
-
- homepage = "https://github.com/arpa2/gnutls-kdh";
- license = licenses.lgpl21Plus;
- maintainers = with maintainers; [ leenaars ];
- platforms = platforms.all;
- broken = true;
- };
-}
diff --git a/pkgs/development/libraries/gtkmathview/default.nix b/pkgs/development/libraries/gtkmathview/default.nix
deleted file mode 100644
index b5399553f960..000000000000
--- a/pkgs/development/libraries/gtkmathview/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{lib, stdenv, fetchurl, pkg-config, gtk2, t1lib, glib, libxml2, popt, gmetadom ? null }:
-
-let
- pname = "gtkmathview";
- version = "0.8.0";
-in
-
-stdenv.mkDerivation {
- name = "${pname}-${version}";
-
- src = fetchurl {
- url = "http://helm.cs.unibo.it/mml-widget/sources/${pname}-${version}.tar.gz";
- sha256 = "0hwcamf5fi35frg7q6kgisc9v0prqbhsplb2gl55cg3av9sh3hqx";
- };
-
- nativeBuildInputs = [ pkg-config ];
- buildInputs = [ t1lib glib gmetadom libxml2 popt];
- propagatedBuildInputs = [gtk2 t1lib];
-
- patches = [ ./gcc-4.3-build-fixes.patch ./gcc-4.4-build-fixes.patch ];
-
- meta = {
- homepage = "http://helm.cs.unibo.it/mml-widget/";
- description = "C++ rendering engine for MathML documents";
- license = lib.licenses.lgpl3Plus;
- maintainers = [ lib.maintainers.roconnor ];
- broken = true;
- };
-}
diff --git a/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch b/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch
deleted file mode 100644
index 14ad594b38b8..000000000000
--- a/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From: Stefano Zacchiroli
-Date: Fri, 11 Dec 2009 12:58:56 +0100
-Subject: [PATCH] gcc 4.3 build fixes
-
----
- mathmlps/main.cc | 1 +
- mathmlsvg/SMS.cc | 1 +
- mathmlsvg/main.cc | 1 +
- src/backend/ps/T1_FontDataBase.cc | 2 +-
- src/engine/mathml/mathVariantAux.cc | 1 +
- 5 files changed, 5 insertions(+), 1 deletions(-)
-
-diff --git a/mathmlps/main.cc b/mathmlps/main.cc
-index cc6cd1c..48339af 100644
---- a/mathmlps/main.cc
-+++ b/mathmlps/main.cc
-@@ -19,6 +19,7 @@
- #include
-
- #include
-+#include
- #include
-
- #include
-diff --git a/mathmlsvg/SMS.cc b/mathmlsvg/SMS.cc
-index a76266e..be7add8 100644
---- a/mathmlsvg/SMS.cc
-+++ b/mathmlsvg/SMS.cc
-@@ -18,6 +18,7 @@
-
- #include
-
-+#include
- #include
- #include "defs.h"
- #include "AbstractLogger.hh"
-diff --git a/mathmlsvg/main.cc b/mathmlsvg/main.cc
-index 259d67e..c49e8ac 100644
---- a/mathmlsvg/main.cc
-+++ b/mathmlsvg/main.cc
-@@ -19,6 +19,7 @@
- #include
-
- #include
-+#include
- #include
-
- #include
-diff --git a/src/backend/ps/T1_FontDataBase.cc b/src/backend/ps/T1_FontDataBase.cc
-index b6490eb..3dd436c 100644
---- a/src/backend/ps/T1_FontDataBase.cc
-+++ b/src/backend/ps/T1_FontDataBase.cc
-@@ -19,7 +19,7 @@
- #include
- #include
- #include