Skip to content

Commit

Permalink
Merge master into haskell-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 30, 2023
2 parents 23bb2be + ed66c81 commit c0831fc
Show file tree
Hide file tree
Showing 192 changed files with 3,481 additions and 2,765 deletions.
51 changes: 47 additions & 4 deletions doc/stdenv/stdenv.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -991,13 +991,56 @@ Hook executed at the end of the fixup phase.

If set to `true`, the standard environment will enable debug information in C/C++ builds. After installation, the debug information will be separated from the executables and stored in the output named `debug`. (This output is enabled automatically; you don’t need to set the `outputs` attribute explicitly.) To be precise, the debug information is stored in `debug/lib/debug/.build-id/XX/YYYY…`, where \<XXYYYY…\> is the \<build ID\> of the binary — a SHA-1 hash of the contents of the binary. Debuggers like GDB use the build ID to look up the separated debug information.

For example, with GDB, you can add
:::{.example #ex-gdb-debug-symbols-socat}

# Enable debug symbols for use with GDB

To make GDB find debug information for the `socat` package and its dependencies, you can use the following `shell.nix`:

```nix
let
pkgs = import ./. {
config = {};
overlays = [
(final: prev: {
ncurses = prev.ncurses.overrideAttrs { separateDebugInfo = true; };
readline = prev.readline.overrideAttrs { separateDebugInfo = true; };
})
];
};
myDebugInfoDirs = pkgs.symlinkJoin {
name = "myDebugInfoDirs";
paths = with pkgs; [
glibc.debug
ncurses.debug
openssl.debug
readline.debug
];
};
in
pkgs.mkShell {
NIX_DEBUG_INFO_DIRS = "${pkgs.lib.getLib myDebugInfoDirs}/lib/debug";
packages = [
pkgs.gdb
pkgs.socat
];
shellHook = ''
${pkgs.lib.getBin pkgs.gdb}/bin/gdb ${pkgs.lib.getBin pkgs.socat}/bin/socat
'';
}
```
set debug-file-directory ~/.nix-profile/lib/debug
```

to `~/.gdbinit`. GDB will then be able to find debug information installed via `nix-env -i`.
This setup works as follows:
- Add [`overlays`](#chap-overlays) to the package set, since debug symbols are disabled for `ncurses` and `readline` by default.
- Create a derivation to combine all required debug symbols under one path with [`symlinkJoin`](#trivial-builder-symlinkJoin).
- Set the environment variable `NIX_DEBUG_INFO_DIRS` in the shell. Nixpkgs patches `gdb` to use it for looking up debug symbols.
- Run `gdb` on the `socat` binary on shell startup in the [`shellHook`](#sec-pkgs-mkShell). Here we use [`lib.getBin`](#function-library-lib.attrsets.getBin) to ensure that the correct derivation output is selected rather than the default one.

:::

### The installCheck phase {#ssec-installCheck-phase}

Expand Down
30 changes: 30 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,12 @@
githubId = 160476;
name = "Amanjeev Sethi";
};
amanse = {
email = "[email protected]";
github = "amanse";
githubId = 13214574;
name = "Aman Setia";
};
amar1729 = {
email = "[email protected]";
github = "Amar1729";
Expand Down Expand Up @@ -11591,6 +11597,13 @@
githubId = 1001112;
name = "Marcin Janczyk";
};
mjm = {
email = "[email protected]";
github = "mjm";
githubId = 1181;
matrix = "@mjm:beeper.com";
name = "Matt Moriarity";
};
mjp = {
email = "[email protected]";
github = "MikePlayle";
Expand Down Expand Up @@ -12091,6 +12104,11 @@
githubId = 59313755;
name = "Maxim Karasev";
};
mxmlnkn = {
github = "mxmlnkn";
githubId = 6842824;
name = "Maximilian Knespel";
};
myaats = {
email = "[email protected]";
github = "Myaats";
Expand Down Expand Up @@ -15283,6 +15301,12 @@
githubId = 171470;
name = "Sam Hug";
};
SamirTalwar = {
email = "[email protected]";
github = "SamirTalwar";
githubId = 47852;
name = "Samir Talwar";
};
samlich = {
email = "[email protected]";
github = "samlich";
Expand Down Expand Up @@ -18575,6 +18599,12 @@
githubId = 7121530;
name = "Wolf Honoré";
};
wietsedv = {
email = "[email protected]";
github = "wietsedv";
githubId = 13139101;
name = "Wietse de Vries";
};
wigust = {
name = "Oleg Pykhalov";
email = "[email protected]";
Expand Down
10 changes: 10 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@

- [tuxedo-rs](https://github.com/AaronErhardt/tuxedo-rs), Rust utilities for interacting with hardware from TUXEDO Computers.

- [audiobookshelf](https://github.com/advplyr/audiobookshelf/), a self-hosted audiobook and podcast server. Available as [services.audiobookshelf](#opt-services.audiobookshelf.enable).

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

- The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices.
Expand Down Expand Up @@ -165,6 +167,10 @@

- PHP now defaults to PHP 8.2, updated from 8.1.

- GraalVM has been updated to the latest version, and this brings significant changes. Upstream don't release multiple versions targeting different JVMs anymore, so now we only have one GraalVM derivation (`graalvm-ce`). While at first glance the version may seem a downgrade (22.3.1 -> 21.0.0), the major version is now following the JVM it targets (so this latest version targets JVM 21). Also some products like `llvm-installable-svm` and `native-image-svm` were incorporate to the main GraalVM derivation, so they're included by default.

- GraalPy (`graalCEPackages.graalpy`), TruffleRuby (`graalCEPackages.truffleruby`), GraalJS (`graalCEPackages.graaljs`) and GraalNodeJS (`grallCEPackages.graalnodejs`) are now indepedent from the main GraalVM derivation.

- The ISC DHCP package and corresponding module have been removed, because they are end of life upstream. See https://www.isc.org/blogs/isc-dhcp-eol/ for details and switch to a different DHCP implementation like kea or dnsmasq.

- `prometheus-unbound-exporter` has been replaced by the Let's Encrypt maintained version, since the previous version was archived. This requires some changes to the module configuration, most notable `controlInterface` needs migration
Expand Down Expand Up @@ -196,6 +202,10 @@

- `spamassassin` no longer supports the `Hashcash` module. The module needs to be removed from the `loadplugin` list if it was copied over from the default `initPreConf` option.

- `nano` was removed from `environment.defaultPackages`. To not leave systems without a editor, now `programs.nano.enable` is enabled by default.

- `programs.nano.nanorc` and `programs.nano.syntaxHighlight` no longer have an effect unless `programs.nano.enable` is set to true which is the default.

- `services.outline.sequelizeArguments` has been removed, as `outline` no longer executes database migrations via the `sequelize` cli.

- The binary of the package `cloud-sql-proxy` has changed from `cloud_sql_proxy` to `cloud-sql-proxy`.
Expand Down
3 changes: 3 additions & 0 deletions nixos/lib/test-driver/test_driver/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ def shell_ready(timeout_secs: int) -> bool:

while True:
chunk = self.shell.recv(1024)
# No need to print empty strings, it means we are waiting.
if len(chunk) == 0:
continue
self.log(f"Guest shell says: {chunk!r}")
# NOTE: for this to work, nothing must be printed after this line!
if b"Spawning backdoor root shell..." in chunk:
Expand Down
3 changes: 1 addition & 2 deletions nixos/modules/config/system-path.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ let
];

defaultPackageNames =
[ "nano"
"perl"
[ "perl"
"rsync"
"strace"
];
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@
./services/web-apps/atlassian/confluence.nix
./services/web-apps/atlassian/crowd.nix
./services/web-apps/atlassian/jira.nix
./services/web-apps/audiobookshelf.nix
./services/web-apps/bookstack.nix
./services/web-apps/calibre-web.nix
./services/web-apps/coder.nix
Expand Down
34 changes: 15 additions & 19 deletions nixos/modules/programs/nano.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

let
cfg = config.programs.nano;
LF = "\n";
in

{
###### interface

options = {
programs.nano = {
enable = lib.mkEnableOption (lib.mdDoc "nano") // {
default = true;
};

package = lib.mkPackageOptionMD pkgs "nano" { };

nanorc = lib.mkOption {
type = lib.types.lines;
Expand All @@ -24,28 +26,22 @@ in
set tabsize 2
'';
};

syntaxHighlight = lib.mkOption {
type = lib.types.bool;
default = true;
default = false;
description = lib.mdDoc "Whether to enable syntax highlight for various languages.";
};
};
};

###### implementation

config = lib.mkIf (cfg.nanorc != "" || cfg.syntaxHighlight) {
environment.etc.nanorc.text = lib.concatStringsSep LF (
( lib.optionals cfg.syntaxHighlight [
"# The line below is added because value of programs.nano.syntaxHighlight is set to true"
''include "${pkgs.nano}/share/nano/*.nanorc"''
""
])
++ ( lib.optionals (cfg.nanorc != "") [
"# The lines below have been set from value of programs.nano.nanorc"
cfg.nanorc
])
);
config = lib.mkIf cfg.enable {
environment = {
etc.nanorc.text = (lib.optionalString cfg.syntaxHighlight ''
# load syntax highlighting files
include "${cfg.package}/share/nano/*.nanorc"
'') + cfg.nanorc;
systemPackages = [ cfg.package ];
};
};

}
4 changes: 2 additions & 2 deletions nixos/modules/services/backup/btrbk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ in
{ command = "${pkgs.coreutils}/bin/mkdir"; options = [ "NOPASSWD" ]; }
{ command = "${pkgs.coreutils}/bin/readlink"; options = [ "NOPASSWD" ]; }
# for ssh, they are not the same than the one hard coded in ${pkgs.btrbk}
{ command = "/run/current-system/bin/btrfs"; options = [ "NOPASSWD" ]; }
{ command = "/run/current-system/sw/bin/btrfs"; options = [ "NOPASSWD" ]; }
{ command = "/run/current-system/sw/bin/mkdir"; options = [ "NOPASSWD" ]; }
{ command = "/run/current-system/sw/bin/readlink"; options = [ "NOPASSWD" ]; }
];
Expand All @@ -182,7 +182,7 @@ in
(doasCmdNoPass "${pkgs.coreutils}/bin/mkdir")
(doasCmdNoPass "${pkgs.coreutils}/bin/readlink")
# for ssh, they are not the same than the one hard coded in ${pkgs.btrbk}
(doasCmdNoPass "/run/current-system/bin/btrfs")
(doasCmdNoPass "/run/current-system/sw/bin/btrfs")
(doasCmdNoPass "/run/current-system/sw/bin/mkdir")
(doasCmdNoPass "/run/current-system/sw/bin/readlink")

Expand Down
8 changes: 2 additions & 6 deletions nixos/modules/services/misc/xmr-stak.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
cfg = config.services.xmr-stak;

pkg = pkgs.xmr-stak.override {
inherit (cfg) openclSupport cudaSupport;
inherit (cfg) openclSupport;
};

in
Expand All @@ -17,7 +17,6 @@ in
services.xmr-stak = {
enable = mkEnableOption (lib.mdDoc "xmr-stak miner");
openclSupport = mkEnableOption (lib.mdDoc "support for OpenCL (AMD/ATI graphics cards)");
cudaSupport = mkEnableOption (lib.mdDoc "support for CUDA (NVidia graphics cards)");

extraArgs = mkOption {
type = types.listOf types.str;
Expand Down Expand Up @@ -64,15 +63,12 @@ in
wantedBy = [ "multi-user.target" ];
bindsTo = [ "network-online.target" ];
after = [ "network-online.target" ];
environment = mkIf cfg.cudaSupport {
LD_LIBRARY_PATH = "${pkgs.linuxPackages_latest.nvidia_x11}/lib";
};

preStart = concatStrings (flip mapAttrsToList cfg.configFiles (fn: content: ''
ln -sf '${pkgs.writeText "xmr-stak-${fn}" content}' '${fn}'
''));

serviceConfig = let rootRequired = cfg.openclSupport || cfg.cudaSupport; in {
serviceConfig = let rootRequired = cfg.openclSupport; in {
ExecStart = "${pkg}/bin/xmr-stak ${concatStringsSep " " cfg.extraArgs}";
# xmr-stak generates cpu and/or gpu configuration files
WorkingDirectory = "/tmp";
Expand Down
90 changes: 90 additions & 0 deletions nixos/modules/services/web-apps/audiobookshelf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.audiobookshelf;
in
{
options = {
services.audiobookshelf = {
enable = mkEnableOption "Audiobookshelf, self-hosted audiobook and podcast server.";

package = mkPackageOption pkgs "audiobookshelf" { };

dataDir = mkOption {
description = "Path to Audiobookshelf config and metadata inside of /var/lib.";
default = "audiobookshelf";
type = types.str;
};

host = mkOption {
description = "The host Audiobookshelf binds to.";
default = "127.0.0.1";
example = "0.0.0.0";
type = types.str;
};

port = mkOption {
description = "The TCP port Audiobookshelf will listen on.";
default = 8000;
type = types.port;
};

user = mkOption {
description = "User account under which Audiobookshelf runs.";
default = "audiobookshelf";
type = types.str;
};

group = mkOption {
description = "Group under which Audiobookshelf runs.";
default = "audiobookshelf";
type = types.str;
};

openFirewall = mkOption {
description = "Open ports in the firewall for the Audiobookshelf web interface.";
default = false;
type = types.bool;
};
};
};

config = mkIf cfg.enable {
systemd.services.audiobookshelf = {
description = "Audiobookshelf is a self-hosted audiobook and podcast server";

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

serviceConfig = {
Type = "simple";
User = cfg.user;
Group = cfg.group;
StateDirectory = cfg.dataDir;
WorkingDirectory = "/var/lib/${cfg.dataDir}";
ExecStart = "${cfg.package}/bin/audiobookshelf --host ${cfg.host} --port ${toString cfg.port}";
Restart = "on-failure";
};
};

users.users = mkIf (cfg.user == "audiobookshelf") {
audiobookshelf = {
isSystemUser = true;
group = cfg.group;
home = "/var/lib/${cfg.dataDir}";
};
};

users.groups = mkIf (cfg.group == "audiobookshelf") {
audiobookshelf = { };
};

networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
};

meta.maintainers = with maintainers; [ wietsedv ];
}
Loading

0 comments on commit c0831fc

Please sign in to comment.