Merge master into haskell-updates
This commit is contained in:
commit
6b871d6cfc
|
@ -759,13 +759,6 @@
|
|||
githubId = 11699655;
|
||||
name = "Stanislas Lange";
|
||||
};
|
||||
angustrau = {
|
||||
name = "Angus Trau";
|
||||
email = "nix@angus.ws";
|
||||
matrix = "@angustrau:matrix.org";
|
||||
github = "angustrau";
|
||||
githubId = 13267947;
|
||||
};
|
||||
anhdle14 = {
|
||||
name = "Le Anh Duc";
|
||||
email = "anhdle14@icloud.com";
|
||||
|
@ -3388,6 +3381,12 @@
|
|||
githubId = 18535642;
|
||||
name = "Emily";
|
||||
};
|
||||
emilytrau = {
|
||||
name = "Emily Trau";
|
||||
email = "nix@angus.ws";
|
||||
github = "emilytrau";
|
||||
githubId = 13267947;
|
||||
};
|
||||
enderger = {
|
||||
email = "endergeryt@gmail.com";
|
||||
github = "enderger";
|
||||
|
@ -4023,6 +4022,12 @@
|
|||
github = "fitzgibbon";
|
||||
githubId = 617048;
|
||||
};
|
||||
fkautz = {
|
||||
name = "Frederick F. Kautz IV";
|
||||
email = "fkautz@alumni.cmu.edu";
|
||||
github = "fkautz";
|
||||
githubId = 135706;
|
||||
};
|
||||
Flakebi = {
|
||||
email = "flakebi@t-online.de";
|
||||
github = "Flakebi";
|
||||
|
|
|
@ -223,7 +223,7 @@ with lib.maintainers; {
|
|||
|
||||
openstack = {
|
||||
members = [
|
||||
angustrau
|
||||
emilytrau
|
||||
SuperSandro2000
|
||||
];
|
||||
scope = "Maintain the ecosystem around OpenStack";
|
||||
|
|
72
nixos/doc/manual/development/activation-script.section.md
Normal file
72
nixos/doc/manual/development/activation-script.section.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
# Activation script {#sec-activation-script}
|
||||
|
||||
The activation script is a bash script called to activate the new
|
||||
configuration which resides in a NixOS system in `$out/activate`. Since its
|
||||
contents depend on your system configuration, the contents may differ.
|
||||
This chapter explains how the script works in general and some common NixOS
|
||||
snippets. Please be aware that the script is executed on every boot and system
|
||||
switch, so tasks that can be performed in other places should be performed
|
||||
there (for example letting a directory of a service be created by systemd using
|
||||
mechanisms like `StateDirectory`, `CacheDirectory`, ... or if that's not
|
||||
possible using `preStart` of the service).
|
||||
|
||||
Activation scripts are defined as snippets using
|
||||
[](#opt-system.activationScripts). They can either be a simple multiline string
|
||||
or an attribute set that can depend on other snippets. The builder for the
|
||||
activation script will take these dependencies into account and order the
|
||||
snippets accordingly. As a simple example:
|
||||
|
||||
```nix
|
||||
system.activationScripts.my-activation-script = {
|
||||
deps = [ "etc" ];
|
||||
# supportsDryActivation = true;
|
||||
text = ''
|
||||
echo "Hallo i bims"
|
||||
'';
|
||||
};
|
||||
```
|
||||
|
||||
This example creates an activation script snippet that is run after the `etc`
|
||||
snippet. The special variable `supportsDryActivation` can be set so the snippet
|
||||
is also run when `nixos-rebuild dry-activate` is run. To differentiate between
|
||||
real and dry activation, the `$NIXOS_ACTION` environment variable can be
|
||||
read which is set to `dry-activate` when a dry activation is done.
|
||||
|
||||
An activation script can write to special files instructing
|
||||
`switch-to-configuration` to restart/reload units. The script will take these
|
||||
requests into account and will incorperate the unit configuration as described
|
||||
above. This means that the activation script will "fake" a modified unit file
|
||||
and `switch-to-configuration` will act accordingly. By doing so, configuration
|
||||
like [systemd.services.\<name\>.restartIfChanged](#opt-systemd.services) is
|
||||
respected. Since the activation script is run **after** services are already
|
||||
stopped, [systemd.services.\<name\>.stopIfChanged](#opt-systemd.services)
|
||||
cannot be taken into account anymore and the unit is always restarted instead
|
||||
of being stopped and started afterwards.
|
||||
|
||||
The files that can be written to are `/run/nixos/activation-restart-list` and
|
||||
`/run/nixos/activation-reload-list` with their respective counterparts for
|
||||
dry activation being `/run/nixos/dry-activation-restart-list` and
|
||||
`/run/nixos/dry-activation-reload-list`. Those files can contain
|
||||
newline-separated lists of unit names where duplicates are being ignored. These
|
||||
files are not create automatically and activation scripts must take the
|
||||
possiblility into account that they have to create them first.
|
||||
|
||||
## NixOS snippets {#sec-activation-script-nixos-snippets}
|
||||
|
||||
There are some snippets NixOS enables by default because disabling them would
|
||||
most likely break you system. This section lists a few of them and what they
|
||||
do:
|
||||
|
||||
- `binsh` creates `/bin/sh` which points to the runtime shell
|
||||
- `etc` sets up the contents of `/etc`, this includes systemd units and
|
||||
excludes `/etc/passwd`, `/etc/group`, and `/etc/shadow` (which are managed by
|
||||
the `users` snippet)
|
||||
- `hostname` sets the system's hostname in the kernel (not in `/etc`)
|
||||
- `modprobe` sets the path to the `modprobe` binary for module auto-loading
|
||||
- `nix` prepares the nix store and adds a default initial channel
|
||||
- `specialfs` is responsible for mounting filesystems like `/proc` and `sys`
|
||||
- `users` creates and removes users and groups by managing `/etc/passwd`,
|
||||
`/etc/group` and `/etc/shadow`. This also creates home directories
|
||||
- `usrbinenv` creates `/usr/bin/env`
|
||||
- `var` creates some directories in `/var` that are not service-specific
|
||||
- `wrappers` creates setuid wrappers like `ping` and `sudo`
|
|
@ -12,6 +12,7 @@
|
|||
<xi:include href="../from_md/development/sources.chapter.xml" />
|
||||
<xi:include href="../from_md/development/writing-modules.chapter.xml" />
|
||||
<xi:include href="../from_md/development/building-parts.chapter.xml" />
|
||||
<xi:include href="../from_md/development/what-happens-during-a-system-switch.chapter.xml" />
|
||||
<xi:include href="../from_md/development/writing-documentation.chapter.xml" />
|
||||
<xi:include href="../from_md/development/building-nixos.chapter.xml" />
|
||||
<xi:include href="../from_md/development/nixos-tests.chapter.xml" />
|
||||
|
|
57
nixos/doc/manual/development/unit-handling.section.md
Normal file
57
nixos/doc/manual/development/unit-handling.section.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Unit handling {#sec-unit-handling}
|
||||
|
||||
To figure out what units need to be started/stopped/restarted/reloaded, the
|
||||
script first checks the current state of the system, similar to what `systemctl
|
||||
list-units` shows. For each of the units, the script goes through the following
|
||||
checks:
|
||||
|
||||
- Is the unit file still in the new system? If not, **stop** the service unless
|
||||
it sets `X-StopOnRemoval` in the `[Unit]` section to `false`.
|
||||
|
||||
- Is it a `.target` unit? If so, **start** it unless it sets
|
||||
`RefuseManualStart` in the `[Unit]` section to `true` or `X-OnlyManualStart`
|
||||
in the `[Unit]` section to `true`. Also **stop** the unit again unless it
|
||||
sets `X-StopOnReconfiguration` to `false`.
|
||||
|
||||
- Are the contents of the unit files different? They are compared by parsing
|
||||
them and comparing their contents. If they are different but only
|
||||
`X-Reload-Triggers` in the `[Unit]` section is changed, **reload** the unit.
|
||||
The NixOS module system allows setting these triggers with the option
|
||||
[systemd.services.\<name\>.reloadTriggers](#opt-systemd.services). If the
|
||||
unit files differ in any way, the following actions are performed:
|
||||
|
||||
- `.path` and `.slice` units are ignored. There is no need to restart them
|
||||
since changes in their values are applied by systemd when systemd is
|
||||
reloaded.
|
||||
|
||||
- `.mount` units are **reload**ed. These mostly come from the `/etc/fstab`
|
||||
parser.
|
||||
|
||||
- `.socket` units are currently ignored. This is to be fixed at a later
|
||||
point.
|
||||
|
||||
- The rest of the units (mostly `.service` units) are then **reload**ed if
|
||||
`X-ReloadIfChanged` in the `[Service]` section is set to `true` (exposed
|
||||
via [systemd.services.\<name\>.reloadIfChanged](#opt-systemd.services)).
|
||||
|
||||
- If the reload flag is not set, some more flags decide if the unit is
|
||||
skipped. These flags are `X-RestartIfChanged` in the `[Service]` section
|
||||
(exposed via
|
||||
[systemd.services.\<name\>.restartIfChanged](#opt-systemd.services)),
|
||||
`RefuseManualStop` in the `[Unit]` section, and `X-OnlyManualStart` in the
|
||||
`[Unit]` section.
|
||||
|
||||
- The rest of the behavior is decided whether the unit has `X-StopIfChanged`
|
||||
in the `[Service]` section set (exposed via
|
||||
[systemd.services.\<name\>.stopIfChanged](#opt-systemd.services)). This is
|
||||
set to `true` by default and must be explicitly turned off if not wanted.
|
||||
If the flag is enabled, the unit is **stop**ped and then **start**ed. If
|
||||
not, the unit is **restart**ed. The goal of the flag is to make sure that
|
||||
the new unit never runs in the old environment which is still in place
|
||||
before the activation script is run.
|
||||
|
||||
- The last thing that is taken into account is whether the unit is a service
|
||||
and socket-activated. Due to a bug, this is currently only done when
|
||||
`X-StopIfChanged` is set. If the unit is socket-activated, the socket is
|
||||
stopped and started, and the service is stopped and to be started by socket
|
||||
activation.
|
|
@ -0,0 +1,53 @@
|
|||
# What happens during a system switch? {#sec-switching-systems}
|
||||
|
||||
Running `nixos-rebuild switch` is one of the more common tasks under NixOS.
|
||||
This chapter explains some of the internals of this command to make it simpler
|
||||
for new module developers to configure their units correctly and to make it
|
||||
easier to understand what is happening and why for curious administrators.
|
||||
|
||||
`nixos-rebuild`, like many deployment solutions, calls `switch-to-configuration`
|
||||
which resides in a NixOS system at `$out/bin/switch-to-configuration`. The
|
||||
script is called with the action that is to be performed like `switch`, `test`,
|
||||
`boot`. There is also the `dry-activate` action which does not really perform
|
||||
the actions but rather prints what it would do if you called it with `test`.
|
||||
This feature can be used to check what service states would be changed if the
|
||||
configuration was switched to.
|
||||
|
||||
If the action is `switch` or `boot`, the bootloader is updated first so the
|
||||
configuration will be the next one to boot. Unless `NIXOS_NO_SYNC` is set to
|
||||
`1`, `/nix/store` is synced to disk.
|
||||
|
||||
If the action is `switch` or `test`, the currently running system is inspected
|
||||
and the actions to switch to the new system are calculated. This process takes
|
||||
two data sources into account: `/etc/fstab` and the current systemd status.
|
||||
Mounts and swaps are read from `/etc/fstab` and the corresponding actions are
|
||||
generated. If a new mount is added, for example, the proper `.mount` unit is
|
||||
marked to be started. The current systemd state is inspected, the difference
|
||||
between the current system and the desired configuration is calculated and
|
||||
actions are generated to get to this state. There are a lot of nuances that can
|
||||
be controlled by the units which are explained here.
|
||||
|
||||
After calculating what should be done, the actions are carried out. The order
|
||||
of actions is always the same:
|
||||
- Stop units (`systemctl stop`)
|
||||
- Run activation script (`$out/activate`)
|
||||
- See if the activation script requested more units to restart
|
||||
- Restart systemd if needed (`systemd daemon-reexec`)
|
||||
- Forget about the failed state of units (`systemctl reset-failed`)
|
||||
- Reload systemd (`systemctl daemon-reload`)
|
||||
- Reload systemd user instances (`systemctl --user daemon-reload`)
|
||||
- Set up tmpfiles (`systemd-tmpfiles --create`)
|
||||
- Reload units (`systemctl reload`)
|
||||
- Restart units (`systemctl restart`)
|
||||
- Start units (`systemctl start`)
|
||||
- Inspect what changed during these actions and print units that failed and
|
||||
that were newly started
|
||||
|
||||
Most of these actions are either self-explaining but some of them have to do
|
||||
with our units or the activation script. For this reason, these topics are
|
||||
explained in the next sections.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="unit-handling.section.xml" />
|
||||
<xi:include href="activation-script.section.xml" />
|
||||
```
|
|
@ -0,0 +1,150 @@
|
|||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-activation-script">
|
||||
<title>Activation script</title>
|
||||
<para>
|
||||
The activation script is a bash script called to activate the new
|
||||
configuration which resides in a NixOS system in
|
||||
<literal>$out/activate</literal>. Since its contents depend on your
|
||||
system configuration, the contents may differ. This chapter explains
|
||||
how the script works in general and some common NixOS snippets.
|
||||
Please be aware that the script is executed on every boot and system
|
||||
switch, so tasks that can be performed in other places should be
|
||||
performed there (for example letting a directory of a service be
|
||||
created by systemd using mechanisms like
|
||||
<literal>StateDirectory</literal>,
|
||||
<literal>CacheDirectory</literal>, … or if that’s not possible using
|
||||
<literal>preStart</literal> of the service).
|
||||
</para>
|
||||
<para>
|
||||
Activation scripts are defined as snippets using
|
||||
<xref linkend="opt-system.activationScripts" />. They can either be
|
||||
a simple multiline string or an attribute set that can depend on
|
||||
other snippets. The builder for the activation script will take
|
||||
these dependencies into account and order the snippets accordingly.
|
||||
As a simple example:
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
system.activationScripts.my-activation-script = {
|
||||
deps = [ "etc" ];
|
||||
# supportsDryActivation = true;
|
||||
text = ''
|
||||
echo "Hallo i bims"
|
||||
'';
|
||||
};
|
||||
</programlisting>
|
||||
<para>
|
||||
This example creates an activation script snippet that is run after
|
||||
the <literal>etc</literal> snippet. The special variable
|
||||
<literal>supportsDryActivation</literal> can be set so the snippet
|
||||
is also run when <literal>nixos-rebuild dry-activate</literal> is
|
||||
run. To differentiate between real and dry activation, the
|
||||
<literal>$NIXOS_ACTION</literal> environment variable can be read
|
||||
which is set to <literal>dry-activate</literal> when a dry
|
||||
activation is done.
|
||||
</para>
|
||||
<para>
|
||||
An activation script can write to special files instructing
|
||||
<literal>switch-to-configuration</literal> to restart/reload units.
|
||||
The script will take these requests into account and will
|
||||
incorperate the unit configuration as described above. This means
|
||||
that the activation script will <quote>fake</quote> a modified unit
|
||||
file and <literal>switch-to-configuration</literal> will act
|
||||
accordingly. By doing so, configuration like
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.restartIfChanged</link>
|
||||
is respected. Since the activation script is run
|
||||
<emphasis role="strong">after</emphasis> services are already
|
||||
stopped,
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.stopIfChanged</link>
|
||||
cannot be taken into account anymore and the unit is always
|
||||
restarted instead of being stopped and started afterwards.
|
||||
</para>
|
||||
<para>
|
||||
The files that can be written to are
|
||||
<literal>/run/nixos/activation-restart-list</literal> and
|
||||
<literal>/run/nixos/activation-reload-list</literal> with their
|
||||
respective counterparts for dry activation being
|
||||
<literal>/run/nixos/dry-activation-restart-list</literal> and
|
||||
<literal>/run/nixos/dry-activation-reload-list</literal>. Those
|
||||
files can contain newline-separated lists of unit names where
|
||||
duplicates are being ignored. These files are not create
|
||||
automatically and activation scripts must take the possiblility into
|
||||
account that they have to create them first.
|
||||
</para>
|
||||
<section xml:id="sec-activation-script-nixos-snippets">
|
||||
<title>NixOS snippets</title>
|
||||
<para>
|
||||
There are some snippets NixOS enables by default because disabling
|
||||
them would most likely break you system. This section lists a few
|
||||
of them and what they do:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>binsh</literal> creates <literal>/bin/sh</literal>
|
||||
which points to the runtime shell
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>etc</literal> sets up the contents of
|
||||
<literal>/etc</literal>, this includes systemd units and
|
||||
excludes <literal>/etc/passwd</literal>,
|
||||
<literal>/etc/group</literal>, and
|
||||
<literal>/etc/shadow</literal> (which are managed by the
|
||||
<literal>users</literal> snippet)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>hostname</literal> sets the system’s hostname in the
|
||||
kernel (not in <literal>/etc</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>modprobe</literal> sets the path to the
|
||||
<literal>modprobe</literal> binary for module auto-loading
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>nix</literal> prepares the nix store and adds a
|
||||
default initial channel
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>specialfs</literal> is responsible for mounting
|
||||
filesystems like <literal>/proc</literal> and
|
||||
<literal>sys</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>users</literal> creates and removes users and groups
|
||||
by managing <literal>/etc/passwd</literal>,
|
||||
<literal>/etc/group</literal> and
|
||||
<literal>/etc/shadow</literal>. This also creates home
|
||||
directories
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>usrbinenv</literal> creates
|
||||
<literal>/usr/bin/env</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>var</literal> creates some directories in
|
||||
<literal>/var</literal> that are not service-specific
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>wrappers</literal> creates setuid wrappers like
|
||||
<literal>ping</literal> and <literal>sudo</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
119
nixos/doc/manual/from_md/development/unit-handling.section.xml
Normal file
119
nixos/doc/manual/from_md/development/unit-handling.section.xml
Normal file
|
@ -0,0 +1,119 @@
|
|||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-unit-handling">
|
||||
<title>Unit handling</title>
|
||||
<para>
|
||||
To figure out what units need to be
|
||||
started/stopped/restarted/reloaded, the script first checks the
|
||||
current state of the system, similar to what
|
||||
<literal>systemctl list-units</literal> shows. For each of the
|
||||
units, the script goes through the following checks:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Is the unit file still in the new system? If not,
|
||||
<emphasis role="strong">stop</emphasis> the service unless it
|
||||
sets <literal>X-StopOnRemoval</literal> in the
|
||||
<literal>[Unit]</literal> section to <literal>false</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Is it a <literal>.target</literal> unit? If so,
|
||||
<emphasis role="strong">start</emphasis> it unless it sets
|
||||
<literal>RefuseManualStart</literal> in the
|
||||
<literal>[Unit]</literal> section to <literal>true</literal> or
|
||||
<literal>X-OnlyManualStart</literal> in the
|
||||
<literal>[Unit]</literal> section to <literal>true</literal>.
|
||||
Also <emphasis role="strong">stop</emphasis> the unit again
|
||||
unless it sets <literal>X-StopOnReconfiguration</literal> to
|
||||
<literal>false</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Are the contents of the unit files different? They are compared
|
||||
by parsing them and comparing their contents. If they are
|
||||
different but only <literal>X-Reload-Triggers</literal> in the
|
||||
<literal>[Unit]</literal> section is changed,
|
||||
<emphasis role="strong">reload</emphasis> the unit. The NixOS
|
||||
module system allows setting these triggers with the option
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.reloadTriggers</link>.
|
||||
If the unit files differ in any way, the following actions are
|
||||
performed:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>.path</literal> and <literal>.slice</literal> units
|
||||
are ignored. There is no need to restart them since changes
|
||||
in their values are applied by systemd when systemd is
|
||||
reloaded.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>.mount</literal> units are
|
||||
<emphasis role="strong">reload</emphasis>ed. These mostly
|
||||
come from the <literal>/etc/fstab</literal> parser.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>.socket</literal> units are currently ignored. This
|
||||
is to be fixed at a later point.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The rest of the units (mostly <literal>.service</literal>
|
||||
units) are then <emphasis role="strong">reload</emphasis>ed
|
||||
if <literal>X-ReloadIfChanged</literal> in the
|
||||
<literal>[Service]</literal> section is set to
|
||||
<literal>true</literal> (exposed via
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.reloadIfChanged</link>).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
If the reload flag is not set, some more flags decide if the
|
||||
unit is skipped. These flags are
|
||||
<literal>X-RestartIfChanged</literal> in the
|
||||
<literal>[Service]</literal> section (exposed via
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.restartIfChanged</link>),
|
||||
<literal>RefuseManualStop</literal> in the
|
||||
<literal>[Unit]</literal> section, and
|
||||
<literal>X-OnlyManualStart</literal> in the
|
||||
<literal>[Unit]</literal> section.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The rest of the behavior is decided whether the unit has
|
||||
<literal>X-StopIfChanged</literal> in the
|
||||
<literal>[Service]</literal> section set (exposed via
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.stopIfChanged</link>).
|
||||
This is set to <literal>true</literal> by default and must
|
||||
be explicitly turned off if not wanted. If the flag is
|
||||
enabled, the unit is
|
||||
<emphasis role="strong">stop</emphasis>ped and then
|
||||
<emphasis role="strong">start</emphasis>ed. If not, the unit
|
||||
is <emphasis role="strong">restart</emphasis>ed. The goal of
|
||||
the flag is to make sure that the new unit never runs in the
|
||||
old environment which is still in place before the
|
||||
activation script is run.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The last thing that is taken into account is whether the
|
||||
unit is a service and socket-activated. Due to a bug, this
|
||||
is currently only done when
|
||||
<literal>X-StopIfChanged</literal> is set. If the unit is
|
||||
socket-activated, the socket is stopped and started, and the
|
||||
service is stopped and to be started by socket activation.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
|
@ -0,0 +1,122 @@
|
|||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="sec-switching-systems">
|
||||
<title>What happens during a system switch?</title>
|
||||
<para>
|
||||
Running <literal>nixos-rebuild switch</literal> is one of the more
|
||||
common tasks under NixOS. This chapter explains some of the
|
||||
internals of this command to make it simpler for new module
|
||||
developers to configure their units correctly and to make it easier
|
||||
to understand what is happening and why for curious administrators.
|
||||
</para>
|
||||
<para>
|
||||
<literal>nixos-rebuild</literal>, like many deployment solutions,
|
||||
calls <literal>switch-to-configuration</literal> which resides in a
|
||||
NixOS system at <literal>$out/bin/switch-to-configuration</literal>.
|
||||
The script is called with the action that is to be performed like
|
||||
<literal>switch</literal>, <literal>test</literal>,
|
||||
<literal>boot</literal>. There is also the
|
||||
<literal>dry-activate</literal> action which does not really perform
|
||||
the actions but rather prints what it would do if you called it with
|
||||
<literal>test</literal>. This feature can be used to check what
|
||||
service states would be changed if the configuration was switched
|
||||
to.
|
||||
</para>
|
||||
<para>
|
||||
If the action is <literal>switch</literal> or
|
||||
<literal>boot</literal>, the bootloader is updated first so the
|
||||
configuration will be the next one to boot. Unless
|
||||
<literal>NIXOS_NO_SYNC</literal> is set to <literal>1</literal>,
|
||||
<literal>/nix/store</literal> is synced to disk.
|
||||
</para>
|
||||
<para>
|
||||
If the action is <literal>switch</literal> or
|
||||
<literal>test</literal>, the currently running system is inspected
|
||||
and the actions to switch to the new system are calculated. This
|
||||
process takes two data sources into account:
|
||||
<literal>/etc/fstab</literal> and the current systemd status. Mounts
|
||||
and swaps are read from <literal>/etc/fstab</literal> and the
|
||||
corresponding actions are generated. If a new mount is added, for
|
||||
example, the proper <literal>.mount</literal> unit is marked to be
|
||||
started. The current systemd state is inspected, the difference
|
||||
between the current system and the desired configuration is
|
||||
calculated and actions are generated to get to this state. There are
|
||||
a lot of nuances that can be controlled by the units which are
|
||||
explained here.
|
||||
</para>
|
||||
<para>
|
||||
After calculating what should be done, the actions are carried out.
|
||||
The order of actions is always the same:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Stop units (<literal>systemctl stop</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Run activation script (<literal>$out/activate</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
See if the activation script requested more units to restart
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Restart systemd if needed
|
||||
(<literal>systemd daemon-reexec</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Forget about the failed state of units
|
||||
(<literal>systemctl reset-failed</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Reload systemd (<literal>systemctl daemon-reload</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Reload systemd user instances
|
||||
(<literal>systemctl --user daemon-reload</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Set up tmpfiles (<literal>systemd-tmpfiles --create</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Reload units (<literal>systemctl reload</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Restart units (<literal>systemctl restart</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Start units (<literal>systemctl start</literal>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Inspect what changed during these actions and print units that
|
||||
failed and that were newly started
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
Most of these actions are either self-explaining but some of them
|
||||
have to do with our units or the activation script. For this reason,
|
||||
these topics are explained in the next sections.
|
||||
</para>
|
||||
<xi:include href="unit-handling.section.xml" />
|
||||
<xi:include href="activation-script.section.xml" />
|
||||
</chapter>
|
|
@ -42,6 +42,14 @@
|
|||
upgrade notes</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
systemd services can now set
|
||||
<link linkend="opt-systemd.services">systemd.services.<name>.reloadTriggers</link>
|
||||
instead of <literal>reloadIfChanged</literal> for a more
|
||||
granular distinction between reloads and restarts.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-22.05-new-services">
|
||||
|
@ -550,6 +558,15 @@
|
|||
honors <literal>restartIfChanged</literal> and
|
||||
<literal>reloadIfChanged</literal> of the units.
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Preferring to reload instead of restarting can still
|
||||
be achieved using
|
||||
<literal>/run/nixos/activation-reload-list</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
|
|
|
@ -17,6 +17,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||
Migrations may take a while, see the [changelog](https://docs.mattermost.com/install/self-managed-changelog.html#release-v6-3-extended-support-release)
|
||||
and [important upgrade notes](https://docs.mattermost.com/upgrade/important-upgrade-notes.html).
|
||||
|
||||
- systemd services can now set [systemd.services.\<name\>.reloadTriggers](#opt-systemd.services) instead of `reloadIfChanged` for a more granular distinction between reloads and restarts.
|
||||
|
||||
## New Services {#sec-release-22.05-new-services}
|
||||
|
||||
- [aesmd](https://github.com/intel/linux-sgx#install-the-intelr-sgx-psw), the Intel SGX Architectural Enclave Service Manager. Available as [services.aesmd](#opt-services.aesmd.enable).
|
||||
|
@ -179,6 +181,7 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||
|
||||
- `switch-to-configuration` (the script that is run when running `nixos-rebuild switch` for example) has been reworked
|
||||
* The interface that allows activation scripts to restart units has been streamlined. Restarting and reloading is now done by a single file `/run/nixos/activation-restart-list` that honors `restartIfChanged` and `reloadIfChanged` of the units.
|
||||
* Preferring to reload instead of restarting can still be achieved using `/run/nixos/activation-reload-list`.
|
||||
* The script now uses a proper ini-file parser to parse systemd units. Some values are now only searched in one section instead of in the entire unit. This is only relevant for units that don't use the NixOS systemd moule.
|
||||
* `RefuseManualStop`, `X-OnlyManualStart`, `X-StopOnRemoval`, `X-StopOnReconfiguration` are only searched in the `[Unit]` section
|
||||
* `X-ReloadIfChanged`, `X-RestartIfChanged`, `X-StopIfChanged` are only searched in the `[Service]` section
|
||||
|
|
|
@ -201,6 +201,17 @@ in rec {
|
|||
'';
|
||||
};
|
||||
|
||||
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;
|
||||
|
@ -338,6 +349,11 @@ in rec {
|
|||
configuration switch if its definition has changed. If
|
||||
enabled, the value of <option>restartIfChanged</option> is
|
||||
ignored.
|
||||
|
||||
This option should not be used anymore in favor of
|
||||
<option>reloadTriggers</option> which allows more granular
|
||||
control of when a service is reloaded and when a service
|
||||
is restarted.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -595,6 +595,7 @@
|
|||
./services/misc/redmine.nix
|
||||
./services/misc/rippled.nix
|
||||
./services/misc/ripple-data-api.nix
|
||||
./services/misc/rmfakecloud.nix
|
||||
./services/misc/serviio.nix
|
||||
./services/misc/safeeyes.nix
|
||||
./services/misc/sdrplay.nix
|
||||
|
@ -759,7 +760,6 @@
|
|||
./services/networking/go-neb.nix
|
||||
./services/networking/go-shadowsocks2.nix
|
||||
./services/networking/gobgpd.nix
|
||||
./services/networking/gogoclient.nix
|
||||
./services/networking/gvpe.nix
|
||||
./services/networking/hans.nix
|
||||
./services/networking/haproxy.nix
|
||||
|
|
|
@ -90,6 +90,8 @@ with lib;
|
|||
|
||||
(mkRemovedOptionModule [ "services" "shellinabox" ] "The corresponding package was removed from nixpkgs.")
|
||||
|
||||
(mkRemovedOptionModule [ "services" "gogoclient" ] "The corresponding package was removed from nixpkgs.")
|
||||
|
||||
# Do NOT add any option renames here, see top of the file
|
||||
];
|
||||
}
|
||||
|
|
147
nixos/modules/services/misc/rmfakecloud.nix
Normal file
147
nixos/modules/services/misc/rmfakecloud.nix
Normal file
|
@ -0,0 +1,147 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.rmfakecloud;
|
||||
serviceDataDir = "/var/lib/rmfakecloud";
|
||||
|
||||
in {
|
||||
options = {
|
||||
services.rmfakecloud = {
|
||||
enable = mkEnableOption "rmfakecloud remarkable self-hosted cloud";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.rmfakecloud;
|
||||
defaultText = literalExpression "pkgs.rmfakecloud";
|
||||
description = ''
|
||||
rmfakecloud package to use.
|
||||
|
||||
The default does not include the web user interface.
|
||||
'';
|
||||
};
|
||||
|
||||
storageUrl = mkOption {
|
||||
type = types.str;
|
||||
example = "https://local.appspot.com";
|
||||
description = ''
|
||||
URL used by the tablet to access the rmfakecloud service.
|
||||
'';
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 3000;
|
||||
description = ''
|
||||
Listening port number.
|
||||
'';
|
||||
};
|
||||
|
||||
logLevel = mkOption {
|
||||
type = types.enum [ "info" "debug" "warn" "error" ];
|
||||
default = "info";
|
||||
description = ''
|
||||
Logging level.
|
||||
'';
|
||||
};
|
||||
|
||||
extraSettings = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
example = { DATADIR = "/custom/path/for/rmfakecloud/data"; };
|
||||
description = ''
|
||||
Extra settings in the form of a set of key-value pairs.
|
||||
For tokens and secrets, use `environmentFile` instead.
|
||||
|
||||
Available settings are listed on
|
||||
https://ddvk.github.io/rmfakecloud/install/configuration/.
|
||||
'';
|
||||
};
|
||||
|
||||
environmentFile = mkOption {
|
||||
type = with types; nullOr path;
|
||||
default = null;
|
||||
example = "/etc/secrets/rmfakecloud.env";
|
||||
description = ''
|
||||
Path to an environment file loaded for the rmfakecloud service.
|
||||
|
||||
This can be used to securely store tokens and secrets outside of the
|
||||
world-readable Nix store. Since this file is read by systemd, it may
|
||||
have permission 0400 and be owned by root.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.rmfakecloud = {
|
||||
description = "rmfakecloud remarkable self-hosted cloud";
|
||||
|
||||
environment = {
|
||||
STORAGE_URL = cfg.storageUrl;
|
||||
PORT = toString cfg.port;
|
||||
LOGLEVEL = cfg.logLevel;
|
||||
} // cfg.extraSettings;
|
||||
|
||||
preStart = ''
|
||||
# Generate the secret key used to sign client session tokens.
|
||||
# Replacing it invalidates the previously established sessions.
|
||||
if [ -z "$JWT_SECRET_KEY" ] && [ ! -f jwt_secret_key ]; then
|
||||
(umask 077; touch jwt_secret_key)
|
||||
cat /dev/urandom | tr -cd '[:alnum:]' | head -c 48 >> jwt_secret_key
|
||||
fi
|
||||
'';
|
||||
|
||||
script = ''
|
||||
if [ -z "$JWT_SECRET_KEY" ]; then
|
||||
export JWT_SECRET_KEY="$(cat jwt_secret_key)"
|
||||
fi
|
||||
|
||||
${cfg.package}/bin/rmfakecloud
|
||||
'';
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
|
||||
EnvironmentFile =
|
||||
mkIf (cfg.environmentFile != null) cfg.environmentFile;
|
||||
|
||||
AmbientCapabilities =
|
||||
mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||
|
||||
DynamicUser = true;
|
||||
PrivateDevices = true;
|
||||
ProtectHome = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectControlGroups = true;
|
||||
CapabilityBoundingSet = [ "" ];
|
||||
DevicePolicy = "closed";
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
ProtectClock = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectProc = "invisible";
|
||||
ProcSubset = "pid";
|
||||
RemoveIPC = true;
|
||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictSUIDSGID = true;
|
||||
SystemCallArchitectures = "native";
|
||||
WorkingDirectory = serviceDataDir;
|
||||
StateDirectory = baseNameOf serviceDataDir;
|
||||
UMask = 0027;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ pacien ];
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.gogoclient;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
services.gogoclient = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Enable the gogoCLIENT IPv6 tunnel.
|
||||
'';
|
||||
};
|
||||
autorun = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to automatically start the tunnel.
|
||||
'';
|
||||
};
|
||||
|
||||
username = mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Your Gateway6 login name, if any.
|
||||
'';
|
||||
};
|
||||
|
||||
password = mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Path to a file (as a string), containing your gogoNET password, if any.
|
||||
'';
|
||||
};
|
||||
|
||||
server = mkOption {
|
||||
type = types.str;
|
||||
default = "anonymous.freenet6.net";
|
||||
example = "broker.freenet6.net";
|
||||
description = "The Gateway6 server to be used.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelModules = [ "tun" ];
|
||||
|
||||
networking.enableIPv6 = true;
|
||||
|
||||
systemd.services.gogoclient = {
|
||||
description = "ipv6 tunnel";
|
||||
|
||||
after = [ "network.target" ];
|
||||
requires = [ "network.target" ];
|
||||
|
||||
unitConfig.RequiresMountsFor = "/var/lib/gogoc";
|
||||
|
||||
script = let authMethod = if cfg.password == "" then "anonymous" else "any"; in ''
|
||||
mkdir -p -m 700 /var/lib/gogoc
|
||||
cat ${pkgs.gogoclient}/share/${pkgs.gogoclient.name}/gogoc.conf.sample | \
|
||||
${pkgs.gnused}/bin/sed \
|
||||
-e "s|^userid=|&${cfg.username}|" \
|
||||
-e "s|^passwd=|&${optionalString (cfg.password != "") "$(cat ${cfg.password})"}|" \
|
||||
-e "s|^server=.*|server=${cfg.server}|" \
|
||||
-e "s|^auth_method=.*|auth_method=${authMethod}|" \
|
||||
-e "s|^#log_file=|log_file=1|" > /var/lib/gogoc/gogoc.conf
|
||||
cd /var/lib/gogoc
|
||||
exec ${pkgs.gogoclient}/bin/gogoc -y -f /var/lib/gogoc/gogoc.conf
|
||||
'';
|
||||
} // optionalAttrs cfg.autorun {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Array::Compare;
|
||||
use Config::IniFiles;
|
||||
use File::Path qw(make_path);
|
||||
use File::Basename;
|
||||
use File::Slurp;
|
||||
use File::Slurp qw(read_file write_file edit_file);
|
||||
use Net::DBus;
|
||||
use Sys::Syslog qw(:standard :macros);
|
||||
use Cwd 'abs_path';
|
||||
|
@ -20,12 +21,19 @@ my $restartListFile = "/run/nixos/restart-list";
|
|||
my $reloadListFile = "/run/nixos/reload-list";
|
||||
|
||||
# Parse restart/reload requests by the activation script.
|
||||
# Activation scripts may write newline-separated units to this
|
||||
# Activation scripts may write newline-separated units to the restart
|
||||
# file and switch-to-configuration will handle them. While
|
||||
# `stopIfChanged = true` is ignored, switch-to-configuration will
|
||||
# handle `restartIfChanged = false` and `reloadIfChanged = true`.
|
||||
# This is the same as specifying a restart trigger in the NixOS module.
|
||||
#
|
||||
# The reload file asks the script to reload a unit. This is the same as
|
||||
# specifying a reload trigger in the NixOS module and can be ignored if
|
||||
# the unit is restarted in this activation.
|
||||
my $restartByActivationFile = "/run/nixos/activation-restart-list";
|
||||
my $reloadByActivationFile = "/run/nixos/activation-reload-list";
|
||||
my $dryRestartByActivationFile = "/run/nixos/dry-activation-restart-list";
|
||||
my $dryReloadByActivationFile = "/run/nixos/dry-activation-reload-list";
|
||||
|
||||
make_path("/run/nixos", { mode => oct(755) });
|
||||
|
||||
|
@ -131,6 +139,10 @@ sub parseSystemdIni {
|
|||
|
||||
# Copy over all sections
|
||||
foreach my $sectionName (keys %fileContents) {
|
||||
if ($sectionName eq "Install") {
|
||||
# Skip the [Install] section because it has no relevant keys for us
|
||||
next;
|
||||
}
|
||||
# Copy over all keys
|
||||
foreach my $iniKey (keys %{$fileContents{$sectionName}}) {
|
||||
# Ensure the value is an array so it's easier to work with
|
||||
|
@ -192,16 +204,92 @@ sub recordUnit {
|
|||
write_file($fn, { append => 1 }, "$unit\n") if $action ne "dry-activate";
|
||||
}
|
||||
|
||||
# As a fingerprint for determining whether a unit has changed, we use
|
||||
# its absolute path. If it has an override file, we append *its*
|
||||
# absolute path as well.
|
||||
sub fingerprintUnit {
|
||||
my ($s) = @_;
|
||||
return abs_path($s) . (-f "${s}.d/overrides.conf" ? " " . abs_path "${s}.d/overrides.conf" : "");
|
||||
# The opposite of recordUnit, removes a unit name from a file
|
||||
sub unrecord_unit {
|
||||
my ($fn, $unit) = @_;
|
||||
edit_file { s/^$unit\n//msx } $fn if $action ne "dry-activate";
|
||||
}
|
||||
|
||||
# Compare the contents of two unit files and return whether the unit
|
||||
# needs to be restarted or reloaded. If the units differ, the service
|
||||
# is restarted unless the only difference is `X-Reload-Triggers` in the
|
||||
# `Unit` section. If this is the only modification, the unit is reloaded
|
||||
# instead of restarted.
|
||||
# Returns:
|
||||
# - 0 if the units are equal
|
||||
# - 1 if the units are different and a restart action is required
|
||||
# - 2 if the units are different and a reload action is required
|
||||
sub compare_units {
|
||||
my ($old_unit, $new_unit) = @_;
|
||||
my $comp = Array::Compare->new;
|
||||
my $ret = 0;
|
||||
|
||||
# Comparison hash for the sections
|
||||
my %section_cmp = map { $_ => 1 } keys %{$new_unit};
|
||||
# Iterate over the sections
|
||||
foreach my $section_name (keys %{$old_unit}) {
|
||||
# Missing section in the new unit?
|
||||
if (not exists $section_cmp{$section_name}) {
|
||||
if ($section_name eq 'Unit' and %{$old_unit->{'Unit'}} == 1 and defined(%{$old_unit->{'Unit'}}{'X-Reload-Triggers'})) {
|
||||
# If a new [Unit] section was removed that only contained X-Reload-Triggers,
|
||||
# do nothing.
|
||||
next;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
delete $section_cmp{$section_name};
|
||||
# Comparison hash for the section contents
|
||||
my %ini_cmp = map { $_ => 1 } keys %{$new_unit->{$section_name}};
|
||||
# Iterate over the keys of the section
|
||||
foreach my $ini_key (keys %{$old_unit->{$section_name}}) {
|
||||
delete $ini_cmp{$ini_key};
|
||||
my @old_value = @{$old_unit->{$section_name}{$ini_key}};
|
||||
# If the key is missing in the new unit, they are different...
|
||||
if (not $new_unit->{$section_name}{$ini_key}) {
|
||||
# ... unless the key that is now missing was the reload trigger
|
||||
if ($section_name eq 'Unit' and $ini_key eq 'X-Reload-Triggers') {
|
||||
next;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
my @new_value = @{$new_unit->{$section_name}{$ini_key}};
|
||||
# If the contents are different, the units are different
|
||||
if (not $comp->compare(\@old_value, \@new_value)) {
|
||||
# Check if only the reload triggers changed
|
||||
if ($section_name eq 'Unit' and $ini_key eq 'X-Reload-Triggers') {
|
||||
$ret = 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
# A key was introduced that was missing in the old unit
|
||||
if (%ini_cmp) {
|
||||
if ($section_name eq 'Unit' and %ini_cmp == 1 and defined($ini_cmp{'X-Reload-Triggers'})) {
|
||||
# If the newly introduced key was the reload triggers, reload the unit
|
||||
$ret = 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
# A section was introduced that was missing in the old unit
|
||||
if (%section_cmp) {
|
||||
if (%section_cmp == 1 and defined($section_cmp{'Unit'}) and %{$new_unit->{'Unit'}} == 1 and defined(%{$new_unit->{'Unit'}}{'X-Reload-Triggers'})) {
|
||||
# If a new [Unit] section was introduced that only contains X-Reload-Triggers,
|
||||
# reload instead of restarting
|
||||
$ret = 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub handleModifiedUnit {
|
||||
my ($unit, $baseName, $newUnitFile, $activePrev, $unitsToStop, $unitsToStart, $unitsToReload, $unitsToRestart, $unitsToSkip) = @_;
|
||||
my ($unit, $baseName, $newUnitFile, $newUnitInfo, $activePrev, $unitsToStop, $unitsToStart, $unitsToReload, $unitsToRestart, $unitsToSkip) = @_;
|
||||
|
||||
if ($unit eq "sysinit.target" || $unit eq "basic.target" || $unit eq "multi-user.target" || $unit eq "graphical.target" || $unit =~ /\.path$/ || $unit =~ /\.slice$/) {
|
||||
# Do nothing. These cannot be restarted directly.
|
||||
|
@ -219,8 +307,8 @@ sub handleModifiedUnit {
|
|||
# Revert of the attempt: https://github.com/NixOS/nixpkgs/pull/147609
|
||||
# More details: https://github.com/NixOS/nixpkgs/issues/74899#issuecomment-981142430
|
||||
} else {
|
||||
my %unitInfo = parseUnit($newUnitFile);
|
||||
if (parseSystemdBool(\%unitInfo, "Service", "X-ReloadIfChanged", 0)) {
|
||||
my %unitInfo = $newUnitInfo ? %{$newUnitInfo} : parseUnit($newUnitFile);
|
||||
if (parseSystemdBool(\%unitInfo, "Service", "X-ReloadIfChanged", 0) and not $unitsToRestart->{$unit} and not $unitsToStop->{$unit}) {
|
||||
$unitsToReload->{$unit} = 1;
|
||||
recordUnit($reloadListFile, $unit);
|
||||
}
|
||||
|
@ -234,6 +322,11 @@ sub handleModifiedUnit {
|
|||
# stopped and started.
|
||||
$unitsToRestart->{$unit} = 1;
|
||||
recordUnit($restartListFile, $unit);
|
||||
# Remove from units to reload so we don't restart and reload
|
||||
if ($unitsToReload->{$unit}) {
|
||||
delete $unitsToReload->{$unit};
|
||||
unrecord_unit($reloadListFile, $unit);
|
||||
}
|
||||
} else {
|
||||
# If this unit is socket-activated, then stop the
|
||||
# socket unit(s) as well, and restart the
|
||||
|
@ -254,6 +347,11 @@ sub handleModifiedUnit {
|
|||
recordUnit($startListFile, $socket);
|
||||
$socketActivated = 1;
|
||||
}
|
||||
# Remove from units to reload so we don't restart and reload
|
||||
if ($unitsToReload->{$unit}) {
|
||||
delete $unitsToReload->{$unit};
|
||||
unrecord_unit($reloadListFile, $unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -268,6 +366,11 @@ sub handleModifiedUnit {
|
|||
}
|
||||
|
||||
$unitsToStop->{$unit} = 1;
|
||||
# Remove from units to reload so we don't restart and reload
|
||||
if ($unitsToReload->{$unit}) {
|
||||
delete $unitsToReload->{$unit};
|
||||
unrecord_unit($reloadListFile, $unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -344,8 +447,16 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
|||
}
|
||||
}
|
||||
|
||||
elsif (fingerprintUnit($prevUnitFile) ne fingerprintUnit($newUnitFile)) {
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, $activePrev, \%unitsToStop, \%unitsToStart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
else {
|
||||
my %old_unit_info = parseUnit($prevUnitFile);
|
||||
my %new_unit_info = parseUnit($newUnitFile);
|
||||
my $diff = compare_units(\%old_unit_info, \%new_unit_info);
|
||||
if ($diff eq 1) {
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, \%new_unit_info, $activePrev, \%unitsToStop, \%unitsToStart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
} elsif ($diff eq 2 and not $unitsToRestart{$unit}) {
|
||||
$unitsToReload{$unit} = 1;
|
||||
recordUnit($reloadListFile, $unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -361,17 +472,6 @@ sub pathToUnitName {
|
|||
return $escaped;
|
||||
}
|
||||
|
||||
sub unique {
|
||||
my %seen;
|
||||
my @res;
|
||||
foreach my $name (@_) {
|
||||
next if $seen{$name};
|
||||
$seen{$name} = 1;
|
||||
push @res, $name;
|
||||
}
|
||||
return @res;
|
||||
}
|
||||
|
||||
# Compare the previous and new fstab to figure out which filesystems
|
||||
# need a remount or need to be unmounted. New filesystems are mounted
|
||||
# automatically by starting local-fs.target. FIXME: might be nicer if
|
||||
|
@ -407,8 +507,12 @@ foreach my $device (keys %$prevSwaps) {
|
|||
# "systemctl stop" here because systemd has lots of alias
|
||||
# units that prevent a stop from actually calling
|
||||
# "swapoff".
|
||||
print STDERR "stopping swap device: $device\n";
|
||||
system("@utillinux@/sbin/swapoff", $device);
|
||||
if ($action ne "dry-activate") {
|
||||
print STDERR "would stop swap device: $device\n";
|
||||
} else {
|
||||
print STDERR "stopping swap device: $device\n";
|
||||
system("@utillinux@/sbin/swapoff", $device);
|
||||
}
|
||||
}
|
||||
# FIXME: update swap options (i.e. its priority).
|
||||
}
|
||||
|
@ -469,10 +573,20 @@ if ($action eq "dry-activate") {
|
|||
next;
|
||||
}
|
||||
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, $activePrev, \%unitsToRestart, \%unitsToRestart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, undef, $activePrev, \%unitsToRestart, \%unitsToRestart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
}
|
||||
unlink($dryRestartByActivationFile);
|
||||
|
||||
foreach (split('\n', read_file($dryReloadByActivationFile, err_mode => 'quiet') // "")) {
|
||||
my $unit = $_;
|
||||
|
||||
if (defined($activePrev->{$unit}) and not $unitsToRestart{$unit} and not $unitsToStop{$unit}) {
|
||||
$unitsToReload{$unit} = 1;
|
||||
recordUnit($reloadListFile, $unit);
|
||||
}
|
||||
}
|
||||
unlink($dryReloadByActivationFile);
|
||||
|
||||
print STDERR "would restart systemd\n" if $restartSystemd;
|
||||
print STDERR "would reload the following units: ", join(", ", sort(keys %unitsToReload)), "\n"
|
||||
if scalar(keys %unitsToReload) > 0;
|
||||
|
@ -525,11 +639,22 @@ foreach (split('\n', read_file($restartByActivationFile, err_mode => 'quiet') //
|
|||
next;
|
||||
}
|
||||
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, $activePrev, \%unitsToRestart, \%unitsToRestart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
handleModifiedUnit($unit, $baseName, $newUnitFile, undef, $activePrev, \%unitsToRestart, \%unitsToRestart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
|
||||
}
|
||||
# We can remove the file now because it has been propagated to the other restart/reload files
|
||||
unlink($restartByActivationFile);
|
||||
|
||||
foreach (split('\n', read_file($reloadByActivationFile, err_mode => 'quiet') // "")) {
|
||||
my $unit = $_;
|
||||
|
||||
if (defined($activePrev->{$unit}) and not $unitsToRestart{$unit} and not $unitsToStop{$unit}) {
|
||||
$unitsToReload{$unit} = 1;
|
||||
recordUnit($reloadListFile, $unit);
|
||||
}
|
||||
}
|
||||
# We can remove the file now because it has been propagated to the other reload file
|
||||
unlink($reloadByActivationFile);
|
||||
|
||||
# Restart systemd if necessary. Note that this is done using the
|
||||
# current version of systemd, just in case the new one has trouble
|
||||
# communicating with the running pid 1.
|
||||
|
|
|
@ -117,7 +117,7 @@ let
|
|||
configurationName = config.boot.loader.grub.configurationName;
|
||||
|
||||
# Needed by switch-to-configuration.
|
||||
perl = pkgs.perl.withPackages (p: with p; [ FileSlurp NetDBus XMLParser XMLTwig ConfigIniFiles ]);
|
||||
perl = pkgs.perl.withPackages (p: with p; [ ArrayCompare ConfigIniFiles FileSlurp NetDBus ]);
|
||||
};
|
||||
|
||||
# Handle assertions and warnings
|
||||
|
|
|
@ -243,6 +243,8 @@ let
|
|||
{ Requisite = toString config.requisite; }
|
||||
// optionalAttrs (config.restartTriggers != [])
|
||||
{ X-Restart-Triggers = toString config.restartTriggers; }
|
||||
// optionalAttrs (config.reloadTriggers != [])
|
||||
{ X-Reload-Triggers = toString config.reloadTriggers; }
|
||||
// optionalAttrs (config.description != "") {
|
||||
Description = config.description; }
|
||||
// optionalAttrs (config.documentation != []) {
|
||||
|
@ -917,6 +919,9 @@ in
|
|||
(optional hasDeprecated
|
||||
"Service '${name}.service' uses the attribute 'StartLimitInterval' in the Service section, which is deprecated. See https://github.com/NixOS/nixpkgs/issues/45786."
|
||||
)
|
||||
(optional (service.reloadIfChanged && service.reloadTriggers != [])
|
||||
"Service '${name}.service' has both 'reloadIfChanged' and 'reloadTriggers' set. This is probably not what you want, because 'reloadTriggers' behave the same whay as 'restartTriggers' if 'reloadIfChanged' is set."
|
||||
)
|
||||
]
|
||||
)
|
||||
cfg.services
|
||||
|
|
|
@ -18,6 +18,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.coreutils}/bin/true";
|
||||
ExecReload = "${pkgs.coreutils}/bin/true";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -70,6 +71,80 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
};
|
||||
};
|
||||
|
||||
simpleServiceWithExtraSection.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.packages = [ (pkgs.writeTextFile {
|
||||
name = "systemd-extra-section";
|
||||
destination = "/etc/systemd/system/test.service";
|
||||
text = ''
|
||||
[X-Test]
|
||||
X-Test-Value=a
|
||||
'';
|
||||
}) ];
|
||||
};
|
||||
|
||||
simpleServiceWithExtraSectionOtherName.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.packages = [ (pkgs.writeTextFile {
|
||||
name = "systemd-extra-section";
|
||||
destination = "/etc/systemd/system/test.service";
|
||||
text = ''
|
||||
[X-Test2]
|
||||
X-Test-Value=a
|
||||
'';
|
||||
}) ];
|
||||
};
|
||||
|
||||
simpleServiceWithInstallSection.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.packages = [ (pkgs.writeTextFile {
|
||||
name = "systemd-extra-section";
|
||||
destination = "/etc/systemd/system/test.service";
|
||||
text = ''
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
'';
|
||||
}) ];
|
||||
};
|
||||
|
||||
simpleServiceWithExtraKey.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.serviceConfig."X-Test" = "test";
|
||||
};
|
||||
|
||||
simpleServiceWithExtraKeyOtherValue.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.serviceConfig."X-Test" = "test2";
|
||||
};
|
||||
|
||||
simpleServiceWithExtraKeyOtherName.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.serviceConfig."X-Test2" = "test";
|
||||
};
|
||||
|
||||
simpleServiceReloadTrigger.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.reloadTriggers = [ "/dev/null" ];
|
||||
};
|
||||
|
||||
simpleServiceReloadTriggerModified.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.reloadTriggers = [ "/dev/zero" ];
|
||||
};
|
||||
|
||||
simpleServiceReloadTriggerModifiedAndSomethingElse.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test = {
|
||||
reloadTriggers = [ "/dev/zero" ];
|
||||
serviceConfig."X-Test" = "test";
|
||||
};
|
||||
};
|
||||
|
||||
simpleServiceReloadTriggerModifiedSomethingElse.configuration = {
|
||||
imports = [ simpleServiceNostop.configuration ];
|
||||
systemd.services.test.serviceConfig."X-Test" = "test";
|
||||
};
|
||||
|
||||
restart-and-reload-by-activation-script.configuration = {
|
||||
systemd.services = rec {
|
||||
simple-service = {
|
||||
|
@ -93,6 +168,17 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
no-restart-service = simple-service // {
|
||||
restartIfChanged = false;
|
||||
};
|
||||
|
||||
reload-triggers = simple-service // {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
reload-triggers-and-restart-by-as = simple-service;
|
||||
|
||||
reload-triggers-and-restart = simple-service // {
|
||||
stopIfChanged = false; # easier to check for this
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
system.activationScripts.restart-and-reload-test = {
|
||||
|
@ -101,19 +187,33 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
text = ''
|
||||
if [ "$NIXOS_ACTION" = dry-activate ]; then
|
||||
f=/run/nixos/dry-activation-restart-list
|
||||
g=/run/nixos/dry-activation-reload-list
|
||||
else
|
||||
f=/run/nixos/activation-restart-list
|
||||
g=/run/nixos/activation-reload-list
|
||||
fi
|
||||
cat <<EOF >> "$f"
|
||||
simple-service.service
|
||||
simple-restart-service.service
|
||||
simple-reload-service.service
|
||||
no-restart-service.service
|
||||
reload-triggers-and-restart-by-as.service
|
||||
EOF
|
||||
|
||||
cat <<EOF >> "$g"
|
||||
reload-triggers.service
|
||||
reload-triggers-and-restart-by-as.service
|
||||
reload-triggers-and-restart.service
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
restart-and-reload-by-activation-script-modified.configuration = {
|
||||
imports = [ restart-and-reload-by-activation-script.configuration ];
|
||||
systemd.services.reload-triggers-and-restart.serviceConfig.X-Modified = "test";
|
||||
};
|
||||
|
||||
mount.configuration = {
|
||||
systemd.mounts = [
|
||||
{
|
||||
|
@ -241,6 +341,8 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
raise Exception(f"Unexpected string '{needle}' was found")
|
||||
|
||||
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
machine.succeed(
|
||||
"${stderrRunner} ${originalSystem}/bin/switch-to-configuration test"
|
||||
)
|
||||
|
@ -379,6 +481,130 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
assert_contains(out, "Main PID:") # output of systemctl
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
with subtest("unit file parser"):
|
||||
# Switch to a well-known state
|
||||
switch_to_specialisation("${machine}", "simpleServiceNostop")
|
||||
|
||||
# Add a section
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithExtraSection")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Rename it
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithExtraSectionOtherName")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Remove it
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceNostop")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# [Install] section is ignored
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithInstallSection")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_lacks(out, "\nrestarting the following units:")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Add a key
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithExtraKey")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Change its value
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithExtraKeyOtherValue")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Rename it
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceWithExtraKeyOtherName")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Remove it
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceNostop")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Add a reload trigger
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceReloadTrigger")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_contains(out, "reloading the following units: test.service\n")
|
||||
assert_lacks(out, "\nrestarting the following units:")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Modify the reload trigger
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceReloadTriggerModified")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_contains(out, "reloading the following units: test.service\n")
|
||||
assert_lacks(out, "\nrestarting the following units:")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Modify the reload trigger and something else
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceReloadTriggerModifiedAndSomethingElse")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_contains(out, "\nrestarting the following units: test.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
# Remove the reload trigger
|
||||
out = switch_to_specialisation("${machine}", "simpleServiceReloadTriggerModifiedSomethingElse")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_lacks(out, "\nrestarting the following units:")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "the following new units were started:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
with subtest("restart and reload by activation script"):
|
||||
switch_to_specialisation("${machine}", "simpleServiceNorestart")
|
||||
out = switch_to_specialisation("${machine}", "restart-and-reload-by-activation-script")
|
||||
|
@ -386,23 +612,32 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_lacks(out, "reloading the following units:")
|
||||
assert_lacks(out, "restarting the following units:")
|
||||
assert_contains(out, "\nstarting the following units: no-restart-service.service, simple-reload-service.service, simple-restart-service.service, simple-service.service\n")
|
||||
assert_contains(out, "\nstarting the following units: no-restart-service.service, reload-triggers-and-restart-by-as.service, simple-reload-service.service, simple-restart-service.service, simple-service.service\n")
|
||||
assert_lacks(out, "as well:")
|
||||
# Switch to the same system where the example services get restarted
|
||||
# by the activation script
|
||||
# and reloaded by the activation script
|
||||
out = switch_to_specialisation("${machine}", "restart-and-reload-by-activation-script")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_contains(out, "reloading the following units: simple-reload-service.service\n")
|
||||
assert_contains(out, "restarting the following units: simple-restart-service.service, simple-service.service\n")
|
||||
assert_contains(out, "reloading the following units: reload-triggers-and-restart.service, reload-triggers.service, simple-reload-service.service\n")
|
||||
assert_contains(out, "restarting the following units: reload-triggers-and-restart-by-as.service, simple-restart-service.service, simple-service.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "as well:")
|
||||
# Switch to the same system and see if the service gets restarted when it's modified
|
||||
# while the fact that it's supposed to be reloaded by the activation script is ignored.
|
||||
out = switch_to_specialisation("${machine}", "restart-and-reload-by-activation-script-modified")
|
||||
assert_lacks(out, "stopping the following units:")
|
||||
assert_lacks(out, "NOT restarting the following changed units:")
|
||||
assert_contains(out, "reloading the following units: reload-triggers.service, simple-reload-service.service\n")
|
||||
assert_contains(out, "restarting the following units: reload-triggers-and-restart-by-as.service, reload-triggers-and-restart.service, simple-restart-service.service, simple-service.service\n")
|
||||
assert_lacks(out, "\nstarting the following units:")
|
||||
assert_lacks(out, "as well:")
|
||||
# The same, but in dry mode
|
||||
out = switch_to_specialisation("${machine}", "restart-and-reload-by-activation-script", action="dry-activate")
|
||||
assert_lacks(out, "would stop the following units:")
|
||||
assert_lacks(out, "would NOT stop the following changed units:")
|
||||
assert_contains(out, "would reload the following units: simple-reload-service.service\n")
|
||||
assert_contains(out, "would restart the following units: simple-restart-service.service, simple-service.service\n")
|
||||
assert_contains(out, "would reload the following units: reload-triggers.service, simple-reload-service.service\n")
|
||||
assert_contains(out, "would restart the following units: reload-triggers-and-restart-by-as.service, reload-triggers-and-restart.service, simple-restart-service.service, simple-service.service\n")
|
||||
assert_lacks(out, "\nwould start the following units:")
|
||||
assert_lacks(out, "as well:")
|
||||
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "indicator-sound-switcher";
|
||||
version = "2.3.6";
|
||||
version = "2.3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yktoo";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "APU8Y0xUhRd9RbMSG9TD0TBvFLu/VlLGauf56z8gZDw=";
|
||||
sha256 = "sha256-agzU3Z3E6NvCnlsz9L719LqMTm8EmYg3TY/2lWTYgKs=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
buildGoModule rec {
|
||||
pname = "erigon";
|
||||
version = "2021.09.04";
|
||||
version = "2022.01.02";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ledgerwatch";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0l0w1badhvlh1rgqzvlmy5k7xhb1nf4f5dmhkl935a5ila08aak3";
|
||||
sha256 = "sha256-PzLFwpLKPMV9J2+hqwFppdrFvGxyWpSzYDiQTWZXKco=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-i8BaT9C39tmHU3GGgd0hUB1PHXnoAdNYRIqZA1ggbjQ=";
|
||||
vendorSha256 = "sha256-YslMHpc3ApPiZOhNZrKoLaQcUWZwj7WLxmzYFyThnRo=";
|
||||
proxyVendor = true;
|
||||
|
||||
# Build errors in mdbx when format hardening is enabled:
|
||||
|
|
|
@ -4,21 +4,48 @@
|
|||
, llvmPackages
|
||||
, protobuf
|
||||
, rustPlatform
|
||||
, writeShellScriptBin
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "polkadot";
|
||||
version = "0.9.14";
|
||||
version = "0.9.16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "paritytech";
|
||||
repo = "polkadot";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-SCi+hpdMUTX1NLF1RUce0d/2G19sVfJ5IsmM1xcAUKo=";
|
||||
sha256 = "sha256-NXuYUmo80rrBZCcuISKon48SKyyJrkzCEhggxaJNfBM=";
|
||||
|
||||
# see the comment below on fakeGit for how this is used
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
( cd $out; git rev-parse --short HEAD > .git_commit )
|
||||
rm -rf $out/.git
|
||||
'';
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-ZcIsbMI96qX0LLJXmkCRS9g40ccZOH/upPbAA7XEZIw=";
|
||||
cargoSha256 = "sha256-PIORMTzQbMdlrKwuF4MiGrLlg2nQpgLRsaHHeiCbqrg=";
|
||||
|
||||
nativeBuildInputs = [ clang ];
|
||||
nativeBuildInputs =
|
||||
let
|
||||
# the build process of polkadot requires a .git folder in order to determine
|
||||
# the git commit hash that is being built and add it to the version string.
|
||||
# since having a .git folder introduces reproducibility issues to the nix
|
||||
# build, we check the git commit hash after fetching the source and save it
|
||||
# into a .git_commit file, and then delete the .git folder. then we create a
|
||||
# fake git command that will just return the contents of this file, which will
|
||||
# be used when the polkadot build calls `git rev-parse` to fetch the commit
|
||||
# hash.
|
||||
fakeGit = writeShellScriptBin "git" ''
|
||||
if [[ $@ = "rev-parse --short HEAD" ]]; then
|
||||
cat /build/source/.git_commit
|
||||
else
|
||||
>&2 echo "Unknown command: $@"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
in
|
||||
[ clang fakeGit ];
|
||||
|
||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
||||
PROTOC = "${protobuf}/bin/protoc";
|
||||
|
|
|
@ -14,17 +14,17 @@ let
|
|||
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
||||
|
||||
sha256 = {
|
||||
x86_64-linux = "0nszdd3bmixspv9wc837l9ibs996kr92awpnhx0c00mh823id9g8";
|
||||
x86_64-darwin = "0fvxlkgsr19rwbjlqqsql7rb1ah15svr4bd9zwxg0xv23q51xadc";
|
||||
aarch64-linux = "0037k2iv8cg45rx8sprm3zdj0ai76xn2l4ynij0hp7s2sh947d4s";
|
||||
aarch64-darwin = "0z3zrd90cxh892g5n5ga8xxwczfqd03lcnhz8b8k0lh2l9321inc";
|
||||
armv7l-linux = "193b560pvznkwk58bhqbr3jgbwx26vg26s5sqaibcw3z41v58a3c";
|
||||
x86_64-linux = "0gv71l9cidkbbv7b1dsfyn7lnlwcmjds9qx6nrh7alymdm1xa2xr";
|
||||
x86_64-darwin = "1is795040xb3l23crblwf056wsvsi4dip3lkwhlblhkpsl0048f1";
|
||||
aarch64-linux = "186dy6h3krc6fqvmh1nay1dk5109kl9p25kx37jkbzf2qhnpibm8";
|
||||
aarch64-darwin = "04xc5fy4wcplfrigbm624dpzxd2m4rkq979xr1i57p3d20i96s6g";
|
||||
armv7l-linux = "1k7bfmrfw16zpn33p7ycxpp6g9xh8aypmf61nrkx2jn99nxy5d3s";
|
||||
}.${system};
|
||||
in
|
||||
callPackage ./generic.nix rec {
|
||||
# Please backport all compatible updates to the stable release.
|
||||
# This is important for the extension ecosystem.
|
||||
version = "1.64.0";
|
||||
version = "1.64.2";
|
||||
pname = "vscode";
|
||||
|
||||
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gmt";
|
||||
version = "6.2.0";
|
||||
version = "6.3.0";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/GenericMappingTools/gmt/releases/download/${version}/gmt-${version}-src.tar.gz";
|
||||
sha256 = "sha256-q3BikSrurRAhdw+tR1bgqZhg/ejqm0KPsAwi+hWju/w=";
|
||||
sha256 = "sha256-LNBz2LHxG4elmziqeq+OOceUDStVpGoyZ+I4AuyKCNE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
{ lib, stdenv, fetchzip, fltk, zlib, xdg-utils, xorg, libjpeg, libGL }:
|
||||
{ lib, stdenv, fetchzip, fltk, zlib, xdg-utils, xorg, libjpeg, libGLU }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "eureka-editor";
|
||||
version = "1.21";
|
||||
shortver = "121";
|
||||
version = "1.27b";
|
||||
|
||||
src = fetchzip {
|
||||
url = "mirror://sourceforge/eureka-editor/Eureka/${version}/eureka-${shortver}-source.tar.gz";
|
||||
sha256 = "0fpj13aq4wh3f7473cdc5jkf1c71jiiqmjc0ihqa0nm3hic1d4yv";
|
||||
url = "mirror://sourceforge/eureka-editor/Eureka/${lib.versions.majorMinor version}/eureka-${version}-source.tar.gz";
|
||||
sha256 = "075w7xxsgbgh6dhndc1pfxb2h1s5fhsw28yl1c025gmx9bb4v3bf";
|
||||
};
|
||||
|
||||
buildInputs = [ fltk zlib xdg-utils libjpeg xorg.libXinerama libGL ];
|
||||
buildInputs = [ fltk zlib xdg-utils libjpeg xorg.libXinerama libGLU ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
preBuild = ''
|
||||
substituteInPlace src/main.cc \
|
||||
--replace /usr/local $out
|
||||
substituteInPlace Makefile \
|
||||
--replace /usr/local $out \
|
||||
--replace "-o root " ""
|
||||
postPatch = ''
|
||||
substituteInPlace src/main.cc --replace /usr/local $out
|
||||
substituteInPlace Makefile --replace /usr/local $out
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
|
@ -32,9 +28,9 @@ stdenv.mkDerivation rec {
|
|||
meta = with lib; {
|
||||
homepage = "http://eureka-editor.sourceforge.net";
|
||||
description = "A map editor for the classic DOOM games, and a few related games such as Heretic and Hexen";
|
||||
license = licenses.gpl2;
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.all;
|
||||
broken = stdenv.isDarwin;
|
||||
badPlatforms = platforms.darwin;
|
||||
maintainers = with maintainers; [ neonfuz ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xmrig";
|
||||
version = "6.16.3";
|
||||
version = "6.16.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xmrig";
|
||||
repo = "xmrig";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-YR/8ApkuZtO2vJA/VlZ06JdQnGDbTzQ5fNqHgBpFZjQ=";
|
||||
sha256 = "sha256-hfdKhTUGoVN4DIURO+e3MOSpsL6GWxOV3LItd0nA51Y=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
}
|
||||
},
|
||||
"beta": {
|
||||
"version": "99.0.4844.17",
|
||||
"sha256": "18bhfy64rz4bilbzml33856azwzq4bhiisc2jlbncdnmk3x6n71s",
|
||||
"sha256bin64": "1vaxcfgiww4skanny5ks431jyrnf0rgx7g850m29v8v49c3qflm8",
|
||||
"version": "99.0.4844.27",
|
||||
"sha256": "07srkycb92sajbxcjbwgjcj0xgb17k9i4b7cg50dvz3pwdvm7y8y",
|
||||
"sha256bin64": "1a3a66kmcim3f8wvi19330m2iixxngsfiwv44g8zz51qk4rg4wx3",
|
||||
"deps": {
|
||||
"gn": {
|
||||
"version": "2022-01-10",
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
, iptables
|
||||
, iproute2
|
||||
, bridge-utils
|
||||
, btrfs-progs
|
||||
, conntrack-tools
|
||||
, buildGoPackage
|
||||
, buildGoModule
|
||||
, runc
|
||||
, rsync
|
||||
, kmod
|
||||
, libseccomp
|
||||
, pkg-config
|
||||
|
@ -18,6 +20,7 @@
|
|||
, fetchzip
|
||||
, fetchgit
|
||||
, zstd
|
||||
, yq-go
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
|
@ -43,27 +46,58 @@ with lib;
|
|||
# Those pieces of software we entirely ignore upstream's handling of, and just
|
||||
# make sure they're in the path if desired.
|
||||
let
|
||||
k3sVersion = "1.22.3+k3s1"; # k3s git tag
|
||||
k3sCommit = "61a2aab25eeb97c26fa3f2b177e4355a7654c991"; # k3s git commit at the above version
|
||||
k3sRepoSha256 = "0lz5hr3c86gxm9w5jy3g26n6a26m8k0y559hv6220rsi709j7ma9";
|
||||
k3sVersion = "1.23.3+k3s1"; # k3s git tag
|
||||
k3sCommit = "6f4217a3405d16a1a51bbb40872d7dcb87207bb9"; # k3s git commit at the above version
|
||||
k3sRepoSha256 = "sha256-0dRusG1vL+1KbmViIUNCZK1b+FEgV6otcVUyFonHmm4=";
|
||||
|
||||
traefikChartVersion = "10.3.0"; # taken from ./manifests/traefik.yaml at spec.version
|
||||
traefikChartSha256 = "0y6wr64xp7bgx24kqil0x6myr3pnfrg8rw0d1h5zd2n5a8nfd73f";
|
||||
# taken from ./manifests/traefik.yaml, extracted from '.spec.chart' https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/download#L9
|
||||
# The 'patch' and 'minor' versions are currently hardcoded as single digits only, so ignore the trailing two digits. Weird, I know.
|
||||
traefikChartVersion = "10.9.1";
|
||||
traefikChartSha256 = "sha256-XM1DLofU1zEEFeB5bNQ7cgv102gXsToPP7SFh87QuGQ=";
|
||||
|
||||
k3sRootVersion = "0.9.1"; # taken from ./scripts/download at ROOT_VERSION
|
||||
# taken from ./scripts/version.sh VERSION_ROOT https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/version.sh#L47
|
||||
k3sRootVersion = "0.9.1";
|
||||
k3sRootSha256 = "0r2cj4l50cxkrvszpzxfk36lvbjf9vcmp6d5lvxg8qsah8lki3x8";
|
||||
|
||||
k3sCNIVersion = "0.9.1-k3s1"; # taken from ./scripts/version.sh at VERSION_CNIPLUGINS
|
||||
# taken from ./scripts/version.sh VERSION_CNIPLUGINS https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/version.sh#L45
|
||||
k3sCNIVersion = "0.9.1-k3s1";
|
||||
k3sCNISha256 = "1327vmfph7b8i14q05c2xdfzk60caflg1zhycx0mrf3d59f4zsz5";
|
||||
|
||||
# taken from go.mod, the 'github.com/containerd/containerd' line
|
||||
# run `grep github.com/containerd/containerd go.mod | head -n1 | awk '{print $4}'`
|
||||
containerdVersion = "v1.5.9-k3s1";
|
||||
containerdSha256 = "sha256-7xlhBA6KuwFlw+jyThygv4Ow9F3xjjIUtS6x8YHwjic=";
|
||||
|
||||
# run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag
|
||||
criCtlVersion = "v1.22.0-k3s1";
|
||||
|
||||
baseMeta = {
|
||||
description = "A lightweight Kubernetes distribution";
|
||||
license = licenses.asl20;
|
||||
homepage = "https://k3s.io";
|
||||
maintainers = with maintainers; [ euank ];
|
||||
maintainers = with maintainers; [ euank mic92 ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
|
||||
# https://github.com/k3s-io/k3s/blob/5fb370e53e0014dc96183b8ecb2c25a61e891e76/scripts/build#L19-L40
|
||||
versionldflags = [
|
||||
"-X github.com/rancher/k3s/pkg/version.Version=v${k3sVersion}"
|
||||
"-X github.com/rancher/k3s/pkg/version.GitCommit=${lib.substring 0 8 k3sCommit}"
|
||||
"-X k8s.io/client-go/pkg/version.gitVersion=v${k3sVersion}"
|
||||
"-X k8s.io/client-go/pkg/version.gitCommit=${k3sCommit}"
|
||||
"-X k8s.io/client-go/pkg/version.gitTreeState=clean"
|
||||
"-X k8s.io/client-go/pkg/version.buildDate=1970-01-01T01:01:01Z"
|
||||
"-X k8s.io/component-base/version.gitVersion=v${k3sVersion}"
|
||||
"-X k8s.io/component-base/version.gitCommit=${k3sCommit}"
|
||||
"-X k8s.io/component-base/version.gitTreeState=clean"
|
||||
"-X k8s.io/component-base/version.buildDate=1970-01-01T01:01:01Z"
|
||||
"-X github.com/kubernetes-sigs/cri-tools/pkg/version.Version=${criCtlVersion}"
|
||||
"-X github.com/containerd/containerd/version.Version=${containerdVersion}"
|
||||
"-X github.com/containerd/containerd/version.Package=github.com/k3s-io/containerd"
|
||||
"-X github.com/containerd/containerd/version.Version=${containerdVersion}"
|
||||
"-X github.com/containerd/containerd/version.Package=github.com/k3s-io/containerd"
|
||||
];
|
||||
|
||||
# bundled into the k3s binary
|
||||
traefikChart = fetchurl {
|
||||
url = "https://helm.traefik.io/traefik/traefik-${traefikChartVersion}.tgz";
|
||||
|
@ -84,11 +118,11 @@ let
|
|||
sha256 = k3sRootSha256;
|
||||
stripRoot = false;
|
||||
};
|
||||
k3sPlugins = buildGoPackage rec {
|
||||
name = "k3s-cni-plugins";
|
||||
k3sCNIPlugins = buildGoModule rec {
|
||||
pname = "k3s-cni-plugins";
|
||||
version = k3sCNIVersion;
|
||||
vendorSha256 = null;
|
||||
|
||||
goPackagePath = "github.com/containernetworking/plugins";
|
||||
subPackages = [ "." ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
|
@ -98,6 +132,10 @@ let
|
|||
sha256 = k3sCNISha256;
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
mv $out/bin/plugins $out/bin/cni
|
||||
'';
|
||||
|
||||
meta = baseMeta // {
|
||||
description = "CNI plugins, as patched by rancher for k3s";
|
||||
};
|
||||
|
@ -124,50 +162,38 @@ let
|
|||
# Then, we bundle those binaries into our thick k3s binary and use that as
|
||||
# the final single output.
|
||||
# This approach was chosen because it ensures the bundled binaries all are
|
||||
# correctly built to run with nix (we can lean on the existing buildGoPackage
|
||||
# correctly built to run with nix (we can lean on the existing buildGoModule
|
||||
# stuff), and we can again lean on that tooling for the final k3s binary too.
|
||||
# Other alternatives would be to manually run the
|
||||
# strip/patchelf/remove-references step ourselves in the installPhase of the
|
||||
# derivation when we've built all the binaries, but haven't bundled them in
|
||||
# with generated bindata yet.
|
||||
k3sBuildStage1 = buildGoPackage rec {
|
||||
name = "k3s-build-1";
|
||||
k3sServer = buildGoModule rec {
|
||||
pname = "k3s-server";
|
||||
version = k3sVersion;
|
||||
|
||||
goPackagePath = "github.com/rancher/k3s";
|
||||
|
||||
src = k3sRepo;
|
||||
|
||||
# Patch build scripts so that we can use them.
|
||||
# This makes things more dynamically linked (because nix can deal with
|
||||
# dynamically linked dependencies just fine), removes the upload at the
|
||||
# end, and skips building runc + cni, since we have our own derivations for
|
||||
# those.
|
||||
patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
|
||||
vendorSha256 = "sha256-9+2k/ipAOhc8JJU+L2dwaM01Dkw+0xyrF5kt6mL19G0=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ libseccomp ];
|
||||
|
||||
# Versioning info for build script
|
||||
DRONE_TAG = "v${version}";
|
||||
DRONE_COMMIT = k3sCommit;
|
||||
|
||||
buildPhase = ''
|
||||
pushd go/src/${goPackagePath}
|
||||
|
||||
patchShebangs ./scripts/build ./scripts/version.sh
|
||||
mkdir -p bin
|
||||
./scripts/build
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
pushd go/src/${goPackagePath}
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
install -m 0755 -t "$out/bin" ./bin/*
|
||||
subPackages = [ "cmd/server" ];
|
||||
ldflags = versionldflags;
|
||||
|
||||
# create the multicall symlinks for k3s
|
||||
postInstall = ''
|
||||
mv $out/bin/server $out/bin/k3s
|
||||
pushd $out
|
||||
# taken verbatim from https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/build#L105-L113
|
||||
ln -s k3s ./bin/k3s-agent
|
||||
ln -s k3s ./bin/k3s-server
|
||||
ln -s k3s ./bin/k3s-etcd-snapshot
|
||||
ln -s k3s ./bin/k3s-secrets-encrypt
|
||||
ln -s k3s ./bin/k3s-certificate
|
||||
ln -s k3s ./bin/kubectl
|
||||
ln -s k3s ./bin/crictl
|
||||
ln -s k3s ./bin/ctr
|
||||
popd
|
||||
'';
|
||||
|
||||
|
@ -175,76 +201,33 @@ let
|
|||
description = "The various binaries that get packaged into the final k3s binary";
|
||||
};
|
||||
};
|
||||
k3sBin = buildGoPackage rec {
|
||||
name = "k3s-bin";
|
||||
k3sContainerd = buildGoModule {
|
||||
pname = "k3s-containerd";
|
||||
version = k3sVersion;
|
||||
|
||||
goPackagePath = "github.com/rancher/k3s";
|
||||
|
||||
src = k3sRepo;
|
||||
|
||||
# See the above comment in k3sBuildStage1
|
||||
patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config zstd ];
|
||||
# These dependencies are embedded as compressed files in k3s at runtime.
|
||||
# Propagate them to avoid broken runtime references to libraries.
|
||||
propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ];
|
||||
|
||||
# k3s appends a suffix to the final distribution binary for some arches
|
||||
archSuffix =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then ""
|
||||
else if stdenv.hostPlatform.system == "aarch64-linux" then "-arm64"
|
||||
else throw "k3s isn't being built for ${stdenv.hostPlatform.system} yet.";
|
||||
|
||||
DRONE_TAG = "v${version}";
|
||||
DRONE_COMMIT = k3sCommit;
|
||||
|
||||
# In order to build the thick k3s binary (which is what
|
||||
# ./scripts/package-cli does), we need to get all the binaries that script
|
||||
# expects in place.
|
||||
buildPhase = ''
|
||||
pushd go/src/${goPackagePath}
|
||||
|
||||
patchShebangs ./scripts/build ./scripts/version.sh ./scripts/package-cli
|
||||
|
||||
mkdir -p bin
|
||||
|
||||
install -m 0755 -t ./bin ${k3sBuildStage1}/bin/*
|
||||
install -m 0755 -T "${k3sPlugins}/bin/plugins" ./bin/cni
|
||||
# Note: use the already-nixpkgs-bundled k3s rather than the one bundled
|
||||
# in k3s because the k3s one is completely unmodified from upstream
|
||||
# (unlike containerd, cni, etc)
|
||||
install -m 0755 -T "${runc}/bin/runc" ./bin/runc
|
||||
cp -R "${k3sRoot}/etc" ./etc
|
||||
mkdir -p "build/static/charts"
|
||||
cp "${traefikChart}" "build/static/charts/traefik-${traefikChartVersion}.tgz"
|
||||
|
||||
./scripts/package-cli
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
pushd go/src/${goPackagePath}
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
install -m 0755 -T ./dist/artifacts/k3s${archSuffix} "$out/bin/k3s"
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = baseMeta // {
|
||||
description = "The k3s go binary which is used by the final wrapped output below";
|
||||
src = fetchFromGitHub {
|
||||
owner = "k3s-io";
|
||||
repo = "containerd";
|
||||
rev = containerdVersion;
|
||||
sha256 = containerdSha256;
|
||||
};
|
||||
vendorSha256 = null;
|
||||
buildInputs = [ btrfs-progs ];
|
||||
subPackages = [ "cmd/containerd" "cmd/containerd-shim-runc-v2" ];
|
||||
ldflags = versionldflags;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
buildGoModule rec {
|
||||
pname = "k3s";
|
||||
version = k3sVersion;
|
||||
|
||||
# `src` here is a workaround for the updateScript bot. It couldn't be empty.
|
||||
src = builtins.filterSource (path: type: false) ./.;
|
||||
src = k3sRepo;
|
||||
proxyVendor = true;
|
||||
vendorSha256 = "sha256-8Yp9csyRNSYi9wo8E8mF8cu92wG1t3l18wJ8Y4L7HEA=";
|
||||
|
||||
patches = [
|
||||
./patches/0001-scrips-download-strip-downloading-just-package-CRD.patch
|
||||
./patches/0002-Don-t-build-a-static-binary-in-package-cli.patch
|
||||
];
|
||||
|
||||
# Important utilities used by the kubelet, see
|
||||
# https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-237202494
|
||||
|
@ -260,32 +243,68 @@ stdenv.mkDerivation rec {
|
|||
conntrack-tools
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
k3sBin
|
||||
] ++ k3sRuntimeDeps;
|
||||
buildInputs = k3sRuntimeDeps;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
rsync
|
||||
yq-go
|
||||
zstd
|
||||
];
|
||||
|
||||
unpackPhase = "true";
|
||||
# embedded in the final k3s cli
|
||||
propagatedBuildInputs = [
|
||||
k3sCNIPlugins
|
||||
k3sContainerd
|
||||
k3sServer
|
||||
runc
|
||||
];
|
||||
|
||||
# We override most of buildPhase due to peculiarities in k3s's build.
|
||||
# Specifically, it has a 'go generate' which runs part of the package. See
|
||||
# this comment:
|
||||
# https://github.com/NixOS/nixpkgs/pull/158089#discussion_r799965694
|
||||
# So, why do we use buildGoModule at all? For the `vendorSha256` / `go mod download` stuff primarily.
|
||||
buildPhase = ''
|
||||
patchShebangs ./scripts/package-cli ./scripts/download ./scripts/build-upload
|
||||
|
||||
# copy needed 'go generate' inputs into place
|
||||
mkdir -p ./bin/aux
|
||||
rsync -a --no-perms ${k3sServer}/bin/ ./bin/
|
||||
ln -vsf ${runc}/bin/runc ./bin/runc
|
||||
ln -vsf ${k3sCNIPlugins}/bin/cni ./bin/cni
|
||||
ln -vsf ${k3sContainerd}/bin/* ./bin/
|
||||
rsync -a --no-perms --chmod u=rwX ${k3sRoot}/etc/ ./etc/
|
||||
mkdir -p ./build/static/charts
|
||||
# Note, upstream's chart has a 00 suffix. This seems to not matter though, so we're ignoring that naming detail.
|
||||
export TRAEFIK_CHART_FILE=${traefikChart}
|
||||
# place the traefik chart using their code since it's complicated
|
||||
# We trim the actual download, see patches
|
||||
./scripts/download
|
||||
|
||||
export ARCH=$GOARCH
|
||||
export DRONE_TAG="v${k3sVersion}"
|
||||
export DRONE_COMMIT="${k3sCommit}"
|
||||
# use ./scripts/package-cli to run 'go generate' + 'go build'
|
||||
|
||||
./scripts/package-cli
|
||||
mkdir -p $out/bin
|
||||
'';
|
||||
|
||||
# Otherwise it depends on 'getGoDirs', which is normally set in buildPhase
|
||||
doCheck = false;
|
||||
|
||||
# And, one final derivation (you thought the last one was it, right?)
|
||||
# We got the binary we wanted above, but it doesn't have all the runtime
|
||||
# dependencies k8s wants, including mount utilities for kubelet, networking
|
||||
# tools for cni/kubelet stuff, etc
|
||||
# Use a wrapper script to reference all the binaries that k3s tries to
|
||||
# execute, but that we didn't bundle with it.
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out/bin"
|
||||
makeWrapper ${k3sBin}/bin/k3s "$out/bin/k3s" \
|
||||
# wildcard to match the arm64 build too
|
||||
install -m 0755 dist/artifacts/k3s* -D $out/bin/k3s
|
||||
wrapProgram $out/bin/k3s \
|
||||
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
||||
--prefix PATH : "$out/bin"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
$out/bin/k3s --version | grep v${k3sVersion} > /dev/null
|
||||
$out/bin/k3s --version | grep -F "v${k3sVersion}" >/dev/null
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
From 6f53bd36a40da4c71486e3b79f6e32d53d6eea5d Mon Sep 17 00:00:00 2001
|
||||
From: Euan Kemp <euank@euank.com>
|
||||
Date: Thu, 3 Feb 2022 23:50:40 -0800
|
||||
Subject: [PATCH 2/2] scrips/download: strip downloading, just package CRD
|
||||
|
||||
The CRD packaging is a complicated set of commands, so let's reuse it.
|
||||
---
|
||||
scripts/download | 10 ++--------
|
||||
1 file changed, 2 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/scripts/download b/scripts/download
|
||||
index 5effc0562a..82361803ee 100755
|
||||
--- a/scripts/download
|
||||
+++ b/scripts/download
|
||||
@@ -24,12 +24,6 @@ rm -rf ${CONTAINERD_DIR}
|
||||
mkdir -p ${CHARTS_DIR}
|
||||
mkdir -p ${DATA_DIR}
|
||||
|
||||
-curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf - --exclude=bin/socat
|
||||
-
|
||||
-git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}
|
||||
-
|
||||
-git clone --single-branch --branch=${VERSION_CONTAINERD} --depth=1 https://github.com/k3s-io/containerd ${CONTAINERD_DIR}
|
||||
-
|
||||
setup_tmp() {
|
||||
TMP_DIR=$(mktemp -d --tmpdir=${CHARTS_DIR})
|
||||
cleanup() {
|
||||
@@ -44,8 +38,8 @@ setup_tmp() {
|
||||
|
||||
download_and_package_traefik () {
|
||||
echo "Downloading Traefik Helm chart from ${TRAEFIK_URL}"
|
||||
- curl -sfL ${TRAEFIK_URL} -o ${TMP_DIR}/${TRAEFIK_FILE}
|
||||
- code=$?
|
||||
+ # nixpkgs: copy in our known traefik chart instead
|
||||
+ cp $TRAEFIK_CHART_FILE ${TMP_DIR}/${TRAEFIK_FILE}
|
||||
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "Error: Failed to download Traefik Helm chart!"
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
-Subject: [PATCH 2/2] Add nixpkgs patches
|
||||
-Original patch by: Euan Kemp <euank@euank.com>
|
||||
-Adapted by: superherointj
|
||||
-
|
||||
-This patch allows us to re-use upstream build scripts when building for nix.
|
||||
----
|
||||
- 2 files changed:
|
||||
- scripts/build
|
||||
- scripts/package-cli
|
||||
-
|
||||
diff --git a/scripts/build b/scripts/build
|
||||
index 2f3d1dc496..4f4e5aa897 100755
|
||||
--- a/scripts/build
|
||||
+++ b/scripts/build
|
||||
@@ -12,7 +12,8 @@ PKG_CONTAINERD="github.com/containerd/containerd"
|
||||
PKG_K3S_CONTAINERD="github.com/k3s-io/containerd"
|
||||
PKG_CRICTL="github.com/kubernetes-sigs/cri-tools"
|
||||
|
||||
-buildDate=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
+# nixpkgs: deterministic build date
|
||||
+buildDate="$(date -d "$(git log -1 --format=%ai)" -u "+%Y-%m-%dT%H:%M:%SZ")"
|
||||
|
||||
VENDOR_PREFIX="${PKG}/vendor/"
|
||||
VERSIONFLAGS="
|
||||
@@ -89,17 +90,7 @@ cleanup() {
|
||||
}
|
||||
|
||||
INSTALLBIN=$(pwd)/bin
|
||||
-if [ ! -x ${INSTALLBIN}/cni ]; then
|
||||
-(
|
||||
- echo Building cni
|
||||
- TMPDIR=$(mktemp -d)
|
||||
- trap cleanup EXIT
|
||||
- WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins
|
||||
- git clone -b $VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
|
||||
- cd $WORKDIR
|
||||
- GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$LDFLAGS $STATIC" -o $INSTALLBIN/cni
|
||||
-)
|
||||
-fi
|
||||
+# nixpkgs: skip building cni, we build it separately
|
||||
# echo Building agent
|
||||
# CGO_ENABLED=1 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/k3s-agent ./cmd/agent/main.go
|
||||
echo Building server
|
||||
@@ -116,10 +107,7 @@ ln -s containerd ./bin/ctr
|
||||
#CGO_ENABLED=1 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC_SQLITE" -o bin/ctr ./cmd/ctr/main.go
|
||||
# echo Building containerd
|
||||
# CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/containerd ./cmd/containerd/
|
||||
-echo Building runc
|
||||
-rm -f ./build/src/github.com/opencontainers/runc/runc
|
||||
-make GOPATH=$(pwd)/build EXTRA_LDFLAGS="-w -s" BUILDTAGS="$RUNC_TAGS" -C ./build/src/github.com/opencontainers/runc $RUNC_STATIC
|
||||
-cp -f ./build/src/github.com/opencontainers/runc/runc ./bin/runc
|
||||
+# nixpkgs: we build runc separately
|
||||
|
||||
echo Building containerd-shim
|
||||
rm -f ./vendor/github.com/containerd/containerd/bin/containerd-shim
|
||||
diff --git a/scripts/package-cli b/scripts/package-cli
|
||||
index ab4a6dac63..044b5587d0 100755
|
||||
--- a/scripts/package-cli
|
||||
+++ b/scripts/package-cli
|
||||
@@ -50,15 +50,17 @@ fi
|
||||
|
||||
CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
|
||||
|
||||
-"${GO}" generate
|
||||
+CGO_ENABLED=0 env -u GOARCH "${GO}" generate
|
||||
LDFLAGS="
|
||||
-X github.com/rancher/k3s/pkg/version.Version=$VERSION
|
||||
-X github.com/rancher/k3s/pkg/version.GitCommit=${COMMIT:0:8}
|
||||
-w -s
|
||||
"
|
||||
-STATIC="-extldflags '-static'"
|
||||
-CGO_ENABLED=0 "${GO}" build -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go
|
||||
+# STATIC="-extldflags '-static'"
|
||||
+# nixpkgs: we can depend on dynamic linking because we have a good package manager
|
||||
+"${GO}" build -ldflags "$LDFLAGS" -o ${CMD_NAME} ./cmd/k3s/main.go
|
||||
|
||||
stat ${CMD_NAME}
|
||||
|
||||
-./scripts/build-upload ${CMD_NAME} ${COMMIT}
|
||||
+# nixpkgs: skip uploading
|
||||
+# ./scripts/build-upload ${CMD_NAME} ${COMMIT}
|
|
@ -0,0 +1,37 @@
|
|||
From 49c000c7c5dd7a502a2be4c638d2c32b65673c00 Mon Sep 17 00:00:00 2001
|
||||
From: Euan Kemp <euank@euank.com>
|
||||
Date: Sun, 6 Feb 2022 23:13:00 -0800
|
||||
Subject: [PATCH] Don't build a static binary in package-cli
|
||||
|
||||
since nixpkgs prefers dynamically linked binaries.
|
||||
|
||||
Also remove "trimpath" for the 'go generate' step because the codegen
|
||||
they use doesn't work with trimpath set.
|
||||
---
|
||||
scripts/package-cli | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/scripts/package-cli b/scripts/package-cli
|
||||
index 28927327b7..95dbb469f1 100755
|
||||
--- a/scripts/package-cli
|
||||
+++ b/scripts/package-cli
|
||||
@@ -48,14 +48,13 @@ fi
|
||||
|
||||
CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
|
||||
|
||||
-"${GO}" generate
|
||||
+GOFLAGS="" "${GO}" generate
|
||||
LDFLAGS="
|
||||
-X github.com/rancher/k3s/pkg/version.Version=$VERSION
|
||||
-X github.com/rancher/k3s/pkg/version.GitCommit=${COMMIT:0:8}
|
||||
-w -s
|
||||
"
|
||||
-STATIC="-extldflags '-static'"
|
||||
-CGO_ENABLED=0 "${GO}" build -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go
|
||||
+CGO_ENABLED=0 "${GO}" build -ldflags "$LDFLAGS" -o ${CMD_NAME} ./cmd/k3s/main.go
|
||||
|
||||
stat ${CMD_NAME}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
buildGoModule rec {
|
||||
pname = "tektoncd-cli";
|
||||
version = "0.21.0";
|
||||
version = "0.22.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tektoncd";
|
||||
repo = "cli";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-VGdYnynEm0ShG96W0uKiWBbUy/EitX3od5Nnho6T0pg=";
|
||||
sha256 = "sha256-AmJN7hnYuhxYNG/qs7yv3phhffYKVaM8f7irhi9wRfA=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "alfaview";
|
||||
version = "8.34.0";
|
||||
version = "8.37.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://production-alfaview-assets.alfaview.com/stable/linux/${pname}_${version}.deb";
|
||||
sha256 = "sha256-85bsu6l/B+lHkjFBXNQ9BEzOn1oYTsFgungG06p9nD0=";
|
||||
sha256 = "sha256-hU4tqDu95ej8ChiWJq3ZPhEwxBcmTQkA/n///pPVa5U=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{ stdenvNoCC, lib, fetchzip }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "ripcord";
|
||||
version = "0.4.29";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://cancel.fm/dl/Ripcord_Mac_${version}.zip";
|
||||
sha256 = "sha256-v8iydjLBjFN5LuctpcBpEkhSICxPhLKzLjSASWtsQok=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
dontFixup = true; # modification is not allowed by the license https://cancel.fm/ripcord/shareware-redistribution/
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/Applications
|
||||
cp -r $src/Ripcord.app $out/Applications/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Desktop chat client for Slack and Discord";
|
||||
homepage = "https://cancel.fm/ripcord/";
|
||||
# See: https://cancel.fm/ripcord/shareware-redistribution/
|
||||
license = licenses.unfreeRedistributable;
|
||||
maintainers = with maintainers; [ mikroskeem ];
|
||||
platforms = [ "x86_64-darwin" ];
|
||||
};
|
||||
}
|
0
pkgs/applications/networking/instant-messengers/ripcord/default.nix
Executable file → Normal file
0
pkgs/applications/networking/instant-messengers/ripcord/default.nix
Executable file → Normal file
|
@ -3,12 +3,12 @@ electron, libsecret }:
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "tutanota-desktop";
|
||||
version = "3.91.6";
|
||||
version = "3.91.10";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/tutao/tutanota/releases/download/tutanota-release-${version}/${pname}-${version}-unpacked-linux.tar.gz";
|
||||
name = "tutanota-desktop-${version}.tar.gz";
|
||||
sha256 = "sha256-REoYLxU9p0lECKNwcDHidO+jTCKS1yQSzed9GSHSNGI=";
|
||||
sha256 = "sha256-RlEgpXco0lkkjlJ8FZz4MxYznKLPl1Lxkb5MSmhOTzI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
buildGoModule rec {
|
||||
pname = "nextdns";
|
||||
version = "1.37.3";
|
||||
version = "1.37.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nextdns";
|
||||
repo = "nextdns";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-BCDVn4JaRYIexI7NrRDchUl9u4AEJa+An9ItYYJDs3A=";
|
||||
sha256 = "sha256-L5PeT4Y2oWM1WUJaBK9xgrpfkpvKM1+sA29A3AiDE38=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-YZm+DUrH+1xdJrGjmlajbcsnqVODVbZKivVjmqZ2e48=";
|
||||
vendorSha256 = "sha256-6hWD05lXteqL7egj9tiRVHlevKM33i+a+zBUZs7PF7I=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ stdenv.mkDerivation {
|
|||
nativeBuildInputs =
|
||||
[ autoreconfHook ]
|
||||
++ lib.optional withReadline readline;
|
||||
enableParallelBuild = true;
|
||||
enableParallelBuilding = true;
|
||||
configureFlags = with lib;
|
||||
optional (!withReadline) "--without-readline"
|
||||
++ optional enableEmu "--enable-emu"
|
||||
|
|
30
pkgs/applications/networking/novnc/default.nix
Normal file
30
pkgs/applications/networking/novnc/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "novnc";
|
||||
version = "1.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "novnc";
|
||||
repo = "noVNC";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-Z+bks7kcwj+Z3uf/t0u25DnGOM60QhSH6uuoIi59jqU=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 utils/novnc_proxy "$out/bin/novnc"
|
||||
install -dm755 "$out/share/webapps/novnc/"
|
||||
cp -a app core po vendor vnc.html karma.conf.js package.json vnc_lite.html "$out/share/webapps/novnc/"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "VNC client web application";
|
||||
homepage = "https://novnc.com";
|
||||
license = with licenses; [ mpl20 ofl bsd3 bsd2 mit ];
|
||||
maintainers = with maintainers; [ neverbehave ];
|
||||
};
|
||||
}
|
|
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
|
|||
description = "BitTorrent DHT library";
|
||||
homepage = "https://github.com/transmission/dht";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
|
|||
meta = with lib; {
|
||||
homepage = "https://gitlab.gnome.org/World/Fragments";
|
||||
description = "A GTK3 BitTorrent Client";
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
|
|||
description = "uTorrent Transport Protocol library";
|
||||
homepage = "https://github.com/transmission/libutp";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ fetchurl
|
||||
, lib
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, aqbanking
|
||||
, boost
|
||||
, cmake
|
||||
, gettext
|
||||
, glib
|
||||
, glibcLocales
|
||||
, gtest
|
||||
|
@ -16,7 +17,6 @@
|
|||
, libxml2
|
||||
, libxslt
|
||||
, makeWrapper
|
||||
, perl
|
||||
, perlPackages
|
||||
, pkg-config
|
||||
, swig
|
||||
|
@ -28,13 +28,15 @@ stdenv.mkDerivation rec {
|
|||
pname = "gnucash";
|
||||
version = "4.9";
|
||||
|
||||
# raw source code doesn't work out of box; fetchFromGitHub not usable
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Gnucash/gnucash/releases/download/${version}/gnucash-${version}.tar.bz2";
|
||||
sha256 = "0bdpzb0wc9bjph5iff7133ppnkcqzfd10yi2qagij4mpq4q1qmcs";
|
||||
url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2";
|
||||
hash = "sha256-mlUcMMG3EhmfwiJ6EJr7mE177xjhOBcLvHIlxsH6ty0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
gettext
|
||||
makeWrapper
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
@ -53,11 +55,15 @@ stdenv.mkDerivation rec {
|
|||
libofx
|
||||
libxml2
|
||||
libxslt
|
||||
perl
|
||||
pkg-config
|
||||
swig
|
||||
webkitgtk
|
||||
] ++ (with perlPackages; [ FinanceQuote DateManip ]);
|
||||
]
|
||||
++ (with perlPackages; [
|
||||
DateManip
|
||||
FinanceQuote
|
||||
perl
|
||||
]);
|
||||
|
||||
patches = [
|
||||
# this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges
|
||||
|
@ -68,16 +74,14 @@ stdenv.mkDerivation rec {
|
|||
./0003-remove-valgrind.patch
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
export GUILE_AUTO_COMPILE=0 # this needs to be an env variable and not a cmake flag to suppress guile warning
|
||||
'';
|
||||
# this needs to be an environment variable and not a cmake flag to suppress
|
||||
# guile warning
|
||||
GUILE_AUTO_COMPILE="0";
|
||||
|
||||
# `make check` target does not define its prerequisites but expects them to
|
||||
# have already been built. The list of targets below was built through trial
|
||||
# and error based on failing tests.
|
||||
doCheck = true;
|
||||
|
||||
/*
|
||||
GNUcash's `make check` target does not define its prerequisites but expects them to have already been built.
|
||||
The list of targets below was built through trial and error based on failing tests.
|
||||
*/
|
||||
preCheck = ''
|
||||
make \
|
||||
test-account-object \
|
||||
|
@ -156,12 +160,15 @@ stdenv.mkDerivation rec {
|
|||
|
||||
preFixup = ''
|
||||
gappsWrapperArgs+=(
|
||||
--set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd # specify where db drivers are
|
||||
--set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"} # specify where nix puts the gnome settings schemas
|
||||
# db drivers location
|
||||
--set GNC_DBD_DIR ${libdbiDrivers}/lib/dbd
|
||||
# gnome settings schemas location on Nix
|
||||
--set GSETTINGS_SCHEMA_DIR ${glib.makeSchemaPath "$out" "${pname}-${version}"}
|
||||
)
|
||||
'';
|
||||
|
||||
# wrapGAppsHook would wrap all binaries including the cli utils which need Perl wrapping
|
||||
# wrapGAppsHook would wrap all binaries including the cli utils which need
|
||||
# Perl wrapping
|
||||
dontWrapGApps = true;
|
||||
|
||||
# gnucash is wrapped using the args constructed for wrapGAppsHook.
|
||||
|
@ -176,15 +183,31 @@ stdenv.mkDerivation rec {
|
|||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Personal and small business double entry accounting application.";
|
||||
longDescription = ''
|
||||
Designed to be easy to use, yet powerful and flexible, GnuCash allows you to track bank accounts, stocks, income and expenses.
|
||||
As quick and intuitive to use as a checkbook register, it is based on professional accounting principles to ensure balanced books and accurate reports.
|
||||
'';
|
||||
|
||||
homepage = "https://www.gnucash.org/";
|
||||
description = "Free software for double entry accounting";
|
||||
longDescription = ''
|
||||
GnuCash is personal and small-business financial-accounting software,
|
||||
freely licensed under the GNU GPL and available for GNU/Linux, BSD,
|
||||
Solaris, Mac OS X and Microsoft Windows.
|
||||
|
||||
Designed to be easy to use, yet powerful and flexible, GnuCash allows you
|
||||
to track bank accounts, stocks, income and expenses. As quick and
|
||||
intuitive to use as a checkbook register, it is based on professional
|
||||
accounting principles to ensure balanced books and accurate reports.
|
||||
|
||||
Some interesting features:
|
||||
|
||||
- Double-Entry Accounting
|
||||
- Stock/Bond/Mutual Fund Accounts
|
||||
- Small-Business Accounting
|
||||
- Reports, Graphs
|
||||
- QIF/OFX/HBCI Import, Transaction Matching
|
||||
- Scheduled Transactions
|
||||
- Financial Calculations
|
||||
'';
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = [ maintainers.domenkozar ];
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ domenkozar AndersonTorres ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
# TODO: investigate Darwin support
|
||||
|
|
|
@ -19,16 +19,16 @@ let
|
|||
maintainers = with maintainers; [ fliegendewurst ];
|
||||
};
|
||||
|
||||
version = "0.50.1";
|
||||
version = "0.50.2";
|
||||
|
||||
desktopSource = {
|
||||
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
|
||||
sha256 = "1fb491ld3z6b2cndy8nl7zhpdsbb2v6kkrrc0hv92zm9qnfp7a99";
|
||||
sha256 = "0fljza5afpjxgrzgskjhs7w86aa51d88xzv2h43666638j3c5mvk";
|
||||
};
|
||||
|
||||
serverSource = {
|
||||
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
|
||||
sha256 = "1yfj1i5hsphp1y52rgsapqmmv7cvl4imf6dkv8fp3qx5i7j4y5j9";
|
||||
sha256 = "0jqpi1gc48jxvc68yzx80jp553haihybj3g3c5ymvqmgivwn7n4c";
|
||||
};
|
||||
|
||||
in {
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
{
|
||||
"kicad" = {
|
||||
kicadVersion = {
|
||||
version = "6.0.1";
|
||||
version = "6.0.2";
|
||||
src = {
|
||||
rev = "79c1e3a40b913f818bddb69ae98d4d38ab81f926";
|
||||
sha256 = "1vpcbhhw8844hm6vpk3kk405wak531pvcvcpc66z0b48iprk3imr";
|
||||
rev = "378541a8ebe8a691b61c8ed1b4012c71343acfbb";
|
||||
sha256 = "1lcl25zkqkyj5rvw9rad3n7bklpg10kmhmhkyyrgg8ql7di6wa0f";
|
||||
};
|
||||
};
|
||||
libVersion = {
|
||||
version = "6.0.1";
|
||||
version = "6.0.2";
|
||||
libSources = {
|
||||
symbols.rev = "9f21fdcd5728ce6339dd4e1b26ebe60a1bba05e0";
|
||||
symbols.sha256 = "1azjx1bmxaz8bniyw75lq60mc8hvay00jn9qdc2zp7isy3c9ibp0";
|
||||
templates.rev = "5a9266bc796ba5c285401dd1fd900dbc4b6a8cd3";
|
||||
symbols.rev = "80a176076a8f3785a4cd64e55ec87f27f6fcc163";
|
||||
symbols.sha256 = "1f57wv5b95iqd64k8ab82fvxnh5q890v7bzclmn019gl6ikisxj5";
|
||||
templates.rev = "c9a51b852eacc3e64639548032b50edd80ddb27c";
|
||||
templates.sha256 = "13h9ly6amiwm7zkwa2fd9730kh295ls8j95fszlfjp9rczv2yyzm";
|
||||
footprints.rev = "c7f4881b9ec1cbe7f7e5a0828946d0dd909afbee";
|
||||
footprints.sha256 = "0mv9xs0mmmfn0yhzx1v55r5app13ckagb16249rabyiz3v5crdpb";
|
||||
packages3d.rev = "5d0c3590b26835f9d206a355d7579706c06d8bfe";
|
||||
packages3d.sha256 = "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla";
|
||||
footprints.rev = "c81b399054b0d3842094d7e8dfe08eb04310573a";
|
||||
footprints.sha256 = "1xmnq2731v2afan1d08xb1qqgl5xd01v5jphi6cdmw28ri555cna";
|
||||
packages3d.rev = "75175a21b720c59a26efce9a8c6dba3d032392a9";
|
||||
packages3d.sha256 = "10zf8hp85ksi84cbiczsksn0ygvri4ffsa126v73nnkx6irw6nkk";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
|
|||
meta = with lib; {
|
||||
homepage = "https://github.com/logisim-evolution/logisim-evolution";
|
||||
description = "Digital logic designer and simulator";
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
|
|||
meta = with lib; {
|
||||
homepage = "http://www.cburch.com/logisim/";
|
||||
description = "Educational tool for designing and simulating digital logic circuits";
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "cwltool";
|
||||
version = "3.1.20220204090313";
|
||||
version = "3.1.20220210171524";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "common-workflow-language";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-2+2xTUBzQFaS99Xd3jwWuMrg2pNKCb6ZsMKKdOBRo74=";
|
||||
sha256 = "sha256-Z0Btg2NklOwwv9c9lIwE6ONpfwCqZfraNWZd3qxzpGs=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "flat-remix-gtk";
|
||||
version = "20211223";
|
||||
version = "20220118";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "daniruiz";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-jGE5ud7wEEa4JI1QTaCrOnbDwjQtDOFJX2uMo7t7+Js=";
|
||||
sha256 = "sha256-FG/SQdMracnP9zlb6LtPAsATvKeX0WaWPwjbrR1ZNZM=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "zuki-themes";
|
||||
version = "3.38-1";
|
||||
version = "4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lassekongo83";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0890i8kavgnrhm8ic4zpl16wc4ngpnf1zi8js9gvki2cl7dlj1xm";
|
||||
sha256 = "1q026wa8xgyb6f5k7pqpm5zav30dbnm3b8w59as3sh8rhfgpbf80";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ meson ninja sassc ];
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -54,11 +54,11 @@ in
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.16.13";
|
||||
version = "1.16.14";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "sha256-sJJmVOrrAe9DgWY49C17FoHy0/QblVnwdzVSK3r61Bo=";
|
||||
sha256 = "sha256-RniYzTohbeVNy5AU9UHv536beacVTbwf0t13iwxj+1Y=";
|
||||
};
|
||||
|
||||
# perl is used for testing go vet
|
||||
|
|
|
@ -54,11 +54,11 @@ in
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.17.6";
|
||||
version = "1.17.7";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "sha256-TcG78/9h8MH/Kxk1Xm2IFRpwEmJopHx2FHdobvlHSMg=";
|
||||
sha256 = "sha256-wQjNM7c7GRGgK2l3Qd896kPgGlxOCOQJ6LOg43RdK00=";
|
||||
};
|
||||
|
||||
# perl is used for testing go vet
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# How to obtain `sha256`:
|
||||
# nix-prefetch-url --unpack https://github.com/elixir-lang/elixir/archive/v${version}.tar.gz
|
||||
mkDerivation {
|
||||
version = "1.13.2";
|
||||
sha256 = "sha256-qv85aDP3RPCa1YBo45ykWRRZNanL6brNKDMPu9SZdbQ=";
|
||||
version = "1.13.3";
|
||||
sha256 = "sha256-xOIGMpjemPi1xLiYmFpQR4FD6PzeFBxSJP4QpNnEUSE=";
|
||||
minimumOTPVersion = "22";
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
diff --git a/test/suite0009.janet b/test/suite0009.janet
|
||||
index 6095bc60..25360d60 100644
|
||||
--- a/test/suite0009.janet
|
||||
+++ b/test/suite0009.janet
|
||||
@@ -174,15 +174,6 @@
|
||||
(defer (:close stream)
|
||||
(check-matching-names stream)))
|
||||
|
||||
-# Test localname and peername
|
||||
-(repeat 20
|
||||
- (with [s (net/server "127.0.0.1" "8000" names-handler)]
|
||||
- (defn test-names []
|
||||
- (with [conn (net/connect "127.0.0.1" "8000")]
|
||||
- (check-matching-names conn)))
|
||||
- (repeat 20 (test-names)))
|
||||
- (gccollect))
|
||||
-
|
||||
# Create pipe
|
||||
|
||||
(var pipe-counter 0)
|
|
@ -2,25 +2,22 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "janet";
|
||||
version = "1.16.1";
|
||||
version = "1.20.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "janet-lang";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-TzJbHmHIySlf3asQ02HOdehMR+s0KkPifBiaQ4FvFCg=";
|
||||
sha256 = "sha256-mCeOaTbOQej4Uza9fg+xop77z31SQ3sO09dZK8SVAyU=";
|
||||
};
|
||||
|
||||
# we don't have /usr/bin/env in the sandbox, so substitute for a proper,
|
||||
# absolute path to janet
|
||||
postPatch = ''
|
||||
substituteInPlace jpm \
|
||||
--replace '/usr/bin/env janet' $out/bin/janet \
|
||||
--replace /usr/local/lib/janet $out/lib \
|
||||
--replace /usr/local $out
|
||||
# This release fails the test suite on darwin, remove when debugged.
|
||||
# See https://github.com/NixOS/nixpkgs/pull/150618 for discussion.
|
||||
patches = lib.optionals stdenv.isDarwin ./darwin-remove-net-test.patch;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace janet.1 \
|
||||
--replace /usr/local/lib/janet $out/lib
|
||||
--replace /usr/local/ $out/
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ meson ninja ];
|
||||
|
@ -35,5 +32,7 @@ stdenv.mkDerivation rec {
|
|||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ andrewchambers peterhoeg ];
|
||||
platforms = platforms.all;
|
||||
# Marked as broken when patch is applied, see comment above patch.
|
||||
broken = stdenv.isDarwin;
|
||||
};
|
||||
}
|
||||
|
|
59
pkgs/development/interpreters/janet/jpm.nix
Normal file
59
pkgs/development/interpreters/janet/jpm.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{ lib, stdenv, fetchFromGitHub, janet }:
|
||||
|
||||
let
|
||||
platformFiles = {
|
||||
aarch64-darwin = "macos_config.janet";
|
||||
aarch64-linux = "linux_config.janet";
|
||||
x86_64-darwin = "macos_config.janet";
|
||||
x86_64-linux = "linux_config.janet";
|
||||
};
|
||||
|
||||
platformFile = platformFiles.${stdenv.hostPlatform.system};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jpm";
|
||||
version = "0.0.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "janet-lang";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-nv+vkDjEY711L+C5ibw48DUSNqq2UJiFC2i5LntuBNM=";
|
||||
};
|
||||
|
||||
# `auto-shebangs true` gives us a shebang line that points to janet inside the
|
||||
# jpm bin folder
|
||||
postPatch = ''
|
||||
substituteInPlace configs/${platformFile} \
|
||||
--replace 'auto-shebang true' 'auto-shebang false' \
|
||||
--replace /usr/local $out
|
||||
'';
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
buildInputs = [ janet ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{lib/janet,share/man/man1}
|
||||
|
||||
janet bootstrap.janet configs/${platformFile}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
installCheckPhase = ''
|
||||
$out/bin/jpm help
|
||||
'';
|
||||
|
||||
meta = janet.meta // {
|
||||
description = "Janet Project Manager for the Janet programming language";
|
||||
platforms = lib.attrNames platformFiles;
|
||||
};
|
||||
}
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cgal";
|
||||
version = "5.3.1";
|
||||
version = "5.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "CGAL";
|
||||
repo = "releases";
|
||||
rev = "CGAL-${version}";
|
||||
sha256 = "sha256-atILY/d2b99v0Kk226KwJ/qEcJnWBhtge52wkz6Bgcg=";
|
||||
sha256 = "sha256-flrVWsvGAdGVCZ1Ygy9z30w6aU8WAzpMLv+JbP2CKjE=";
|
||||
};
|
||||
|
||||
# note: optional component libCGAL_ImageIO would need zlib and opengl;
|
||||
|
|
|
@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
|
|||
homepage = "http://aften.sourceforge.net/";
|
||||
license = licenses.lgpl21Only;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "armadillo";
|
||||
version = "10.7.5";
|
||||
version = "10.8.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
|
||||
sha256 = "sha256-XQ2f1rNO/Lpqb87/VMDS0T/L6RXXr4owxecs8xfSCU8=";
|
||||
sha256 = "sha256-if3YmL9r/3X278OjAYF+Tt51K5qAkn+wfuNYsT41OSI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "elfio";
|
||||
version = "3.9";
|
||||
version = "3.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "serge1";
|
||||
repo = "elfio";
|
||||
rev = "Release_${version}";
|
||||
sha256 = "sha256-5O9KnHZXzepp3O1PGenJarrHElWLHgyBvvDig1Hkmo4=";
|
||||
sha256 = "sha256-DuZhkiHXdCplRiOy1Gsu7voVPdCbFt+4qFqlOeOeWQw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
|
|
@ -13,13 +13,15 @@
|
|||
, cudatoolkit
|
||||
} :
|
||||
|
||||
# The standard Scalapack has no iLP64 interface
|
||||
assert (!blas.isILP64) && (!lapack.isILP64);
|
||||
assert blas.isILP64 == lapack.isILP64;
|
||||
assert blas.isILP64 == scalapack.isILP64;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "elpa";
|
||||
version = "2021.11.001";
|
||||
|
||||
passthru = { inherit (blas) isILP64; };
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/${version}/elpa-${version}.tar.gz";
|
||||
sha256 = "0bw0nwzwvjfmijfwznmrghypd3q237a3h5g5fcdncilrqnk1sdpv";
|
||||
|
@ -60,7 +62,8 @@ stdenv.mkDerivation rec {
|
|||
"--with-mpi"
|
||||
"--enable-openmp"
|
||||
"--without-threading-support-check-during-build"
|
||||
] ++ lib.optional (!avxSupport) "--disable-avx"
|
||||
] ++ lib.optional blas.isILP64 "--enable-64bit-integer-math-support"
|
||||
++ lib.optional (!avxSupport) "--disable-avx"
|
||||
++ lib.optional (!avx2Support) "--disable-avx2"
|
||||
++ lib.optional (!avx512Support) "--disable-avx512"
|
||||
++ lib.optional (!stdenv.hostPlatform.isx86_64) "--disable-sse"
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pico-sdk";
|
||||
version = "1.2.0";
|
||||
version = "1.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "raspberrypi";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "00z160f7ypws5pzp1ql7xrs3gmjcbw6gywnnq2fiwl47940balns";
|
||||
sha256 = "sha256-cc1UTc1aswtJzuaUdYNcCzLtQ9+Wggiy/eRE+UoxSgE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
|
|
@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
|
|||
homepage = "http://portmedia.sourceforge.net/portmidi/";
|
||||
description = "Platform independent library for MIDI I/O";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
, qtbase, qtdeclarative, qtlocation, qtmultimedia, qtsensors, qtwebchannel
|
||||
, fontconfig, libwebp, libxml2, libxslt
|
||||
, sqlite, systemd, glib, gst_all_1, cmake
|
||||
, bison, flex, gdb, gperf, perl, pkg-config, python2, ruby
|
||||
, bison, flex, gdb, gperf, perl, pkg-config, python38, ruby
|
||||
, ICU, OpenGL
|
||||
}:
|
||||
|
||||
|
@ -30,7 +30,7 @@ qtModule {
|
|||
++ lib.optionals stdenv.isDarwin [ ICU OpenGL ]
|
||||
++ lib.optional usingAnnulenWebkitFork hyphen;
|
||||
nativeBuildInputs = [
|
||||
bison flex gdb gperf perl pkg-config python2 ruby
|
||||
bison flex gdb gperf perl pkg-config python38 ruby
|
||||
] ++ lib.optional usingAnnulenWebkitFork cmake;
|
||||
|
||||
cmakeFlags = lib.optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "rinutils";
|
||||
version = "0.8.0";
|
||||
version = "0.10.0";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/shlomif/rinutils";
|
||||
|
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/shlomif/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "1q09aihm5m42xiq2prpa9mf0srwiirzgzblkp5nl74i7zg6pg5hx";
|
||||
sha256 = "sha256-cNifCoRk+PSU8zcEt8k5bn/KOS6Kr6pEZXEMGjiemAY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
|
|
|
@ -49,6 +49,7 @@ stdenv.mkDerivation rec {
|
|||
piqi-ocaml uuidm frontc yojson ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
export OCAMLPATH=$OCAMLPATH:$OCAMLFIND_DESTDIR;
|
||||
export PATH=$PATH:$out/bin
|
||||
export CAML_LD_LIBRARY_PATH=''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}$OCAMLFIND_DESTDIR/bap-plugin-llvm/:$OCAMLFIND_DESTDIR/bap/
|
||||
|
@ -58,6 +59,7 @@ stdenv.mkDerivation rec {
|
|||
makeWrapper ${utop}/bin/utop $out/bin/baptop --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH --add-flags "-ppx ppx-bap -short-paths -require \"bap.top\""
|
||||
wrapProgram $out/bin/bapbuild --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH
|
||||
ln -s $sigs $out/share/bap/sigs.zip
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
disableIda = "--disable-ida";
|
||||
|
|
|
@ -16,7 +16,11 @@ stdenv.mkDerivation rec {
|
|||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
installPhase = "DESTDIR=$out make install";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
DESTDIR=$out make install
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://piqi.org";
|
||||
|
|
|
@ -19,15 +19,9 @@ stdenv.mkDerivation rec {
|
|||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
buildPhase = ''
|
||||
make
|
||||
make -C piqilib piqilib.cma
|
||||
'';
|
||||
postBuild = "make -C piqilib piqilib.cma";
|
||||
|
||||
installPhase = ''
|
||||
make install;
|
||||
make ocaml-install;
|
||||
'';
|
||||
installTargets = [ "install" "ocaml-install" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://piqi.org";
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
{ stdenv, lib, fetchFromGitHub, ocaml, findlib }:
|
||||
let
|
||||
pname = "xml-light";
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml${ocaml.version}-xml-light";
|
||||
version = "2.4";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "ocaml-${pname}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ncannasse";
|
||||
|
@ -17,15 +15,12 @@ stdenv.mkDerivation {
|
|||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
buildPhase = ''
|
||||
make all
|
||||
make opt
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
make install_ocamlfind
|
||||
mkdir -p $out/share
|
||||
cp -vai doc $out/share/
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
@ -40,6 +35,6 @@ stdenv.mkDerivation {
|
|||
homepage = "http://tech.motion-twin.com/xmllight.html";
|
||||
license = lib.licenses.lgpl21;
|
||||
maintainers = [ lib.maintainers.romildo ];
|
||||
platforms = ocaml.meta.platforms or [ ];
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,6 +32,6 @@ buildPythonPackage rec {
|
|||
description = "Python language bindings for ev3dev";
|
||||
homepage = "https://github.com/ev3dev/ev3dev-lang-python";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
|
||||
buildPythonPackage rec {
|
||||
pname = "flexmock";
|
||||
version = "0.11.2";
|
||||
version = "0.11.3";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-RPcCwNCt3nCFtMev6a2rULAbckrO635Jsp9WMuYyXOg=";
|
||||
hash = "sha256-sf419qXzJUe1zTGhXAYNmrhj3Aiv8BjNc9x40bZR7dQ=";
|
||||
};
|
||||
|
||||
checkInputs = [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
buildPythonPackage rec {
|
||||
pname = "google-nest-sdm";
|
||||
version = "1.7.0";
|
||||
version = "1.7.1";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.8";
|
||||
|
@ -25,7 +25,7 @@ buildPythonPackage rec {
|
|||
owner = "allenporter";
|
||||
repo = "python-google-nest-sdm";
|
||||
rev = version;
|
||||
sha256 = "sha256-SDxYPncC/VVTbI4Ka/mgcVfU1KUNRXVvQl78LCoD/RQ=";
|
||||
sha256 = "sha256-c/Btc2CiYGb9ZGzNYDd1xJoGID6amTyv/Emdh1M6e/U=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
buildPythonPackage rec {
|
||||
pname = "gql";
|
||||
version = "3.0.0rc0";
|
||||
version = "3.0.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
|
@ -29,7 +29,7 @@ buildPythonPackage rec {
|
|||
owner = "graphql-python";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-yr1DyMj/0C9XPTyGdbQbn7nMRKr4JwItFDsqvl/goqU=";
|
||||
hash = "sha256-c2OVBOIwQlwyqET8Q22O65VtWduVzQjYOhkE8GpD6LQ=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
|
|
@ -37,7 +37,7 @@ buildPythonPackage rec {
|
|||
|
||||
meta = with lib; {
|
||||
description = "HTTP/2 State-Machine based protocol implementation";
|
||||
homepage = "http://hyper.rtfd.org/";
|
||||
homepage = "https://github.com/python-hyper/h2";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ lib
|
||||
, buildPythonApplication
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, jupyter_console
|
||||
, jupyter_core
|
||||
|
@ -8,7 +8,7 @@
|
|||
, txzmq
|
||||
}:
|
||||
|
||||
buildPythonApplication rec {
|
||||
buildPythonPackage rec {
|
||||
pname = "ilua";
|
||||
version = "0.2.1";
|
||||
format = "pyproject";
|
||||
|
|
32
pkgs/development/python-modules/lightwave/default.nix
Normal file
32
pkgs/development/python-modules/lightwave/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pythonOlder
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "lightwave";
|
||||
version = "0.20";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-jhffMDhgQ257ZQxvidiRgBSnZvzLJFKNU2NZ8AyGTGc=";
|
||||
};
|
||||
|
||||
pythonImportsCheck = [
|
||||
"lightwave"
|
||||
];
|
||||
|
||||
# Requires phyiscal hardware
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Module for interacting with LightwaveRF hubs";
|
||||
homepage = "https://github.com/GeoffAtHome/lightwave";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
};
|
||||
}
|
|
@ -2,12 +2,13 @@
|
|||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
, strenum
|
||||
, token-bucket
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "limiter";
|
||||
version = "0.2.0";
|
||||
version = "0.3.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.10";
|
||||
|
@ -16,19 +17,15 @@ buildPythonPackage rec {
|
|||
owner = "alexdelorenzo";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-h3XiCR/8rcCBwdhO6ExrrUE9piba5mssad3+t41scSk=";
|
||||
hash = "sha256-9EkA7S549JLi6MxAXBC+2euPDrcJjW8IsQzMtij8+hA=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
strenum
|
||||
token-bucket
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "token-bucket==0.2.0" "token-bucket>=0.2.0"
|
||||
'';
|
||||
|
||||
# Project has no tests
|
||||
# Module has no tests
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
|
|
|
@ -32,6 +32,6 @@ buildPythonPackage rec {
|
|||
description = "Checks for out-of-date package versions";
|
||||
homepage = "https://github.com/jumptrading/luddite";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ angustrau ];
|
||||
maintainers = with maintainers; [ emilytrau ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,6 +32,6 @@ buildPythonPackage rec {
|
|||
homepage = "https://github.com/ManimCommunity/ManimPango";
|
||||
license = licenses.mit;
|
||||
description = "Binding for Pango";
|
||||
maintainers = [ maintainers.angustrau ];
|
||||
maintainers = [ maintainers.emilytrau ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ buildPythonPackage rec {
|
|||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'asyncio-dgram = "1.2.0"' 'asyncio-dgram = ">=1.2.0"' \
|
||||
--replace 'dnspython = "2.1.0"' 'dnspython = "^2.1.0"' \
|
||||
--replace 'six = "1.14.0"' 'six = ">=1.14.0"' \
|
||||
--replace 'click = "7.1.2"' 'click = ">=7.1.2"'
|
||||
'';
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue