Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 22, 2023
2 parents a01279c + 76d4d2e commit 1cf369a
Show file tree
Hide file tree
Showing 120 changed files with 2,813 additions and 522 deletions.
7 changes: 4 additions & 3 deletions doc/languages-frameworks/dart.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ If you are packaging a Flutter desktop application, use [`buildFlutterApplicatio

If the upstream source is missing a `pubspec.lock` file, you'll have to vendor one and specify it using `pubspecLockFile`. If it is needed, one will be generated for you and printed when attempting to build the derivation.

The `depsListFile` must always be provided when packaging in Nixpkgs. It will be generated and printed if the derivation is attempted to be built without one. Alternatively, `autoDepsList` may be set to `true` only when outside of Nixpkgs, as it relies on import-from-derivation.

The `dart` commands run can be overridden through `pubGetScript` and `dartCompileCommand`, you can also add flags using `dartCompileFlags` or `dartJitFlags`.

Dart supports multiple [outputs types](https://dart.dev/tools/dart-compile#types-of-output), you can choose between them using `dartOutputType` (defaults to `exe`). If you want to override the binaries path or the source path they come from, you can use `dartEntryPoints`. Outputs that require a runtime will automatically be wrapped with the relevant runtime (`dartaotruntime` for `aot-snapshot`, `dart run` for `jit-snapshot` and `kernel`, `node` for `js`), this can be overridden through `dartRuntimeCommand`.
Expand All @@ -31,6 +33,7 @@ buildDartApplication rec {
};
pubspecLockFile = ./pubspec.lock;
depsListFile = ./deps.json;
vendorHash = "sha256-Atm7zfnDambN/BmmUf4BG0yUz/y6xWzf0reDw3Ad41s=";
}
```
Expand All @@ -39,9 +42,7 @@ buildDartApplication rec {

The function `buildFlutterApplication` builds Flutter applications.

The deps.json file must always be provided when packaging in Nixpkgs. It will be generated and printed if the derivation is attempted to be built without one. Alternatively, `autoDepsList` may be set to `true` when outside of Nixpkgs, as it relies on import-from-derivation.

A `pubspec.lock` file must be available. See the [Dart documentation](#ssec-dart-applications) for more details.
See the [Dart documentation](#ssec-dart-applications) for more details on required files and arguments.

```nix
{ flutter, fetchFromGitHub }:
Expand Down
20 changes: 20 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6199,6 +6199,16 @@
githubId = 45048741;
name = "Alwanga Oyango";
};
galaxy = {
email = "[email protected]";
matrix = "@galaxy:mozilla.org";
name = "The Galaxy";
github = "ga1aksy";
githubId = 148551648;
keys = [{
fingerprint = "48CA 3873 9E9F CA8E 76A0 835A E3DE CF85 4212 E1EA";
}];
};
gal_bolle = {
email = "[email protected]";
github = "FlorentBecker";
Expand Down Expand Up @@ -13664,6 +13674,12 @@
githubId = 152312;
name = "Periklis Tsirakidis";
};
perstark = {
email = "[email protected]";
github = "perstarkse";
githubId = 63069986;
name = "Per Stark";
};
petercommand = {
email = "[email protected]";
github = "petercommand";
Expand Down Expand Up @@ -17883,6 +17899,10 @@
githubId = 13155277;
name = "Tom Houle";
};
tomkoid = {
email = "[email protected]";
name = "Tomkoid";
};
tomodachi94 = {
email = "[email protected]";
matrix = "@tomodachi94:matrix.org";
Expand Down
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@

- [virt-manager](https://virt-manager.org/), an UI for managing virtual machines in libvirt, is now available as `programs.virt-manager`.

- [Soft Serve](https://github.com/charmbracelet/soft-serve), a tasty, self-hostable Git server for the command line. Available as [services.soft-serve](#opt-services.soft-serve.enable).

## Backward Incompatibilities {#sec-release-23.11-incompatibilities}

- `network-online.target` has been fixed to no longer time out for systems with `networking.useDHCP = true` and `networking.useNetworkd = true`.
Expand Down Expand Up @@ -345,6 +347,8 @@

- `jq` was updated to 1.7, its [first release in 5 years](https://github.com/jqlang/jq/releases/tag/jq-1.7).

- `zfs` was updated from 2.1.x to 2.2.0, [enabling newer kernel support and adding new features](https://github.com/openzfs/zfs/releases/tag/zfs-2.2.0).

- A new option was added to the virtualisation module that enables specifying explicitly named network interfaces in QEMU VMs. The existing `virtualisation.vlans` is still supported for cases where the name of the network interface is irrelevant.

- DocBook option documentation is no longer supported, all module documentation now uses markdown.
Expand Down
49 changes: 49 additions & 0 deletions nixos/modules/config/fanout.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.fanout;
mknodCmds = n: lib.lists.imap0 (i: s:
"mknod /dev/fanout${builtins.toString i} c $MAJOR ${builtins.toString i}"
) (lib.lists.replicate n "");
in
{
options.services.fanout = {
enable = lib.mkEnableOption (lib.mdDoc "fanout");
fanoutDevices = lib.mkOption {
type = lib.types.int;
default = 1;
description = "Number of /dev/fanout devices";
};
bufferSize = lib.mkOption {
type = lib.types.int;
default = 16384;
description = "Size of /dev/fanout buffer in bytes";
};
};

config = lib.mkIf cfg.enable {
boot.extraModulePackages = [ config.boot.kernelPackages.fanout.out ];

boot.kernelModules = [ "fanout" ];

boot.extraModprobeConfig = ''
options fanout buffersize=${builtins.toString cfg.bufferSize}
'';

systemd.services.fanout = {
description = "Bring up /dev/fanout devices";
script = ''
MAJOR=$(${pkgs.gnugrep}/bin/grep fanout /proc/devices | ${pkgs.gawk}/bin/awk '{print $1}')
${lib.strings.concatLines (mknodCmds cfg.fanoutDevices)}
'';

wantedBy = [ "multi-user.target" ];

serviceConfig = {
Type = "oneshot";
User = "root";
RemainAfterExit = "yes";
Restart = "no";
};
};
};
}
2 changes: 2 additions & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
./config/appstream.nix
./config/console.nix
./config/debug-info.nix
./config/fanout.nix
./config/fonts/fontconfig.nix
./config/fonts/fontdir.nix
./config/fonts/ghostscript.nix
Expand Down Expand Up @@ -730,6 +731,7 @@
./services/misc/signald.nix
./services/misc/siproxd.nix
./services/misc/snapper.nix
./services/misc/soft-serve.nix
./services/misc/sonarr.nix
./services/misc/sourcehut
./services/misc/spice-vdagentd.nix
Expand Down
10 changes: 5 additions & 5 deletions nixos/modules/programs/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ in
extraPrefs = cfg.autoConfig;
extraNativeMessagingHosts =
old.extraNativeMessagingHosts or []
++ optional nmh.ff2mpv ff2mpv
++ optional nmh.euwebid web-eid-app
++ optional nmh.gsconnect gnomeExtensions.gsconnect
++ optional nmh.jabref jabref
++ optional nmh.passff passff-host;
++ optional nmh.ff2mpv pkgs.ff2mpv
++ optional nmh.euwebid pkgs.web-eid-app
++ optional nmh.gsconnect pkgs.gnomeExtensions.gsconnect
++ optional nmh.jabref pkgs.jabref
++ optional nmh.passff pkgs.passff-host;
cfg = let
# copy-pasted from the wrapper; TODO: figure out fix
applicationName = cfg.package.binaryName or (lib.getName cfg.package);
Expand Down
18 changes: 9 additions & 9 deletions nixos/modules/services/cluster/hadoop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ with lib;
mapredSiteDefault = mkOption {
default = {
"mapreduce.framework.name" = "yarn";
"yarn.app.mapreduce.am.env" = "HADOOP_MAPRED_HOME=${cfg.package}/lib/${cfg.package.untarDir}";
"mapreduce.map.env" = "HADOOP_MAPRED_HOME=${cfg.package}/lib/${cfg.package.untarDir}";
"mapreduce.reduce.env" = "HADOOP_MAPRED_HOME=${cfg.package}/lib/${cfg.package.untarDir}";
"yarn.app.mapreduce.am.env" = "HADOOP_MAPRED_HOME=${cfg.package}";
"mapreduce.map.env" = "HADOOP_MAPRED_HOME=${cfg.package}";
"mapreduce.reduce.env" = "HADOOP_MAPRED_HOME=${cfg.package}";
};
defaultText = literalExpression ''
{
"mapreduce.framework.name" = "yarn";
"yarn.app.mapreduce.am.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}/lib/''${config.${opt.package}.untarDir}";
"mapreduce.map.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}/lib/''${config.${opt.package}.untarDir}";
"mapreduce.reduce.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}/lib/''${config.${opt.package}.untarDir}";
"yarn.app.mapreduce.am.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}";
"mapreduce.map.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}";
"mapreduce.reduce.env" = "HADOOP_MAPRED_HOME=''${config.${opt.package}}";
}
'';
type = types.attrsOf types.anything;
Expand Down Expand Up @@ -154,13 +154,13 @@ with lib;
};

log4jProperties = mkOption {
default = "${cfg.package}/lib/${cfg.package.untarDir}/etc/hadoop/log4j.properties";
default = "${cfg.package}/etc/hadoop/log4j.properties";
defaultText = literalExpression ''
"''${config.${opt.package}}/lib/''${config.${opt.package}.untarDir}/etc/hadoop/log4j.properties"
"''${config.${opt.package}}/etc/hadoop/log4j.properties"
'';
type = types.path;
example = literalExpression ''
"''${pkgs.hadoop}/lib/''${pkgs.hadoop.untarDir}/etc/hadoop/log4j.properties";
"''${pkgs.hadoop}/etc/hadoop/log4j.properties";
'';
description = lib.mdDoc "log4j.properties file added to HADOOP_CONF_DIR";
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/cluster/hadoop/yarn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ in
umount /run/wrappers/yarn-nodemanager/cgroup/cpu || true
rm -rf /run/wrappers/yarn-nodemanager/ || true
mkdir -p /run/wrappers/yarn-nodemanager/{bin,etc/hadoop,cgroup/cpu}
cp ${cfg.package}/lib/${cfg.package.untarDir}/bin/container-executor /run/wrappers/yarn-nodemanager/bin/
cp ${cfg.package}/bin/container-executor /run/wrappers/yarn-nodemanager/bin/
chgrp hadoop /run/wrappers/yarn-nodemanager/bin/container-executor
chmod 6050 /run/wrappers/yarn-nodemanager/bin/container-executor
cp ${hadoopConf}/container-executor.cfg /run/wrappers/yarn-nodemanager/etc/hadoop/
Expand Down
99 changes: 99 additions & 0 deletions nixos/modules/services/misc/soft-serve.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.soft-serve;
configFile = format.generate "config.yaml" cfg.settings;
format = pkgs.formats.yaml { };
docUrl = "https://charm.sh/blog/self-hosted-soft-serve/";
stateDir = "/var/lib/soft-serve";
in
{
options = {
services.soft-serve = {
enable = mkEnableOption "Enable soft-serve service";

package = mkPackageOption pkgs "soft-serve" { };

settings = mkOption {
type = format.type;
default = { };
description = mdDoc ''
The contents of the configuration file.
See <${docUrl}>.
'';
example = literalExpression ''
{
name = "dadada's repos";
log_format = "text";
ssh = {
listen_addr = ":23231";
public_url = "ssh://localhost:23231";
max_timeout = 30;
idle_timeout = 120;
};
stats.listen_addr = ":23233";
}
'';
};
};
};

config = mkIf cfg.enable {

systemd.tmpfiles.rules = [
# The config file has to be inside the state dir
"L+ ${stateDir}/config.yaml - - - - ${configFile}"
];

systemd.services.soft-serve = {
description = "Soft Serve git server";
documentation = [ docUrl ];
requires = [ "network-online.target" ];
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];

environment.SOFT_SERVE_DATA_PATH = stateDir;

serviceConfig = {
Type = "simple";
DynamicUser = true;
Restart = "always";
ExecStart = "${getExe cfg.package} serve";
StateDirectory = "soft-serve";
WorkingDirectory = stateDir;
RuntimeDirectory = "soft-serve";
RuntimeDirectoryMode = "0750";
ProcSubset = "pid";
ProtectProc = "invisible";
UMask = "0027";
CapabilityBoundingSet = "";
ProtectHome = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectHostname = true;
ProtectClock = true;
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectKernelLogs = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
LockPersonality = true;
MemoryDenyWriteExecute = true;
RestrictRealtime = true;
RemoveIPC = true;
PrivateMounts = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io @reboot @setuid @swap"
];
};
};
};

meta.maintainers = [ maintainers.dadada ];
}
1 change: 1 addition & 0 deletions nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ let
};

storeImage = import ../../lib/make-disk-image.nix {
name = "nix-store-image";
inherit pkgs config lib;
additionalPaths = [ regInfo ];
format = "qcow2";
Expand Down
2 changes: 2 additions & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ in {
fail2ban = handleTest ./fail2ban.nix { };
fakeroute = handleTest ./fakeroute.nix {};
fancontrol = handleTest ./fancontrol.nix {};
fanout = handleTest ./fanout.nix {};
fcitx5 = handleTest ./fcitx5 {};
fenics = handleTest ./fenics.nix {};
ferm = handleTest ./ferm.nix {};
Expand Down Expand Up @@ -733,6 +734,7 @@ in {
snapper = handleTest ./snapper.nix {};
snipe-it = runTest ./web-apps/snipe-it.nix;
soapui = handleTest ./soapui.nix {};
soft-serve = handleTest ./soft-serve.nix {};
sogo = handleTest ./sogo.nix {};
solanum = handleTest ./solanum.nix {};
sonarr = handleTest ./sonarr.nix {};
Expand Down
30 changes: 30 additions & 0 deletions nixos/tests/fanout.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? import ../.. { inherit system config; }
}:
import ./make-test-python.nix ({lib, pkgs, ...}: {
name = "fanout";
meta.maintainers = [ lib.maintainers.therishidesai ];

nodes = let
cfg = { ... }: {
services.fanout = {
enable = true;
fanoutDevices = 2;
bufferSize = 8192;
};
};
in {
machine = cfg;
};

testScript = ''
start_all()
# mDNS.
machine.wait_for_unit("multi-user.target")
machine.succeed("test -c /dev/fanout0")
machine.succeed("test -c /dev/fanout1")
'';
})
2 changes: 1 addition & 1 deletion nixos/tests/hadoop/hadoop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ import ../make-test-python.nix ({ package, ... }: {
assert "standby" in client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState")
client.succeed("sudo -u yarn yarn rmadmin -getAllServiceState | systemd-cat")
assert "Estimated value of Pi is" in client.succeed("HADOOP_USER_NAME=hdfs yarn jar $(readlink $(which yarn) | sed -r 's~bin/yarn~lib/hadoop-*/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar~g') pi 2 10")
assert "Estimated value of Pi is" in client.succeed("HADOOP_USER_NAME=hdfs yarn jar $(readlink $(which yarn) | sed -r 's~bin/yarn~share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar~g') pi 2 10")
assert "SUCCEEDED" in client.succeed("yarn application -list -appStates FINISHED")
'';
})
Loading

0 comments on commit 1cf369a

Please sign in to comment.