From 640810a16c96a94ca17b7ef173d553d17e1c12ea Mon Sep 17 00:00:00 2001 From: Whovian9369 Date: Wed, 29 May 2024 15:27:25 -0400 Subject: [PATCH] Workaround dotnet HTTP Header sanitisation issue. --- flake.nix | 3 +++ system/dotnet_os_codename-workaround.nix | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 system/dotnet_os_codename-workaround.nix diff --git a/flake.nix b/flake.nix index 2d68f24..2408a85 100644 --- a/flake.nix +++ b/flake.nix @@ -94,6 +94,9 @@ system = "x86_64-linux"; modules = [ ./system/nixos-wsl/configuration.nix + ./system/dotnet_os_codename-workaround.nix + # Source of this fix file is + # https://github.com/nazarewk-iac/nix-configs/blob/main/modules/ascii-workaround.nix ./system/nix_lix.nix nixos-wsl.nixosModules.wsl lix-module.nixosModules.default diff --git a/system/dotnet_os_codename-workaround.nix b/system/dotnet_os_codename-workaround.nix new file mode 100644 index 0000000..16b1067 --- /dev/null +++ b/system/dotnet_os_codename-workaround.nix @@ -0,0 +1,19 @@ +/* Last reviewied: 2024-05-29 + + fixes issues with lack of HTTP header sanitization in .NET Core, see: + - https://github.com/NixOS/nixpkgs/issues/315574 + - https://github.com/microsoftgraph/msgraph-cli/issues/477 +*/ +{ lib, options, ... }: { + /* + using just `readOnly` because it can contain neither of: default, example, description, apply, type + see https://github.com/NixOS/nixpkgs/blob/aae38d0d557d2f0e65b2ea8e1b92219f2c0ea8f9/lib/modules.nix#L752-L756 + */ + options.system.nixos.codeName = lib.mkOption { readOnly = false; }; + config.system.nixos.codeName = + let + codeName = options.system.nixos.codeName.default; + renames."Vicuña" = "Vicuna"; + in + renames."${codeName}" or (throw "Unknown `codeName`: ${codeName}, please add it to `renames` in `ascii-workaround.nix`"); +}