!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

255 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena86 Servers

Load older messages


SenderMessageTime
22 Dec 2024
@allrealmsoflife:matrix.orgallrealmsoflife joined the room.15:54:19
@justinas:nixos.devJustinas Stankevičius dmoonfire: in the second case it should be import nixpkgs { inherit system; config = ... }. Not nixpkgs.config. 18:38:44
@justinas:nixos.devJustinas Stankevičius Try also putting it in nixpkgs.config in an individual node's config. The Flakes shim you linked does not seem to necessarily apply defaults. 18:39:15
@justinas:nixos.devJustinas Stankevičius
In reply to @otanaut:matrix.org
Hey, when using colmena with nixosConfigurations, as suggested in this Issus:https://github.com/zhaofengli/colmena/issues/60, where do i put the `deploment.targetUser` and `targetHost` properties?
Include the colmena.nixosModules.deploymentOptions module in your nodes modules / imports, then use deployment.targetHost in the node config like before.
18:40:00
23 Dec 2024
@dmoonfire:matrix.orgdmoonfire I tried putting it in the package and it doesn't seem to be picking it up.

      colmena = {
        meta = {
          # Figure out the default nixpkgs to use for each node.
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            config.permittedInsecurePackages = insecure-packages;
          };

Putting it as config. in various places get the error where you can't configure a setting and a service in the same (unknown boot or services depending on where).
04:09:12
@pepin:globohomo.coPepin joined the room.19:49:50
@pepin:globohomo.coPepin

Hi, I am overriding package version via overrideAttrs. colmena build works fine, however applying the build throws this error:

error: cannot add path '/nix/store/dpxhgkc31n0yh7mv7a47x5p9j4rmk3gz-foundationdb73' because it lacks a signature by a trusted key

Is there a way to bypass the check?

19:52:04
24 Dec 2024
@justinas:nixos.devJustinas Stankevičius
In reply to @dmoonfire:matrix.org
I tried putting it in the package and it doesn't seem to be picking it up.

      colmena = {
        meta = {
          # Figure out the default nixpkgs to use for each node.
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            config.permittedInsecurePackages = insecure-packages;
          };

Putting it as config. in various places get the error where you can't configure a setting and a service in the same (unknown boot or services depending on where).

get the error where you can't configure a setting and a service in the same (unknown boot or services depending on where).

I'm not sure what that means

10:43:46
@karlthane:matrix.org@karlthane:matrix.org joined the room.13:58:22
@karlthane:matrix.org@karlthane:matrix.org left the room.14:03:18
@dmoonfire:matrix.orgdmoonfire
In reply to@justinas:nixos.dev

get the error where you can't configure a setting and a service in the same (unknown boot or services depending on where).

I'm not sure what that means

Adding the configuration option to the top-level file for a host (in example/default.nix with example = import ./src/nodes/example/default.nix; in flake.nix), such as:

config.permittedInsecurePackages = ["dotnet-sdk-6.0.428"];

gives the following error:

       error: Module `:anon-1766:anon-1' has an unsupported attribute `boot'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: boot deployment environment networking services sops system time) into the explicit `config' attribute.

Putting this in the top-level file:

nixpkgs.config.permittedInsecurePackages = ["dotnet-sdk-6.0.428"];

doesn't pick up the insecure packages entry. "Doesn't pick up" being "gives me an error that I need to add dotnet-sdk-6.0.428 to the permittedInsecurePackages" error.

Putting the nixpkgs.config... in flake.nix:outputs.colmena.defaults is what used to work before I upgraded to 24.11.

Putting the config... in flake.nix:outputs.colmena.meta.nixpkgs = import inputs.nixpkgs { ...; config.permitted... } doesn't pick it up.

Putting the nixpkgs.config... in flake.nix:outputs.colmena.meta.nixpkgs = import inputs.nixpkgs { ...; config.permitted... } doesn't pick it up (but you already said that, just being complete).
23:17:23
@justinas:nixos.devJustinas Stankevičius

Alright, I see. The This is caused by introducing a top-level config' or options' attribute. issue is because you misunderstood me, I'll try to be a bit more clear.

When you're importing / calling nixpkgs explicitly, its options are under an argument called config. In full, import nixpkgs { config = { permittedInsecurePackages = ... } };.

However, when you're configuring nixpkgs in a modular way through the NixOS machine config, then that same thing is nested under nixpkgs, e.g. the option to set is nixpkgs.config. In full, nixpkgs.config.permittedInsecurePackages = { ... }. https://search.nixos.org/options?channel=24.11&show=nixpkgs.config&from=0&size=50&sort=relevance&type=packages&query=nixpkgs.config

In the context of a NixOS configuration module, config refers to the system configuration itself.

23:21:35
@justinas:nixos.devJustinas Stankevičius *

Alright, I see. The This is caused by introducing a top-level config' or options' attribute. issue is because you misunderstood me, I'll try to be a bit more clear.

When you're importing / calling nixpkgs explicitly, its options are under an argument called config. In full, import nixpkgs { config = { permittedInsecurePackages = ... } };.

However, when you're configuring nixpkgs in a modular way through the NixOS machine config, then that same thing is nested under nixpkgs, e.g. the option to set is nixpkgs.config. In full, nixpkgs.config.permittedInsecurePackages = [ ... ]. https://search.nixos.org/options?channel=24.11&show=nixpkgs.config&from=0&size=50&sort=relevance&type=packages&query=nixpkgs.config

In the context of a NixOS configuration module, config refers to the system configuration itself.

23:24:09
@dmoonfire:matrix.orgdmoonfire So, in the metadata, then this should work from what I'm understanding.

      colmena = {
        meta = {
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            config = { permittedInsecurePackages = [ "dotnet-sdk-6.0.428" ]; };
          };

But I still get the error that I need to allow "dotnet-sdk-6.0.428".
23:26:06
@justinas:nixos.devJustinas Stankevičius Are you sure that after you add the permitted package, it still complains about the same package? We've already have a couple of people ask about this, and they misunderstood the fact that you may need to include several distinct packages in this list under some circumstances. https://discourse.nixos.org/t/solved-sonarr-is-broken-in-24-11-unstable-aka-how-the-hell-do-i-use-nixpkgs-config-permittedinsecurepackages/56828 23:31:09
@otanaut:matrix.org@otanaut:matrix.org left the room.23:31:21
@justinas:nixos.devJustinas StankevičiusPlease make sure that after you attempt the fix, it is the same exact package reported in the error.23:32:12
@justinas:nixos.devJustinas Stankevičius I've just confirmed that the following works (allows me to build Sonarr, which is one of the apps affected): https://gist.github.com/justinas/d2465aacfdf196ba65bf4f7bd1894f0e . nixos-unstable, colmena master, colmena build --experimental-flake-eval. 23:33:50
@justinas:nixos.devJustinas Stankevičius * Are you sure that after you add the permitted package, it still complains about the same package? We've already had a couple of people ask about this, and they misunderstood the fact that you may need to include several distinct packages in this list under some circumstances. https://discourse.nixos.org/t/solved-sonarr-is-broken-in-24-11-unstable-aka-how-the-hell-do-i-use-nixpkgs-config-permittedinsecurepackages/56828 23:35:21
@dmoonfire:matrix.orgdmoonfire
paruk |        Known issues:
paruk |         - Dotnet SDK 6.0.428 is EOL, please use 8.0 (LTS) or 9.0 (Current)
paruk | 
paruk |        You can install it anyway by allowing this package, using the
paruk |        following methods:
paruk | 
paruk |        a) To temporarily allow all insecure packages, you can use an environment
paruk |           variable for a single invocation of the nix tools:
paruk | 
paruk |             $ export NIXPKGS_ALLOW_INSECURE=1
paruk | 
paruk |           Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
paruk |                 then pass `--impure` in order to allow use of environment variables.
paruk | 
paruk |        b) for `nixos-rebuild` you can add ‘dotnet-sdk-6.0.428’ to
paruk |           `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
paruk |           like so:
paruk | 
paruk |             {
paruk |               nixpkgs.config.permittedInsecurePackages = [
paruk |                 "dotnet-sdk-6.0.428"
paruk |               ];
paruk |             }
paruk | 
paruk |        c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
paruk |           ‘dotnet-sdk-6.0.428’ to `permittedInsecurePackages` in
paruk |           ~/.config/nixpkgs/config.nix, like so:
paruk | 
paruk |             {
paruk |               permittedInsecurePackages = [
paruk |                 "dotnet-sdk-6.0.428"
paruk |               ];
paruk |             }
paruk | Evaluation failed

That is the package, but I tried to include those Sonarr ones since sonarr is on that server.

23:35:24
@justinas:nixos.devJustinas Stankevičius Okay. Please see my gist, it is a very simple config that you can verify works in isolation. I also use the samenixpkgs.config from the gist in a personal machine with 24.11 and it works. 23:36:49
@dmoonfire:matrix.orgdmoonfireChecking that now.23:37:13
@justinas:nixos.devJustinas Stankevičius * Okay. Please see my gist, it is a very simple config that you can verify works in isolation. I also use the same nixpkgs.config from the gist in a personal machine with 24.11 and it works. 23:37:33
@dmoonfire:matrix.orgdmoonfireOkay, that will take me longer to try out. I have to do that "family" thing. Thank you for the help, I'll work on this before asking again.23:40:26
26 Dec 2024
@dmoonfire:matrix.orgdmoonfire
In reply to @justinas:nixos.dev
Okay. Please see my gist, it is a very simple config that you can verify works in isolation. I also use the same nixpkgs.config from the gist in a personal machine with 24.11 and it works.
I'm struggling to make a non trivial example of your gist. Do you have another with a remote flake being pulled down through imports into the nixosConfiguration?
05:21:17
@justinas:nixos.devJustinas StankevičiusLet's start a thread maybe. What would a remote flake change and what is in that remote flake? If that remote flake does an explicit `import nixpkgs` on its own, then maybe that's the problem - it has its own instance of nixpkgs where the config option would need to be applied again. My gist is just to show that `nixpkgs.config` definitely works, even with Colmena. Have you verified that by trying to build it?08:35:14
@dmoonfire:matrix.orgdmoonfire

Your gist works fine, that isn't the problem. The problem I'm having is translating your trivial example into my non-trivial system (154 nix files, 7 nodes, plus a bunch of other flakes that I pull in). I've been working on this flake since 2021 with an imperfect understanding of Nix, so most of it is cobbled together.

A good example is that I haven't used nixosConfigurations but that is something I've been thinking about doing, so I was trying to retrofit my system to do it so I can bring my flake to the same layout in hopes of seeing what I'm doing differently.

I think I have the basic refactor that uses nixosConfigurations, but I'm getting stuck trying to get an input flake (remote flate) from my flake.nix into an inner file.

This in my inputs section of my flake.nix:

    dosage.url = "git+https://src.mfgames.com/nixos-contrib/dosage-dmoonfire-flake.git";
    sbmp4a.url = "git+https://src.mfgames.com/nixos-contrib/sickbeard-mp4-automator-flake.git";
    ficsit-cli.url = "git+https://src.mfgames.com/nixos-contrib/ficsit-cli-flake.git";

I want to get those into the files I need them which means going this path:

  • flake.nix
  • src/nodes/silud/default.nix (silud being one of my home servers)
  • src/programs/sbmp4a.nix

The goal is to have inputs.sbmp4a available in the sbmp4a.nix file so I can have it included on the nodes that need to have Sickbeard's MP4A.

I also don't want to list every flake in every package, so I use inputs: {} or inputs@{pkgs,...}: {} fairly often.

Mostly, this is just trying to refactor to integrate your working gist into my setup. Does that make sense?

14:21:20
@justinas:nixos.devJustinas Stankevičius

Right. This is a bit beyond the scope of your original question about building an insecure package. For getting inputs into individual NixOS modules, look into specialArgs.

Sorry about confusing you by dragging nixosConfigurations into the mix - my brain merged your question with another one together, so for some reason I assumed you were using the "flake shim" for Colmena as well.

14:50:32
@justinas:nixos.devJustinas Stankevičius Coming back to the problem in question, just to clarify: you're using Sonarr, right, that's what's triggering the "insecure package" error? Do you know what configures Sonarr, is it one of the remote flakes you include? If you are not sure, maybe running with --show-trace would help figure that out? 14:51:57
@justinas:nixos.devJustinas Stankevičius *

Right. This is a bit beyond the scope of your original question about building an insecure package. For getting inputs into individual NixOS modules, look into specialArgs.

Sorry about confusing you by dragging nixosConfigurations into the mix - my brain merged your question with another one together, so for some reason I assumed you were using the "flake shim" for Colmena as well.

It does not matter if you use nixosConfigurations as an output or just colmena. What matters is configuring permittedInsecurePkgs for the relevant instance of Nixpkgs. Which is what I'm trying to figure out - since configuring it for the default pkgs for the node is not working, maybe there's another instance of Nixpkgs in play?

14:56:28

Show newer messages


Back to Room ListRoom Version: 6