From d046fcf4b1da09e04a1b9a04c1d9ac9e42fffc94 Mon Sep 17 00:00:00 2001 From: Zenithal Date: Sun, 16 Jan 2022 07:22:33 +0800 Subject: command-not-found: make NIX_AUTO_RUN work when multiple choices --- .../command-not-found/command-not-found.pl | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl index 220d057b7f4f..5f4b30d90190 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.pl +++ b/nixos/modules/programs/command-not-found/command-not-found.pl @@ -21,9 +21,11 @@ my $res = $dbh->selectall_arrayref( "select package from Programs where system = ? and name = ?", { Slice => {} }, $system, $program); -if (!defined $res || scalar @$res == 0) { +my $len = !defined $res ? 0 : scalar @$res; + +if ($len == 0) { print STDERR "$program: command not found\n"; -} elsif (scalar @$res == 1) { +} elsif ($len == 1) { my $package = @$res[0]->{package}; if ($ENV{"NIX_AUTO_RUN"} // "") { exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV)); @@ -35,11 +37,30 @@ ephemeral shell by typing: EOF } } else { - print STDERR <{package}\n"; + } + my $choice = 0; + while (1) { # exec will break this loop + no warnings "numeric"; + print STDERR "Your choice [1-${len}]: "; + # 0 can be invalid user input like non-number string + # so we start from 1 + $choice = + 0; + if (1 <= $choice && $choice <= $len) { + exec("nix-shell", "-p", @$res[$choice - 1]->{package}, + "--run", shell_quote("exec", @ARGV)); + } + } + } else { + print STDERR <{package}\n" foreach @$res; + print STDERR " nix-shell -p $_->{package}\n" foreach @$res; + } } exit 127; -- cgit 1.4.1 From 0358703df27cdc2526b7c17701a1da79e4e4ad5b Mon Sep 17 00:00:00 2001 From: Zenithal Date: Sun, 16 Jan 2022 07:53:54 +0800 Subject: command-not-found: add interactive option for auto run --- nixos/modules/programs/command-not-found/command-not-found.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl index 220d057b7f4f..af2c606230f4 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.pl +++ b/nixos/modules/programs/command-not-found/command-not-found.pl @@ -26,6 +26,17 @@ if (!defined $res || scalar @$res == 0) { } elsif (scalar @$res == 1) { my $package = @$res[0]->{package}; if ($ENV{"NIX_AUTO_RUN"} // "") { + if ($ENV{"NIX_AUTO_RUN_INTERACTIVE"} // "") { + while (1) { + print STDERR "'$program' from package '$package' will be run, confirm? [yn]: "; + chomp(my $comfirm = ); + if (lc $comfirm eq "n") { + exit 0; + } elsif (lc $comfirm eq "y") { + last; + } + } + } exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV)); } else { print STDERR < Date: Wed, 2 Feb 2022 13:45:39 +0300 Subject: nixos/stage-1: add nixos modprobe options --- nixos/modules/system/boot/stage-1.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 9c684fbada2c..1575c0257d1c 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -350,6 +350,9 @@ let ''; symlink = "/etc/modprobe.d/ubuntu.conf"; } + { object = config.environment.etc."modprobe.d/nixos.conf".source; + symlink = "/etc/modprobe.d/nixos.conf"; + } { object = pkgs.kmod-debian-aliases; symlink = "/etc/modprobe.d/debian.conf"; } -- cgit 1.4.1 From 2b3f77b716f8cec333ff72e8a70cf1851a023f4e Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 2 Feb 2022 22:58:27 +0300 Subject: nixos/udev: set firmware path in a separate modprobe.d file This way we don't bloat ramdisk with the whole Linux firmware packages. --- nixos/modules/services/hardware/udev.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index d48b5444677c..61448af2d33b 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -317,7 +317,8 @@ in (isYes "NET") ]; - boot.extraModprobeConfig = "options firmware_class path=${config.hardware.firmware}/lib/firmware"; + # We don't place this into `extraModprobeConfig` so that stage-1 ramdisk doesn't bloat. + environment.etc."modprobe.d/firmware.conf".text = "options firmware_class path=${config.hardware.firmware}/lib/firmware"; system.activationScripts.udevd = '' -- cgit 1.4.1 From 26ca9776aae60d81721e242defa73cfe7a53e061 Mon Sep 17 00:00:00 2001 From: David Lewis Date: Wed, 19 Jan 2022 20:08:32 +0000 Subject: nixos/autorandr: added new KillMode Prevents Udev Rule from killing processes started by autorandr --- nixos/modules/services/misc/autorandr.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/services/misc/autorandr.nix b/nixos/modules/services/misc/autorandr.nix index 95cee5046e81..a65c5c9d11cf 100644 --- a/nixos/modules/services/misc/autorandr.nix +++ b/nixos/modules/services/misc/autorandr.nix @@ -43,6 +43,7 @@ in { ExecStart = "${pkgs.autorandr}/bin/autorandr --batch --change --default ${cfg.defaultTarget}"; Type = "oneshot"; RemainAfterExit = false; + KillMode = "process"; }; }; -- cgit 1.4.1 From 5e7ec2c9adf6981a47396215b49c4690a043e8b3 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:01:38 +1000 Subject: nixos/doc/2205: add note for `go_1_17` `vendorSha256` --- nixos/doc/manual/from_md/release-notes/rl-2205.section.xml | 9 +++++++++ nixos/doc/manual/release-notes/rl-2205.section.md | 2 ++ 2 files changed, 11 insertions(+) (limited to 'nixos') diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 29aa70fd6165..2ec83dab09f7 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -317,6 +317,15 @@ writers.writePyPy2 needs to be used. + + + buildGoModule was updated to use + go_1_17, third party derivations that + specify >= go 1.17 in the main go.mod + will need to regenerate their vendorSha256 + hash. + + The gnome-passwordsafe package updated to diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index c4ace1366f2f..ffb207503f84 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -105,6 +105,8 @@ In addition to numerous new and upgraded packages, this release has the followin - The `writers.writePython2` and corresponding `writers.writePython2Bin` convenience functions to create executable Python 2 scripts in the store were removed in preparation of removal of the Python 2 interpreter. Scripts have to be converted to Python 3 for use with `writers.writePython3` or `writers.writePyPy2` needs to be used. +- `buildGoModule` was updated to use `go_1_17`, third party derivations that specify >= go 1.17 in the main `go.mod` will need to regenerate their `vendorSha256` hash. + - The `gnome-passwordsafe` package updated to [version 6.x](https://gitlab.gnome.org/World/secrets/-/tags/6.0) and renamed to `gnome-secrets`. - If you previously used `/etc/docker/daemon.json`, you need to incorporate the changes into the new option `virtualisation.docker.daemon.settings`. -- cgit 1.4.1 From 833bcbc84438c1f4182f2887d4bcfc47c4b43fbc Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Tue, 8 Feb 2022 10:31:09 +0100 Subject: nixos/firewall: make 'networking.firewall.package' example less confusing pkgs.iptables-nftables-compat == pkgs.iptables (default) since cf9ac2b5. --- nixos/modules/services/networking/firewall.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix index ff023a888f26..2aa3be16f6e9 100644 --- a/nixos/modules/services/networking/firewall.nix +++ b/nixos/modules/services/networking/firewall.nix @@ -326,7 +326,7 @@ in type = types.package; default = pkgs.iptables; defaultText = literalExpression "pkgs.iptables"; - example = literalExpression "pkgs.iptables-nftables-compat"; + example = literalExpression "pkgs.iptables-legacy"; description = '' The iptables package to use for running the firewall service." -- cgit 1.4.1 From 8c27f7a2bd3ce539f6441123c41376a591ab3395 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 27 Jan 2022 09:42:51 +0100 Subject: haskellPackages.ghcWithPackages: throw on old override interface Adding a fake override function via passthru will at least give users of the old override interface a more helpful error message. Additionally we also document the changes in the changelog. --- .../doc/manual/from_md/release-notes/rl-2205.section.xml | 13 +++++++++++++ nixos/doc/manual/release-notes/rl-2205.section.md | 6 ++++++ .../development/haskell-modules/with-packages-wrapper.nix | 15 +++++++++++++++ 3 files changed, 34 insertions(+) (limited to 'nixos') diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 2ec83dab09f7..04bb7ec12d3e 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -240,6 +240,19 @@ haskellPackages.callPackage). + + + pkgs.ghc.withPackages as well as + haskellPackages.ghcWithPackages etc. now + needs be overridden directly, as opposed to overriding the + result of calling it. Additionally, the + withLLVM parameter has been renamed to + useLLVM. So instead of + (ghc.withPackages (p: [])).override { withLLVM = true; }, + one needs to use + (ghc.withPackages.override { useLLVM = true; }) (p: []). + + pkgs.emacsPackages.orgPackages is removed diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index ffb207503f84..a2e8038ae1f8 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -81,6 +81,12 @@ In addition to numerous new and upgraded packages, this release has the followin instead to ensure cross compilation keeps working (or switch to `haskellPackages.callPackage`). +- `pkgs.ghc.withPackages` as well as `haskellPackages.ghcWithPackages` etc. + now needs be overridden directly, as opposed to overriding the result of + calling it. Additionally, the `withLLVM` parameter has been renamed to + `useLLVM`. So instead of `(ghc.withPackages (p: [])).override { withLLVM = true; }`, + one needs to use `(ghc.withPackages.override { useLLVM = true; }) (p: [])`. + - `pkgs.emacsPackages.orgPackages` is removed because org elpa is deprecated. The packages in the top level of `pkgs.emacsPackages`, such as org and org-contrib, refer to the ones in `pkgs.emacsPackages.elpaPackages` and diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 3c645999a1a3..7c7add61679d 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -164,5 +164,20 @@ symlinkJoin { passthru = { preferLocalBuild = true; inherit (ghc) version meta; + + # Inform users about backwards incompatibilities with <= 21.05 + override = _: throw '' + The ghc.withPackages wrapper itself can now be overridden, but no longer + the result of calling it (as before). Consequently overrides need to be + adjusted: Instead of + + (ghc.withPackages (p: [ p.my-package ])).override { withLLLVM = true; } + + use + + (ghc.withPackages.override { useLLVM = true; }) (p: [ p.my-package ]) + + Also note that withLLVM has been renamed to useLLVM for consistency with + the GHC Nix expressions.''; }; } -- cgit 1.4.1 From 1a417bc1dda28270baa23ddaa1aba15cdaf2a92f Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 8 Feb 2022 08:10:09 -0500 Subject: nixos/cloud-init: fix trivial error that prevents deploy --- nixos/modules/services/system/cloud-init.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/system/cloud-init.nix b/nixos/modules/services/system/cloud-init.nix index d05dfcfc42d8..8c6a6e294ebb 100644 --- a/nixos/modules/services/system/cloud-init.nix +++ b/nixos/modules/services/system/cloud-init.nix @@ -143,7 +143,7 @@ in "sshd.service" "sshd-keygen.service" ]; after = [ "network-online.target" "cloud-init-local.service" ]; before = [ "sshd.service" "sshd-keygen.service" ]; - requires = [ "network.target "]; + requires = [ "network.target"]; path = path; serviceConfig = { Type = "oneshot"; -- cgit 1.4.1 From 3ecddf791da4d893beb35fb09eb9da55b326f4fb Mon Sep 17 00:00:00 2001 From: ajs124 Date: Wed, 15 Dec 2021 18:09:05 +0000 Subject: nixos/shellinabox: drop --- nixos/modules/module-list.nix | 1 - nixos/modules/rename.nix | 2 + nixos/modules/services/web-servers/shellinabox.nix | 122 --------------------- 3 files changed, 2 insertions(+), 123 deletions(-) delete mode 100644 nixos/modules/services/web-servers/shellinabox.nix (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index cbc650249127..70964ad80f73 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1075,7 +1075,6 @@ ./services/web-servers/phpfpm/default.nix ./services/web-servers/pomerium.nix ./services/web-servers/unit/default.nix - ./services/web-servers/shellinabox.nix ./services/web-servers/tomcat.nix ./services/web-servers/traefik.nix ./services/web-servers/trafficserver/default.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 17ec13b770a8..1315a2e13681 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -88,6 +88,8 @@ with lib; The racoon module has been removed, because the software project was abandoned upstream. '') + (mkRemovedOptionModule [ "services" "shellinabox" ] "The corresponding package was removed from nixpkgs.") + # Do NOT add any option renames here, see top of the file ]; } diff --git a/nixos/modules/services/web-servers/shellinabox.nix b/nixos/modules/services/web-servers/shellinabox.nix deleted file mode 100644 index c7c51f873eba..000000000000 --- a/nixos/modules/services/web-servers/shellinabox.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - - cfg = config.services.shellinabox; - - # If a certificate file is specified, shellinaboxd requires - # a file descriptor to retrieve it - fd = "3"; - createFd = optionalString (cfg.certFile != null) "${fd}<${cfg.certFile}"; - - # Command line arguments for the shellinabox daemon - args = [ "--background" ] - ++ optional (! cfg.enableSSL) "--disable-ssl" - ++ optional (cfg.certFile != null) "--cert-fd=${fd}" - ++ optional (cfg.certDirectory != null) "--cert=${cfg.certDirectory}" - ++ cfg.extraOptions; - - # Command to start shellinaboxd - cmd = "${pkgs.shellinabox}/bin/shellinaboxd ${concatStringsSep " " args}"; - - # Command to start shellinaboxd if certFile is specified - wrappedCmd = "${pkgs.bash}/bin/bash -c 'exec ${createFd} && ${cmd}'"; - -in - -{ - - ###### interface - - options = { - services.shellinabox = { - enable = mkEnableOption "shellinabox daemon"; - - user = mkOption { - type = types.str; - default = "root"; - description = '' - User to run shellinaboxd as. If started as root, the server drops - privileges by changing to nobody, unless overridden by the - --user option. - ''; - }; - - enableSSL = mkOption { - type = types.bool; - default = false; - description = '' - Whether or not to enable SSL (https) support. - ''; - }; - - certDirectory = mkOption { - type = types.nullOr types.path; - default = null; - example = "/var/certs"; - description = '' - The daemon will look in this directory far any certificates. - If the browser negotiated a Server Name Identification the daemon - will look for a matching certificate-SERVERNAME.pem file. If no SNI - handshake takes place, it will fall back on using the certificate in the - certificate.pem file. - - If no suitable certificate is installed, shellinaboxd will attempt to - create a new self-signed certificate. This will only succeed if, after - dropping privileges, shellinaboxd has write permissions for this - directory. - ''; - }; - - certFile = mkOption { - type = types.nullOr types.path; - default = null; - example = "/var/certificate.pem"; - description = "Path to server SSL certificate."; - }; - - extraOptions = mkOption { - type = types.listOf types.str; - default = [ ]; - example = [ "--port=443" "--service /:LOGIN" ]; - description = '' - A list of strings to be appended to the command line arguments - for shellinaboxd. Please see the manual page - - for a full list of available arguments. - ''; - }; - - }; - }; - - ###### implementation - - config = mkIf cfg.enable { - - assertions = - [ { assertion = cfg.enableSSL == true - -> cfg.certDirectory != null || cfg.certFile != null; - message = "SSL is enabled for shellinabox, but no certDirectory or certFile has been specefied."; } - { assertion = ! (cfg.certDirectory != null && cfg.certFile != null); - message = "Cannot set both certDirectory and certFile for shellinabox."; } - ]; - - systemd.services.shellinaboxd = { - description = "Shellinabox Web Server Daemon"; - - wantedBy = [ "multi-user.target" ]; - requires = [ "sshd.service" ]; - after = [ "sshd.service" ]; - - serviceConfig = { - Type = "forking"; - User = "${cfg.user}"; - ExecStart = "${if cfg.certFile == null then "${cmd}" else "${wrappedCmd}"}"; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - }; - }; - }; -} -- cgit 1.4.1 From 92a6ad8626eb08dbf76fa389d595c7ac7accd70e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 28 Jul 2020 04:53:02 +0000 Subject: packagekit: use Nix backend Fixes https://github.com/NixOS/nixpkgs/issues/21230 Use Nix backend for packagekit. Updates to version with my Nix backend for PackageKit. --- nixos/modules/services/misc/packagekit.nix | 6 +- .../package-management/packagekit/default.nix | 119 +++++++++++++-------- 2 files changed, 81 insertions(+), 44 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/misc/packagekit.nix b/nixos/modules/services/misc/packagekit.nix index 93bd206bd983..9191078ef9ca 100644 --- a/nixos/modules/services/misc/packagekit.nix +++ b/nixos/modules/services/misc/packagekit.nix @@ -13,7 +13,7 @@ let (iniFmt.generate "PackageKit.conf" (recursiveUpdate { Daemon = { - DefaultBackend = "test_nop"; + DefaultBackend = "nix"; KeepCache = false; }; } @@ -35,7 +35,7 @@ let in { imports = [ - (mkRemovedOptionModule [ "services" "packagekit" "backend" ] "The only backend that doesn't blow up is `test_nop`.") + (mkRemovedOptionModule [ "services" "packagekit" "backend" ] "Always set to Nix.") ]; options.services.packagekit = { @@ -62,6 +62,8 @@ in services.dbus.packages = with pkgs; [ packagekit ]; + environment.systemPackages = with pkgs; [ packagekit ]; + systemd.packages = with pkgs; [ packagekit ]; environment.etc = listToAttrs (map diff --git a/pkgs/tools/package-management/packagekit/default.nix b/pkgs/tools/package-management/packagekit/default.nix index b62597e7e508..25ad5be89e83 100644 --- a/pkgs/tools/package-management/packagekit/default.nix +++ b/pkgs/tools/package-management/packagekit/default.nix @@ -1,59 +1,94 @@ -{ stdenv, fetchFromGitHub, lib -, intltool, glib, pkg-config, polkit, python3, sqlite -, gobject-introspection, vala, gtk-doc, autoreconfHook, autoconf-archive -, nix, enableNixBackend ? false, boost +{ stdenv +, fetchFromGitHub +, lib +, gettext +, glib +, pkg-config +, polkit +, python3 +, sqlite +, gobject-introspection +, vala +, gtk-doc +, nix +, boost +, meson +, ninja +, libxslt +, docbook-xsl-nons +, docbook_xml_dtd_42 +, libxml2 +, gst_all_1 +, gtk3 , enableCommandNotFound ? false -, enableBashCompletion ? false, bash-completion ? null -, enableSystemd ? stdenv.isLinux, systemd }: +, enableBashCompletion ? false +, bash-completion ? null +, enableSystemd ? stdenv.isLinux +, systemd +}: stdenv.mkDerivation rec { pname = "packagekit"; - version = "1.1.13"; + version = "1.2.5pre"; - outputs = [ "out" "dev" ]; + outputs = [ "out" "dev" "devdoc" ]; src = fetchFromGitHub { - owner = "hughsie"; + owner = "PackageKit"; repo = "PackageKit"; - rev = "PACKAGEKIT_${lib.replaceStrings ["."] ["_"] version}"; - sha256 = "0xmgac27p5z8wr56yw3cqhywnlvaf8kvyv1g0nzxnq167xj5vxam"; + rev = "9c2ef9cddf39ebde587907561f8e7ac99ed6be1a"; + sha256 = "05z1ds240kcmigygkbgjasr4spn7vd7cbpsbfrghhgnmszx9bjgl"; }; - buildInputs = [ glib polkit python3 gobject-introspection ] - ++ lib.optional enableSystemd systemd - ++ lib.optional enableBashCompletion bash-completion; - propagatedBuildInputs = - [ sqlite boost ] - ++ lib.optional enableNixBackend nix; - nativeBuildInputs = [ vala intltool pkg-config autoreconfHook autoconf-archive gtk-doc ]; - - preAutoreconf = '' - gtkdocize - intltoolize - ''; + buildInputs = [ + glib + polkit + python3 + gobject-introspection + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gtk3 + sqlite + nix + boost + ] ++ lib.optional enableSystemd systemd + ++ lib.optional enableBashCompletion bash-completion; + nativeBuildInputs = [ + vala + gettext + pkg-config + gtk-doc + meson + libxslt + docbook-xsl-nons + docbook_xml_dtd_42 + libxml2 + ninja + ]; - configureFlags = [ - (if enableSystemd then "--enable-systemd" else "--disable-systemd") - "--disable-dummy" - "--disable-cron" - "--enable-introspection" - "--disable-offline-update" - "--localstatedir=/var" + mesonFlags = [ + (if enableSystemd then "-Dsystemd=true" else "-Dsystem=false") + "-Dpackaging_backend=nix" + "-Ddbus_sys=${placeholder "out"}/share/dbus-1/system.d" + "-Ddbus_services=${placeholder "out"}/share/dbus-1/system-services" + "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "-Dcron=false" + "-Dgtk_doc=true" "--sysconfdir=/etc" - "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d" - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" + "--localstatedir=/var" ] - ++ lib.optional enableNixBackend "--enable-nix" - ++ lib.optional (!enableBashCompletion) "--disable-bash-completion" - ++ lib.optional (!enableCommandNotFound) "--disable-command-not-found"; - - enableParallelBuilding = true; + ++ lib.optional (!enableBashCompletion) "-Dbash_completion=false" + ++ lib.optional (!enableCommandNotFound) "-Dbash_command_not_found=false"; - installFlags = [ - "sysconfdir=${placeholder "out"}/etc" - "localstatedir=\${TMPDIR}" - ]; + postPatch = '' + # HACK: we want packagekit to look in /etc for configs but install + # those files in $out/etc ; we just override the runtime paths here + # same for /var & $out/var + substituteInPlace etc/meson.build \ + --replace "install_dir: join_paths(get_option('sysconfdir'), 'PackageKit')" "install_dir: join_paths('$out', 'etc', 'PackageKit')" + substituteInPlace data/meson.build \ + --replace "install_dir: join_paths(get_option('localstatedir'), 'lib', 'PackageKit')," "install_dir: join_paths('$out', 'var', 'lib', 'PackageKit')," + ''; meta = with lib; { description = "System to facilitate installing and updating packages"; -- cgit 1.4.1