From 3cb83409d2e88e86d51e57fc5213b3c2d32723f1 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 12 Apr 2021 00:00:57 +0200 Subject: [PATCH 1/6] Revert "nixos/home-assistant: use override before overridePythonAttrs" --- .../modules/services/misc/home-assistant.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 2787c975b35..f6398c08397 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -50,15 +50,10 @@ let # List of components used in config extraComponents = filter useComponent availableComponents; - testedPackage = if (cfg.autoExtraComponents && cfg.config != null) + package = if (cfg.autoExtraComponents && cfg.config != null) then (cfg.package.override { inherit extraComponents; }) else cfg.package; - # overridePythonAttrs has to be applied after override - package = testedPackage.overridePythonAttrs (oldAttrs: { - doCheck = false; - }); - # If you are changing this, please update the description in applyDefaultConfig defaultConfig = { homeassistant.time_zone = config.time.timeZone; @@ -188,9 +183,13 @@ in { }; package = mkOption { - default = pkgs.home-assistant; + default = pkgs.home-assistant.overridePythonAttrs (oldAttrs: { + doCheck = false; + }); defaultText = literalExample '' - pkgs.home-assistant + pkgs.home-assistant.overridePythonAttrs (oldAttrs: { + doCheck = false; + }) ''; type = types.package; example = literalExample '' @@ -199,12 +198,10 @@ in { } ''; description = '' - Home Assistant package to use. Tests are automatically disabled, as they take a considerable amout of time to complete. + Home Assistant package to use. By default the tests are disabled, as they take a considerable amout of time to complete. Override extraPackages or extraComponents in order to add additional dependencies. If you specify and do not set to false, overriding extraComponents will have no effect. - Avoid home-assistant.overridePythonAttrs if you use - autoExtraComponents. ''; }; From 064b446fc0c7b79f05c6fac6b8da23eb18340d50 Mon Sep 17 00:00:00 2001 From: Fabian Geiselhart Date: Thu, 4 Feb 2021 20:20:58 +0100 Subject: [PATCH 2/6] nixos/quake3-server: Init --- nixos/modules/module-list.nix | 1 + .../modules/services/games/quake3-server.nix | 111 ++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 nixos/modules/services/games/quake3-server.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0d26b7300d0..e3c5f35fad4 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -355,6 +355,7 @@ ./services/games/minecraft-server.nix ./services/games/minetest-server.nix ./services/games/openarena.nix + ./services/games/quake3-server.nix ./services/games/teeworlds.nix ./services/games/terraria.nix ./services/hardware/acpid.nix diff --git a/nixos/modules/services/games/quake3-server.nix b/nixos/modules/services/games/quake3-server.nix new file mode 100644 index 00000000000..1dc01260e8f --- /dev/null +++ b/nixos/modules/services/games/quake3-server.nix @@ -0,0 +1,111 @@ +{ config, pkgs, lib, ... }: +with lib; + +let + cfg = config.services.quake3-server; + configFile = pkgs.writeText "q3ds-extra.cfg" '' + set net_port ${builtins.toString cfg.port} + + ${cfg.extraConfig} + ''; + defaultBaseq3 = pkgs.requireFile rec { + name = "baseq3"; + hashMode = "recursive"; + sha256 = "5dd8ee09eabd45e80450f31d7a8b69b846f59738726929298d8a813ce5725ed3"; + message = '' + Unfortunately, we cannot download ${name} automatically. + Please purchase a legitimate copy of Quake 3 and change into the installation directory. + + You can either add all relevant files to the nix-store like this: + mkdir /tmp/baseq3 + cp baseq3/pak*.pk3 /tmp/baseq3 + nix-store --add-fixed sha256 --recursive /tmp/baseq3 + + Alternatively you can set services.quake3-server.baseq3 to a path and copy the baseq3 directory into + $services.quake3-server.baseq3/.q3a/ + ''; + }; + home = pkgs.runCommand "quake3-home" {} '' + mkdir -p $out/.q3a/baseq3 + + for file in ${cfg.baseq3}/*; do + ln -s $file $out/.q3a/baseq3/$(basename $file) + done + + ln -s ${configFile} $out/.q3a/baseq3/nix.cfg + ''; +in { + options = { + services.quake3-server = { + enable = mkEnableOption "Quake 3 dedicated server"; + + port = mkOption { + type = types.port; + default = 27960; + description = '' + UDP Port the server should listen on. + ''; + }; + + openFirewall = mkOption { + type = types.bool; + default = false; + description = '' + Open the firewall. + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + example = '' + seta rconPassword "superSecret" // sets RCON password for remote console + seta sv_hostname "My Quake 3 server" // name that appears in server list + ''; + description = '' + Extra configuration options. Note that options changed via RCON will not be persisted. To list all possible + options, use "cvarlist 1" via RCON. + ''; + }; + + baseq3 = mkOption { + type = types.either types.package types.path; + default = defaultBaseq3; + example = "/var/lib/q3ds"; + description = '' + Path to the baseq3 files (pak*.pk3). If this is on the nix store (type = package) all .pk3 files should be saved + in the top-level directory. If this is on another filesystem (e.g /var/lib/baseq3) the .pk3 files are searched in + $baseq3/.q3a/baseq3/ + ''; + }; + }; + }; + + config = let + baseq3InStore = builtins.typeOf cfg.baseq3 == "set"; + in mkIf cfg.enable { + networking.firewall.allowedUDPPorts = mkIf cfg.openFirewall [ cfg.port ]; + + systemd.services.q3ds = { + description = "Quake 3 dedicated server"; + wantedBy = [ "multi-user.target" ]; + after = [ "networking.target" ]; + + environment.HOME = if baseq3InStore then home else cfg.baseq3; + + serviceConfig = with lib; { + Restart = "always"; + DynamicUser = true; + WorkingDirectory = home; + + # It is possible to alter configuration files via RCON. To ensure reproducibility we have to prevent this + ReadOnlyPaths = if baseq3InStore then home else cfg.baseq3; + ExecStartPre = optionalString (!baseq3InStore) "+${pkgs.coreutils}/bin/cp ${configFile} ${cfg.baseq3}/.q3a/baseq3/nix.cfg"; + + ExecStart = "${pkgs.ioquake3}/ioq3ded.x86_64 +exec nix.cfg"; + }; + }; + }; + + meta.maintainers = with maintainers; [ f4814n ]; +} From 485034873f6d8bc8b86cb768c7144a9f9e789724 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 13 Apr 2021 22:46:36 +0200 Subject: [PATCH 3/6] Revert "nixos/home-assistant: use overridePythonAttrs" This reverts commit f9bd8b1b7bda019a823e93a0ecb719e15ac620cb. --- nixos/modules/services/misc/home-assistant.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index f6398c08397..5cfadf81b97 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -183,12 +183,12 @@ in { }; package = mkOption { - default = pkgs.home-assistant.overridePythonAttrs (oldAttrs: { - doCheck = false; + default = pkgs.home-assistant.overrideAttrs (oldAttrs: { + doInstallCheck = false; }); defaultText = literalExample '' - pkgs.home-assistant.overridePythonAttrs (oldAttrs: { - doCheck = false; + pkgs.home-assistant.overrideAttrs (oldAttrs: { + doInstallCheck = false; }) ''; type = types.package; From 1d9f619311e9fa28a63ce0b65ae93a9273709114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 17 Apr 2021 02:20:07 +0200 Subject: [PATCH 4/6] nixos/home-assistant: warn about `overridePythonAttrs` in package option --- nixos/modules/services/misc/home-assistant.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 5cfadf81b97..0590f54ae60 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -202,6 +202,7 @@ in { Override extraPackages or extraComponents in order to add additional dependencies. If you specify and do not set to false, overriding extraComponents will have no effect. + Avoid home-assistant.overridePythonAttrs if you use autoExtraComponents. ''; }; From af2b2fe34a5cadd8907ebd348789bccddaf3e9de Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Fri, 16 Apr 2021 22:55:32 -0300 Subject: [PATCH 5/6] with-shell: 2016-08-20 -> 2018-03-20 --- pkgs/applications/misc/with-shell/default.nix | 76 ++++++++++++++++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/with-shell/default.nix b/pkgs/applications/misc/with-shell/default.nix index daf697c1661..cf52d194f61 100644 --- a/pkgs/applications/misc/with-shell/default.nix +++ b/pkgs/applications/misc/with-shell/default.nix @@ -1,20 +1,76 @@ -{ lib, stdenv, fetchFromGitHub }: -stdenv.mkDerivation { - name = "with-2016-08-20"; +{ lib +, stdenv +, fetchFromGitHub +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "with"; + version = "unstable-2018-03-20"; + src = fetchFromGitHub { owner = "mchav"; repo = "With"; - rev = "cc2828bddd92297147d4365765f4ef36385f050a"; - sha256 = "10m2xv6icrdp6lfprw3a9hsrzb3bip19ipkbmscap0niddqgcl9b"; + rev = "28eb40bbc08d171daabf0210f420477ad75e16d6"; + hash = "sha256-mKHsLHs9/I+NUdb1t9wZWkPxXcsBlVWSj8fgZckXFXk="; }; + + nativeBuildInputs = [ installShellFiles ]; + installPhase = '' - mkdir -p $out/bin - cp with $out/bin/with + runHook preInstall + install -D with $out/bin/with + installShellCompletion --bash --name with.bash with.bash-completion + runHook postInstall ''; - meta = { + + meta = with lib; { homepage = "https://github.com/mchav/With"; description = "Command prefixing for continuous workflow using a single tool"; - license = lib.licenses.asl20; - platforms = lib.platforms.unix; + longDescription = '' + with is a Bash script that starts an interactive shell with where every + command is prefixed using . + + For example: + + $ with git + git> add . + git> commit -a -m "Commited" + git> push + + Can also be used for compound commands. + + $ with java Primes + java Primes> 1 + 2 + java Primes> 4 + 7 + + And to repeat commands: + + $ with gcc -o output input.c + gcc -o -output input.c> + + Compiling... + gcc -o -output input.c> + + To execute a shell command proper prefix line with :. + + git> :ls + + You can also drop, add, and replace different commands. + + git> +add + git add> + git add> !commit + git commit> + git commit> - + git> + + To exit use either :q or :exit. + ''; + license = licenses.asl20; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = platforms.unix; }; } From 67c4ab77be9daaca447c14ec5c3fdcb62f581ad0 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 17 Apr 2021 04:20:00 +0000 Subject: [PATCH 6/6] podman: 3.1.0 -> 3.1.1 https://github.com/containers/podman/releases/tag/v3.1.1 --- pkgs/applications/virtualization/podman/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/podman/default.nix b/pkgs/applications/virtualization/podman/default.nix index b64fc82f532..956baea8856 100644 --- a/pkgs/applications/virtualization/podman/default.nix +++ b/pkgs/applications/virtualization/podman/default.nix @@ -16,13 +16,13 @@ buildGoModule rec { pname = "podman"; - version = "3.1.0"; + version = "3.1.1"; src = fetchFromGitHub { owner = "containers"; repo = "podman"; rev = "v${version}"; - sha256 = "sha256-Cql9ikk0lo/LeWNykEJSKgfGnBSUU5vOh/zUIEvMapk="; + sha256 = "1ihpz50c50frw9nrjp0vna2lg50kwlar6y6vr4s5sjiwza1qv2d2"; }; patches = [