Merge master into haskell-updates

This commit is contained in:
github-actions[bot] 2022-03-14 00:11:26 +00:00 committed by GitHub
commit 6182623035
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
174 changed files with 2280 additions and 1040 deletions

View file

@ -1474,7 +1474,7 @@ lib.attrsets.zipAttrsWith
<section xml:id="function-library-lib.attrsets.zipAttrs">
<title><function>lib.attrsets.zipAttrs</function></title>
<subtitle><literal>zipAttrsWith :: [ AttrSet ] -> AttrSet</literal>
<subtitle><literal>zipAttrs :: [ AttrSet ] -> AttrSet</literal>
</subtitle>
<xi:include href="./locations.xml" xpointer="lib.attrsets.zipAttrs" />

View file

@ -38,8 +38,8 @@ Here is a simple package example.
- It uses the `fetchFromGitHub` fetcher to get its source.
- `useDune2 = true` ensures that the latest version of Dune is used for the
build (this may become the default value in a future release).
- `useDune2 = true` ensures that Dune version 2 is used for the
build (this is the default; set to `false` to use Dune version 1).
- It sets the optional `doCheck` attribute such that tests will be run with
`dune runtest -p angstrom` after the build (`dune build -p angstrom`) is

View file

@ -5631,6 +5631,12 @@
github = "jduan";
githubId = 452450;
};
jdupak = {
name = "Jakub Dupak";
email = "dev@jakubdupak.com";
github = "jdupak";
githubId = 22683640;
};
jecaro = {
email = "jeancharles.quillet@gmail.com";
github = "jecaro";

View file

@ -17,7 +17,8 @@ checks:
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
[systemd.services.\<name\>.reloadTriggers](#opt-systemd.services). There are
some additional keys in the `[Unit]` section that are ignored as well. 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
@ -33,6 +34,9 @@ checks:
- 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)).
A little exception is done for units that were deactivated in the meantime,
for example because they require a unit that got stopped before. These
are **start**ed instead of reloaded.
- 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

View file

@ -90,6 +90,17 @@ modules: `systemd.services` (the set of all systemd services) and
`systemd.timers` (the list of commands to be executed periodically by
`systemd`).
Care must be taken when writing systemd services using `Exec*` directives. By
default systemd performs substitution on `%<char>` specifiers in these
directives, expands environment variables from `$FOO` and `${FOO}`, splits
arguments on whitespace, and splits commands on `;`. All of these must be escaped
to avoid unexpected substitution or splitting when interpolating into an `Exec*`
directive, e.g. when using an `extraArgs` option to pass additional arguments to
the service. The functions `utils.escapeSystemdExecArg` and
`utils.escapeSystemdExecArgs` are provided for this, see [Example: Escaping in
Exec directives](#exec-escaping-example) for an example. When using these
functions system environment substitution should *not* be disabled explicitly.
::: {#locate-example .example}
::: {.title}
**Example: NixOS Module for the "locate" Service**
@ -153,6 +164,37 @@ in {
```
:::
::: {#exec-escaping-example .example}
::: {.title}
**Example: Escaping in Exec directives**
:::
```nix
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.services.echo;
echoAll = pkgs.writeScript "echo-all" ''
#! ${pkgs.runtimeShell}
for s in "$@"; do
printf '%s\n' "$s"
done
'';
args = [ "a%Nything" "lang=\${LANG}" ";" "/bin/sh -c date" ];
in {
systemd.services.echo =
{ description = "Echo to the journal";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
${echoAll} ${utils.escapeSystemdExecArgs args}
'';
};
}
```
:::
```{=docbook}
<xi:include href="option-declarations.section.xml" />
<xi:include href="option-types.section.xml" />

View file

@ -38,8 +38,9 @@
<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.&lt;name&gt;.reloadTriggers</link>.
If the unit files differ in any way, the following actions are
performed:
There are some additional keys in the <literal>[Unit]</literal>
section that are ignored as well. If the unit files differ in
any way, the following actions are performed:
</para>
<itemizedlist>
<listitem>
@ -71,6 +72,11 @@
<literal>[Service]</literal> section is set to
<literal>true</literal> (exposed via
<link linkend="opt-systemd.services">systemd.services.&lt;name&gt;.reloadIfChanged</link>).
A little exception is done for units that were deactivated
in the meantime, for example because they require a unit
that got stopped before. These are
<emphasis role="strong">start</emphasis>ed instead of
reloaded.
</para>
</listitem>
<listitem>

View file

@ -122,6 +122,25 @@
services) and <literal>systemd.timers</literal> (the list of
commands to be executed periodically by <literal>systemd</literal>).
</para>
<para>
Care must be taken when writing systemd services using
<literal>Exec*</literal> directives. By default systemd performs
substitution on <literal>%&lt;char&gt;</literal> specifiers in these
directives, expands environment variables from
<literal>$FOO</literal> and <literal>${FOO}</literal>, splits
arguments on whitespace, and splits commands on
<literal>;</literal>. All of these must be escaped to avoid
unexpected substitution or splitting when interpolating into an
<literal>Exec*</literal> directive, e.g. when using an
<literal>extraArgs</literal> option to pass additional arguments to
the service. The functions
<literal>utils.escapeSystemdExecArg</literal> and
<literal>utils.escapeSystemdExecArgs</literal> are provided for
this, see <link linkend="exec-escaping-example">Example: Escaping in
Exec directives</link> for an example. When using these functions
system environment substitution should <emphasis>not</emphasis> be
disabled explicitly.
</para>
<anchor xml:id="locate-example" />
<para>
<emphasis role="strong">Example: NixOS Module for the
@ -183,6 +202,36 @@ in {
};
};
}
</programlisting>
<anchor xml:id="exec-escaping-example" />
<para>
<emphasis role="strong">Example: Escaping in Exec
directives</emphasis>
</para>
<programlisting language="bash">
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.services.echo;
echoAll = pkgs.writeScript &quot;echo-all&quot; ''
#! ${pkgs.runtimeShell}
for s in &quot;$@&quot;; do
printf '%s\n' &quot;$s&quot;
done
'';
args = [ &quot;a%Nything&quot; &quot;lang=\${LANG}&quot; &quot;;&quot; &quot;/bin/sh -c date&quot; ];
in {
systemd.services.echo =
{ description = &quot;Echo to the journal&quot;;
wantedBy = [ &quot;multi-user.target&quot; ];
serviceConfig.Type = &quot;oneshot&quot;;
serviceConfig.ExecStart = ''
${echoAll} ${utils.escapeSystemdExecArgs args}
'';
};
}
</programlisting>
<xi:include href="option-declarations.section.xml" />
<xi:include href="option-types.section.xml" />

View file

@ -249,6 +249,17 @@
<link linkend="opt-services.prosody-filer.enable">services.prosody-filer</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/rfjakob/systembus-notify">systembus-notify</link>,
allow system level notifications to reach the users. Available
as
<link xlink:href="opt-services.systembus-notify.enable">services.systembus-notify</link>.
Please keep in mind that this service should only be enabled
on machines with fully trusted users, as any local user is
able to DoS user sessions by spamming notifications.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/audreyt/ethercalc">ethercalc</link>,
@ -1374,6 +1385,16 @@
warning.
</para>
</listitem>
<listitem>
<para>
The <literal>pomerium-cli</literal> command has been moved out
of the <literal>pomerium</literal> package into the
<literal>pomerium-cli</literal> package, following upstreams
repository split. If you are using the
<literal>pomerium-cli</literal> command, you should now
install the <literal>pomerium-cli</literal> package.
</para>
</listitem>
<listitem>
<para>
The option

View file

@ -72,6 +72,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- [prosody-filer](https://github.com/ThomasLeister/prosody-filer), a server for handling XMPP HTTP Upload requests. Available at [services.prosody-filer](#opt-services.prosody-filer.enable).
- [systembus-notify](https://github.com/rfjakob/systembus-notify), allow system level notifications to reach the users. Available as [services.systembus-notify](opt-services.systembus-notify.enable). Please keep in mind that this service should only be enabled on machines with fully trusted users, as any local user is able to DoS user sessions by spamming notifications.
- [ethercalc](https://github.com/audreyt/ethercalc), an online collaborative
spreadsheet. Available as [services.ethercalc](options.html#opt-services.ethercalc.enable).
@ -503,6 +505,11 @@ In addition to numerous new and upgraded packages, this release has the followin
Reason is that the old name has been deprecated upstream.
Using the old option name will still work, but produce a warning.
- The `pomerium-cli` command has been moved out of the `pomerium` package into
the `pomerium-cli` package, following upstream's repository split. If you are
using the `pomerium-cli` command, you should now install the `pomerium-cli`
package.
- The option
[services.networking.networkmanager.enableFccUnlock](#opt-networking.networkmanager.enableFccUnlock)
was added to support FCC unlock procedures. Since release 1.18.4, the ModemManager

View file

@ -45,6 +45,26 @@ rec {
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"]
(removePrefix "/" s);
# Quotes an argument for use in Exec* service lines.
# systemd accepts "-quoted strings with escape sequences, toJSON produces
# a subset of these.
# Additionally we escape % to disallow expansion of % specifiers. Any lone ;
# in the input will be turned it ";" and thus lose its special meaning.
# Every $ is escaped to $$, this makes it unnecessary to disable environment
# substitution for the directive.
escapeSystemdExecArg = arg:
let
s = if builtins.isPath arg then "${arg}"
else if builtins.isString arg then arg
else if builtins.isInt arg || builtins.isFloat arg then toString arg
else throw "escapeSystemdExecArg only allows strings, paths and numbers";
in
replaceChars [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);
# Quotes a list of arguments into a single string for use in a Exec*
# line.
escapeSystemdExecArgs = concatMapStringsSep " " escapeSystemdExecArg;
# Returns a system path for a given shell package
toShellPath = shell:
if types.shellPackage.check shell then

View file

@ -987,6 +987,7 @@
./services/system/nscd.nix
./services/system/saslauthd.nix
./services/system/self-deploy.nix
./services/system/systembus-notify.nix
./services/system/uptimed.nix
./services/torrent/deluge.nix
./services/torrent/flexget.nix

View file

@ -1,8 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.captive-browser;
inherit (lib)
concatStringsSep escapeShellArgs optionalString
literalExpression mkEnableOption mkIf mkOption mkOptionDefault types;
browserDefault = chromium: concatStringsSep " " [
''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"''
''${chromium}/bin/chromium''
@ -15,6 +19,15 @@ let
''-no-default-browser-check''
''http://cache.nixos.org/''
];
desktopItem = pkgs.makeDesktopItem {
name = "captive-browser";
desktopName = "Captive Portal Browser";
exec = "/run/wrappers/bin/captive-browser";
icon = "nix-snowflake";
categories = [ "Network" ];
};
in
{
###### interface
@ -84,6 +97,11 @@ in
###### implementation
config = mkIf cfg.enable {
environment.systemPackages = [
(pkgs.runCommandNoCC "captive-browser-desktop-item" { } ''
install -Dm444 -t $out/share/applications ${desktopItem}/share/applications/*.desktop
'')
];
programs.captive-browser.dhcp-dns =
let

View file

@ -1,50 +1,46 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) mkEnableOption mkIf mkOption optionalString types;
dataDir = "/var/lib/squeezelite";
cfg = config.services.squeezelite;
pkg = if cfg.pulseAudio then pkgs.squeezelite-pulse else pkgs.squeezelite;
bin = "${pkg}/bin/${pkg.pname}";
in {
in
{
###### interface
options = {
options.services.squeezelite = {
enable = mkEnableOption "Squeezelite, a software Squeezebox emulator";
services.squeezelite= {
enable = mkEnableOption "Squeezelite, a software Squeezebox emulator";
extraArguments = mkOption {
default = "";
type = types.str;
description = ''
Additional command line arguments to pass to Squeezelite.
'';
};
pulseAudio = mkEnableOption "pulseaudio support";
extraArguments = mkOption {
default = "";
type = types.str;
description = ''
Additional command line arguments to pass to Squeezelite.
'';
};
};
###### implementation
config = mkIf cfg.enable {
systemd.services.squeezelite= {
systemd.services.squeezelite = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "sound.target" ];
description = "Software Squeezebox emulator";
serviceConfig = {
DynamicUser = true;
ExecStart = "${pkgs.squeezelite}/bin/squeezelite -N ${dataDir}/player-name ${cfg.extraArguments}";
ExecStart = "${bin} -N ${dataDir}/player-name ${cfg.extraArguments}";
StateDirectory = builtins.baseNameOf dataDir;
SupplementaryGroups = "audio";
};
};
};
}

View file

@ -70,7 +70,8 @@ in
LockPersonality = true;
PrivateTmp = true;
PrivateDevices = true;
# Disabled to allow Jellyfin to access hw accel devices endpoints
# PrivateDevices = true;
PrivateUsers = true;
# Disabled as it does not allow Jellyfin to interface with CUDA devices

View file

@ -1,81 +1,73 @@
{ config, lib, pkgs, ... }:
with lib;
let
ecfg = config.services.earlyoom;
cfg = config.services.earlyoom;
inherit (lib)
mkDefault mkEnableOption mkIf mkOption types
mkRemovedOptionModule
concatStringsSep optional;
in
{
options = {
services.earlyoom = {
options.services.earlyoom = {
enable = mkEnableOption "Early out of memory killing";
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable early out of memory killing.
'';
};
freeMemThreshold = mkOption {
type = types.ints.between 1 100;
default = 10;
description = ''
Minimum of availabe memory (in percent).
If the free memory falls below this threshold and the analog is true for
<option>services.earlyoom.freeSwapThreshold</option>
the killing begins.
'';
};
freeMemThreshold = mkOption {
type = types.int;
default = 10;
description = ''
Minimum of availabe memory (in percent).
If the free memory falls below this threshold and the analog is true for
<option>services.earlyoom.freeSwapThreshold</option>
the killing begins.
'';
};
freeSwapThreshold = mkOption {
type = types.ints.between 1 100;
default = 10;
description = ''
Minimum of availabe swap space (in percent).
If the available swap space falls below this threshold and the analog
is true for <option>services.earlyoom.freeMemThreshold</option>
the killing begins.
'';
};
freeSwapThreshold = mkOption {
type = types.int;
default = 10;
description = ''
Minimum of availabe swap space (in percent).
If the available swap space falls below this threshold and the analog
is true for <option>services.earlyoom.freeMemThreshold</option>
the killing begins.
'';
};
# TODO: remove or warn after 1.7 (https://github.com/rfjakob/earlyoom/commit/7ebc4554)
ignoreOOMScoreAdjust = mkOption {
type = types.bool;
default = false;
description = ''
Ignore oom_score_adjust values of processes.
'';
};
# TODO: remove or warn after 1.7 (https://github.com/rfjakob/earlyoom/commit/7ebc4554)
ignoreOOMScoreAdjust = mkOption {
type = types.bool;
default = false;
description = ''
Ignore oom_score_adjust values of processes.
'';
};
enableDebugInfo = mkOption {
type = types.bool;
default = false;
description = ''
Enable debugging messages.
'';
};
enableDebugInfo = mkOption {
type = types.bool;
default = false;
description = ''
Enable debugging messages.
'';
};
enableNotifications = mkOption {
type = types.bool;
default = false;
description = ''
Send notifications about killed processes via the system d-bus.
notificationsCommand = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This option is deprecated and ignored by earlyoom since 1.6.
Use <option>services.earlyoom.enableNotifications</option> instead.
'';
};
WARNING: enabling this option (while convenient) should *not* be done on a
machine where you do not trust the other users as it allows any other
local user to DoS your session by spamming notifications.
enableNotifications = mkOption {
type = types.bool;
default = false;
description = ''
Send notifications about killed processes via the system d-bus.
To actually see the notifications in your GUI session, you need to have
<literal>systembus-notify</literal> running as your user.
To actually see the notifications in your GUI session, you need to have
<literal>systembus-notify</literal> running as your user which this
option handles.
See <link xlink:href="https://github.com/rfjakob/earlyoom#notifications">README</link> for details.
'';
};
See <link xlink:href="https://github.com/rfjakob/earlyoom#notifications">README</link> for details.
'';
};
};
@ -83,37 +75,30 @@ in
(mkRemovedOptionModule [ "services" "earlyoom" "useKernelOOMKiller" ] ''
This option is deprecated and ignored by earlyoom since 1.2.
'')
(mkRemovedOptionModule [ "services" "earlyoom" "notificationsCommand" ] ''
This option is deprecated and ignored by earlyoom since 1.6.
'')
];
config = mkIf ecfg.enable {
assertions = [
{ assertion = ecfg.freeMemThreshold > 0 && ecfg.freeMemThreshold <= 100;
message = "Needs to be a positive percentage"; }
{ assertion = ecfg.freeSwapThreshold > 0 && ecfg.freeSwapThreshold <= 100;
message = "Needs to be a positive percentage"; }
];
# TODO: reimplement this option as -N after 1.7 (https://github.com/rfjakob/earlyoom/commit/afe03606)
warnings = optional (ecfg.notificationsCommand != null)
"`services.earlyoom.notificationsCommand` is deprecated and ignored by earlyoom since 1.6.";
config = mkIf cfg.enable {
services.systembus-notify.enable = mkDefault cfg.enableNotifications;
systemd.services.earlyoom = {
description = "Early OOM Daemon for Linux";
wantedBy = [ "multi-user.target" ];
path = optional ecfg.enableNotifications pkgs.dbus;
path = optional cfg.enableNotifications pkgs.dbus;
serviceConfig = {
StandardOutput = "null";
StandardError = "journal";
ExecStart = concatStringsSep " " ([
"${pkgs.earlyoom}/bin/earlyoom"
"-m ${toString ecfg.freeMemThreshold}"
"-s ${toString ecfg.freeSwapThreshold}"
] ++ optional ecfg.ignoreOOMScoreAdjust "-i"
++ optional ecfg.enableDebugInfo "-d"
++ optional ecfg.enableNotifications "-n");
"-m ${toString cfg.freeMemThreshold}"
"-s ${toString cfg.freeSwapThreshold}"
]
++ optional cfg.ignoreOOMScoreAdjust "-i"
++ optional cfg.enableDebugInfo "-d"
++ optional cfg.enableNotifications "-n"
);
};
};
environment.systemPackages = optional ecfg.enableNotifications pkgs.systembus-notify;
};
}

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.systembus-notify;
inherit (lib) mkEnableOption mkIf;
in
{
options.services.systembus-notify = {
enable = mkEnableOption ''
System bus notification support
WARNING: enabling this option (while convenient) should *not* be done on a
machine where you do not trust the other users as it allows any other
local user to DoS your session by spamming notifications.
'';
};
config = mkIf cfg.enable {
systemd = {
packages = with pkgs; [ systembus-notify ];
user.services.systembus-notify.wantedBy = [ "graphical-session.target" ];
};
};
}

View file

@ -69,11 +69,16 @@ in
CERTIFICATE_KEY_FILE = "key.pem";
};
startLimitIntervalSec = 60;
script = ''
if [[ -v CREDENTIALS_DIRECTORY ]]; then
cd "$CREDENTIALS_DIRECTORY"
fi
exec "${pkgs.pomerium}/bin/pomerium" -config "${cfgFile}"
'';
serviceConfig = {
DynamicUser = true;
StateDirectory = [ "pomerium" ];
ExecStart = "${pkgs.pomerium}/bin/pomerium -config ${cfgFile}";
PrivateUsers = false; # breaks CAP_NET_BIND_SERVICE
MemoryDenyWriteExecute = false; # breaks LuaJIT
@ -99,7 +104,6 @@ in
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
WorkingDirectory = mkIf (cfg.useACMEHost != null) "$CREDENTIALS_DIRECTORY";
LoadCredential = optionals (cfg.useACMEHost != null) [
"fullchain.pem:/var/lib/acme/${cfg.useACMEHost}/fullchain.pem"
"key.pem:/var/lib/acme/${cfg.useACMEHost}/key.pem"
@ -124,7 +128,7 @@ in
Type = "oneshot";
TimeoutSec = 60;
ExecCondition = "/run/current-system/systemd/bin/systemctl -q is-active pomerium.service";
ExecStart = "/run/current-system/systemd/bin/systemctl restart pomerium.service";
ExecStart = "/run/current-system/systemd/bin/systemctl --no-block restart pomerium.service";
};
};
});

View file

@ -23,8 +23,8 @@ in
package = mkOption {
type = types.package;
default = pkgs.tomcat85;
defaultText = literalExpression "pkgs.tomcat85";
default = pkgs.tomcat9;
defaultText = literalExpression "pkgs.tomcat9";
example = lib.literalExpression "pkgs.tomcat9";
description = ''
Which tomcat package to use.
@ -127,7 +127,7 @@ in
webapps = mkOption {
type = types.listOf types.path;
default = [ tomcat.webapps ];
defaultText = literalExpression "[ pkgs.tomcat85.webapps ]";
defaultText = literalExpression "[ config.services.tomcat.package.webapps ]";
description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat";
};
@ -201,6 +201,7 @@ in
{ uid = config.ids.uids.tomcat;
description = "Tomcat user";
home = "/homeless-shelter";
group = "tomcat";
extraGroups = cfg.extraGroups;
};

View file

@ -10,6 +10,8 @@ use Net::DBus;
use Sys::Syslog qw(:standard :macros);
use Cwd 'abs_path';
## no critic(CodeLayout::ProhibitParensWithBuiltins)
my $out = "@out@";
my $curSystemd = abs_path("/run/current-system/sw/bin");
@ -36,13 +38,13 @@ my $dryReloadByActivationFile = "/run/nixos/dry-activation-reload-list";
make_path("/run/nixos", { mode => oct(755) });
my $action = shift @ARGV;
my $action = shift(@ARGV);
if ("@localeArchive@" ne "") {
$ENV{LOCALE_ARCHIVE} = "@localeArchive@";
}
if (!defined $action || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
if (!defined($action) || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
print STDERR <<EOF;
Usage: $0 [switch|boot|test]
@ -51,27 +53,27 @@ boot: make the configuration the boot default
test: activate the configuration, but don\'t make it the boot default
dry-activate: show what would be done if this configuration were activated
EOF
exit 1;
exit(1);
}
$ENV{NIXOS_ACTION} = $action;
# This is a NixOS installation if it has /etc/NIXOS or a proper
# /etc/os-release.
die "This is not a NixOS installation!\n" unless
die("This is not a NixOS installation!\n") unless
-f "/etc/NIXOS" || (read_file("/etc/os-release", err_mode => 'quiet') // "") =~ /ID="?nixos"?/s;
openlog("nixos", "", LOG_USER);
# Install or update the bootloader.
if ($action eq "switch" || $action eq "boot") {
system("@installBootLoader@ $out") == 0 or exit 1;
system('@installBootLoader@', $out) == 0 or exit 1;
}
# Just in case the new configuration hangs the system, do a sync now.
system("@coreutils@/bin/sync", "-f", "/nix/store") unless ($ENV{"NIXOS_NO_SYNC"} // "") eq "1";
exit 0 if $action eq "boot";
exit(0) if $action eq "boot";
# Check if we can activate the new configuration.
my $oldVersion = read_file("/run/current-system/init-interface-version", err_mode => 'quiet') // "";
@ -83,7 +85,7 @@ Warning: the new NixOS configuration has an init that is
incompatible with the current configuration. The new configuration
won\'t take effect until you reboot the system.
EOF
exit 100;
exit(100);
}
# Ignore SIGHUP so that we're not killed if we're running on (say)
@ -104,14 +106,27 @@ sub getActiveUnits {
return $res;
}
# Returns whether a systemd unit is active
sub unit_is_active {
my ($unit_name) = @_;
my $mgr = Net::DBus->system->get_service('org.freedesktop.systemd1')->get_object('/org/freedesktop/systemd1');
my $units = $mgr->ListUnitsByNames([$unit_name]);
if (scalar(@{$units}) == 0) {
return 0;
}
my $active_state = $units->[0]->[3]; ## no critic (ValuesAndExpressions::ProhibitMagicNumbers)
return $active_state eq 'active' || $active_state eq 'activating';
}
sub parseFstab {
my ($filename) = @_;
my ($fss, $swaps);
foreach my $line (read_file($filename, err_mode => 'quiet')) {
chomp $line;
chomp($line);
$line =~ s/^\s*#.*//;
next if $line =~ /^\s*$/;
my @xs = split / /, $line;
my @xs = split(/ /, $line);
if ($xs[2] eq "swap") {
$swaps->{$xs[0]} = { options => $xs[3] // "" };
} else {
@ -133,17 +148,16 @@ sub parseFstab {
sub parseSystemdIni {
my ($unitContents, $path) = @_;
# Tie the ini file to a hash for easier access
my %fileContents;
tie %fileContents, "Config::IniFiles", (-file => $path, -allowempty => 1, -allowcontinue => 1);
tie(my %fileContents, 'Config::IniFiles', (-file => $path, -allowempty => 1, -allowcontinue => 1)); ## no critic(Miscellanea::ProhibitTies)
# Copy over all sections
foreach my $sectionName (keys %fileContents) {
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}}) {
foreach my $iniKey (keys(%{$fileContents{$sectionName}})) {
# Ensure the value is an array so it's easier to work with
my $iniValue = $fileContents{$sectionName}{$iniKey};
my @iniValues;
@ -181,7 +195,7 @@ sub parse_unit {
# Replace \ with \\ so glob() still works with units that have a \ in them
# Valid characters in unit names are ASCII letters, digits, ":", "-", "_", ".", and "\"
$unit_path =~ s/\\/\\\\/gmsx;
foreach (glob "${unit_path}{,.d/*.conf}") {
foreach (glob("${unit_path}{,.d/*.conf}")) {
parseSystemdIni(\%unit_data, "$_")
}
return %unit_data;
@ -194,7 +208,7 @@ sub parseSystemdBool {
my @values = @{$unitConfig->{$sectionName}{$boolName} // []};
# Return default if value is not set
if (scalar @values lt 1 || not defined $values[-1]) {
if (scalar(@values) lt 1 || not defined($values[-1])) {
return $default;
}
# If value is defined multiple times, use the last definition
@ -211,7 +225,7 @@ sub recordUnit {
# 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";
edit_file(sub { s/^$unit\n//msx }, $fn) if $action ne "dry-activate";
}
# Compare the contents of two unit files and return whether the unit
@ -226,6 +240,16 @@ sub unrecord_unit {
sub compare_units {
my ($old_unit, $new_unit) = @_;
my $ret = 0;
# Keys to ignore in the [Unit] section
my %unit_section_ignores = map { $_ => 1 } qw(
X-Reload-Triggers
Description Documentation
OnFailure OnSuccess OnFailureJobMode
IgnoreOnIsolate StopWhenUnneeded
RefuseManualStart RefuseManualStop
AllowIsolate CollectMode
SourcePath
);
my $comp_array = sub {
my ($a, $b) = @_;
@ -233,11 +257,23 @@ sub compare_units {
};
# Comparison hash for the sections
my %section_cmp = map { $_ => 1 } keys %{$new_unit};
my %section_cmp = map { $_ => 1 } keys(%{$new_unit});
# Iterate over the sections
foreach my $section_name (keys %{$old_unit}) {
foreach my $section_name (keys(%{$old_unit})) {
# Missing section in the new unit?
if (not exists $section_cmp{$section_name}) {
if (not exists($section_cmp{$section_name})) {
# If the [Unit] section was removed, make sure that only keys
# were in it that are ignored
if ($section_name eq 'Unit') {
foreach my $ini_key (keys(%{$old_unit->{'Unit'}})) {
if (not defined($unit_section_ignores{$ini_key})) {
return 1;
}
}
next; # check the next section
} else {
return 1;
}
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.
@ -248,15 +284,15 @@ sub compare_units {
}
delete $section_cmp{$section_name};
# Comparison hash for the section contents
my %ini_cmp = map { $_ => 1 } keys %{$new_unit->{$section_name}};
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}}) {
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') {
# ... unless the key that is now missing is one of the ignored keys
if ($section_name eq 'Unit' and defined($unit_section_ignores{$ini_key})) {
next;
}
return 1;
@ -264,19 +300,30 @@ sub compare_units {
my @new_value = @{$new_unit->{$section_name}{$ini_key}};
# If the contents are different, the units are different
if (not $comp_array->(\@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;
# Check if only the reload triggers changed or one of the ignored keys
if ($section_name eq 'Unit') {
if ($ini_key eq 'X-Reload-Triggers') {
$ret = 2;
next;
} elsif (defined($unit_section_ignores{$ini_key})) {
next;
}
}
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;
if ($section_name eq 'Unit') {
foreach my $ini_key (keys(%ini_cmp)) {
if ($ini_key eq 'X-Reload-Triggers') {
$ret = 2;
} elsif (defined($unit_section_ignores{$ini_key})) {
next;
} else {
return 1;
}
}
} else {
return 1;
}
@ -284,10 +331,14 @@ sub compare_units {
}
# 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;
if (%section_cmp == 1 and defined($section_cmp{'Unit'})) {
foreach my $ini_key (keys(%{$new_unit->{'Unit'}})) {
if (not defined($unit_section_ignores{$ini_key})) {
return 1;
} elsif ($ini_key eq 'X-Reload-Triggers') {
$ret = 2;
}
}
} else {
return 1;
}
@ -343,11 +394,11 @@ sub handleModifiedUnit {
my $socket_activated = 0;
if ($unit =~ /\.service$/) {
my @sockets = split(/ /, join(" ", @{$unitInfo{Service}{Sockets} // []}));
if (scalar @sockets == 0) {
if (scalar(@sockets) == 0) {
@sockets = ("$baseName.socket");
}
foreach my $socket (@sockets) {
if (defined $activePrev->{$socket}) {
if (defined($activePrev->{$socket})) {
# We can now be sure this is a socket-activate unit
$unitsToStop->{$socket} = 1;
@ -355,7 +406,11 @@ sub handleModifiedUnit {
# exist in new configuration:
if (-e "$out/etc/systemd/system/$socket") {
$unitsToStart->{$socket} = 1;
recordUnit($startListFile, $socket);
if ($unitsToStart eq $unitsToRestart) {
recordUnit($restartListFile, $socket);
} else {
recordUnit($startListFile, $socket);
}
$socket_activated = 1;
}
# Remove from units to reload so we don't restart and reload
@ -373,7 +428,11 @@ sub handleModifiedUnit {
# service gets restarted if we're interrupted.
if (!$socket_activated) {
$unitsToStart->{$unit} = 1;
recordUnit($startListFile, $unit);
if ($unitsToStart eq $unitsToRestart) {
recordUnit($restartListFile, $unit);
} else {
recordUnit($startListFile, $unit);
}
}
$unitsToStop->{$unit} = 1;
@ -401,8 +460,8 @@ $unitsToRestart{$_} = 1 foreach
$unitsToReload{$_} = 1 foreach
split('\n', read_file($reloadListFile, err_mode => 'quiet') // "");
my $activePrev = getActiveUnits;
while (my ($unit, $state) = each %{$activePrev}) {
my $activePrev = getActiveUnits();
while (my ($unit, $state) = each(%{$activePrev})) {
my $baseUnit = $unit;
my $prevUnitFile = "/etc/systemd/system/$baseUnit";
@ -462,9 +521,9 @@ while (my ($unit, $state) = each %{$activePrev}) {
my %old_unit_info = parse_unit($prevUnitFile);
my %new_unit_info = parse_unit($newUnitFile);
my $diff = compare_units(\%old_unit_info, \%new_unit_info);
if ($diff eq 1) {
if ($diff == 1) {
handleModifiedUnit($unit, $baseName, $newUnitFile, \%new_unit_info, $activePrev, \%unitsToStop, \%unitsToStart, \%unitsToReload, \%unitsToRestart, \%unitsToSkip);
} elsif ($diff eq 2 and not $unitsToRestart{$unit}) {
} elsif ($diff == 2 and not $unitsToRestart{$unit}) {
$unitsToReload{$unit} = 1;
recordUnit($reloadListFile, $unit);
}
@ -475,11 +534,11 @@ while (my ($unit, $state) = each %{$activePrev}) {
sub pathToUnitName {
my ($path) = @_;
# Use current version of systemctl binary before daemon is reexeced.
open my $cmd, "-|", "$curSystemd/systemd-escape", "--suffix=mount", "-p", $path
open(my $cmd, "-|", "$curSystemd/systemd-escape", "--suffix=mount", "-p", $path)
or die "Unable to escape $path!\n";
my $escaped = join "", <$cmd>;
chomp $escaped;
close $cmd or die;
my $escaped = join("", <$cmd>);
chomp($escaped);
close($cmd) or die('Unable to close systemd-escape pipe');
return $escaped;
}
@ -488,13 +547,13 @@ sub pathToUnitName {
# automatically by starting local-fs.target. FIXME: might be nicer if
# we generated units for all mounts; then we could unify this with the
# unit checking code above.
my ($prevFss, $prevSwaps) = parseFstab "/etc/fstab";
my ($newFss, $newSwaps) = parseFstab "$out/etc/fstab";
foreach my $mountPoint (keys %$prevFss) {
my ($prevFss, $prevSwaps) = parseFstab("/etc/fstab");
my ($newFss, $newSwaps) = parseFstab("$out/etc/fstab");
foreach my $mountPoint (keys(%$prevFss)) {
my $prev = $prevFss->{$mountPoint};
my $new = $newFss->{$mountPoint};
my $unit = pathToUnitName($mountPoint);
if (!defined $new) {
if (!defined($new)) {
# Filesystem entry disappeared, so unmount it.
$unitsToStop{$unit} = 1;
} elsif ($prev->{fsType} ne $new->{fsType} || $prev->{device} ne $new->{device}) {
@ -510,10 +569,10 @@ foreach my $mountPoint (keys %$prevFss) {
}
# Also handles swap devices.
foreach my $device (keys %$prevSwaps) {
foreach my $device (keys(%$prevSwaps)) {
my $prev = $prevSwaps->{$device};
my $new = $newSwaps->{$device};
if (!defined $new) {
if (!defined($new)) {
# Swap entry disappeared, so turn it off. Can't use
# "systemctl stop" here because systemd has lots of alias
# units that prevent a stop from actually calling
@ -544,8 +603,8 @@ if ($prevSystemdSystemConfig ne $newSystemdSystemConfig) {
sub filterUnits {
my ($units) = @_;
my @res;
foreach my $unit (sort(keys %{$units})) {
push @res, $unit if !defined $unitsToFilter{$unit};
foreach my $unit (sort(keys(%{$units}))) {
push(@res, $unit) if !defined($unitsToFilter{$unit});
}
return @res;
}
@ -556,9 +615,9 @@ my @unitsToStopFiltered = filterUnits(\%unitsToStop);
# Show dry-run actions.
if ($action eq "dry-activate") {
print STDERR "would stop the following units: ", join(", ", @unitsToStopFiltered), "\n"
if scalar @unitsToStopFiltered > 0;
print STDERR "would NOT stop the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"
if scalar(keys %unitsToSkip) > 0;
if scalar(@unitsToStopFiltered) > 0;
print STDERR "would NOT stop the following changed units: ", join(", ", sort(keys(%unitsToSkip))), "\n"
if scalar(keys(%unitsToSkip)) > 0;
print STDERR "would activate the configuration...\n";
system("$out/dry-activate", "$out");
@ -579,7 +638,7 @@ if ($action eq "dry-activate") {
$baseName =~ s/\.[a-z]*$//;
# Start units if they were not active previously
if (not defined $activePrev->{$unit}) {
if (not defined($activePrev->{$unit})) {
$unitsToStart{$unit} = 1;
next;
}
@ -599,28 +658,28 @@ if ($action eq "dry-activate") {
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;
print STDERR "would restart the following units: ", join(", ", sort(keys %unitsToRestart)), "\n"
if scalar(keys %unitsToRestart) > 0;
print STDERR "would reload the following units: ", join(", ", sort(keys(%unitsToReload))), "\n"
if scalar(keys(%unitsToReload)) > 0;
print STDERR "would restart the following units: ", join(", ", sort(keys(%unitsToRestart))), "\n"
if scalar(keys(%unitsToRestart)) > 0;
my @unitsToStartFiltered = filterUnits(\%unitsToStart);
print STDERR "would start the following units: ", join(", ", @unitsToStartFiltered), "\n"
if scalar @unitsToStartFiltered;
if scalar(@unitsToStartFiltered);
exit 0;
}
syslog(LOG_NOTICE, "switching to system configuration $out");
if (scalar (keys %unitsToStop) > 0) {
if (scalar(keys(%unitsToStop)) > 0) {
print STDERR "stopping the following units: ", join(", ", @unitsToStopFiltered), "\n"
if scalar @unitsToStopFiltered;
if scalar(@unitsToStopFiltered);
# Use current version of systemctl binary before daemon is reexeced.
system("$curSystemd/systemctl", "stop", "--", sort(keys %unitsToStop));
system("$curSystemd/systemctl", "stop", "--", sort(keys(%unitsToStop)));
}
print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"
if scalar(keys %unitsToSkip) > 0;
print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys(%unitsToSkip))), "\n"
if scalar(keys(%unitsToSkip)) > 0;
# Activate the new configuration (i.e., update /etc, make accounts,
# and so on).
@ -644,7 +703,7 @@ foreach (split('\n', read_file($restartByActivationFile, err_mode => 'quiet') //
$baseName =~ s/\.[a-z]*$//;
# Start units if they were not active previously
if (not defined $activePrev->{$unit}) {
if (not defined($activePrev->{$unit})) {
$unitsToStart{$unit} = 1;
recordUnit($startListFile, $unit);
next;
@ -681,7 +740,7 @@ system("@systemd@/bin/systemctl", "reset-failed");
system("@systemd@/bin/systemctl", "daemon-reload") == 0 or $res = 3;
# Reload user units
open my $listActiveUsers, '-|', '@systemd@/bin/loginctl', 'list-users', '--no-legend';
open(my $listActiveUsers, '-|', '@systemd@/bin/loginctl', 'list-users', '--no-legend');
while (my $f = <$listActiveUsers>) {
next unless $f =~ /^\s*(?<uid>\d+)\s+(?<user>\S+)/;
my ($uid, $name) = ($+{uid}, $+{user});
@ -693,25 +752,43 @@ while (my $f = <$listActiveUsers>) {
"@systemd@/bin/systemctl --user start nixos-activation.service");
}
close $listActiveUsers;
close($listActiveUsers);
# Set the new tmpfiles
print STDERR "setting up tmpfiles\n";
system("@systemd@/bin/systemd-tmpfiles", "--create", "--remove", "--exclude-prefix=/dev") == 0 or $res = 3;
# Before reloading we need to ensure that the units are still active. They may have been
# deactivated because one of their requirements got stopped. If they are inactive
# but should have been reloaded, the user probably expects them to be started.
if (scalar(keys(%unitsToReload)) > 0) {
for my $unit (keys(%unitsToReload)) {
if (!unit_is_active($unit)) {
# Figure out if we need to start the unit
my %unit_info = parse_unit("$out/etc/systemd/system/$unit");
if (!(parseSystemdBool(\%unit_info, 'Unit', 'RefuseManualStart', 0) || parseSystemdBool(\%unit_info, 'Unit', 'X-OnlyManualStart', 0))) {
$unitsToStart{$unit} = 1;
recordUnit($startListFile, $unit);
}
# Don't reload the unit, reloading would fail
delete %unitsToReload{$unit};
unrecord_unit($reloadListFile, $unit);
}
}
}
# Reload units that need it. This includes remounting changed mount
# units.
if (scalar(keys %unitsToReload) > 0) {
print STDERR "reloading the following units: ", join(", ", sort(keys %unitsToReload)), "\n";
system("@systemd@/bin/systemctl", "reload", "--", sort(keys %unitsToReload)) == 0 or $res = 4;
if (scalar(keys(%unitsToReload)) > 0) {
print STDERR "reloading the following units: ", join(", ", sort(keys(%unitsToReload))), "\n";
system("@systemd@/bin/systemctl", "reload", "--", sort(keys(%unitsToReload))) == 0 or $res = 4;
unlink($reloadListFile);
}
# Restart changed services (those that have to be restarted rather
# than stopped and started).
if (scalar(keys %unitsToRestart) > 0) {
print STDERR "restarting the following units: ", join(", ", sort(keys %unitsToRestart)), "\n";
system("@systemd@/bin/systemctl", "restart", "--", sort(keys %unitsToRestart)) == 0 or $res = 4;
if (scalar(keys(%unitsToRestart)) > 0) {
print STDERR "restarting the following units: ", join(", ", sort(keys(%unitsToRestart))), "\n";
system("@systemd@/bin/systemctl", "restart", "--", sort(keys(%unitsToRestart))) == 0 or $res = 4;
unlink($restartListFile);
}
@ -723,17 +800,17 @@ if (scalar(keys %unitsToRestart) > 0) {
# systemd.
my @unitsToStartFiltered = filterUnits(\%unitsToStart);
print STDERR "starting the following units: ", join(", ", @unitsToStartFiltered), "\n"
if scalar @unitsToStartFiltered;
system("@systemd@/bin/systemctl", "start", "--", sort(keys %unitsToStart)) == 0 or $res = 4;
if scalar(@unitsToStartFiltered);
system("@systemd@/bin/systemctl", "start", "--", sort(keys(%unitsToStart))) == 0 or $res = 4;
unlink($startListFile);
# Print failed and new units.
my (@failed, @new);
my $activeNew = getActiveUnits;
while (my ($unit, $state) = each %{$activeNew}) {
my $activeNew = getActiveUnits();
while (my ($unit, $state) = each(%{$activeNew})) {
if ($state->{state} eq "failed") {
push @failed, $unit;
push(@failed, $unit);
next;
}
@ -743,7 +820,7 @@ while (my ($unit, $state) = each %{$activeNew}) {
chomp($main_status);
if ($main_status ne "0") {
push @failed, $unit;
push(@failed, $unit);
next;
}
}
@ -751,19 +828,19 @@ while (my ($unit, $state) = each %{$activeNew}) {
# Ignore scopes since they are not managed by this script but rather
# created and managed by third-party services via the systemd dbus API.
# This only lists units that are not failed (including ones that are in auto-restart but have not failed previously)
if ($state->{state} ne "failed" && !defined $activePrev->{$unit} && $unit !~ /\.scope$/msx) {
push @new, $unit;
if ($state->{state} ne "failed" && !defined($activePrev->{$unit}) && $unit !~ /\.scope$/msx) {
push(@new, $unit);
}
}
if (scalar @new > 0) {
if (scalar(@new) > 0) {
print STDERR "the following new units were started: ", join(", ", sort(@new)), "\n"
}
if (scalar @failed > 0) {
my @failed_sorted = sort @failed;
if (scalar(@failed) > 0) {
my @failed_sorted = sort(@failed);
print STDERR "warning: the following units failed: ", join(", ", @failed_sorted), "\n\n";
system "@systemd@/bin/systemctl status --no-pager --full '" . join("' '", @failed_sorted) . "' >&2";
system("@systemd@/bin/systemctl status --no-pager --full '" . join("' '", @failed_sorted) . "' >&2");
$res = 4;
}
@ -773,4 +850,4 @@ if ($res == 0) {
syslog(LOG_ERR, "switching to system configuration $out failed (status $res)");
}
exit $res;
exit($res);

View file

@ -15,9 +15,12 @@ import re
import datetime
import glob
import os.path
from typing import Tuple, List, Optional
from typing import NamedTuple, List, Optional
SystemIdentifier = Tuple[Optional[str], int, Optional[str]]
class SystemIdentifier(NamedTuple):
profile: Optional[str]
generation: int
specialisation: Optional[str]
def copy_if_not_exists(source: str, dest: str) -> None:
@ -151,7 +154,14 @@ def get_generations(profile: Optional[str] = None) -> List[SystemIdentifier]:
gen_lines.pop()
configurationLimit = @configurationLimit@
configurations: List[SystemIdentifier] = [ (profile, int(line.split()[0]), None) for line in gen_lines ]
configurations = [
SystemIdentifier(
profile=profile,
generation=int(line.split()[0]),
specialisation=None
)
for line in gen_lines
]
return configurations[-configurationLimit:]
@ -160,7 +170,7 @@ def get_specialisations(profile: Optional[str], generation: int, _: Optional[str
system_dir(profile, generation, None), "specialisation")
if not os.path.exists(specialisations_dir):
return []
return [(profile, generation, spec) for spec in os.listdir(specialisations_dir)]
return [SystemIdentifier(profile, generation, spec) for spec in os.listdir(specialisations_dir)]
def remove_old_entries(gens: List[SystemIdentifier]) -> None:
@ -271,7 +281,8 @@ def main() -> None:
if os.readlink(system_dir(*gen)) == args.default_config:
write_loader_conf(*gen)
except OSError as e:
print("ignoring generation '{}' in the list of boot entries because of the following error:\n{}".format(*gen, e), file=sys.stderr)
profile = f"profile '{gen.profile}'" if gen.profile else "default profile"
print("ignoring {} in the list of boot entries because of the following error:\n{}".format(profile, e), file=sys.stderr)
for root, _, files in os.walk('@efiSysMountPoint@/efi/nixos/.extra-files', topdown=False):
relative_root = root.removeprefix("@efiSysMountPoint@/efi/nixos/.extra-files").removeprefix("/")

View file

@ -503,6 +503,7 @@ in
systemd-boot = handleTest ./systemd-boot.nix {};
systemd-confinement = handleTest ./systemd-confinement.nix {};
systemd-cryptenroll = handleTest ./systemd-cryptenroll.nix {};
systemd-escaping = handleTest ./systemd-escaping.nix {};
systemd-journal = handleTest ./systemd-journal.nix {};
systemd-machinectl = handleTest ./systemd-machinectl.nix {};
systemd-networkd = handleTest ./systemd-networkd.nix {};
@ -524,6 +525,7 @@ in
tinc = handleTest ./tinc {};
tinydns = handleTest ./tinydns.nix {};
tinywl = handleTest ./tinywl.nix {};
tomcat = handleTest ./tomcat.nix {};
tor = handleTest ./tor.nix {};
# traefik test relies on docker-containers
traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {};

0
nixos/tests/empty-file Normal file
View file

View file

@ -64,6 +64,11 @@ in {
};
};
simpleServiceDifferentDescription.configuration = {
imports = [ simpleService.configuration ];
systemd.services.test.description = "Test unit";
};
simpleServiceModified.configuration = {
imports = [ simpleService.configuration ];
systemd.services.test.serviceConfig.X-Test = true;
@ -203,6 +208,39 @@ in {
systemd.services."escaped\\x2ddash".serviceConfig.X-Test = "test";
};
unitWithRequirement.configuration = {
systemd.services.required-service = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.coreutils}/bin/true";
ExecReload = "${pkgs.coreutils}/bin/true";
};
};
systemd.services.test-service = {
wantedBy = [ "multi-user.target" ];
requires = [ "required-service.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.coreutils}/bin/true";
ExecReload = "${pkgs.coreutils}/bin/true";
};
};
};
unitWithRequirementModified.configuration = {
imports = [ unitWithRequirement.configuration ];
systemd.services.required-service.serviceConfig.X-Test = "test";
systemd.services.test-service.reloadTriggers = [ "test" ];
};
unitWithRequirementModifiedNostart.configuration = {
imports = [ unitWithRequirement.configuration ];
systemd.services.test-service.unitConfig.RefuseManualStart = true;
};
restart-and-reload-by-activation-script.configuration = {
systemd.services = rec {
simple-service = {
@ -350,6 +388,31 @@ in {
systemd.timers.test-timer.timerConfig.OnCalendar = lib.mkForce "Fri 2012-11-23 16:00:00";
};
hybridSleepModified.configuration = {
systemd.targets.hybrid-sleep.unitConfig.X-Test = true;
};
target.configuration = {
systemd.targets.test-target.wantedBy = [ "multi-user.target" ];
# We use this service to figure out whether the target was modified.
# This is the only way because targets are filtered and therefore not
# printed when they are started/stopped.
systemd.services.test-service = {
bindsTo = [ "test-target.target" ];
serviceConfig.ExecStart = "${pkgs.coreutils}/bin/sleep infinity";
};
};
targetModified.configuration = {
imports = [ target.configuration ];
systemd.targets.test-target.unitConfig.X-Test = true;
};
targetModifiedStopOnReconfig.configuration = {
imports = [ target.configuration ];
systemd.targets.test-target.unitConfig.X-StopOnReconfiguration = true;
};
path.configuration = {
systemd.paths.test-watch = {
wantedBy = [ "paths.target" ];
@ -472,6 +535,15 @@ in {
assert_lacks(out, "\nstarting the following units:")
assert_lacks(out, "the following new units were started:")
# Only changing the description does nothing
out = switch_to_specialisation("${machine}", "simpleServiceDifferentDescription")
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:")
# Restart the simple service
out = switch_to_specialisation("${machine}", "simpleServiceModified")
assert_contains(out, "stopping the following units: test.service\n")
@ -535,6 +607,32 @@ in {
assert_contains(out, "\nstarting the following units: escaped\\x2ddash.service\n")
assert_lacks(out, "the following new units were started:")
# Ensure units that require changed units are properly reloaded
out = switch_to_specialisation("${machine}", "unitWithRequirement")
assert_contains(out, "stopping the following units: escaped\\x2ddash.service\n")
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_contains(out, "the following new units were started: required-service.service, test-service.service\n")
out = switch_to_specialisation("${machine}", "unitWithRequirementModified")
assert_contains(out, "stopping the following units: required-service.service\n")
assert_lacks(out, "NOT restarting the following changed units:")
assert_lacks(out, "reloading the following units:")
assert_lacks(out, "\nrestarting the following units:")
assert_contains(out, "\nstarting the following units: required-service.service, test-service.service\n")
assert_lacks(out, "the following new units were started:")
# Unless the unit asks to be not restarted
out = switch_to_specialisation("${machine}", "unitWithRequirementModifiedNostart")
assert_contains(out, "stopping the following units: required-service.service\n")
assert_lacks(out, "NOT restarting the following changed units:")
assert_lacks(out, "reloading the following units:")
assert_lacks(out, "\nrestarting the following units:")
assert_contains(out, "\nstarting the following units: required-service.service\n")
assert_lacks(out, "the following new units were started:")
with subtest("failing units"):
# Let the simple service fail
switch_to_specialisation("${machine}", "simpleServiceModified")
@ -821,6 +919,55 @@ in {
out = machine.succeed("systemctl show test-timer.timer")
assert_contains(out, "OnCalendar=Fri 2012-11-23 16:00:00")
with subtest("targets"):
# Modifying some special targets like hybrid-sleep.target does nothing
out = switch_to_specialisation("${machine}", "hybridSleepModified")
assert_contains(out, "stopping the following units: test-timer.timer\n")
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:")
# Adding a new target starts it
out = switch_to_specialisation("${machine}", "target")
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_contains(out, "the following new units were started: test-target.target\n")
# Changing a target doesn't print anything because the unit is filtered
machine.systemctl("start test-service.service")
out = switch_to_specialisation("${machine}", "targetModified")
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:")
machine.succeed("systemctl is-active test-service.service") # target was not restarted
# With X-StopOnReconfiguration, the target gets stopped and started
out = switch_to_specialisation("${machine}", "targetModifiedStopOnReconfig")
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:")
machine.fail("systemctl is-active test-service.servce") # target was restarted
# Remove the target by switching to the old specialisation
out = switch_to_specialisation("${machine}", "timerModified")
assert_contains(out, "stopping the following units: test-target.target\n")
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_contains(out, "the following new units were started: test-timer.timer\n")
with subtest("paths"):
out = switch_to_specialisation("${machine}", "path")
assert_contains(out, "stopping the following units: test-timer.timer\n")

View file

@ -0,0 +1,45 @@
import ./make-test-python.nix ({ pkgs, ... }:
let
echoAll = pkgs.writeScript "echo-all" ''
#! ${pkgs.runtimeShell}
for s in "$@"; do
printf '%s\n' "$s"
done
'';
# deliberately using a local empty file instead of pkgs.emptyFile to have
# a non-store path in the test
args = [ "a%Nything" "lang=\${LANG}" ";" "/bin/sh -c date" ./empty-file 4.2 23 ];
in
{
name = "systemd-escaping";
machine = { pkgs, lib, utils, ... }: {
systemd.services.echo =
assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ [] ])).success;
assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ {} ])).success;
assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ null ])).success;
assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ false ])).success;
assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ (_:_) ])).success;
{ description = "Echo to the journal";
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
${echoAll} ${utils.escapeSystemdExecArgs args}
'';
};
};
testScript = ''
machine.wait_for_unit("multi-user.target")
machine.succeed("systemctl start echo.service")
# skip the first 'Starting <service> ...' line
logs = machine.succeed("journalctl -u echo.service -o cat").splitlines()[1:]
assert "a%Nything" == logs[0]
assert "lang=''${LANG}" == logs[1]
assert ";" == logs[2]
assert "/bin/sh -c date" == logs[3]
assert "/nix/store/ij3gw72f4n5z4dz6nnzl1731p9kmjbwr-empty-file" == logs[4]
assert "4.2" in logs[5] # toString produces extra fractional digits!
assert "23" == logs[6]
'';
})

21
nixos/tests/tomcat.nix Normal file
View file

@ -0,0 +1,21 @@
import ./make-test-python.nix ({ pkgs, ... }:
{
name = "tomcat";
machine = { pkgs, ... }: {
services.tomcat.enable = true;
};
testScript = ''
machine.wait_for_unit("tomcat.service")
machine.wait_for_open_port(8080)
machine.wait_for_file("/var/tomcat/webapps/examples");
machine.succeed(
"curl --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'"
)
machine.succeed(
"curl --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'"
)
'';
})

View file

@ -1,39 +1,50 @@
{ lib, stdenv, fetchFromGitHub
, alsa-lib, flac, libmad, libvorbis, mpg123
{ lib
, stdenv
, fetchFromGitHub
, alsa-lib
, flac
, libmad
, libpulseaudio
, libvorbis
, mpg123
, audioBackend ? "alsa"
, dsdSupport ? true
, faad2Support ? true, faad2
, ffmpegSupport ? true, ffmpeg
, opusSupport ? true, opusfile
, resampleSupport ? true, soxr
, sslSupport ? true, openssl
, faad2Support ? true
, faad2
, ffmpegSupport ? true
, ffmpeg
, opusSupport ? true
, opusfile
, resampleSupport ? true
, soxr
, sslSupport ? true
, openssl
}:
let
concatStringsSep = lib.concatStringsSep;
optional = lib.optional;
opts = [ "-DLINKALL" ]
++ optional dsdSupport "-DDSD"
++ optional (!faad2Support) "-DNO_FAAD"
++ optional ffmpegSupport "-DFFMPEG"
++ optional opusSupport "-DOPUS"
++ optional resampleSupport "-DRESAMPLE"
++ optional sslSupport "-DUSE_SSL";
inherit (lib) optional optionalString;
in stdenv.mkDerivation {
pname = "squeezelite";
pulseSupport = audioBackend == "pulse";
binName = "squeezelite${optionalString pulseSupport "-pulse"}";
in
stdenv.mkDerivation {
# the nixos module uses the pname as the binary name
pname = binName;
# versions are specified in `squeezelite.h`
# see https://github.com/ralph-irving/squeezelite/issues/29
version = "1.9.6.1196";
version = "1.9.9.1401";
src = fetchFromGitHub {
owner = "ralph-irving";
repo = "squeezelite";
rev = "2b508464dce2cbdb2a3089c58df2a6fbc36328c0";
sha256 = "024ypr1da2r079k3hgiifzd3d3wcfprhbl5zdm40zm0c7frzmr8i";
owner = "ralph-irving";
repo = "squeezelite";
rev = "894df3ea80f66a27a9ae5fab918acf62a6798b8b";
hash = "sha256-LIi+9vb0+56AGvVrLx4gQaUkUNjIi6PmqrLViLT1DSU=";
};
buildInputs = [ alsa-lib flac libmad libvorbis mpg123 ]
buildInputs = [ flac libmad libvorbis mpg123 ]
++ lib.singleton (if pulseSupport then libpulseaudio else alsa-lib)
++ optional faad2Support faad2
++ optional ffmpegSupport ffmpeg
++ optional opusSupport opusfile
@ -47,15 +58,22 @@ in stdenv.mkDerivation {
--replace "<opusfile.h>" "<opus/opusfile.h>"
'';
preBuild = ''
export OPTS="${concatStringsSep " " opts}"
'';
EXECUTABLE = binName;
OPTS = [ "-DLINKALL" ]
++ optional dsdSupport "-DDSD"
++ optional (!faad2Support) "-DNO_FAAD"
++ optional ffmpegSupport "-DFFMPEG"
++ optional opusSupport "-DOPUS"
++ optional pulseSupport "-DPULSEAUDIO"
++ optional resampleSupport "-DRESAMPLE"
++ optional sslSupport "-DUSE_SSL";
installPhase = ''
runHook preInstall
install -Dm755 -t $out/bin squeezelite
install -Dm644 -t $out/share/doc/squeezelite *.txt *.md
install -Dm555 -t $out/bin ${binName}
install -Dm444 -t $out/share/doc/squeezelite *.txt *.md
runHook postInstall
'';
@ -63,7 +81,7 @@ in stdenv.mkDerivation {
meta = with lib; {
description = "Lightweight headless squeezebox client emulator";
homepage = "https://github.com/ralph-irving/squeezelite";
license = with licenses; [ gpl3 ] ++ optional dsdSupport bsd2;
license = with licenses; [ gpl3Plus ] ++ optional dsdSupport bsd2;
maintainers = with maintainers; [ samdoshi ];
platforms = platforms.linux;
};

View file

@ -0,0 +1,37 @@
{ lib
, stdenvNoCC
, undmg
, ...
}:
{ meta
, name
, product
, productShort ? product
, src
, version
, ...
}:
let
loname = lib.toLower productShort;
in
stdenvNoCC.mkDerivation {
inherit meta src version;
desktopName = product;
installPhase = ''
runHook preInstall
APP_DIR="$out/Applications/${product}.app"
mkdir -p "$APP_DIR"
cp -Tr "${product}.app" "$APP_DIR"
mkdir -p "$out/bin"
cat << EOF > "$out/bin/${loname}"
open -na '$APP_DIR' --args "\$@"
EOF
chmod +x "$out/bin/${loname}"
runHook postInstall
'';
nativeBuildInputs = [ undmg ];
pname = lib.concatStringsSep "-" (lib.init (lib.splitString "-" name));
sourceRoot = ".";
}

View file

@ -10,7 +10,18 @@
with lib;
let
mkJetBrainsProduct = callPackage ./common.nix { inherit vmopts; };
platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" ];
inherit (stdenv.hostPlatform) system;
versions = builtins.fromJSON (readFile (./versions.json));
versionKey = if stdenv.isLinux then "linux" else system;
products = versions.${versionKey} or (throw "Unsupported system: ${system}");
package = if stdenv.isDarwin then ./darwin.nix else ./linux.nix;
mkJetBrainsProduct = callPackage package { inherit vmopts; };
# Sorted alphabetically
buildClion = { name, version, src, license, description, wmClass, ... }:
@ -19,13 +30,12 @@ let
product = "CLion";
meta = with lib; {
homepage = "https://www.jetbrains.com/clion/";
inherit description license;
inherit description license platforms;
longDescription = ''
Enhancing productivity for every C and C++
developer on Linux, macOS and Windows.
'';
maintainers = with maintainers; [ edwtjo mic92 ];
platforms = platforms.linux;
};
}).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [
@ -58,14 +68,13 @@ let
product = "DataGrip";
meta = with lib; {
homepage = "https://www.jetbrains.com/datagrip/";
inherit description license;
inherit description license platforms;
longDescription = ''
DataGrip is a new IDE from JetBrains built for database admins.
It allows you to quickly migrate and refactor relational databases,
construct efficient, statically checked SQL queries and much more.
'';
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
});
@ -75,7 +84,7 @@ let
product = "Goland";
meta = with lib; {
homepage = "https://www.jetbrains.com/go/";
inherit description license;
inherit description license platforms;
longDescription = ''
Goland is the codename for a new commercial IDE by JetBrains
aimed at providing an ergonomic environment for Go development.
@ -83,10 +92,9 @@ let
and tool integrations specific for the Go language
'';
maintainers = [ maintainers.miltador ];
platforms = platforms.linux;
};
}).overrideAttrs (attrs: {
postFixup = (attrs.postFixup or "") + ''
postFixup = (attrs.postFixup or "") + lib.optionalString stdenv.isLinux ''
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
patchelf --set-interpreter $interp $out/goland*/plugins/go/lib/dlv/linux/dlv
@ -98,10 +106,10 @@ let
'';
});
buildIdea = { name, version, src, license, description, wmClass, ... }:
buildIdea = { name, version, src, license, description, wmClass, product, ... }:
(mkJetBrainsProduct {
inherit name version src wmClass jdk;
product = "IDEA";
inherit name version src wmClass jdk product;
productShort = "IDEA";
extraLdPath = [ zlib ];
extraWrapperArgs = [
''--set M2_HOME "${maven}/maven"''
@ -116,18 +124,18 @@ let
with JUnit, TestNG, popular SCMs, Ant & Maven. Also known
as IntelliJ.
'';
maintainers = with maintainers; [ edwtjo gytis-ivaskevicius ];
platforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" ];
maintainers = with maintainers; [ edwtjo gytis-ivaskevicius steinybot ];
platforms = ideaPlatforms;
};
});
buildMps = { name, version, src, license, description, wmClass, ... }:
buildMps = { name, version, src, license, description, wmClass, product, ... }:
(mkJetBrainsProduct rec {
inherit name version src wmClass jdk;
product = "MPS";
inherit name version src wmClass jdk product;
productShort = "MPS";
meta = with lib; {
homepage = "https://www.jetbrains.com/mps/";
inherit license description;
inherit license description platforms;
longDescription = ''
A metaprogramming system which uses projectional editing
which allows users to overcome the limits of language
@ -135,7 +143,6 @@ let
diagrams.
'';
maintainers = with maintainers; [ rasendubi ];
platforms = platforms.linux;
};
});
@ -145,24 +152,23 @@ let
product = "PhpStorm";
meta = with lib; {
homepage = "https://www.jetbrains.com/phpstorm/";
inherit description license;
inherit description license platforms;
longDescription = ''
PhpStorm provides an editor for PHP, HTML and JavaScript
with on-the-fly code analysis, error prevention and
automated refactorings for PHP and JavaScript code.
'';
maintainers = with maintainers; [ schristo ma27 ];
platforms = platforms.linux;
};
});
buildPycharm = { name, version, src, license, description, wmClass, ... }:
buildPycharm = { name, version, src, license, description, wmClass, product, ... }:
(mkJetBrainsProduct {
inherit name version src wmClass jdk;
product = "PyCharm";
inherit name version src wmClass jdk product;
productShort = "PyCharm";
meta = with lib; {
homepage = "https://www.jetbrains.com/pycharm/";
inherit description license;
inherit description license platforms;
longDescription = ''
Python IDE with complete set of tools for productive
development with Python programming language. In addition, the
@ -177,11 +183,8 @@ let
and productive development!
'';
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
}).override {
propagatedUserEnvPkgs = [ python3 ];
};
});
buildRider = { name, version, src, license, description, wmClass, ... }:
(mkJetBrainsProduct {
@ -189,7 +192,7 @@ let
product = "Rider";
meta = with lib; {
homepage = "https://www.jetbrains.com/rider/";
inherit description license;
inherit description license platforms;
longDescription = ''
JetBrains Rider is a new .NET IDE based on the IntelliJ
platform and ReSharper. Rider supports .NET Core,
@ -199,7 +202,6 @@ let
ASP.NET Core web applications.
'';
maintainers = [ maintainers.miltador ];
platforms = platforms.linux;
};
}).overrideAttrs (attrs: {
postPatch = lib.optionalString (!stdenv.isDarwin) (attrs.postPatch + ''
@ -215,10 +217,9 @@ let
product = "RubyMine";
meta = with lib; {
homepage = "https://www.jetbrains.com/ruby/";
inherit description license;
inherit description license platforms;
longDescription = description;
maintainers = with maintainers; [ edwtjo ];
platforms = platforms.linux;
};
});
@ -228,14 +229,13 @@ let
product = "WebStorm";
meta = with lib; {
homepage = "https://www.jetbrains.com/webstorm/";
inherit description license;
inherit description license platforms;
longDescription = ''
WebStorm provides an editor for HTML, JavaScript (incl. Node.js),
and CSS with on-the-fly code analysis, error prevention and
automated refactorings for JavaScript code.
'';
maintainers = with maintainers; [ abaldeau ];
platforms = platforms.linux;
};
}).overrideAttrs (attrs: {
postPatch = (attrs.postPatch or "") + optionalString (stdenv.isLinux) ''
@ -244,6 +244,7 @@ let
rm -r jbr
'';
});
in
{
@ -251,12 +252,12 @@ in
clion = buildClion rec {
name = "clion-${version}";
version = "2021.3.3"; /* updated by script */
version = products.clion.version;
description = "C/C++ IDE. New. Intelligent. Cross-platform";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/cpp/CLion-${version}.tar.gz";
sha256 = "03gil00srq3jljc13iyb7v1yc6l6yhdhqm9d1ld2j2pympl6p61m"; /* updated by script */
url = products.clion.url;
sha256 = products.clion.sha256;
};
wmClass = "jetbrains-clion";
update-channel = "CLion RELEASE"; # channel's id as in http://www.jetbrains.com/updates/updates.xml
@ -264,12 +265,12 @@ in
datagrip = buildDataGrip rec {
name = "datagrip-${version}";
version = "2021.3.4"; /* updated by script */
version = products.datagrip.version;
description = "Your Swiss Army Knife for Databases and SQL";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
sha256 = "09dkxj5vn99gkgc1yd18w7gqkw2vzci0z9q2fcih0zn7lvqp0im3"; /* updated by script */
url = products.datagrip.url;
sha256 = products.datagrip.sha256;
};
wmClass = "jetbrains-datagrip";
update-channel = "DataGrip RELEASE";
@ -277,12 +278,12 @@ in
goland = buildGoland rec {
name = "goland-${version}";
version = "2021.3.3"; /* updated by script */
version = products.goland.version;
description = "Up and Coming Go IDE";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/go/${name}.tar.gz";
sha256 = "18z4mvxhds5fgdwcfywc4pj8s9ifvsknhradgzmxsvji0fbp0awx"; /* updated by script */
url = products.goland.url;
sha256 = products.goland.sha256;
};
wmClass = "jetbrains-goland";
update-channel = "GoLand RELEASE";
@ -290,12 +291,13 @@ in
idea-community = buildIdea rec {
name = "idea-community-${version}";
version = "2021.3.2"; /* updated by script */
product = "IntelliJ IDEA CE";
version = products.idea-community.version;
description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
license = lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
sha256 = "1j889b2r950bl9wiqq1z8v8s2qicidfcdar300cy666i8rc25qlr"; /* updated by script */
url = products.idea-community.url;
sha256 = products.idea-community.sha256;
};
wmClass = "jetbrains-idea-ce";
update-channel = "IntelliJ IDEA RELEASE";
@ -303,12 +305,13 @@ in
idea-ultimate = buildIdea rec {
name = "idea-ultimate-${version}";
version = "2021.3.2"; /* updated by script */
product = "IntelliJ IDEA";
version = products.idea-ultimate.version;
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jbr.tar.gz";
sha256 = "0w36qnqgkvw6j1ks09h515237bhqfaixrimzg2r494ic98amvkps"; /* updated by script */
url = products.idea-ultimate.url;
sha256 = products.idea-ultimate.sha256;
};
wmClass = "jetbrains-idea";
update-channel = "IntelliJ IDEA RELEASE";
@ -316,13 +319,13 @@ in
mps = buildMps rec {
name = "mps-${version}";
version = "2021.3"; /* updated by script */
versionMajorMinor = "2021.3"; /* updated by script */
product = "MPS ${products.mps.version-major-minor}";
version = products.mps.version;
description = "Create your own domain-specific language";
license = lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/mps/${versionMajorMinor}/MPS-${version}.tar.gz";
sha256 = "0zw5xqdlhjfg0smfjl8xy7drf9spiwqbmqq8z22x4zb61lpvdbp9"; /* updated by script */
url = products.mps.url;
sha256 = products.mps.sha256;
};
wmClass = "jetbrains-mps";
update-channel = "MPS RELEASE";
@ -330,12 +333,12 @@ in
phpstorm = buildPhpStorm rec {
name = "phpstorm-${version}";
version = "2021.3.2"; /* updated by script */
version = products.phpstorm.version;
description = "Professional IDE for Web and PHP developers";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
sha256 = "1qi0zq3gzcfnikky37g2dqgmzm7r1883k6asris8nph389qk86vn"; /* updated by script */
url = products.phpstorm.url;
sha256 = products.phpstorm.sha256;
};
wmClass = "jetbrains-phpstorm";
update-channel = "PhpStorm RELEASE";
@ -343,12 +346,13 @@ in
pycharm-community = buildPycharm rec {
name = "pycharm-community-${version}";
version = "2021.3.2"; /* updated by script */
product = "PyCharm CE";
version = products.pycharm-community.version;
description = "PyCharm Community Edition";
license = lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/python/${name}.tar.gz";
sha256 = "1s36basydp7cxgbgdapjhkslx0x9vv3639xhm84ny76hf7s03bpi"; /* updated by script */
url = products.pycharm-community.url;
sha256 = products.pycharm-community.sha256;
};
wmClass = "jetbrains-pycharm-ce";
update-channel = "PyCharm RELEASE";
@ -356,12 +360,13 @@ in
pycharm-professional = buildPycharm rec {
name = "pycharm-professional-${version}";
version = "2021.3.2"; /* updated by script */
product = "PyCharm";
version = products.pycharm-professional.version;
description = "PyCharm Professional Edition";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/python/${name}.tar.gz";
sha256 = "0rwykngqgby05mh47kls8wzi68gfka2z04k6kdmsxwn1hhx5gnbb"; /* updated by script */
url = products.pycharm-professional.url;
sha256 = products.pycharm-professional.sha256;
};
wmClass = "jetbrains-pycharm";
update-channel = "PyCharm RELEASE";
@ -369,12 +374,12 @@ in
rider = buildRider rec {
name = "rider-${version}";
version = "2021.3.3"; /* updated by script */
version = products.rider.version;
description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
sha256 = "13q6hk5l3fqmz818z5wj014jd5iglpdcpi8zlpgaim1jg5fpvi8x"; /* updated by script */
url = products.rider.url;
sha256 = products.rider.sha256;
};
wmClass = "jetbrains-rider";
update-channel = "Rider RELEASE";
@ -382,12 +387,12 @@ in
ruby-mine = buildRubyMine rec {
name = "ruby-mine-${version}";
version = "2021.3.2"; /* updated by script */
version = products.ruby-mine.version;
description = "The Most Intelligent Ruby and Rails IDE";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/ruby/RubyMine-${version}.tar.gz";
sha256 = "18ny40zl9hgkynkc5yyy2xqngl9diifh2gqrfnz7rfq14kp10xb9"; /* updated by script */
url = products.ruby-mine.url;
sha256 = products.ruby-mine.sha256;
};
wmClass = "jetbrains-rubymine";
update-channel = "RubyMine RELEASE";
@ -395,12 +400,12 @@ in
webstorm = buildWebStorm rec {
name = "webstorm-${version}";
version = "2021.3.2"; /* updated by script */
version = products.webstorm.version;
description = "Professional IDE for Web and JavaScript development";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/webstorm/WebStorm-${version}.tar.gz";
sha256 = "0q2hn48499hv7licpl84ly0bhiizya8a69dl2vjvgscj3cdkr98q"; /* updated by script */
url = products.webstorm.url;
sha256 = products.webstorm.sha256;
};
wmClass = "jetbrains-webstorm";
update-channel = "WebStorm RELEASE";

View file

@ -3,17 +3,15 @@
, vmopts ? null
}:
{ name, product, version, src, wmClass, jdk, meta, extraLdPath ? [], extraWrapperArgs ? [] }@args:
{ name, product, productShort ? product, version, src, wmClass, jdk, meta, extraLdPath ? [], extraWrapperArgs ? [] }@args:
with lib;
let loName = toLower product;
hiName = toUpper product;
let loName = toLower productShort;
hiName = toUpper productShort;
mainProgram = concatStringsSep "-" (init (splitString "-" name));
vmoptsName = loName
+ ( if (with stdenv.hostPlatform; (is32bit || isDarwin))
then ""
else "64" )
+ lib.optionalString stdenv.hostPlatform.is64bit "64"
+ ".vmoptions";
in
@ -36,7 +34,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
nativeBuildInputs = [ makeWrapper patchelf unzip ];
postPatch = lib.optionalString (!stdenv.isDarwin) ''
postPatch = ''
get_file_size() {
local fname="$1"
echo $(ls -l $fname | cut -d ' ' -f5)
@ -73,7 +71,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
item=${desktopItem}
makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${mainProgram}" \
--prefix PATH : "$out/libexec/${name}:${lib.optionalString (stdenv.isDarwin) "${jdk}/jdk/Contents/Home/bin:"}${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
--prefix PATH : "$out/libexec/${name}:${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath ([
# Some internals want libstdc++.so.6
stdenv.cc.cc.lib libsecret e2fsprogs

View file

@ -1,101 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i perl -p perl perlPackages.LWPProtocolHttps perlPackages.FileSlurp
use strict;
use List::Util qw(reduce);
use File::Slurp;
use LWP::Simple;
my $only_free = grep { $_ eq "--only-free" } @ARGV;
sub semantic_less {
my ($a, $b) = @_;
$a =~ s/\b(\d+)\b/sprintf("%010s", $1)/eg;
$b =~ s/\b(\d+)\b/sprintf("%010s", $1)/eg;
return $a lt $b;
}
sub get_latest_versions {
my @channels = get("https://www.jetbrains.com/updates/updates.xml") =~ /(<channel .+?<\/channel>)/gs;
my %h = {};
for my $ch (@channels) {
my ($id) = $ch =~ /^<channel id="[^"]+" name="([^"]+)"/;
my @builds = $ch =~ /(<build .+?<\/build>)/gs;
my $latest_build = reduce {
my ($aversion) = $a =~ /^<build [^>]*version="([^"]+)"/; die "no version in $a" unless $aversion;
my ($bversion) = $b =~ /^<build [^>]*version="([^"]+)"/; die "no version in $b" unless $bversion;
semantic_less($aversion, $bversion) ? $b : $a;
} @builds;
next unless $latest_build;
# version as in download url
my ($version) = $latest_build =~ /^<build [^>]*version="([^"]+)"/;
my ($fullNumber) = $latest_build =~ /^<build [^>]*fullNumber="([^"]+)"/;
my $latest_version_full1 = "$version-$fullNumber";
$latest_version_full1 =~ s/\s*EAP//;
my ($latest_version) = $latest_build =~ /^<build [^>]*version="([^"]+)"/;
($latest_version) = $latest_build =~ /^<build [^>]*fullNumber="([^"]+)"/ if $latest_version =~ / /;
$h{$id} = $latest_version;
$h{"full1_" . $id} = $latest_version_full1;
}
return %h;
}
my %latest_versions = get_latest_versions();
# for my $ch (sort keys %latest_versions) {
# print("$ch $latest_versions{$ch}\n");
# }
sub update_nix_block {
my ($block) = @_;
my ($channel) = $block =~ /update-channel\s*=\s*"([^"]+)"/;
if ($channel) {
if ($latest_versions{$channel}) {
my ($version) = $block =~ /version\s*=\s*"([^"]+)"/;
die "no version in $block" unless $version;
if ($version eq $latest_versions{$channel}) {
print("$channel is up to date at $version\n");
} elsif ($only_free && $block =~ /licenses\.unfree/) {
print("$channel is unfree, skipping\n");
} else {
my $version_string = $latest_versions{$channel};
my $versionMajorMinor = $version_string =~ s/^([0-9]+[.][0-9]+).*/$1/r;
print("updating $channel: $version -> $version_string\n");
my ($url) = $block =~ /url\s*=\s*"([^"]+)"/;
# try to interpret some nix
my ($name) = $block =~ /name\s*=\s*"([^"]+)"/;
$name =~ s/\$\{version\}/$version_string/;
# Some url pattern contain variables more than once
$url =~ s/\$\{name\}/$name/g;
$url =~ s/\$\{version\}/$version_string/g;
$url =~ s/\$\{versionMajorMinor\}/$versionMajorMinor/g;
die "$url still has some interpolation" if $url =~ /\$/;
my ($sha256) = get("$url.sha256") =~ /^([0-9a-f]{64})/;
unless ( $sha256 ) {
my $full_version = $latest_versions{"full1_" . $channel};
$url =~ s/$version_string/$full_version/;
($sha256) = get("$url.sha256") =~ /^([0-9a-f]{64})/;
$version_string = $full_version;
}
die "invalid sha256 in $url.sha256" unless $sha256;
my ($sha256Base32) = readpipe("nix-hash --type sha256 --to-base32 $sha256");
chomp $sha256Base32;
print "Jetbrains published SHA256: $sha256\n";
print "Conversion into base32 yields: $sha256Base32\n";
$block =~ s#version\s*=\s*"([^"]+)".+$#version = "$version_string"; /* updated by script */#m;
$block =~ s#versionMajorMinor\s*=\s*"([^"]+)".+$#versionMajorMinor = "$versionMajorMinor"; /* updated by script */#m;
$block =~ s#sha256\s*=\s*"([^"]+)".+$#sha256 = "$sha256Base32"; /* updated by script */#m;
}
} else {
warn "unknown update-channel $channel";
}
}
return $block;
}
my $nix = read_file 'default.nix';
$nix =~ s/(= build\w+ rec \{.+?\n \};\n)/update_nix_block($1)/gse;
write_file 'default.nix', $nix;

View file

@ -0,0 +1,97 @@
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3 python3.pkgs.packaging python3.pkgs.requests python3.pkgs.xmltodict
import hashlib
import json
import pathlib
import logging
import requests
import sys
import xmltodict
from packaging import version
updates_url = "https://www.jetbrains.com/updates/updates.xml"
versions_file_path = pathlib.Path(__file__).parent.joinpath("versions.json").resolve()
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
def one_or_more(x):
return x if isinstance(x, list) else [x]
def download_channels():
logging.info("Checking for updates from %s", updates_url)
updates_response = requests.get(updates_url)
updates_response.raise_for_status()
root = xmltodict.parse(updates_response.text)
products = root["products"]["product"]
return {
channel["@name"]: channel
for product in products
for channel in one_or_more(product["channel"])
}
def build_version(build):
return version.parse(build["@version"])
def latest_build(channel):
builds = one_or_more(channel["build"])
latest = max(builds, key=build_version)
return latest
def download_sha256(url):
download_response = requests.get(url)
download_response.raise_for_status()
h = hashlib.sha256()
h.update(download_response.content)
return h.hexdigest()
channels = download_channels()
def update_product(name, product):
update_channel = product["update-channel"]
logging.info("Updating %s", name)
channel = channels.get(update_channel)
if channel is None:
logging.error("Failed to find channel %s.", update_channel)
logging.error("Check that the update-channel in %s matches the name in %s", versions_file_path, updates_url)
else:
try:
build = latest_build(channel)
version = build["@version"]
parsed_version = build_version(build)
version_major_minor = f"{parsed_version.major}.{parsed_version.minor}"
download_url = product["url-template"].format(version = version, versionMajorMinor = version_major_minor)
product["url"] = download_url
product["version-major-minor"] = version_major_minor
if "sha256" not in product or product.get("version") != version:
logging.info("Found a newer version %s.", version)
product["version"] = version
product["sha256"] = download_sha256(download_url)
else:
logging.info("Already at the latest version %s.", version)
except Exception as e:
logging.exception("Update failed:", exc_info=e)
logging.warning("Skipping %s due to the above error.", name)
logging.warning("It may be out-of-date. Fix the error and rerun.")
def update_products(products):
for name, product in products.items():
update_product(name, product)
with open(versions_file_path, "r") as versions_file:
versions = json.load(versions_file)
for products in versions.values():
update_products(products)
with open(versions_file_path, "w") as versions_file:
json.dump(versions, versions_file, indent=2)
versions_file.write("\n")

View file

@ -0,0 +1,296 @@
{
"linux": {
"clion": {
"update-channel": "CLion RELEASE",
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}.tar.gz",
"version": "2021.3.3",
"sha256": "35986be8adfe0a291a0d2d550c1bf4861ae6c33ecbc71198a472e0ac01a0f10d",
"url": "https://download.jetbrains.com/cpp/CLion-2021.3.3.tar.gz",
"version-major-minor": "2021.3"
},
"datagrip": {
"update-channel": "DataGrip RELEASE",
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}.tar.gz",
"version": "2021.3.4",
"sha256": "a34670f1a6c77e00237302a70f22fb5bf089dfe128341fd89b2f25bb8becb325",
"url": "https://download.jetbrains.com/datagrip/datagrip-2021.3.4.tar.gz",
"version-major-minor": "2021.3"
},
"goland": {
"update-channel": "GoLand RELEASE",
"url-template": "https://download.jetbrains.com/go/goland-{version}.tar.gz",
"version": "2021.3.3",
"sha256": "9d2b709703516eddeb7f4d6568a7de2e268de4258c7bc7787baee806fbaee4a3",
"url": "https://download.jetbrains.com/go/goland-2021.3.3.tar.gz",
"version-major-minor": "2021.3"
},
"idea-community": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "99e2225846d118e3190023abc65c8b2c62a1d1463f601c79a20b9494c54a08c9",
"url": "https://download.jetbrains.com/idea/ideaIC-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
},
"idea-ultimate": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}-no-jbr.tar.gz",
"version": "2021.3.2",
"sha256": "face5d154a2c9244b278bfc6dca37218ae3344090526a0679086eff9b0c56670",
"url": "https://download.jetbrains.com/idea/ideaIU-2021.3.2-no-jbr.tar.gz",
"version-major-minor": "2021.3"
},
"mps": {
"update-channel": "MPS RELEASE",
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}.tar.gz",
"version": "2021.3",
"sha256": "e9aeb62f0d667dd285f808e3ba308f572797dbf11d51e9aa06cf49481bee857f",
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3.tar.gz",
"version-major-minor": "2021.3"
},
"phpstorm": {
"update-channel": "PhpStorm RELEASE",
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "761b347142035e8b74cc5a9939100af9d45f1f6ee29de1e78cd6b1ff06fe20e2",
"url": "https://download.jetbrains.com/webide/PhpStorm-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
},
"pycharm-community": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "f1ae01f471d01c6f09aab0a761c6dea9834ef584f2aaf6d6ebecdce6b55a66e8",
"url": "https://download.jetbrains.com/python/pycharm-community-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
},
"pycharm-professional": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "6bd9573a84c1f2ae6b9b6612f0859aee21133f479ace43602dc0af879f9d9e67",
"url": "https://download.jetbrains.com/python/pycharm-professional-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
},
"rider": {
"update-channel": "Rider RELEASE",
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}.tar.gz",
"version": "2021.3.3",
"sha256": "1dc57d5d7932d4a8dea51fc5cbdaa52f9626490092978f02fa15bb41cb84068f",
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2021.3.3.tar.gz",
"version-major-minor": "2021.3"
},
"ruby-mine": {
"update-channel": "RubyMine RELEASE",
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "697510ee2401bb7cbe75193f015d8c2dd1677117defbc2a6f5f3c1443f20dea2",
"url": "https://download.jetbrains.com/ruby/RubyMine-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
},
"webstorm": {
"update-channel": "WebStorm RELEASE",
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}.tar.gz",
"version": "2021.3.2",
"sha256": "18a53c1b1b92e9b7e516b425a390f23f46b880a704d1cb223d1ba64410b15060",
"url": "https://download.jetbrains.com/webstorm/WebStorm-2021.3.2.tar.gz",
"version-major-minor": "2021.3"
}
},
"x86_64-darwin": {
"clion": {
"update-channel": "CLion RELEASE",
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}.dmg",
"version": "2021.3.3",
"sha256": "342a4d8549ae4623a5edfa7f9737887cf0a25c1a61bb414b54b742b1c5a1a84d",
"url": "https://download.jetbrains.com/cpp/CLion-2021.3.3.dmg",
"version-major-minor": "2021.3"
},
"datagrip": {
"update-channel": "DataGrip RELEASE",
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}.dmg",
"version": "2021.3.4",
"sha256": "27e709d2ced66d37a615d8c56885828e49a08962708e28df1a20f324c626bf52",
"url": "https://download.jetbrains.com/datagrip/datagrip-2021.3.4.dmg",
"version-major-minor": "2021.3"
},
"goland": {
"update-channel": "GoLand RELEASE",
"url-template": "https://download.jetbrains.com/go/goland-{version}.dmg",
"version": "2021.3.3",
"sha256": "4b245b6fe0cf588adbf36e68f12397d5fd311b0b6d49f17ba374ebaa10d207c9",
"url": "https://download.jetbrains.com/go/goland-2021.3.3.dmg",
"version-major-minor": "2021.3"
},
"idea-community": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}.dmg",
"version": "2021.3.2",
"sha256": "20d8cee2bbedaeb0ea388f795e13d08eca5b59e59d4e980ac2d8bc07c9fed3e9",
"url": "https://download.jetbrains.com/idea/ideaIC-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"idea-ultimate": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}.dmg",
"version": "2021.3.2",
"sha256": "9f574562b866e6ccc3d2f9b4c245c45844d1d0fd54be3dbdcc893d40ba1cf54a",
"url": "https://download.jetbrains.com/idea/ideaIU-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"mps": {
"update-channel": "MPS RELEASE",
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}-macos.dmg",
"version": "2021.3",
"sha256": "2c5517518fec31ac960e4309fa848ad831f9048ef15df1b362e12aa8f41d9dbd",
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3-macos.dmg",
"version-major-minor": "2021.3"
},
"phpstorm": {
"update-channel": "PhpStorm RELEASE",
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}.dmg",
"version": "2021.3.2",
"sha256": "596a9d5fdc30d5fba65ddd482da90f9d555fed748b930587562022bfe7df4e14",
"url": "https://download.jetbrains.com/webide/PhpStorm-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"pycharm-community": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}.dmg",
"version": "2021.3.2",
"sha256": "b8f41f5dddeda0ed5f5c81ba57d2560ccc6e227987882fb6bf305b5d1d8c6909",
"url": "https://download.jetbrains.com/python/pycharm-community-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"pycharm-professional": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.dmg",
"version": "2021.3.2",
"sha256": "188b998660e7cfb7ac1364c818c008a5608ab2aeb17c6cc19d1d9dda547d3775",
"url": "https://download.jetbrains.com/python/pycharm-professional-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"rider": {
"update-channel": "Rider RELEASE",
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}.dmg",
"version": "2021.3.3",
"sha256": "41a0939cb6258a0fb303268c5a466a663cf3588af14bcbb351be4c3a1d158094",
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2021.3.3.dmg",
"version-major-minor": "2021.3"
},
"ruby-mine": {
"update-channel": "RubyMine RELEASE",
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}.dmg",
"version": "2021.3.2",
"sha256": "ba27c14b21d66ca96a64ceb7dc5d9f0952254a5f405b3201f51d2ad3cc749a96",
"url": "https://download.jetbrains.com/ruby/RubyMine-2021.3.2.dmg",
"version-major-minor": "2021.3"
},
"webstorm": {
"update-channel": "WebStorm RELEASE",
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}.dmg",
"version": "2021.3.2",
"sha256": "932d4920f831d1ceae68a474444c37d986277d8d3288d3aab93dd43d99336a36",
"url": "https://download.jetbrains.com/webstorm/WebStorm-2021.3.2.dmg",
"version-major-minor": "2021.3"
}
},
"aarch64-darwin": {
"clion": {
"update-channel": "CLion RELEASE",
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}-aarch64.dmg",
"version": "2021.3.3",
"sha256": "fbf651fa4a5925fe729be30ca8a6fa3be84dc4d7827dbcf74f4d28c52b903cc2",
"url": "https://download.jetbrains.com/cpp/CLion-2021.3.3-aarch64.dmg",
"version-major-minor": "2021.3"
},
"datagrip": {
"update-channel": "DataGrip RELEASE",
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}-aarch64.dmg",
"version": "2021.3.4",
"sha256": "7a77ba9fce56c781ae6a4fc65eaab4bcc10780b6bd679b04d74146719e42890a",
"url": "https://download.jetbrains.com/datagrip/datagrip-2021.3.4-aarch64.dmg",
"version-major-minor": "2021.3"
},
"goland": {
"update-channel": "GoLand RELEASE",
"url-template": "https://download.jetbrains.com/go/goland-{version}-aarch64.dmg",
"version": "2021.3.3",
"sha256": "54397d48e20fb534206e13f84b35868b1eaea13175176487b1239b23db4e13db",
"url": "https://download.jetbrains.com/go/goland-2021.3.3-aarch64.dmg",
"version-major-minor": "2021.3"
},
"idea-community": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "79e540fb0cd480837b3a954e4802f4f252073955393e8927c9c1b28c37112d51",
"url": "https://download.jetbrains.com/idea/ideaIC-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"idea-ultimate": {
"update-channel": "IntelliJ IDEA RELEASE",
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "511c6aed9c5cd4c7665a9bac9ba94582977013244cbe88b820eb5464fce91a1c",
"url": "https://download.jetbrains.com/idea/ideaIU-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"mps": {
"update-channel": "MPS RELEASE",
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}-macos-aarch64.dmg",
"version": "2021.3",
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3-macos-aarch64.dmg",
"sha256": "3ace6d45db718dffd80bf126a76735fb65099de292112a01cc078aa61c475a70",
"version-major-minor": "2021.3"
},
"phpstorm": {
"update-channel": "PhpStorm RELEASE",
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "ba15c3f843c85141a9adaec1c4611224a853bd98649148751e34ac304591a314",
"url": "https://download.jetbrains.com/webide/PhpStorm-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"pycharm-community": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "407bf395cfb6d61f1c0861c7679b197238780e82a019e10162b8cd7130edb15a",
"url": "https://download.jetbrains.com/python/pycharm-community-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"pycharm-professional": {
"update-channel": "PyCharm RELEASE",
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "12fa34d1e60a555bac230acea9cd46c7adfe9ca42ff3e458c79d33e5b88eb8db",
"url": "https://download.jetbrains.com/python/pycharm-professional-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"rider": {
"update-channel": "Rider RELEASE",
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}-aarch64.dmg",
"version": "2021.3.3",
"sha256": "65603860d1fd3134c5659f5a06de7cac17f3183a01056b79cfe72242b99adb37",
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2021.3.3-aarch64.dmg",
"version-major-minor": "2021.3"
},
"ruby-mine": {
"update-channel": "RubyMine RELEASE",
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "33773222b2fa14300de5ed12ca96c3442b933f66cef67cebc9610e5cef51c75e",
"url": "https://download.jetbrains.com/ruby/RubyMine-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
},
"webstorm": {
"update-channel": "WebStorm RELEASE",
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}-aarch64.dmg",
"version": "2021.3.2",
"sha256": "f4788ec0c55123b1f4e14934792f65bf8040e2a2ee673e985b50b8feded60408",
"url": "https://download.jetbrains.com/webstorm/WebStorm-2021.3.2-aarch64.dmg",
"version-major-minor": "2021.3"
}
}
}

View file

@ -6,13 +6,13 @@
mkDerivation rec {
pname = "sigil";
version = "1.9.1";
version = "1.9.2";
src = fetchFromGitHub {
repo = "Sigil";
owner = "Sigil-Ebook";
rev = version;
sha256 = "sha256-PsHliyJu61QFTFZUgDtxguu18GBVTOGMW6pPYjHhvG0=";
sha256 = "sha256-LfP3qUzoHuYSpkTz1queVGTWOP9v9kbgbgvvtiMK6Eo=";
};
pythonPath = with python3Packages; [ lxml ];

View file

@ -14,17 +14,17 @@ let
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
sha256 = {
x86_64-linux = "09hqcym8dj4d8r5ibdzypdmjxdw4ix24zq688vnb4kfas2jbb3hi";
x86_64-darwin = "1wij82gl1wqrprrfn9cfih19wr4h3bn2xapr1l2l0mkansrzsvg5";
aarch64-linux = "09x93i190lmxb3ygzjcmb7ag3dz7ixf07yk7zqc7ljrnn5f0b6ag";
aarch64-darwin = "1k7glnqy0vjx55chjpwbgwipcvzb0vx0wmvqis865pvzmr0d06a0";
armv7l-linux = "0vkivg1f61k8vkr0j9dm7fw2klh45xxnp07pill1gmrwxafm5bra";
x86_64-linux = "0x8vc6gj83mn767wi285k0hxhlh5gh1lcvq63na89vglja4ipna4";
x86_64-darwin = "1x47xfq0fgd10wq6aa8gq55aqrl1ir1f6v1mm6324yny16pf20k2";
aarch64-linux = "1ibg2qvpnwfwwzgby2xva9xz138b13x9q8vf1xf6plazv0arla1l";
aarch64-darwin = "100834mqix7b46frlqf0jz4qs673lavxm8sizfjm7c9y0xxy4ld3";
armv7l-linux = "100yfkzvnjccp1g3p353jr2vicvkjc0skiwmmzgad6i8j1m9js62";
}.${system};
in
callPackage ./generic.nix rec {
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
version = "1.65.1";
version = "1.65.2";
pname = "vscode";
executableName = "code" + lib.optionalString isInsiders "-insiders";

View file

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-csWowcRSgF5M74yv787MLSXOGXrkxnODCCgC5a3Nd7Y=";
};
makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ];
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
meta = with lib; {

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "fceux";
version = "2.6.2";
version = "2.6.3";
src = fetchFromGitHub {
owner = "TASEmulators";
repo = pname;
rev = "${pname}-${version}";
sha256 = "sha256-yQX58m/sMW/8Jr5cm2SrVXTiF7qyZOgOZg1v0qEyiLw=";
sha256 = "sha256-jNR9AB8s2S9ehYsompkV2GOLsaXIQzldeQ1WRCxdDG0=";
};
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];

View file

@ -6,7 +6,7 @@
stdenv.mkDerivation rec {
pname = "lightburn";
version = "1.1.01";
version = "1.1.03";
nativeBuildInputs = [
p7zip
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://github.com/LightBurnSoftware/deployment/releases/download/${version}/LightBurn-Linux64-v${version}.7z";
sha256 = "sha256-HgyqpZTf9GTsbDi1+e20YNoFIPYtTHQd8KC626G0038=";
sha256 = "sha256-X7hAkzVqIABpyFokiYaMGZqSda69cKhKghFDWDEVOow=";
};
buildInputs = [

View file

@ -11,13 +11,13 @@
stdenv.mkDerivation rec {
pname = "nsxiv";
version = "28";
version = "29";
src = fetchFromGitHub {
owner = "nsxiv";
repo = pname;
rev = "v${version}";
hash = "sha256-12RmEAzZdeanrRtnan96loXT7qSjIMjcWf296XmNE+A=";
hash = "sha256-JUF2cF6QeAXk6G76uMu3reaMgxp2RcqHDbamkNufwqE=";
};
buildInputs = [

View file

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "charm";
version = "0.10.2";
version = "0.10.3";
src = fetchFromGitHub {
owner = "charmbracelet";
repo = "charm";
rev = "v${version}";
sha256 = "sha256-kyfyRq/5QWMoiMooEpLv7UkehGxFlrfGEq9jA3OHiIs=";
sha256 = "sha256-7WdSIpmpN8Zz2k5PveYZoCueQo5sLxLLZvZdzxRlkaE=";
};
vendorSha256 = "sha256-LB5fwySDOH+kOYYdGdtLAvETmI6fFP2QT6l2eAS3Ijg=";
vendorSha256 = "sha256-5cqZxh2uvmJV7DtAGzQwt//heF3kF9mjyB0KAs8nWZY=";
doCheck = false;

View file

@ -18,13 +18,13 @@
mkDerivation rec {
pname = "mediaelch";
version = "2.8.14";
version = "2.8.16";
src = fetchFromGitHub {
owner = "Komet";
repo = "MediaElch";
rev = "v${version}";
sha256 = "sha256-yHThX5Xs+8SijNKgmg+4Mawbwi3zHA/DJQoIBy0Wchs=";
sha256 = "sha256-83bHfIRVAC+3RkCYmV+TBjjQxaFMHfVyxt5Jq44dzeI=";
fetchSubmodules = true;
};

View file

@ -15,13 +15,13 @@
stdenv.mkDerivation rec {
pname = "otpclient";
version = "2.4.8";
version = "2.4.9.1";
src = fetchFromGitHub {
owner = "paolostivanin";
repo = pname;
rev = "v${version}";
sha256 = "sha256-2exqMYcxg0UxlH+ZANQv2MFii9dZ6nizB4vxGR9cAwk=";
sha256 = "sha256-QcdPyuwbGK12Kul+gGTfRGmXfghr0qugpBEcrgATOT4=";
};
buildInputs = [ gtk3 jansson libgcrypt libzip libpng libcotp zbar ];

View file

@ -1,5 +1,30 @@
{ lib, stdenv, fetchFromGitHub, systemd }:
{ lib
, stdenv
, fetchFromGitHub
, formats
, systemd
}:
let
ini = formats.ini { };
unit = ini.generate "systembus-notify.service" {
Unit = {
Description = "system bus notification daemon";
};
Service = {
Type = "exec";
ExecStart = "@out@/bin/systembus-notify";
PrivateTmp = true;
ProtectHome = true;
ProtectSystem = "strict";
Restart = "on-failure";
Slice = "background.slice";
};
};
in
stdenv.mkDerivation rec {
pname = "systembus-notify";
version = "1.1";
@ -8,23 +33,32 @@ stdenv.mkDerivation rec {
owner = "rfjakob";
repo = "systembus-notify";
rev = "v${version}";
sha256 = "1pdn45rfpwhrf20hs87qmk2j8sr7ab8161f81019wnypnb1q2fsv";
sha256 = "sha256-WzuBw7LXW54CCMgFE9BSJ2skxaz4IA2BcBny63Ihtt0=";
};
buildInputs = [ systemd ];
installPhase = ''
runHook preInstall
install -Dm755 systembus-notify -t $out/bin
install -Dm644 systembus-notify.desktop -t $out/etc/xdg/autostart
install -Dm555 -t $out/bin systembus-notify
install -Dm444 -t $out/share/systembus-notify systembus-notify.desktop
install -d $out/lib/systemd/user
substitute ${unit} $out/lib/systemd/user/${unit.name} \
--subst-var out
runHook postInstall
'';
# requires a running dbus instance
doCheck = false;
meta = with lib; {
description = "System bus notification daemon";
homepage = "https://github.com/rfjakob/systembus-notify";
license = licenses.mit;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
maintainers = with maintainers; [];
};
}

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
inherit patches;
installFlags = [ "PREFIX=$(out)" ];
makeFlags = [ "PREFIX=$(out)" ];
# Add run-time dependencies to PATH. Append them to PATH so the user can
# override the dependencies with their own PATH.

View file

@ -2,15 +2,15 @@
buildGoModule rec {
pname = "cloudfoundry-cli";
version = "8.0.0";
version = "8.3.0";
src = fetchFromGitHub {
owner = "cloudfoundry";
repo = "cli";
rev = "v${version}";
sha256 = "00cwnfylra0msbb423ad21if98s6smzccsyidqsl4r2mrlkhahwm";
sha256 = "sha256-tC9U0yvuMEwO4mzWyUC+v+/H0EzgwTu02waTQrx19Bs=";
};
vendorSha256 = "0fcgyyd11xfhn8i11bqnaw3h51bj1y8s37b4d8wzv31dr8zswqsc";
vendorSha256 = "sha256-aXq92SI4cgJrmo67SEfg8YKPEpO2UW2fcYnKq9TmAQg=";
subPackages = [ "." ];

View file

@ -5,7 +5,7 @@
# Update all providers which have specified provider source address
set -euo pipefail
providers=$(
readarray -t providers < <(
jq -r 'to_entries
| map_values(.value + { alias: .key })
| .[]
@ -13,10 +13,13 @@ providers=$(
| .alias' providers.json
)
echo "Will update providers:"
echo "${providers}"
cat <<EOF
Will update ${#providers[@]} providers:
for provider in ${providers}; do
echo "Updating ${provider}"
${providers[*]}
EOF
for provider in "${providers[@]}"; do
./update-provider "$@" "${provider}"
done

View file

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../../../.. -i bash -p coreutils curl jq moreutils nix nix-prefetch
#! nix-shell -I nixpkgs=../../../../.. -i bash -p coreutils curl git jq moreutils nix nix-prefetch
# shellcheck shell=bash
# vim: ft=sh
#
@ -75,45 +75,46 @@ if [[ -z ${provider} ]]; then
exit 1
fi
provider_name=$(basename "${provider}")
# Usage: read_attr <key>
read_attr() {
jq -r ".\"${provider_name}\".\"$1\"" providers.json
jq -r ".\"${provider}\".\"$1\"" providers.json
}
# Usage: update_attr <key> <value>
update_attr() {
if [[ $2 == "null" ]]; then
jq -S ".\"${provider_name}\".\"$1\" = null" providers.json | sponge providers.json
jq -S ".\"${provider}\".\"$1\" = null" providers.json | sponge providers.json
else
jq -S ".\"${provider_name}\".\"$1\" = \"$2\"" providers.json | sponge providers.json
jq -S ".\"${provider}\".\"$1\" = \"$2\"" providers.json | sponge providers.json
fi
}
prefetch_github() {
# of a given owner, repo and rev, fetch the tarball and return the output of
# `nix-prefetch-url`
local owner=$1
local repo=$2
local rev=$3
nix-prefetch-url --unpack "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"
repo_root=$(git rev-parse --show-toplevel)
generate_hash() {
nix-prefetch -I nixpkgs="${repo_root}" \
"{ sha256 }: (import ${repo_root} {}).terraform-providers.${provider}.$1.overrideAttrs (_: { $2 = sha256; })"
}
old_source_address="$(read_attr provider-source-address)"
old_vendor_sha256=$(read_attr vendorSha256)
old_version=$(read_attr version)
echo_provider() {
echo "== terraform-providers.${provider}: $* =="
}
if [[ ${provider} =~ ^[^/]+/[^/]+$ ]]; then
echo_provider "init"
source_address=registry.terraform.io/${provider}
provider=$(basename "${provider}")
update_attr "provider-source-address" "${source_address}"
update_attr version "0"
# create empty stings so nix-prefetch works
update_attr sha256 ""
update_attr vendorSha256 ""
else
source_address=${old_source_address}
source_address="$(read_attr provider-source-address)"
fi
if [[ ${source_address} == "null" ]]; then
echo "Could not find the source address for provider: ${provider}"
exit 1
fi
update_attr "provider-source-address" "${source_address}"
old_vendor_sha256=$(read_attr vendorSha256)
old_version=$(read_attr version)
# The provider source address (used inside Terraform `required_providers` block) is
# used to compute the registry API endpoint
@ -125,8 +126,10 @@ registry_response=$(curl -s https://"${source_address/\///v1/providers/}")
version="$(jq -r '.version' <<<"${registry_response}")"
if [[ ${old_version} == "${version}" && ${force} != 1 && -z ${vendorSha256} && ${old_vendor_sha256} != "${vendorSha256}" ]]; then
echo "${provider_name} is already at version ${version}"
echo_provider "already at version ${version}"
exit
else
echo_provider "updating from ${old_version} to ${version}"
fi
update_attr version "${version}"
@ -138,28 +141,23 @@ repo="$(echo "${provider_source_url}" | cut -d '/' -f 5)"
update_attr repo "${repo}"
rev="$(jq -r '.tag' <<<"${registry_response}")"
update_attr rev "${rev}"
sha256=$(prefetch_github "${org}" "${repo}" "${rev}")
echo_provider "calculating sha256"
sha256=$(generate_hash src outputHash)
update_attr sha256 "${sha256}"
if [[ -z ${vendorSha256} ]]; then
if [[ ${old_vendor_sha256} == null ]]; then
vendorSha256=null
elif [[ -n ${old_vendor_sha256} ]]; then
echo "=== Calculating vendorSha256 ==="
vendorSha256=$(nix-prefetch -I nixpkgs=../../../../.. "{ sha256 }: (import ../../../../.. {}).terraform-providers.${provider_name}.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })")
# Deal with nix unstable
if [[ ${vendorSha256} == sha256-* ]]; then
vendorSha256=$(nix --extra-experimental-features nix-command hash to-base32 "${vendorSha256}")
fi
else
echo_provider "calculating vendorSha256"
vendorSha256=$(generate_hash go-modules vendorSha256)
fi
fi
if [[ -n ${vendorSha256} ]]; then
update_attr vendorSha256 "${vendorSha256}"
fi
update_attr vendorSha256 "${vendorSha256}"
# Check that the provider builds
if [[ ${build} == 1 ]]; then
echo "=== Building terraform-providers.${provider_name} ==="
nix-build --no-out-link ../../../../.. -A "terraform-providers.${provider_name}"
echo_provider "building"
nix-build --no-out-link "${repo_root}" -A "terraform-providers.${provider}"
fi

View file

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "vcluster";
version = "0.5.3";
version = "0.6.0";
src = fetchFromGitHub {
owner = "loft-sh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-+rLDRVfB6wZ1wYoLE2wwRxzS6GmI6KYtOKdXZd+LnnU=";
sha256 = "sha256-kY12bsZyDb36KE2dWx6RVYlKTbJh+XFQcBpFXoCLgEM=";
};
vendorSha256 = null;

View file

@ -4,11 +4,11 @@ let
configOverrides = writeText "cinny-config-overrides.json" (builtins.toJSON conf);
in stdenv.mkDerivation rec {
pname = "cinny";
version = "1.7.0";
version = "1.8.0";
src = fetchurl {
url = "https://github.com/ajbura/cinny/releases/download/v${version}/cinny-v${version}.tar.gz";
sha256 = "0133dbzxy0n0i6bn2p3lx33kpabnf9kzs9mv4xws30hbns25q99k";
sha256 = "0pbapzl3pfx87ns4vp7088kkhl34c0ihbq90r3d0iz6sa16mcs79";
};
installPhase = ''

View file

@ -28,13 +28,13 @@
mkDerivation rec {
pname = "qtox";
version = "1.17.5";
version = "1.17.6";
src = fetchFromGitHub {
owner = "qTox";
repo = "qTox";
rev = "v${version}";
sha256 = "sha256-H3qFEw/TkzOxEXtZs0k89wWMnhrOkF7VapUKtCUhGns=";
sha256 = "sha256-naKWoodSMw0AEtACvkASFmw9t0H0d2pcqOW79NNTYF0=";
};
buildInputs = [

View file

@ -24,7 +24,7 @@ let
in stdenv.mkDerivation rec {
pname = "signal-desktop";
version = "5.34.0"; # Please backport all updates to the stable channel.
version = "5.35.0"; # Please backport all updates to the stable channel.
# All releases have a limited lifetime and "expire" 90 days after the release.
# When releases "expire" the application becomes unusable until an update is
# applied. The expiration date for the current release can be extracted with:
@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
src = fetchurl {
url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
sha256 = "sha256-uU4WJtd9qwrjHgsK0oDg/pCf/5lfNhoMDEd/lHUnLwk=";
sha256 = "sha256-2KF2OLq6/vHElgloxn+kgQisJC+HAkpOBfsKfEPW35c=";
};
nativeBuildInputs = [

View file

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "juju";
version = "2.9.11";
version = "2.9.25";
src = fetchFromGitHub {
owner = "juju";
repo = "juju";
rev = "juju-${version}";
sha256 = "sha256-KcvlnEfDzwhFzwaWLYuRGa8nh6MkjqZ+u+qJSJZl13U=";
sha256 = "sha256-h4w12dmGEviV2N0BWXQKt1eUVxdbgwRKLQghnd6bLFI=";
};
vendorSha256 = "sha256-0KGeMJDv1BdqM1/uMk+mKpK+Nejz9PiCAfRy96pu3OQ=";
vendorSha256 = "sha256-AATK4tDg2eW8Bt8gU88tIk6I+qp5ZeUtXzD74/59c7w=";
# Disable tests because it attempts to use a mongodb instance
doCheck = false;

View file

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "nextdns";
version = "1.37.7";
version = "1.37.10";
src = fetchFromGitHub {
owner = "nextdns";
repo = "nextdns";
rev = "v${version}";
sha256 = "sha256-L5PeT4Y2oWM1WUJaBK9xgrpfkpvKM1+sA29A3AiDE38=";
sha256 = "sha256-iwxgDBIuTClikvXF+3mCjFKKV0upN+K+aL85ewYkMXo=";
};
vendorSha256 = "sha256-6hWD05lXteqL7egj9tiRVHlevKM33i+a+zBUZs7PF7I=";

View file

@ -0,0 +1,30 @@
{ lib, stdenv, fetchFromGitHub, cmake, wrapQtAppsHook, qtbase }:
stdenv.mkDerivation rec {
pname = "QtRVSim";
version = "0.9.1";
src = fetchFromGitHub {
owner = "cvut";
repo = "qtrvsim";
rev = "refs/tags/v${version}";
sha256 = "AOksVS0drIBnK4RCxZw40yVxf4E8GjG9kU0rIZsY9gA=";
};
nativeBuildInputs = [ cmake wrapQtAppsHook ];
buildInputs = [ qtbase ];
meta = with lib; {
description = "RISC-V CPU simulator for education purposes";
longDescription = ''
RISC-V CPU simulator for education purposes with pipeline and cache visualization.
Developed at FEE CTU for computer architecture classes.
'';
homepage = "https://github.com/cvut/qtrvsim";
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ jdupak ];
mainProgram = "qtrvsim_gui";
};
}

View file

@ -4,13 +4,13 @@
stdenv.mkDerivation rec {
pname = "git-repo";
version = "2.21";
version = "2.22";
src = fetchFromGitHub {
owner = "android";
repo = "tools_repo";
rev = "v${version}";
sha256 = "sha256-nl/NFbyL0MWgvpwaqkCOkKuSquFTQRKZ7Ski5qYRL9w=";
sha256 = "sha256-oVwvoZdjD6V3CHECZOYBSYVtCX1XwW5fynyCn7Oj+Bc=";
};
# Fix 'NameError: name 'ssl' is not defined'

View file

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "go-chromecast";
version = "0.2.11";
version = "0.2.12";
src = fetchFromGitHub {
owner = "vishen";
repo = pname;
rev = "v${version}";
sha256 = "sha256-BCOyeXo3uoR4ry/nFbF+//U62/hHnPK+tbG+8Rv6Rv0=";
sha256 = "sha256-h8qWwMaEhXnj6ZSrKAXBVbrMR0je41EoOtFeN9XlCuk=";
};
vendorSha256 = "sha256-idxElk4Sy7SE9G1OMRw8YH4o8orBa80qhBXPA+ar620=";
vendorSha256 = "sha256-PpMLHuJR6irp+QHhzguwGtBy30HM7DR0tNGiwB07M5E=";
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}" "-X main.date=unknown" ];

View file

@ -6,7 +6,7 @@
buildGoPackage rec {
pname = "docker-slim";
version = "1.37.3";
version = "1.37.4";
goPackagePath = "github.com/docker-slim/docker-slim";
@ -14,7 +14,7 @@ buildGoPackage rec {
owner = "docker-slim";
repo = "docker-slim";
rev = version;
sha256 = "sha256-jzwQ3nrhLDiQXcVkPiXrRAmpLQOD8ILBnoCEUiEbxzw=";
sha256 = "sha256-iz1V+wcrJf0grOe81kwbXPBqnvXpHnh7IMDdugaUOH0=";
};
subPackages = [ "cmd/docker-slim" "cmd/docker-slim-sensor" ];

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation {
sourceRoot = ".";
src = dlbin {
x86_64-linux = "sha256-yeWVsrvH3yYlS2uH/TkSleHjXvIDnHWcZSvLgV+CGF0=";
aarch64-linux = "sha256-75UC+HeVUfUk1HRvTJsOHbHHkgr6me1OtxDF7lahf68=";
aarch64-linux = "sha256-9ggRmijwXE9adVFv5XommgvdpeeWnWUFES+Ep2GrBVo=";
};
dontConfigure = true;

View file

@ -0,0 +1,49 @@
{ lib
, cni-plugins
, buildGoModule
, firecracker
, containerd
, runc
, makeWrapper
, fetchFromGitHub
}:
buildGoModule rec{
pname = "flintlock";
version = "0.1.0-alpha.9";
src = fetchFromGitHub {
owner = "weaveworks";
repo = "flintlock";
rev = "v${version}";
sha256 = "sha256-Xw3g2wh0fPUknSuAKoJL3jxVZS50wSPZ9Wz05zkTVXM=";
};
vendorSha256 = "sha256-EjVlM6AD+O/z6+R5TRBmmRWbrP4C+qyvsnEjwOkDkUE=";
subPackages = [ "cmd/flintlock-metrics" "cmd/flintlockd" ];
ldflags = [ "-s" "-w" "-X github.com/weaveworks/flintlock/internal/version.Version=v${version}" ];
nativeBuildInputs = [
makeWrapper
];
buildInputs = [
firecracker
];
postInstall = ''
for prog in flintlockd flintlock-metrics; do
wrapProgram "$out/bin/$prog" --prefix PATH : ${lib.makeBinPath [ cni-plugins firecracker containerd runc ]}
done
'';
meta = with lib; {
description = "Create and manage the lifecycle of MicroVMs backed by containerd";
homepage = "https://github.com/weaveworks/flintlock";
license = licenses.mpl20;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [ techknowlogick ];
};
}

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook
, bash, fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto
{ stdenv, lib, fetchFromGitHub, fetchpatch, makeWrapper, autoreconfHook
, bash, fuse3, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto
, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst
, pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which
, libdrm, udev
@ -8,13 +8,13 @@
stdenv.mkDerivation rec {
pname = "open-vm-tools";
version = "11.3.5";
version = "12.0.0";
src = fetchFromGitHub {
owner = "vmware";
repo = "open-vm-tools";
rev = "stable-${version}";
sha256 = "03fahljrijq4ij8a4v8d7806mpf22ppkgr61n5s974g3xfdvpl13";
sha256 = "sha256-agWTGf8x6bxZ7S5bU2scHt8IdLLe/hZdaEMfHIK9d8U=";
};
sourceRoot = "${src.name}/open-vm-tools";
@ -22,10 +22,24 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
buildInputs = [ fuse glib icu libdnet libdrm libmspack libtirpc openssl pam procps rpcsvc-proto udev xercesc ]
buildInputs = [ fuse3 glib icu libdnet libdrm libmspack libtirpc openssl pam procps rpcsvc-proto udev xercesc ]
++ lib.optionals withX [ gdk-pixbuf-xlib gtk3 gtkmm3 libX11 libXext libXinerama libXi libXrender libXrandr libXtst ];
patches = [
# glibc 2.35 and GCC 11 & 12 reporting possible array bounds overflow
# Will be fixed in the release after 12.0.0
(fetchpatch {
url = "https://github.com/vmware/open-vm-tools/commit/de6d129476724668b8903e2a87654f50ba21b1b2.patch";
sha256 = "1cqhm868g40kcp8qzzwq10zd4bah9ypaw1qawnli5d240mlkpfhh";
})
];
prePatch = ''
cd ..
'';
postPatch = ''
cd open-vm-tools
sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' Makefile.am
sed -i 's,^confdir = ,confdir = ''${prefix},' scripts/Makefile.am
sed -i 's,usr/bin,''${prefix}/usr/bin,' scripts/Makefile.am
@ -43,6 +57,7 @@ stdenv.mkDerivation rec {
"--without-kernel-modules"
"--without-xmlsecurity"
"--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d"
"--with-fuse=fuse3"
] ++ lib.optional (!withX) "--without-x";
enableParallelBuilding = true;

View file

@ -1,12 +1,12 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, nx-libs, xorg, getopt, gnugrep, gawk, ps, mount, iproute2 }:
stdenv.mkDerivation rec {
pname = "x11docker";
version = "7.1.1";
version = "7.1.3";
src = fetchFromGitHub {
owner = "mviereck";
repo = "x11docker";
rev = "v${version}";
sha256 = "sha256-SUHWqcDL/oDljCpngkhUvzOvMIlZSc1p0j0wjupPBqw=";
sha256 = "sha256-eSarw5RG2ckup9pNlZtAyZAN8IPZy94RRfej9ppiLfo=";
};
nativeBuildInputs = [ makeWrapper ];

View file

@ -55,6 +55,7 @@ stdenv.mkDerivation rec {
];
meta = with lib; {
homepage = "https://berrywm.org/";
description = "A healthy, bite-sized window manager";
longDescription = ''
berry is a healthy, bite-sized window manager written in C for unix
@ -69,7 +70,6 @@ stdenv.mkDerivation rec {
- Intuitively place new windows in unoccupied spaces.
- Virtual desktops.
'';
homepage = "https://berrywm.org/";
license = licenses.mit;
maintainers = [ maintainers.AndersonTorres ];
platforms = platforms.linux;

View file

@ -40,13 +40,13 @@
stdenv.mkDerivation rec {
pname = "icewm";
version = "2.9.4";
version = "2.9.6";
src = fetchFromGitHub {
owner = "ice-wm";
owner = "ice-wm";
repo = pname;
rev = version;
hash = "sha256-ne2lqo9CAhGgC8dd9R03zhFXy9nPBQR0NcfAY0DeVj4=";
hash = "sha256-qC8gEVJ/cmsEbF8jMzv7zyvVcjlbXhgHU3ixe7RLcnA=";
};
nativeBuildInputs = [
@ -55,6 +55,7 @@ stdenv.mkDerivation rec {
perl
pkg-config
];
buildInputs = [
expat
fontconfig
@ -108,11 +109,11 @@ stdenv.mkDerivation rec {
system. Application windows can be managed by keyboard and mouse. Windows
can be iconified to the taskbar, to the tray, to the desktop or be made
hidden. They are controllable by a quick switch window (Alt+Tab) and in a
window list. A handful of configurable focus models are
menu-selectable. Setups with multiple monitors are supported by RandR and
Xinerama. IceWM is very configurable, themeable and well documented. It
includes an optional external background wallpaper manager with
transparency support, a simple session manager and a system tray.
window list. A handful of configurable focus models are menu-selectable.
Setups with multiple monitors are supported by RandR and Xinerama. IceWM
is very configurable, themeable and well documented. It includes an
optional external background wallpaper manager with transparency support,
a simple session manager and a system tray.
'';
license = licenses.lgpl2Only;
maintainers = [ maintainers.AndersonTorres ];

View file

@ -21,20 +21,15 @@
stdenv.mkDerivation rec {
pname = "labwc";
version = "0.4.0";
version = "0.5.0";
src = fetchFromGitHub {
owner = "labwc";
repo = pname;
rev = version;
hash = "sha256-O9jVDR7UROt5u8inUsZjbzB3dQTosiLYqXkeOyGrbaM=";
hash = "sha256-G0EQuXSHftl4JLXKIro+tmhbApwAhlzcjPEL7DP6LHk=";
};
patches = [
# Required to fix the build with wlroots 0.15.1:
./relax-the-version-constraint-for-wlroots.patch
];
nativeBuildInputs = [
meson
ninja
@ -64,6 +59,6 @@ stdenv.mkDerivation rec {
description = "A Wayland stacking compositor, similar to Openbox";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
inherit (wayland.meta) platforms;
};
}

View file

@ -1,29 +0,0 @@
From 21d8bfcf7899f5ec50b29f523ace4c19cbfbe919 Mon Sep 17 00:00:00 2001
From: Michael Weiss <dev.primeos@gmail.com>
Date: Fri, 4 Feb 2022 21:17:05 +0100
Subject: [PATCH] build: Relax the version constraint for wlroots to accept
patch releases
Patch releases only contain backwards compatible changes (mainly bug
fixes) so we want to allow them. This fixes the build with the recently
released wlroots 0.15.1 and uses the same version constraints as other
projects that depend on wlroots (e.g., Sway).
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index f950b8e..1905dda 100644
--- a/meson.build
+++ b/meson.build
@@ -37,7 +37,7 @@ if git.found()
endif
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
-wlroots_version = ['=0.15.0']
+wlroots_version = ['>=0.15.0', '<0.16.0']
wlroots_proj = subproject(
'wlroots',
default_options: ['default_library=static', 'examples=false'],
--
2.34.1

View file

@ -1,6 +1,6 @@
{
# Content-addressable Nix mirrors.
# Content-addressable Nix mirrors
hashedMirrors = [
"https://tarballs.nixos.org"
];
@ -8,52 +8,48 @@
# Mirrors for mirror://site/filename URIs, where "site" is
# "sourceforge", "gnu", etc.
luarocks = [
"https://luarocks.org/"
"https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/"
"https://luafr.org/moonrocks/"
"http://luarocks.logiceditor.com/rocks/"
# Alsa Project
alsa = [
"https://www.alsa-project.org/files/pub/"
"ftp://ftp.alsa-project.org/pub/"
"http://alsa.cybermirror.org/"
"http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/"
];
# SourceForge.
sourceforge = [
"https://downloads.sourceforge.net/"
"https://prdownloads.sourceforge.net/"
"https://netcologne.dl.sourceforge.net/sourceforge/"
"https://versaweb.dl.sourceforge.net/sourceforge/"
"https://freefr.dl.sourceforge.net/sourceforge/"
"https://osdn.dl.sourceforge.net/sourceforge/"
"https://kent.dl.sourceforge.net/sourceforge/"
# Apache
apache = [
"https://www-eu.apache.org/dist/"
"https://ftp.wayne.edu/apache/"
"https://www.apache.org/dist/"
"https://archive.apache.org/dist/" # fallback for old releases
"https://apache.cs.uu.nl/"
"https://apache.cs.utah.edu/"
"http://ftp.tudelft.nl/apache/"
"ftp://ftp.funet.fi/pub/mirrors/apache.org/"
];
# OSDN (formerly SourceForge.jp).
osdn = [
"https://osdn.dl.osdn.jp/"
"https://osdn.mirror.constant.com/"
"https://mirrors.gigenet.com/OSDN/"
"https://osdn.dl.sourceforge.jp/"
"https://jaist.dl.sourceforge.jp/"
# Bioconductor mirrors (from https://bioconductor.org/about/mirrors/)
# The commented-out ones don't seem to allow direct package downloads;
# they serve error messages that result in hash mismatches instead
bioc = [
# http://bioc.ism.ac.jp/
# http://bioc.openanalytics.eu/
# http://bioconductor.fmrp.usp.br/
# http://mirror.aarnet.edu.au/pub/bioconductor/
# http://watson.nci.nih.gov/bioc_mirror/
"https://bioconductor.statistik.tu-dortmund.de/packages/"
"https://mirrors.ustc.edu.cn/bioc/"
"http://bioconductor.jp/packages/"
];
# GNU (https://www.gnu.org/prep/ftp.html).
gnu = [
# This one redirects to a (supposedly) nearby and (supposedly) up-to-date
# mirror.
"https://ftpmirror.gnu.org/"
"https://ftp.nluug.nl/pub/gnu/"
"https://mirrors.kernel.org/gnu/"
"https://mirror.ibcp.fr/pub/gnu/"
"https://mirror.dogado.de/gnu/"
"https://mirror.tochlab.net/pub/gnu/"
# This one is the master repository, and thus it's always up-to-date.
"https://ftp.gnu.org/pub/gnu/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/"
# BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html
bitlbee = [
"https://get.bitlbee.org/"
"https://ftp.snt.utwente.nl/pub/software/bitlbee/"
"http://bitlbee.intergenia.de/"
];
# GCC.
# GCC
gcc = [
"https://bigsearcher.com/mirrors/gcc/"
"https://mirror.koddos.net/gcc/"
@ -63,7 +59,37 @@
"ftp://gcc.gnu.org/pub/gcc/"
];
# GnuPG.
# GNOME
gnome = [
# This one redirects to some mirror closeby, so it should be all you need
"https://download.gnome.org/"
"https://fr2.rpmfind.net/linux/gnome.org/"
"https://ftp.acc.umu.se/pub/GNOME/"
"https://ftp.belnet.be/mirror/ftp.gnome.org/"
"ftp://ftp.cse.buffalo.edu/pub/Gnome/"
"ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/"
];
# GNU (https://www.gnu.org/prep/ftp.html)
gnu = [
# This one redirects to a (supposedly) nearby and (supposedly) up-to-date
# mirror
"https://ftpmirror.gnu.org/"
"https://ftp.nluug.nl/pub/gnu/"
"https://mirrors.kernel.org/gnu/"
"https://mirror.ibcp.fr/pub/gnu/"
"https://mirror.dogado.de/gnu/"
"https://mirror.tochlab.net/pub/gnu/"
# This one is the master repository, and thus it's always up-to-date
"https://ftp.gnu.org/pub/gnu/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/"
];
# GnuPG
gnupg = [
"https://gnupg.org/ftp/gcrypt/"
"https://mirrors.dotsrc.org/gcrypt/"
@ -72,11 +98,13 @@
"http://www.ring.gr.jp/pub/net/"
];
# kernel.org's /pub (/pub/{linux,software}) tree.
kernel = [
"https://cdn.kernel.org/pub/"
"http://linux-kernel.uio.no/pub/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/"
# ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php
imagemagick = [
"https://www.imagemagick.org/download/"
"https://mirror.checkdomain.de/imagemagick/"
"https://ftp.nluug.nl/ImageMagick/"
"https://ftp.sunet.se/mirror/imagemagick.org/ftp/"
"ftp://ftp.sunet.se/mirror/imagemagick.org/ftp/" # also contains older versions removed from most mirrors
];
# Mirrors from https://download.kde.org/ls-lR.mirrorlist
@ -89,195 +117,47 @@
"https://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/"
];
# Gentoo files.
gentoo = [
"https://ftp.snt.utwente.nl/pub/os/linux/gentoo/"
"https://distfiles.gentoo.org/"
"https://mirrors.kernel.org/gentoo/"
];
savannah = [
# Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html
"https://mirror.easyname.at/nongnu/"
"https://savannah.c3sl.ufpr.br/"
"https://mirror.csclub.uwaterloo.ca/nongnu/"
"https://mirror.cedia.org.ec/nongnu/"
"https://ftp.igh.cnrs.fr/pub/nongnu/"
"https://mirror6.layerjet.com/nongnu"
"https://mirror.netcologne.de/savannah/"
"https://ftp.cc.uoc.gr/mirrors/nongnu.org/"
"https://nongnu.uib.no/"
"https://ftp.acc.umu.se/mirror/gnu.org/savannah/"
"http://mirror2.klaus-uwe.me/nongnu/"
"http://mirrors.fe.up.pt/pub/nongnu/"
"http://ftp.twaren.net/Unix/NonGNU/"
"http://savannah-nongnu-org.ip-connect.vn.ua/"
"http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/"
"http://gnu.mirrors.pair.com/savannah/savannah/"
"ftp://mirror.easyname.at/nongnu/"
"ftp://mirror2.klaus-uwe.me/nongnu/"
"ftp://mirror.csclub.uwaterloo.ca/nongnu/"
"ftp://ftp.igh.cnrs.fr/pub/nongnu/"
"ftp://mirror.netcologne.de/savannah/"
"ftp://nongnu.uib.no/pub/nongnu/"
"ftp://mirrors.fe.up.pt/pub/nongnu/"
"ftp://ftp.twaren.net/Unix/NonGNU/"
"ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/"
"ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/"
];
samba = [
"https://www.samba.org/ftp/"
"http://www.samba.org/ftp/"
];
# BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html .
bitlbee = [
"https://get.bitlbee.org/"
"https://ftp.snt.utwente.nl/pub/software/bitlbee/"
"http://bitlbee.intergenia.de/"
];
# ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php
imagemagick = [
"https://www.imagemagick.org/download/"
"https://mirror.checkdomain.de/imagemagick/"
"https://ftp.nluug.nl/ImageMagick/"
"https://ftp.sunet.se/mirror/imagemagick.org/ftp/"
"ftp://ftp.sunet.se/mirror/imagemagick.org/ftp/" # also contains older versions removed from most mirrors
];
# CPAN mirrors.
cpan = [
"https://cpan.metacpan.org/"
"https://cpan.perl.org/"
"https://mirrors.kernel.org/CPAN/"
"https://backpan.perl.org/" # for old releases
];
# CentOS.
centos = [
# For old releases
"https://vault.centos.org/"
"https://archive.kernel.org/centos-vault/"
"https://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/"
"https://mirrors.aliyun.com/centos-vault/"
"https://mirror.chpc.utah.edu/pub/vault.centos.org/"
"https://mirror.math.princeton.edu/pub/centos-vault/"
"https://mirrors.tripadvisor.com/centos-vault/"
"http://mirror.centos.org/centos/"
];
# Debian.
debian = [
"https://httpredir.debian.org/debian/"
"https://ftp.debian.org/debian/"
"https://mirrors.edge.kernel.org/debian/"
"ftp://ftp.de.debian.org/debian/"
"ftp://ftp.fr.debian.org/debian/"
"ftp://ftp.nl.debian.org/debian/"
"ftp://ftp.ru.debian.org/debian/"
"http://archive.debian.org/debian-archive/debian/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/"
];
# Ubuntu.
ubuntu = [
"https://nl.archive.ubuntu.com/ubuntu/"
"https://old-releases.ubuntu.com/ubuntu/"
"https://mirrors.edge.kernel.org/ubuntu/"
"http://de.archive.ubuntu.com/ubuntu/"
"http://archive.ubuntu.com/ubuntu/"
];
# Fedora (please only add full mirrors that carry old Fedora distributions as well).
# See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content).
fedora = [
"https://archives.fedoraproject.org/pub/fedora/"
"https://fedora.osuosl.org/"
"https://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/"
"https://ftp.linux.cz/pub/linux/fedora/"
"https://archives.fedoraproject.org/pub/archive/fedora/"
"http://ftp.nluug.nl/pub/os/Linux/distr/fedora/"
"http://mirror.csclub.uwaterloo.ca/fedora/"
"http://mirror.1000mbps.com/fedora/"
];
# openSUSE.
opensuse = [
"https://opensuse.hro.nl/opensuse/distribution/"
"https://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/"
"https://ftp.opensuse.org/pub/opensuse/distribution/"
"https://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/"
"https://mirrors.edge.kernel.org/opensuse/distribution/"
"http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/"
];
gnome = [
# This one redirects to some mirror closeby, so it should be all you need.
"https://download.gnome.org/"
"https://fr2.rpmfind.net/linux/gnome.org/"
"https://ftp.acc.umu.se/pub/GNOME/"
"https://ftp.belnet.be/mirror/ftp.gnome.org/"
"ftp://ftp.cse.buffalo.edu/pub/Gnome/"
"ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/"
];
xfce = [
"https://archive.xfce.org/"
"https://mirror.netcologne.de/xfce/"
"https://archive.be.xfce.org/xfce/"
"https://archive.al-us.xfce.org/"
"http://archive.se.xfce.org/xfce/"
"http://mirror.perldude.de/archive.xfce.org/"
"http://archive.be2.xfce.org/"
"http://ftp.udc.es/xfce/"
];
# X.org.
xorg = [
"https://xorg.freedesktop.org/releases/"
"https://ftp.x.org/archive/"
];
apache = [
"https://www-eu.apache.org/dist/"
"https://ftp.wayne.edu/apache/"
"https://www.apache.org/dist/"
"https://archive.apache.org/dist/" # fallback for old releases
"https://apache.cs.uu.nl/"
"https://apache.cs.utah.edu/"
"http://ftp.tudelft.nl/apache/"
"ftp://ftp.funet.fi/pub/mirrors/apache.org/"
];
postgresql = [
"https://ftp.postgresql.org/pub/"
# kernel.org's /pub (/pub/{linux,software}) tree
kernel = [
"https://cdn.kernel.org/pub/"
"http://linux-kernel.uio.no/pub/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/"
];
# Metalab, now IBiblio
metalab = [
"ftp://ftp.gwdg.de/pub/linux/metalab/"
"ftp://ftp.metalab.unc.edu/pub/linux/"
];
# Bioconductor mirrors (from https://bioconductor.org/about/mirrors/)
# The commented-out ones don't seem to allow direct package downloads;
# they serve error messages that result in hash mismatches instead.
bioc = [
# http://bioc.ism.ac.jp/
# http://bioc.openanalytics.eu/
# http://bioconductor.fmrp.usp.br/
# http://mirror.aarnet.edu.au/pub/bioconductor/
# http://watson.nci.nih.gov/bioc_mirror/
"https://bioconductor.statistik.tu-dortmund.de/packages/"
"https://mirrors.ustc.edu.cn/bioc/"
"http://bioconductor.jp/packages/"
# MySQL
mysql = [
"https://cdn.mysql.com/Downloads/"
];
# Hackage mirrors
hackage = [
"https://hackage.haskell.org/package/"
# Maven Central
maven = [
"https://repo1.maven.org/maven2/"
];
# Mozilla projects
mozilla = [
"https://download.cdn.mozilla.net/pub/mozilla.org/"
"https://archive.mozilla.org/pub/"
];
# OSDN (formerly SourceForge.jp)
osdn = [
"https://osdn.dl.osdn.jp/"
"https://osdn.mirror.constant.com/"
"https://mirrors.gigenet.com/OSDN/"
"https://osdn.dl.sourceforge.jp/"
"https://jaist.dl.sourceforge.jp/"
];
# PostgreSQL
postgresql = [
"https://ftp.postgresql.org/pub/"
];
# Roy marples mirrors
@ -329,25 +209,114 @@
"http://ftp.ntua.gr/pub/sagemath/spkg/upstream/"
];
# MySQL mirrors
mysql = [
"https://cdn.mysql.com/Downloads/"
# SAMBA
samba = [
"https://www.samba.org/ftp/"
"http://www.samba.org/ftp/"
];
# OpenBSD mirrors
openbsd = [
"https://ftp.openbsd.org/pub/OpenBSD/"
"ftp://ftp.nluug.nl/pub/OpenBSD/"
"ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/"
# GNU Savannah
savannah = [
# Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html
"https://mirror.easyname.at/nongnu/"
"https://savannah.c3sl.ufpr.br/"
"https://mirror.csclub.uwaterloo.ca/nongnu/"
"https://mirror.cedia.org.ec/nongnu/"
"https://ftp.igh.cnrs.fr/pub/nongnu/"
"https://mirror6.layerjet.com/nongnu"
"https://mirror.netcologne.de/savannah/"
"https://ftp.cc.uoc.gr/mirrors/nongnu.org/"
"https://nongnu.uib.no/"
"https://ftp.acc.umu.se/mirror/gnu.org/savannah/"
"http://mirror2.klaus-uwe.me/nongnu/"
"http://mirrors.fe.up.pt/pub/nongnu/"
"http://ftp.twaren.net/Unix/NonGNU/"
"http://savannah-nongnu-org.ip-connect.vn.ua/"
"http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/"
"http://gnu.mirrors.pair.com/savannah/savannah/"
"ftp://mirror.easyname.at/nongnu/"
"ftp://mirror2.klaus-uwe.me/nongnu/"
"ftp://mirror.csclub.uwaterloo.ca/nongnu/"
"ftp://ftp.igh.cnrs.fr/pub/nongnu/"
"ftp://mirror.netcologne.de/savannah/"
"ftp://nongnu.uib.no/pub/nongnu/"
"ftp://mirrors.fe.up.pt/pub/nongnu/"
"ftp://ftp.twaren.net/Unix/NonGNU/"
"ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/"
"ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/"
];
# Steam Runtime mirrors
# SourceForge
sourceforge = [
"https://downloads.sourceforge.net/"
"https://prdownloads.sourceforge.net/"
"https://netcologne.dl.sourceforge.net/sourceforge/"
"https://versaweb.dl.sourceforge.net/sourceforge/"
"https://freefr.dl.sourceforge.net/sourceforge/"
"https://osdn.dl.sourceforge.net/sourceforge/"
"https://kent.dl.sourceforge.net/sourceforge/"
];
# Steam Runtime
steamrt = [
"https://repo.steampowered.com/steamrt/"
"https://public.abbradar.moe/steamrt/"
];
# Python PyPI mirrors
# TCSH shell
tcsh = [
"https://astron.com/pub/tcsh/"
"https://astron.com/pub/tcsh/old/"
"http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/"
"http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/"
"ftp://ftp.astron.com/pub/tcsh/"
"ftp://ftp.astron.com/pub/tcsh/old/"
"ftp://ftp.funet.fi/pub/unix/shells/tcsh/"
"ftp://ftp.funet.fi/pub/unix/shells/tcsh/old/"
];
# XFCE
xfce = [
"https://archive.xfce.org/"
"https://mirror.netcologne.de/xfce/"
"https://archive.be.xfce.org/xfce/"
"https://archive.al-us.xfce.org/"
"http://archive.se.xfce.org/xfce/"
"http://mirror.perldude.de/archive.xfce.org/"
"http://archive.be2.xfce.org/"
"http://ftp.udc.es/xfce/"
];
# X.org
xorg = [
"https://xorg.freedesktop.org/releases/"
"https://ftp.x.org/archive/"
];
### Programming languages' package repos
# Perl CPAN
cpan = [
"https://cpan.metacpan.org/"
"https://cpan.perl.org/"
"https://mirrors.kernel.org/CPAN/"
"https://backpan.perl.org/" # for old releases
];
# Haskell Hackage
hackage = [
"https://hackage.haskell.org/package/"
];
# Lua Rocks
luarocks = [
"https://luarocks.org/"
"https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/"
"https://luafr.org/moonrocks/"
"http://luarocks.logiceditor.com/rocks/"
];
# Python PyPI
pypi = [
"https://files.pythonhosted.org/packages/source/"
# pypi.io is a more semantic link, but atm its referencing
@ -355,27 +324,85 @@
"https://pypi.io/packages/source/"
];
# Python Test-PyPI mirror
# Python Test-PyPI
testpypi = [
"https://test.pypi.io/packages/source/"
];
# Mozilla projects.
mozilla = [
"https://download.cdn.mozilla.net/pub/mozilla.org/"
"https://archive.mozilla.org/pub/"
### Linux distros
# CentOS
centos = [
# For old releases
"https://vault.centos.org/"
"https://archive.kernel.org/centos-vault/"
"https://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/"
"https://mirrors.aliyun.com/centos-vault/"
"https://mirror.chpc.utah.edu/pub/vault.centos.org/"
"https://mirror.math.princeton.edu/pub/centos-vault/"
"https://mirrors.tripadvisor.com/centos-vault/"
"http://mirror.centos.org/centos/"
];
# Maven Central
maven = [
"https://repo1.maven.org/maven2/"
# Debian
debian = [
"https://httpredir.debian.org/debian/"
"https://ftp.debian.org/debian/"
"https://mirrors.edge.kernel.org/debian/"
"ftp://ftp.de.debian.org/debian/"
"ftp://ftp.fr.debian.org/debian/"
"ftp://ftp.nl.debian.org/debian/"
"ftp://ftp.ru.debian.org/debian/"
"http://archive.debian.org/debian-archive/debian/"
"ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/"
];
# Alsa Project
alsa = [
"https://www.alsa-project.org/files/pub/"
"ftp://ftp.alsa-project.org/pub/"
"http://alsa.cybermirror.org/"
"http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/"
# Fedora
# Please add only full mirrors that carry old Fedora distributions as well
# See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content)
fedora = [
"https://archives.fedoraproject.org/pub/fedora/"
"https://fedora.osuosl.org/"
"https://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/"
"https://ftp.linux.cz/pub/linux/fedora/"
"https://archives.fedoraproject.org/pub/archive/fedora/"
"http://ftp.nluug.nl/pub/os/Linux/distr/fedora/"
"http://mirror.csclub.uwaterloo.ca/fedora/"
"http://mirror.1000mbps.com/fedora/"
];
# Gentoo
gentoo = [
"https://ftp.snt.utwente.nl/pub/os/linux/gentoo/"
"https://distfiles.gentoo.org/"
"https://mirrors.kernel.org/gentoo/"
];
# openSUSE
opensuse = [
"https://opensuse.hro.nl/opensuse/distribution/"
"https://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/"
"https://ftp.opensuse.org/pub/opensuse/distribution/"
"https://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/"
"https://mirrors.edge.kernel.org/opensuse/distribution/"
"http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/"
];
# Ubuntu
ubuntu = [
"https://nl.archive.ubuntu.com/ubuntu/"
"https://old-releases.ubuntu.com/ubuntu/"
"https://mirrors.edge.kernel.org/ubuntu/"
"http://de.archive.ubuntu.com/ubuntu/"
"http://archive.ubuntu.com/ubuntu/"
];
# ... and other OSes in general
# OpenBSD
openbsd = [
"https://ftp.openbsd.org/pub/OpenBSD/"
"ftp://ftp.nluug.nl/pub/OpenBSD/"
"ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/"
];
}

View file

@ -2,7 +2,7 @@
{ pname, version, nativeBuildInputs ? [], enableParallelBuilding ? true, ... }@args:
let Dune = if args.useDune2 or false then dune_2 else dune_1; in
let Dune = if args.useDune2 or true then dune_2 else dune_1; in
if (args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion) ||
(args ? minimalOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimalOCamlVersion)

View file

@ -1,11 +1,11 @@
{ lib, fetchzip }:
let
version = "0.62";
version = "0.63.1";
in fetchzip {
name = "sudo-font-${version}";
url = "https://github.com/jenskutilek/sudo-font/releases/download/v${version}/sudo.zip";
sha256 = "sha256-I0E2zYbfEFBEIBNC7nnJb+hOaBgGZkAIg08YpA8awso=";
sha256 = "sha256-z/1Y2eJMrQ+43UIt4HWcLwjYs+hfCY/g4iRxJ+yBAqw=";
postFetch = ''
mkdir -p $out/share/fonts/

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "v2ray-geoip";
version = "202203020509";
version = "202203100039";
src = fetchFromGitHub {
owner = "v2fly";
repo = "geoip";
rev = "9dce4df2c1f409bad67f579910a4edf522251e7b";
sha256 = "sha256-fR0lzvVQjWA3KbzLhuvoB15Z+7RAv34Wf5W7KRZ//QA=";
rev = "564c2c8de36d3680a1d5f209d6bb05e4f3f70dfc";
sha256 = "sha256-JPpzIppgKQox8T6VC/kzhpLy+YAcuHdH5L6zqciOXow=";
};
installPhase = ''

View file

@ -3,11 +3,11 @@
stdenvNoCC.mkDerivation rec {
pname = "fasm-bin";
version = "1.73.29";
version = "1.73.30";
src = fetchurl {
url = "https://flatassembler.net/fasm-${version}.tgz";
sha256 = "sha256-Yyj02DRo9wTkJ01ukOwElHr1ZyZFPOMTibwyAkqYISs=";
sha256 = "sha256-dRlQUaWIHbu+DwQBFh6Tf4o2u0LTRw/Ehp2hT9LC8QE=";
};
installPhase = ''

View file

@ -19,7 +19,7 @@
let
release_version = "14.0.0";
candidate = "rc2"; # empty or "rcN"
candidate = "rc4"; # empty or "rcN"
dash-candidate = lib.optionalString (candidate != "") "-${candidate}";
rev = ""; # When using a Git commit
rev-version = ""; # When using a Git commit
@ -30,7 +30,7 @@ let
owner = "llvm";
repo = "llvm-project";
rev = if rev != "" then rev else "llvmorg-${version}";
sha256 = "sha256-5wJEaWvwJohtjqlIsBkqQ5rE6rcWw07MaQnN1RxPb5w=";
sha256 = "0xm3hscg6xv48rjdi7sg9ky960af1qyg5k3jyavnaqimlaj9wxgp";
};
llvm_meta = {

View file

@ -209,6 +209,9 @@ in stdenv.mkDerivation (rec {
checkTarget = "check-all";
# For the update script:
passthru.monorepoSrc = monorepoSrc;
requiredSystemFeatures = [ "big-parallel" ];
meta = llvm_meta // {
homepage = "https://llvm.org/";

View file

@ -20,7 +20,11 @@ sed -Ei \
readonly ATTRSET="llvmPackages_$VERSION_MAJOR"
if [ "$VERSION_MAJOR" -ge "13" ]; then
if [ "$VERSION_MAJOR" -ge "14" ]; then
readonly SOURCES=(
"llvm.monorepoSrc"
)
elif [ "$VERSION_MAJOR" -eq "13" ]; then
readonly SOURCES=(
"llvm.src"
)
@ -43,7 +47,7 @@ fi
for SOURCE in "${SOURCES[@]}"; do
echo "Updating the hash of $SOURCE:"
declare ATTR="$ATTRSET.$SOURCE"
declare OLD_HASH="$(nix eval -f . $ATTR.outputHash)"
declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\""
find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +
done

View file

@ -0,0 +1,9 @@
import ./generic.nix {
major_version = "4";
minor_version = "14";
patch_version = "0-beta1";
src = fetchTarball {
url = "https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~beta1.tar.xz";
sha256 = "0jiz20hb58jbbk8j38agx11ra4hg0v3prmzc5a9j70lm09mnzfcd";
};
}

View file

@ -5,13 +5,13 @@
stdenv.mkDerivation rec {
pname = "cimg";
version = "3.0.0";
version = "3.0.2";
src = fetchFromGitHub {
owner = "dtschump";
repo = "CImg";
rev = "v.${version}";
hash = "sha256-dC4VuWTz0uyFxLjBQ+2ggndHaCErcoI7tJMfkqbWmeg=";
hash = "sha256-OWpztnyVXCg+uoAb6e/2eUK2ebBalDlz6Qcjf17IeMk=";
};
outputs = [ "out" "doc" ];

View file

@ -18,13 +18,13 @@ assert blas.isILP64 == scalapack.isILP64;
stdenv.mkDerivation rec {
pname = "elpa";
version = "2021.11.001";
version = "2021.11.002";
passthru = { inherit (blas) isILP64; };
src = fetchurl {
url = "https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/${version}/elpa-${version}.tar.gz";
sha256 = "0bw0nwzwvjfmijfwznmrghypd3q237a3h5g5fcdncilrqnk1sdpv";
sha256 = "sha256-V28cru14g7gTlmQP2g9QQYOGbPbL1Lxx0Tg7oiCPH5c=";
};
patches = [

View file

@ -21,6 +21,7 @@
, zlib
, icu
, systemd
, systemdSupport ? stdenv.hostPlatform.isLinux
}:
stdenv.mkDerivation rec {
@ -63,6 +64,7 @@ stdenv.mkDerivation rec {
pcre2
zlib
icu
] ++ lib.optionals systemdSupport [
systemd
];
@ -73,6 +75,10 @@ stdenv.mkDerivation rec {
pango
];
mesonFlags = lib.optionals (!systemdSupport) [
"-D_systemd=false"
];
postPatch = ''
patchShebangs perf/*
patchShebangs src/box_drawing_generate.sh

View file

@ -11,13 +11,13 @@
stdenv.mkDerivation rec {
pname = "zchunk";
version = "1.1.16";
version = "1.2.0";
src = fetchFromGitHub {
owner = "zchunk";
repo = pname;
rev = version;
hash = "sha256-+8FkivLTZXdu0+1wu+7T98y6rQzIHbG9l15Abrbln1o=";
hash = "sha256-7H1WF5VkpA65xCdEa0Sw4r4jj+kGhDVCMr5AeE+3Ii4=";
};
nativeBuildInputs = [
@ -47,5 +47,6 @@ stdenv.mkDerivation rec {
license = licenses.bsd2;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
broken = stdenv.isDarwin; # does not find argp-standalone
};
}

View file

@ -4,6 +4,8 @@ buildDunePackage rec {
pname = "facile";
version = "1.1.4";
useDune2 = false;
src = fetchurl {
url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz";
sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp";

View file

@ -6,6 +6,8 @@ buildDunePackage rec {
pname = "genspio";
version = "0.0.2";
useDune2 = false;
src = fetchFromGitHub {
owner = "hammerlab";
repo = pname;
@ -13,7 +15,7 @@ buildDunePackage rec {
sha256 = "0cp6p1f713sfv4p2r03bzvjvakzn4ili7hf3a952b3w1k39hv37x";
};
minimumOCamlVersion = "4.03";
minimalOCamlVersion = "4.03";
propagatedBuildInputs = [ nonstd sosa ];

View file

@ -5,7 +5,9 @@
buildDunePackage (args // {
inherit version buildInputs;
minimumOCamlVersion = "4.04";
useDune2 = false;
minimalOCamlVersion = "4.04";
src = fetchFromGitHub {
owner = "janestreet";

View file

@ -5,6 +5,8 @@
buildDunePackage (args // {
inherit version;
useDune2 = false;
minimalOCamlVersion = "4.07";
src = fetchFromGitHub {

View file

@ -11,7 +11,9 @@ buildDunePackage rec {
sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9";
};
minimumOCamlVersion = "4.02";
useDune2 = false;
minimalOCamlVersion = "4.02";
propagatedBuildInputs = [ camlp4 ];

View file

@ -4,7 +4,9 @@ buildDunePackage rec {
pname = "nonstd";
version = "0.0.3";
minimumOCamlVersion = "4.02";
useDune2 = false;
minimalOCamlVersion = "4.02";
src = fetchzip {
url = "https://bitbucket.org/smondet/${pname}/get/${pname}.${version}.tar.gz";

View file

@ -1,14 +1,14 @@
{ lib, buildDunePackage, fetchFromGitHub, camlidl, fuse, dune-configurator }:
buildDunePackage {
buildDunePackage rec {
pname = "ocamlfuse";
version = "2.7.1_cvs6_e35e76b";
version = "2.7.1_cvs7";
src = fetchFromGitHub {
owner = "astrada";
repo = "ocamlfuse";
rev = "e35e76bee3b06806256b5bfca108b7697267cd5c";
sha256 = "1v9g0wh7rnjkrjrnw50145g6ry38plyjs8fq8w0nlzwizhf3qhff";
rev = "v${version}";
sha256 = "6nmPXZx38hBGlg+gV9nnlRpPfeSAqDj4zBPcjUNvTRo=";
};
# This currently fails with dune

View file

@ -1,20 +1,19 @@
{ lib, buildDunePackage, fetchFromGitHub }:
{ lib, buildDunePackage, fetchurl }:
buildDunePackage rec {
minimumOCamlVersion = "4.06";
minimalOCamlVersion = "4.06";
useDune2 = true;
pname = "owee";
version = "0.3";
version = "0.4";
src = fetchFromGitHub {
owner = "let-def";
repo = "owee";
rev = "v${version}";
sha256 = "0jp8ca57488d7sj2nqy4yxcdpda6sxx51yyi8k6888hbinhyqp0j";
src = fetchurl {
url = "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz";
sha256 = "sha256:055bi0yfdki1pqagbhrwmfvigyawjgsmqw04zhpp6hds8513qzvb";
};
meta = {
description = "An experimental OCaml library to work with DWARF format";
inherit (src.meta) homepage;
homepage = "https://github.com/let-def/owee/";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.vbgl ];
};

View file

@ -1,4 +1,7 @@
{ lib, fetchFromGitHub, buildDunePackage, owee }:
{ lib, fetchFromGitHub, buildDunePackage, ocaml, owee }:
lib.throwIfNot (lib.versionAtLeast "4.12" ocaml.version)
"spacetime_lib is not available for OCaml ${ocaml.version}"
buildDunePackage rec {
pname = "spacetime_lib";

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/box/box.phar
makeWrapper ${php}/bin/php $out/bin/box \
--add-flags "-d phar.readonly=0 $out/libexec/box/box.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -14,6 +14,7 @@ mkDerivation rec {
nativeBuildInputs = [ makeWrapper installShellFiles ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/deployer/deployer.phar
makeWrapper ${php}/bin/php $out/bin/dep --add-flags "$out/libexec/deployer/deployer.phar"
@ -22,6 +23,7 @@ mkDerivation rec {
installShellCompletion --cmd dep \
--bash <($out/bin/dep autocomplete --install) \
--zsh <($out/bin/dep autocomplete --install)
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phing/phing.phar
makeWrapper ${php}/bin/php $out/bin/phing \
--add-flags "$out/libexec/phing/phing.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -0,0 +1,31 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
mkDerivation rec {
pname = "phive";
version = "0.15.0";
src = fetchurl {
url = "https://github.com/phar-io/phive/releases/download/${version}/phive-${version}.phar";
sha256 = "sha256-crMr8d5nsVt7+zQ5xPeph/JXmTEn6jJFVtp3mOgylB4=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phive/phive.phar
makeWrapper ${php}/bin/php $out/bin/phive \
--add-flags "$out/libexec/phive/phive.phar"
runHook postInstall
'';
meta = with lib; {
description = "The Phar Installation and Verification Environment (PHIVE)";
homepage = "https://github.com/phar-io/phive";
license = licenses.bsd3;
maintainers = with maintainers; teams.php.members;
};
}

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/php-cs-fixer/php-cs-fixer.phar
makeWrapper ${php}/bin/php $out/bin/php-cs-fixer \
--add-flags "$out/libexec/php-cs-fixer/php-cs-fixer.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -20,15 +20,19 @@ mkDerivation {
];
buildPhase = ''
runHook preBuild
composer dump-autoload
box build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D parallel-lint.phar $out/libexec/php-parallel-lint/php-parallel-lint.phar
makeWrapper ${php}/bin/php $out/bin/php-parallel-lint \
--add-flags "$out/libexec/php-parallel-lint/php-parallel-lint.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpcbf/phpcbf.phar
makeWrapper ${php}/bin/php $out/bin/phpcbf \
--add-flags "$out/libexec/phpcbf/phpcbf.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpcs/phpcs.phar
makeWrapper ${php}/bin/php $out/bin/phpcs \
--add-flags "$out/libexec/phpcs/phpcs.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpmd/phpmd.phar
makeWrapper ${php}/bin/php $out/bin/phpmd \
--add-flags "$out/libexec/phpmd/phpmd.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpstan/phpstan.phar
makeWrapper ${php}/bin/php $out/bin/phpstan \
--add-flags "$out/libexec/phpstan/phpstan.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/psalm/psalm.phar
makeWrapper ${php}/bin/php $out/bin/psalm \
--add-flags "$out/libexec/psalm/psalm.phar"
runHook postInstall
'';
meta = with lib; {

View file

@ -16,10 +16,12 @@ mkDerivation {
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
tar -xzf $src -C $out/bin
chmod +x $out/bin/psysh
wrapProgram $out/bin/psysh --prefix PATH : "${lib.makeBinPath [ php ]}"
runHook postInstall
'';
meta = with lib; {

View file

@ -13,7 +13,7 @@
buildPythonPackage rec {
pname = "aio-geojson-client";
version = "0.16";
version = "0.17";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -22,7 +22,7 @@ buildPythonPackage rec {
owner = "exxamalte";
repo = "python-aio-geojson-client";
rev = "v${version}";
hash = "sha256-u3SwrSxeBJrBTHfqKY/mAb2p1jqW2AvRsHomKsI81gM=";
hash = "sha256-5GiQgtbvYeleovFbXO2vlr2XPsDIWZiElM64O+urMcY=";
};
propagatedBuildInputs = [

View file

@ -0,0 +1,38 @@
{ lib
, fetchPypi
, buildPythonPackage
, pythonOlder
, behave
, allure-python-commons
, setuptools-scm
}:
buildPythonPackage rec {
pname = "allure-behave";
version = "2.9.45";
disabled = pythonOlder "3.4";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-aK0SgQIXpuUoSTz8jg5IPKQM2Xvk2EfkSGigsy/GFNo=";
};
nativeBuildInputs = [
setuptools-scm
];
pythonImportsCheck = [ "allure_behave" ];
propagatedBuildInputs = [
allure-python-commons
behave
];
meta = with lib; {
description = "Allure behave integration.";
homepage = "https://github.com/allure-framework/allure-python";
license = licenses.asl20;
maintainers = with maintainers; [ happysalada ];
};
}

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