I’m a beginner/intermediate in NixOS and my flake rebuild takes about 25 seconds to be finished. Most of the time is evaluating derivation for some reason and it’s getting kinda frustrating having to wait when I want to add a package to my config. Has anyone the same problem or is it normal that it takes this long in Nix?

    • TomkoidOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 months ago

      It varies by day. Some days, I rebuild the system flake five times, while other weeks I don’t rebuild it at all. However, the time it takes to rebuild remains about the same.

  • Lehmanator@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    5 months ago

    Depends on what you’re doing in your config and what you’re changing. My configs are huge and complex because I was a moron when I first started out. Adding packages to your nixosConfigurations is a smell IMO. Most of the time, it would be preferable to add them to a devshell instead.

    25 seconds sounds pretty close to my experience, but my machine is beefy and my configs have a lot of bad patterns for eval time.

    • TomkoidOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      I agree that adding every package to my NixOS configuration isn’t the right way to do things, and I should definitely use a devshell or nix-shell -p $package for that. However, it’s much more noticeable when I’m working with something like an HTTP server, constantly adding new things to the config, and needing to wait 25 seconds to actually test it.

  • Wooki@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 months ago

    While it obviously depends, it really only depends on how much your building from source. For me its about 1min on a low power processor.

  • sonnius@mastodon.nz
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    @Tomkoid Depends on the system :)
    I usually experiment with new software using nix-shell or similar, both because it’s easy to roll-back and it doesn’t take a lot of time to add a package this way, once happy I put the config in my main nix conf.
    I do agree it can sometimes be a bit cumbersome to do multiple rebuilds to get things just right.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    3
    ·
    5 months ago

    My changes take maybe a few seconds less, but I find that quite normal. It could be faster, but let’s be honest how often does one run that? I run it maybe once a week or once a month. 25 seconds a week is nothing to me.

    Normally I test packages with nix-shell -p $package then when I’m satisfied, it goes into my configuration and the time to do so doesn’t matter anymore.

    Anti Commercial-AI license