I’ve tried adding the code to various parts of my configuration.nix but I keep getting error messages when trying to build. Can anyone help me with this please?
this was super annoying because it required a bunch of additions that looked alike. if you don’t know how to read, like me, you could easily waste 20 minutes on this
Seems like the move of Sonarr to a supported version (.NET 8) might take a while.
But no matter where and how I try to put it, the option just seems to be ignored.
@Almin17 be more specific please. Are we talking a NixOS deployment, or a build of Sonarr in isolation, where do you put this option, etc. Note that as other people have said, you have to put several packages related to dotnet in this list, not just dotnet-runtime-....
{ config, lib, pkgs, ... }:
#lib is needed for mkDefault
with lib;
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./framework.nix
];
nixpkgs.config.permittedInsecurePackages = [
"dotnet-runtime-wrapped-6.0.36"
"aspnetcore-runtime-6.0.36"
"aspnetcore-runtime-wrapped-6.0.36"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];
... bootloader and so on
@justinas I’m trying to build/upgrade NixOS to 24.11, not building Sonarr, this thread is simply the only plausible one I came across when searching for the issue.
@aanderse I already listed all of those, doesn’t make a difference in my case.
The full output:
sudo nixos-rebuild switch --upgrade
unpacking channels...
building Nix...
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1:35741:
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:33591:
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `system.systemBuilderArgs':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activatable-system.nix':
… while evaluating the option `system.activationScripts.etc.text':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc-activation.nix':
… while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix':
… while evaluating the option `environment.etc.dbus-1.source':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Package ‘dotnet-runtime-6.0.36’ in /nix/store/0jxmxi5zihn9gli94hazpyb7mn6311zm-nixos-24.11/nixos/pkgs/development/compilers/dotnet/build-dotnet.nix:212 is marked as insecure, refusing to evaluate.
Known issues:
- Dotnet SDK 6.0.36 is EOL, please use 8.0 (LTS) or 9.0 (Current)
You can install it anyway by allowing this package, using the
following methods:
a) To temporarily allow all insecure packages, you can use an environment
variable for a single invocation of the nix tools:
$ export NIXPKGS_ALLOW_INSECURE=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) for `nixos-rebuild` you can add ‘dotnet-runtime-6.0.36’ to
`nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
like so:
{
nixpkgs.config.permittedInsecurePackages = [
"dotnet-runtime-6.0.36"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
‘dotnet-runtime-6.0.36’ to `permittedInsecurePackages` in
~/.config/nixpkgs/config.nix, like so:
{
permittedInsecurePackages = [
"dotnet-runtime-6.0.36"
];
}
I have the same problem, and adding the permitted insecure packages does allow me to start the build process, but since my sonarr is running on a raspberry pi it does not have enough memory on the SD card to finish the build, and when I try to deploy the build remotely I get a segmentation fault during the checkPhase of the sonarr build (which takes around 20 minutes to get to)