!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

877 Members
175 Servers

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


SenderMessageTime
30 Apr 2025
@fkouhai:matrix.orgfkouhaialtho the user added it to their configuration.nix https://gitlab.com/engmark/root/-/commit/2d76e110f0e91dadcf376e8e8d7be01d14ab47cf06:40:15
@sheeldotme:matrix.orgsheeldotme yeah, thats for nixos. are you running nix develop manually Šimon Brandner ? or are you using direnv to trigger rebuilds? 14:32:37
@simon.brandner:envs.net@simon.brandner:envs.netDo you mean I should set it system wide? I am using direnv14:33:20
@sheeldotme:matrix.orgsheeldotme nix develop --build is what you want, nix develop --command bash -c buildPhase launches a dev shell and tries to run the bash command buildPhase, it won't find it, since its an environment variable. What are the errors you get when you run --build? 14:36:16
@sheeldotme:matrix.orgsheeldotmeand you're just doing use flake in your .envrc? what does your flake look like?14:38:09
@sheeldotme:matrix.orgsheeldotme *

and you're just doing use flake in your .envrc?

what does your flake look like?

14:38:21
@simon.brandner:envs.net@simon.brandner:envs.net

Yes

Right now like so

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  };
  outputs = {nixpkgs, ...}: let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system;
      crossSystem = {
        config = "armv7l-linux-gnueabihf";
      };
    };
  in {
    devShells.${system}.default = import ./nix/shell.nix {inherit pkgs;};
  };
  nixConfig = {
    extraOptions = ''
      keep-outputs = true
      keep-derivations = true
    '';
  };
}

14:38:57
@sheeldotme:matrix.orgsheeldotmeright so that nixConfig can be configured like this https://nix.dev/manual/nix/2.28/command-ref/conf-file.html or it can go in whatever flake is producing your configuration files. have you looked at caching? that might save some time. 14:42:11
@sheeldotme:matrix.orgsheeldotmeWhat are you currently doing that seems to trigger the build? I'm wondering if its in your devshell, or if something else is triggering the rebuild, without seeing the dependencies its hard to say what the issue may be.14:44:31
@simon.brandner:envs.net@simon.brandner:envs.net

The shell.nix looks like so

{pkgs, ...}:
pkgs.mkShell {
  buildInputs = [
    pkgs.glibc
    pkgs.glibc.static
  ];

  makeFlags = [
    "CC=${pkgs.stdenv.cc.targetPrefix}cc"
    "CXX=${pkgs.stdenv.cc.targetPrefix}g++"
  ];
}

14:47:49
@sheeldotme:matrix.orgsheeldotmeHmm, nothing jumping out to me What platform are you on? When exactly does the devshell rebuild? (On every activation, after specific commands, how frequently?) Are you updating flake inputs or the dependencies of your shell frequently? Is the flake lock stable?15:01:17
@sheeldotme:matrix.orgsheeldotme* Hmm, nothing jumping out to me. When exactly does the devshell rebuild? (On every activation, after specific commands, how frequently?) Are you updating flake inputs or the dependencies of your shell frequently? Is the flake lock stable? If you're using nixos or nix-darwin, it could help to check if you're space constrained or if you have the garbage collector running frequently.15:03:35
@simon.brandner:envs.net@simon.brandner:envs.net

To be clear I only added the nixConfig bit today.

The rebuild happens once in a while I guess. E.g. yesterday evening I was using the dev shell (nix develop) but today in the morning gcc had to be rebuilt.

I haven't done any changes to my system or the flake in between those times

GC has this setup

    gc = {
      automatic = true;
      dates = "daily";
      options = "--delete-older-than 7d";
    };

Does this answer your questions?

15:06:24

Show newer messages


Back to Room ListRoom Version: 6