!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

862 Members
168 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
30 Apr 2025
@sheeldotme:matrix.orgsheeldotme Maybe du -hsc /nix/store and see if that is taking up a lot of your system storage, if so that may be our answer. 15:26:05
@simon.brandner:envs.netŠimon BrandnerI am not sure I follow a 100%?15:41:52
@simon.brandner:envs.netŠimon Brandner(it indeed is taking up a lot of space)15:45:53
@simon.brandner:envs.netŠimon Brandner(not sure what to make of it in the context of this issue)15:46:05
@sheeldotme:matrix.orgsheeldotmeSorry, I wasn't being very clear. I guess I meant: could the issue be that its being garbage collected prematurely because there isn't much room in the store leading to the rebuilds?16:48:28
@simon.brandner:envs.netŠimon BrandnerNo worries, but no, that is not the case17:24:48
@skyesoss:matrix.org@skyesoss:matrix.org joined the room.19:53:43
1 May 2025
@leons_pferd:matrix.orgLeon joined the room.00:03:29
@leons_pferd:matrix.orgLeon

Hey guys I have a question.
I was used to instantiate nixpkgs like this

pkgs = import inputs.nixpkgs {
    overlays = [
      inputs.nur.overlays.default
    ];
    system = "x86_64-linux"; # system arch (checkout hardware-configuration.nix -> nixpkgs.hostPlatform);
    config.allowUnfree = true;
  };

And then pass this configured instance as specialArgs to nixpkgs.lib.nixosSystem like this:

  nixosConfigurations.${systemSettings.hostname} = inputs.nixpkgs.lib.nixosSystem {
    modules = [ ./configuration.nix ];
    specialArgs = {
      inherit pkgs;
      inherit inputs;
      inherit systemSettings;
    };
  };

I thought that this ensures that the correctly defined nixpkgs is used throughout my configuration.nix. But now I'm getting this warning:

evaluation warning: You have set specialArgs.pkgs, which means that options like nixpkgs.config
                    and nixpkgs.overlays will be ignored. If you wish to reuse an already created
                    pkgs, which you know is configured correctly for this NixOS configuration,
                    please import the `nixosModules.readOnlyPkgs` module from the nixpkgs flake or
                    `(modulesPath + "/misc/nixpkgs/read-only.nix"), and set `{ nixpkgs.pkgs = <your pkgs>; }`.
                    This properly disables the ignored options to prevent future surprises.

Removing the inherit pkgs; line gets rid of the warning and everything stills works but now I don't understand how my modules know about the nixpkgs instance that they should be using.

I tried googling but found it really difficult to find information regarding this. Any help would be highly appreciated!
In general help for understanding how this nixpkgs.lib.nixosSystem actually works would be nice :slight_smile:

00:09:22
@dramforever:matrix.orgdramforever
In reply to @leons_pferd:matrix.org

Hey guys I have a question.
I was used to instantiate nixpkgs like this

pkgs = import inputs.nixpkgs {
    overlays = [
      inputs.nur.overlays.default
    ];
    system = "x86_64-linux"; # system arch (checkout hardware-configuration.nix -> nixpkgs.hostPlatform);
    config.allowUnfree = true;
  };

And then pass this configured instance as specialArgs to nixpkgs.lib.nixosSystem like this:

  nixosConfigurations.${systemSettings.hostname} = inputs.nixpkgs.lib.nixosSystem {
    modules = [ ./configuration.nix ];
    specialArgs = {
      inherit pkgs;
      inherit inputs;
      inherit systemSettings;
    };
  };

I thought that this ensures that the correctly defined nixpkgs is used throughout my configuration.nix. But now I'm getting this warning:

evaluation warning: You have set specialArgs.pkgs, which means that options like nixpkgs.config
                    and nixpkgs.overlays will be ignored. If you wish to reuse an already created
                    pkgs, which you know is configured correctly for this NixOS configuration,
                    please import the `nixosModules.readOnlyPkgs` module from the nixpkgs flake or
                    `(modulesPath + "/misc/nixpkgs/read-only.nix"), and set `{ nixpkgs.pkgs = <your pkgs>; }`.
                    This properly disables the ignored options to prevent future surprises.

Removing the inherit pkgs; line gets rid of the warning and everything stills works but now I don't understand how my modules know about the nixpkgs instance that they should be using.

I tried googling but found it really difficult to find information regarding this. Any help would be highly appreciated!
In general help for understanding how this nixpkgs.lib.nixosSystem actually works would be nice :slight_smile:

don't use specialArgs to pass pkgs, use { nixpkgs.pkgs = pkgs; } to pass it the non-special way
00:20:09
@dramforever:matrix.orgdramforeverthat's what the message is trying to tell you00:20:35
@dramforever:matrix.orgdramforever if you don't pass it anything, then, well, nixpkgs.lib.nixosSystem is from nixpkgs so it knows to use the thing from nixpkgs 00:21:08
@leons_pferd:matrix.orgLeon Do you know what the nixosModules.readOnlyPkgs is that the warning is talking about? 09:08:06
@rosariopulella:matrix.orgRosuavio changed their display name from Rosario Pulella to Rosuavio.20:08:43
2 May 2025
@dramforever:matrix.orgdramforeverhttps://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/nixpkgs/read-only.nix02:36:01

Show newer messages


Back to Room ListRoom Version: 6