jiebi/CodeConvo huggingface dataset:
<ins> # This test verifies that systemd-timesyncd can resolve the NTP server hostname when DNSSEC validation # fails even though it is enforced in the systemd-resolved settings. It is required in order to solve # the chicken-and-egg problem when DNSSEC validation needs the correct time to work, but to set the # correct time, we need to connect to an NTP server, which usually requires resolving its hostname. # # This test does the following: # - Sets up a DNS server (tinydns) listening on the eth1 ip addess, serving .ntp and fake.ntp records. # - Configures that DNS server as a resolver and enables DNSSEC in systemd-resolved settings. # - Configures systemd-timesyncd to use fake.ntp hostname as an NTP server. # - Performs a regular DNS lookup, to ensure it fails due to broken DNSSEC. # - Waits until systemd-timesyncd resolves fake.ntp by checking its debug output. #   Here, we don't expect systemd-timesyncd to connect and synchronize time because there is no NTP #   server running. For this test to succeed, we only need to ensure that systemd-timesyncd #   resolves the IP address of the fake.ntp host. import ./make-test-python.nix ({ pkgs, ... }: let ntpHostname = "fake.ntp"; ntpIP = "192.0.2.1"; in { name = "systemd-timesyncd"; nodes.machine = { pkgs, lib, config, ... }: let eth1IP = (lib.head config.networking.interfaces.eth1.ipv4.addresses).address; in { # Setup a local DNS server for the NTP domain on the eth1 IP address services.tinydns = { enable = true; ip = eth1IP; data = '' .ntp:${eth1IP} +.${ntpHostname}:${ntpIP} ''; }; # Enable systemd-resolved with DNSSEC and use the local DNS as a name server services.resolved.enable = true; services.resolved.dnssec = "true"; networking.nameservers = [ eth1IP ]; # Configure systemd-timesyncd to use our NTP hostname services.timesyncd.enable = lib.mkForce true; services.timesyncd.servers = [ ntpHostname ]; services.timesyncd.extraConfig = '' FallbackNTP=${ntpHostname} ''; # The debug output is necessary to determine whether systemd-timesyncd successfully resolves our NTP hostname or not systemd.services.systemd-timesyncd.environment.SYSTEMD_LOG_LEVEL = "debug"; }; testScript = '' machine.wait_for_unit("tinydns.service") machine.wait_for_unit("systemd-timesyncd.service") machine.fail("resolvectl query ${ntpHostname}") machine.wait_until_succeeds("journalctl -u systemd-timesyncd.service --grep='Resolved address ${ntpIP}:123 for ${ntpHostname}'") ''; }) </ins>
<ins> From 7a27556920fe1feefd17096841c8f3ca1294a1b3 Mon Sep 17 00:00:00 2001 From: Yuri Nesterov <yuriy.nesterov@unikie.com> Date: Wed, 21 Jun 2023 17:17:38 +0300 Subject: [PATCH] timesyncd: disable NSCD when DNSSEC validation is disabled Systemd-timesyncd sets SYSTEMD_NSS_RESOLVE_VALIDATE=0 in the unit file to disable DNSSEC validation but it doesn't work when NSCD is used in the system. This patch disabes NSCD in systemd-timesyncd when SYSTEMD_NSS_RESOLVE_VALIDATE is set to 0 so that it uses NSS libraries directly. --- src/timesync/timesyncd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 1d8ebecc91..2b0ae361ff 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -21,6 +21,11 @@ #include "timesyncd-conf.h" #include "timesyncd-manager.h" #include "user-util.h" +#include "env-util.h" + +struct traced_file; +extern void __nss_disable_nscd(void (*)(size_t, struct traced_file *)); +static void register_traced_file(size_t dbidx, struct traced_file *finfo) {} static int advance_tstamp(int fd, const struct stat *st) { assert_se(fd >= 0); @@ -198,6 +203,12 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to parse fallback server strings: %m"); +        r = getenv_bool_secure("SYSTEMD_NSS_RESOLVE_VALIDATE"); +        if (r == 0) { +                log_info("Disabling NSCD because DNSSEC validation is turned off"); +                __nss_disable_nscd(register_traced_file); +        } + log_debug("systemd-timesyncd running as pid " PID_FMT, getpid_cached()); notify_message = notify_start("READY=1n" -- 2.34.1 </ins>
./0017-core-don-t-taint-on-unmerged-usr.patch ./0018-tpm2_context_init-fix-driver-name-checking.patch ./0019-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch <ins> ./0020-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch </ins> ] ++ lib.optional stdenv.hostPlatform.isMusl ( let oe-core = fetchzip {
}: mkDerivation rec { <del> version = "1.1.3"; </del> <ins> version = "1.1.20"; </ins> pname = "syncthingtray"; src = fetchFromGitHub { owner = "Martchus"; repo = "syncthingtray"; rev = "v${version}"; <del> sha256 = "sha256-ovit2XSkxSjcbpqQUv8IzMqfsfItbtXLbx0/Vy0+J0Y="; </del> <ins> sha256 = "sha256-T0ddAROwVSh+IKGZZNDMC7YB2IfQZal2pAQ5ArirtjI="; </ins> }; <del> buildInputs = [ qtbase cpp-utilities qtutilities ] </del> <ins> buildInputs = [ qtbase cpp-utilities qtutilities boost qtforkawesome ] </ins> ++ lib.optionals webviewSupport [ qtwebengine ] ++ lib.optionals jsSupport [ qtdeclarative ] ++ lib.optionals kioPluginSupport [ kio ]
<ins> { stdenv , lib , fetchFromGitHub , cpp-utilities , qtutilities , qttools , qtbase , cmake , perl }: let fork_awesome_release = fetchFromGitHub { owner = "ForkAwesome"; repo = "Fork-Awesome"; rev = "1.2.0"; sha256 = "sha256-zG6/0dWjU7/y/oDZuSEv+54Mchng64LVyV8bluskYzc="; }; in stdenv.mkDerivation rec { pname = "qtforkawesome"; version = "0.0.4"; src = fetchFromGitHub { owner = "Martchus"; repo = pname; rev = "v${version}"; sha256 = "sha256-J3F+ikz6gQqV+JsOX8EpMOWoTmI6UK5KndFALUo4oiU="; }; buildInputs = [ qtbase cpp-utilities qtutilities ]; nativeBuildInputs = [ cmake qttools perl perl.pkgs.YAML ]; cmakeFlags = [ "-DFORK_AWESOME_FONT_FILE=${fork_awesome_release}/fonts/forkawesome-webfont.woff2" "-DFORK_AWESOME_ICON_DEFINITIONS=${fork_awesome_release}/src/icons/icons.yml" ]; dontWrapQtApps = true; meta = with lib; { homepage = "https://github.com/Martchus/qtforkawesome"; description = "Library that bundles ForkAwesome for use within Qt applications"; license = licenses.gpl2Plus; maintainers = with maintainers; [ doronbehar ]; platforms   = platforms.linux; }; } </ins>
owner = "zen-kernel"; repo = "zen-kernel"; inherit rev; <del> sha256 = "sha256-A0QrY1REbRODnHtmyNqVaiLhDgYCECevfHZCxtoQ9kU="; </del> <ins> sha256 = "sha256-LCLfLE85NifuskYl2dxLOJEsUNHLegF8ecYyU4xOCtY="; </ins> }; structuredExtraConfig = with lib.kernel; { ZEN_INTERACTIVE = yes; <ins> # TODO: Remove once #175433 reaches master # https://nixpk.gs/pr-tracker.html?pr=175433 WERROR = no; </ins> }; extraMeta = {
function gitea_setup { cp -f ${configFile} ${runConfig} <del> if [ ! -e ${secretKey} ]; then </del> <ins> if [ ! -s ${secretKey} ]; then </ins> ${gitea}/bin/gitea generate secret SECRET_KEY > ${secretKey} fi # Migrate LFS_JWT_SECRET filename <del> if [[ -e ${oldLfsJwtSecret} && ! -e ${lfsJwtSecret} ]]; then </del> <ins> if [[ -s ${oldLfsJwtSecret} && ! -s ${lfsJwtSecret} ]]; then </ins> mv ${oldLfsJwtSecret} ${lfsJwtSecret} fi <del> if [ ! -e ${oauth2JwtSecret} ]; then </del> <ins> if [ ! -s ${oauth2JwtSecret} ]; then </ins> ${gitea}/bin/gitea generate secret JWT_SECRET > ${oauth2JwtSecret} fi <del> if [ ! -e ${lfsJwtSecret} ]; then </del> <ins> if [ ! -s ${lfsJwtSecret} ]; then </ins> ${gitea}/bin/gitea generate secret LFS_JWT_SECRET > ${lfsJwtSecret} fi <del> if [ ! -e ${internalToken} ]; then </del> <ins> if [ ! -s ${internalToken} ]; then </ins> ${gitea}/bin/gitea generate secret INTERNAL_TOKEN > ${internalToken} fi
cp -r $unpacked/sbin/* $out/bin/ cp -r $unpacked/lib/libconf $out/lib/vmware/ <ins> rm $out/lib/vmware/libconf/etc/fonts/fonts.conf </ins> cp -r $unpacked/lib/bin $out/lib/vmware/ cp -r $unpacked/lib/lib $out/lib/vmware/ cp -r $unpacked/lib/scripts $out/lib/vmware/
./linux-5.6.patch # source: https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290 ./linux-5.9.patch <del> # source: https://github.com/archlinux/svntogit-community/blob/5ec5b248976f84fcd7e3d7fae49ee91289912d12/trunk/012-linux517.patch </del> <ins> # source: https://github.com/archlinux/svntogit-community/blob/33b4bd2b9e30679b03f5d7aa2741911d914dcf94/trunk/012-linux517.patch </ins> ./linux-5.17.patch <ins> # source: https://github.com/archlinux/svntogit-community/blob/2e1fd240f9ce06f500feeaa3e4a9675e65e6b967/trunk/013-linux518.patch ./linux-5.18.patch ./pedantic-fix.patch </ins> ./null-pointer-fix.patch ./gcc.patch ];
<ins> diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c --- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000 +++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000 @@ -599,6 +599,8 @@ va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO); if (va) *pap = (ulong)__virt_to_phys(va); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +	va = dma_alloc_coherent(&((struct pci_dev *)osh->pdev)->dev, size, (dma_addr_t*)pap, GFP_ATOMIC); #else va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap); #endif @@ -612,6 +614,8 @@ #ifdef __ARM_ARCH_7A__ kfree(va); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +	dma_free_coherent(&((struct pci_dev *)osh->pdev)->dev, size, va, (dma_addr_t)pa); #else pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa); #endif @@ -623,7 +627,11 @@ int dir; ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +	dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE; +#else dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE; +#endif #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL) if (dmah != NULL) { @@ -641,7 +649,11 @@ ASSERT(totsegs + nsegs <= MAX_DMA_SEGS); sg->page_link = 0; sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +				dma_map_single(&((struct pci_dev *)osh->pdev)->dev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir); +#else pci_map_single(osh->pdev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir); +#endif } totsegs += nsegs; totlen += PKTLEN(osh, skb); @@ -656,7 +668,11 @@ } #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +	return (dma_map_single(&((struct pci_dev *)osh->pdev)->dev, va, size, dir)); +#else return (pci_map_single(osh->pdev, va, size, dir)); +#endif } void BCMFASTPATH @@ -665,8 +681,13 @@ int dir; ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +	dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE; +	dma_unmap_single(&((struct pci_dev *)osh->pdev)->dev, (uint32)pa, size, dir); +#else dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE; pci_unmap_single(osh->pdev, (uint32)pa, size, dir); +#endif } #if defined(BCMDBG_ASSERT) </ins>
url = "https://hg.mozilla.org/releases/mozilla-esr102/raw-rev/1fa20fb474f5d149cc32d98df169dee5e6e6861b"; sha256 = "sha256-eCisKjNxy9SLr9KoEE2UB26BflUknnR7PIvnpezsZeA="; }) <ins> ] ++ lib.optionals (lib.versionAtLeast version "91" && stdenv.hostPlatform.system == "i686-linux") [ # Fixes i686 build, https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 ./fix-float-i686.patch </ins> ]; nativeBuildInputs = [
<ins> diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h index 51d79f9c2ec59..fafd7d6fc1e0d 100644 --- a/modules/fdlibm/src/math_private.h +++ b/modules/fdlibm/src/math_private.h @@ -30,5 +30,9 @@ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t */ +#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2) +typedef long double      __double_t; +#else typedef double      __double_t; +#endif typedef __double_t  double_t; /* </ins>  No newline at end of file
patches = [ ./fix-libcrypto-loading.patch <ins> (fetchpatch { url = "https://github.com/saltstack/salt/commit/6ec8b90e402ff3fa8f27c7da70ece898592416bc.patch"; hash = "sha256-OQCJeG12cp2EZ0BErp6yqsqhv023923rVFDHAFUfF6c="; }) </ins> ]; postPatch = ''
isQtStyle = cfg.platformTheme == "gtk2" && !(builtins.elem cfg.style ["adwaita" "adwaita-dark"]); isQt5ct = cfg.platformTheme == "qt5ct"; isLxqt = cfg.platformTheme == "lxqt"; <ins> isKde = cfg.platformTheme == "kde"; </ins> packages = if isQGnome then [ pkgs.qgnomeplatform pkgs.adwaita-qt ] else if isQtStyle then [ pkgs.libsForQt5.qtstyleplugins ] else if isQt5ct then [ pkgs.libsForQt5.qt5ct ] else if isLxqt then [ pkgs.lxqt.lxqt-qtplugin pkgs.lxqt.lxqt-config ] <ins> else if isKde then [ pkgs.libsForQt5.plasma-integration pkgs.libsForQt5.systemsettings ] </ins> else throw "`qt5.platformTheme` ${cfg.platformTheme} and `qt5.style` ${cfg.style} are not compatible."; in
environment.variables.QT_QPA_PLATFORMTHEME = cfg.platformTheme; <del> environment.variables.QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt)) cfg.style; </del> <ins> environment.variables.QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt || isKde)) cfg.style; </ins> environment.systemPackages = packages;
stdenv.mkDerivation rec { pname = "mullvad-vpn"; <del> version = "2022.1"; </del> <ins> version = "2022.2"; </ins> src = fetchurl { url = "https://github.com/mullvad/mullvadvpn-app/releases/download/${version}/MullvadVPN-${version}_amd64.deb"; <del> sha256 = "0s12y9j75k59kqkcvfflb1v5p3ny7xgc1m5bd635lvql1bv46c3i"; </del> <ins> sha256 = "sha256-h/c4aPH6E2TzbXGROpLJgF9uHYcjvKiW5upIobpJM9o="; </ins> }; nativeBuildInputs = [
, openvpn-mullvad , shadowsocks-rust }: <del> let # result of running address_cache as of 02 Mar 2022 bootstrap-address-cache = writeText "api-ip-address.txt" '' 193.138.218.78:443 193.138.218.71:444 185.65.134.66:444 185.65.135.117:444 217.138.254.130:444 91.90.44.10:444 ''; in </del> rustPlatform.buildRustPackage rec { pname = "mullvad"; <del> version = "2022.1"; </del> <ins> version = "2022.2"; </ins> src = fetchFromGitHub { owner = "mullvad"; repo = "mullvadvpn-app"; rev = version; <del> hash = "sha256-bLwuM3Qy2iStbXIvDEWp31vuiihSQThOej297XKo5Xc="; </del> <ins> hash = "sha256-ZtQKzbFrkacrfPIkMz/UOfIwQBXQUoVVlFla//jmMwY="; </ins> }; <del> cargoHash = "sha256-CBbm8cJHTjyvvzCFQfKmsE5d9N7azEm8nI6KeWLVaa8="; </del> <ins> cargoHash = "sha256-J6h3KY1RDCnAc/tQHNGEyOlVQoQNhRqjWbmimPitydQ="; </ins> nativeBuildInputs = [ pkg-config
postFixup = # Place all binaries in the 'mullvad-' namespace, even though these # specific binaries aren't used in the lifetime of the program. <del> # `address_cache` is used to generate the `api-ip-address.txt` file, which # contains list of Mullvad API servers -- though we provide a "backup" of # the output of this command, it could change at any time, so we want # users to be able to regenerate the list at any time. (The daemon will # refuse to start without this file.) </del> '' <del> for bin in address_cache relay_list translations-converter; do </del> <ins> for bin in relay_list translations-converter; do </ins> mv "$out/bin/$bin" "$out/bin/mullvad-$bin" done '' + <del> # Put distributed assets in-place -- specifically, the # bootstrap-address-cache is necessary; otherwise, the user will have to run # the `address_cache` binary and move the contents into place at # `/var/cache/mullvad-vpn/api-ip-address.txt` manually. '' mkdir -p $out/share/mullvad ln -s ${bootstrap-address-cache} $out/share/mullvad/api-ip-address.txt '' + </del> # Files necessary for OpenVPN tunnels to work. '' <ins> mkdir -p $out/share/mullvad </ins> cp dist-assets/ca.crt $out/share/mullvad ln -s ${openvpn-mullvad}/bin/openvpn $out/share/mullvad ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad
nativeBuildInputs = lib.optionals stdenv.isDarwin [ cctools fixDarwinDylibNames <ins> ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook </ins> ]; dontConfigure = true; <del> buildPhase = let ccc = if stdenv.isDarwin then "ccc.osx" else "ccc"; in '' runHook preBuild </del> <ins> buildPhase = let ccc = if stdenv.isDarwin then "ccc.osx" else "ccc"; in '' runHook preBuild </ins> <del> (cd lpsolve55 && bash -x -e ${ccc}) (cd lp_solve  && bash -x -e ${ccc}) </del> <ins> (cd lpsolve55 && bash -x -e ${ccc}) (cd lp_solve  && bash -x -e ${ccc}) </ins> <del> runHook postBuild ''; </del> <ins> runHook postBuild ''; </ins> installPhase = '' runHook preInstall
meta = with lib; { description = "A Mixed Integer Linear Programming (MILP) solver"; <del> homepage    = "http://lpsolve.sourceforge.net"; license     = licenses.gpl2Plus; </del> <ins> homepage = "http://lpsolve.sourceforge.net"; license = licenses.gpl2Plus; </ins> maintainers = with maintainers; [ smironov ]; <del> platforms   = platforms.unix; </del> <ins> platforms = platforms.unix; </ins> }; }
unstable = fetchurl rec { # NOTE: Don't forget to change the SHA256 for staging as well. <del> version = "7.10"; </del> <ins> version = "7.12"; </ins> url = "https://dl.winehq.org/wine/source/7.x/wine-${version}.tar.xz"; <del> sha256 = "sha256-P+skzYWYwQ9q9xHnSsK10kQrtNO4wHj506JTroc2SA0="; </del> <ins> sha256 = "sha256-gJzsE3FmNubq/Uw9pzEkVqhE0xYCClV4YRvNuiEGnGg="; </ins> inherit (stable) gecko32 gecko64 patches; mono = fetchurl rec {
staging = fetchFromGitHub rec { # https://github.com/wine-staging/wine-staging/releases inherit (unstable) version; <del> sha256 = "sha256-5Pt98pla6t+B3FjB80hOWJUO64jY1EmOPQ0hEkFBWxY="; </del> <ins> sha256 = "sha256-A7IcBm3LzXzFu/NT+kbf2InTTuBzyQju/uMxSnIfsls="; </ins> owner = "wine-staging"; repo = "wine-staging"; rev = "v${version}";
stdenv.mkDerivation rec { pname = "vkd3d"; <del> version = "1.3"; </del> <ins> version = "1.4"; </ins> src = fetchurl { url = "https://dl.winehq.org/vkd3d/source/vkd3d-${version}.tar.xz"; <del> sha256 = "134b347806d34a4d2b39ea29ff1c2b38443793803a3adc50800855bb929fb8b2"; </del> <ins> sha256 = "sha256-yLqF9gSCyHPAVs9tuw6veRvIq30W1ipH83uYQbapCr0="; </ins> }; nativeBuildInputs = [ flex bison ];
${node_webkit}/bin/nw ${onlykey}/lib/node_modules/${onlykey.packageName}/build ''; in <del> runCommand "${onlykey.packageName}-${onlykey.version}" { } '' mkdir -p $out/bin ln -s ${script} $out/bin/onlykey '' </del> <ins> stdenv.mkDerivation { pname = "${onlykey.packageName}"; inherit (onlykey) version; dontUnpack = true; nativeBuildInputs = [ wrapGAppsHook copyDesktopItems ]; desktopItems = [ (makeDesktopItem { name = onlykey.packageName; exec = script; icon = "${onlykey}/lib/node_modules/${onlykey.packageName}/resources/onlykey_logo_128.png"; desktopName = onlykey.packageName; genericName = onlykey.packageName; }) ]; installPhase = '' runHook preInstall mkdir -p $out/bin ln -s ${script} $out/bin/onlykey runHook postInstall ''; } </ins>
- [networkd-dispatcher](https://gitlab.com/craftyguy/networkd-dispatcher), a dispatcher service for systemd-networkd connection status changes. Available as [services.networkd-dispatcher](#opt-services.networkd-dispatcher.enable). <ins> - [gonic](https://github.com/sentriz/gonic), a Subsonic music streaming server. Available as [services.gonic](#opt-services.gonic.enable). </ins> - [mmsd](https://gitlab.com/kop316/mmsd), a lower level daemon that transmits and recieves MMSes. Available as [services.mmsd](#opt-services.mmsd.enable). - [QDMR](https://dm3mat.darc.de/qdmr/), a GUI application and command line tool for programming DMR radios [programs.qdmr](#opt-programs.qdmr.enable)
<ins> { config, lib, pkgs, ... }: with lib; let cfg = config.services.gonic; settingsFormat = pkgs.formats.keyValue { mkKeyValue = lib.generators.mkKeyValueDefault { } " "; listsAsDuplicateKeys = true; }; in { options = { services.gonic = { enable = mkEnableOption (lib.mdDoc "Gonic music server"); settings = mkOption rec { type = settingsFormat.type; apply = recursiveUpdate default; default = { listen-addr = "127.0.0.1:4747"; cache-path = "/var/cache/gonic"; tls-cert = null; tls-key = null; }; example = { music-path = [ "/mnt/music" ]; podcast-path = "/mnt/podcasts"; }; description = lib.mdDoc '' Configuration for Gonic, see <https://github.com/sentriz/gonic#configuration-options> for supported values. ''; }; }; }; config = mkIf cfg.enable { systemd.services.gonic = { description = "Gonic Media Server"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = let # these values are null by default but should not appear in the final config filteredSettings = filterAttrs (n: v: !((n == "tls-cert" || n == "tls-key") && v == null)) cfg.settings; in "${pkgs.gonic}/bin/gonic -config-path ${settingsFormat.generate "gonic" filteredSettings}"; DynamicUser = true; StateDirectory = "gonic"; CacheDirectory = "gonic"; WorkingDirectory = "/var/lib/gonic"; RuntimeDirectory = "gonic"; RootDirectory = "/run/gonic"; ReadWritePaths = ""; BindReadOnlyPaths = [ # gonic can access scrobbling services "-/etc/ssl/certs/ca-certificates.crt" builtins.storeDir cfg.settings.podcast-path ] ++ cfg.settings.music-path ++ lib.optional (cfg.settings.tls-cert != null) cfg.settings.tls-cert ++ lib.optional (cfg.settings.tls-key != null) cfg.settings.tls-key; CapabilityBoundingSet = ""; RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ]; RestrictNamespaces = true; PrivateDevices = true; PrivateUsers = true; ProtectClock = true; ProtectControlGroups = true; ProtectHome = true; ProtectKernelLogs = true; ProtectKernelModules = true; ProtectKernelTunables = true; SystemCallArchitectures = "native"; SystemCallFilter = [ "@system-service" "~@privileged" ]; RestrictRealtime = true; LockPersonality = true; MemoryDenyWriteExecute = true; UMask = "0066"; ProtectHostname = true; }; }; }; meta.maintainers = [ maintainers.autrimpo ]; } </ins>
gocd-agent = handleTest ./gocd-agent.nix {}; gocd-server = handleTest ./gocd-server.nix {}; gollum = handleTest ./gollum.nix {}; <ins> gonic = handleTest ./gonic.nix {}; </ins> google-oslogin = handleTest ./google-oslogin {}; gotify-server = handleTest ./gotify-server.nix {}; grafana = handleTest ./grafana {};
<ins> import ./make-test-python.nix ({ pkgs, ... }: { name = "gonic"; nodes.machine = { ... }: { services.gonic = { enable = true; settings = { music-path = [ "/tmp" ]; podcast-path = "/tmp"; }; }; }; testScript = '' machine.wait_for_unit("gonic") machine.wait_for_open_port(4747) ''; }) </ins>
sha256 = "sha256-kPjS+otVZ8aJmDDd7ywD88J5YLEayiIvoXqnrGE8KJA="; }; <ins> # https://github.com/svaarala/duktape/issues/2464 LDFLAGS = [ "-lm" ]; </ins> nativeBuildInputs = [ validatePkgConfig ]; <del> postPatch = '' substituteInPlace Makefile.sharedlibrary  --replace 'gcc' '${stdenv.cc.targetPrefix}cc'  --replace 'g++' '${stdenv.cc.targetPrefix}c++' substituteInPlace Makefile.cmdline  --replace 'gcc' '${stdenv.cc.targetPrefix}cc'  --replace 'g++' '${stdenv.cc.targetPrefix}c++' ''; </del> buildPhase = '' make -f Makefile.sharedlibrary make -f Makefile.cmdline ''; installPhase = '' install -d $out/bin install -m755 duk $out/bin/
<ins> { lib , stdenv , fetchFromGitHub , python3 , git }: python3.pkgs.buildPythonApplication rec { pname = "hatch"; version = "1.3.1"; format = "pyproject"; src = fetchFromGitHub { owner = "pypa"; repo = "hatch"; rev = "hatch-v${version}"; sha256 = "sha256-ftT86HX5CVbiHe5yzXT2gNl8Rx+f+fmiAJRnOuDpvYI="; }; propagatedBuildInputs = with python3.pkgs; [ click hatchling httpx keyring pexpect pyperclip rich shellingham tomli-w tomlkit userpath virtualenv ]; checkInputs = with python3.pkgs; [ git pytestCheckHook pytest-mock ]; preCheck = '' export HOME=$(mktemp -d); ''; disabledTests = [ # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) "test_default" "test_explicit_path" "test_default_auto_detection" "test_editable_default" "test_editable_default_extra_dependencies" "test_editable_default_force_include" "test_editable_default_force_include_option" "test_editable_exact" "test_editable_exact_extra_dependencies" "test_editable_exact_force_include" "test_editable_exact_force_include_build_data_precedence" "test_editable_pth" # AssertionError: assert len(extract_installed_requirements(output.splitlines())) > 0 "test_creation_allow_system_packages" ]; meta = with lib; { description = "Modern, extensible Python project manager"; homepage = "https://hatch.pypa.io/latest/"; license = licenses.mit; maintainers = with maintainers; [ onny ]; }; } </ins>