Workaround dotnet HTTP Header sanitisation issue.

This commit is contained in:
Whovian NTSN 2024-05-29 15:27:25 -04:00
parent 5664447bcd
commit 640810a16c
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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`");
}