!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

880 Members
175 Servers

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


SenderMessageTime
8 Dec 2023
@swrogers:matrix.orgShane joined the room.15:25:50
@tim:stratum0.orgdadada removed their profile picture.19:18:59
9 Dec 2023
@softinio:matrix.orgsoftinio changed their profile picture.05:18:46
10 Dec 2023
@janik0:matrix.org@janik0:matrix.org
In reply to @janik0:matrix.org
of course, how else would I get people to do free qa :D
As promised, even so it took some time but here it is: https://discourse.nixos.org/t/announcing-nixos-dns/36702
21:47:19
11 Dec 2023
@ryoschin:matrix.org@ryoschin:matrix.org joined the room.12:49:14
@ryoschin:matrix.org@ryoschin:matrix.orgWhen using flakes to manage my system, and having `nixos-unstable` and `home-manager` as inputs, I have to call `sudo nixos-rebuild switch --flake some/path`. Now, that command sometimes downloads around 300 MB of data before actually doing the build (around 150 MB for unstable I suppose, and 148 MB for home-manager). Is it possible to avoid having to wait for that every time? I suppose it might do the downloading when I run `sudo nix-collect-garbage -d` and reboot. (Copied from NixOs, this room might be more suitable for this question)12:50:37
@janik0:matrix.org@janik0:matrix.org
In reply to @ryoschin:matrix.org
When using flakes to manage my system, and having `nixos-unstable` and `home-manager` as inputs, I have to call `sudo nixos-rebuild switch --flake some/path`. Now, that command sometimes downloads around 300 MB of data before actually doing the build (around 150 MB for unstable I suppose, and 148 MB for home-manager). Is it possible to avoid having to wait for that every time? I suppose it might do the downloading when I run `sudo nix-collect-garbage -d` and reboot. (Copied from NixOs, this room might be more suitable for this question)

you can try with --offline then it will try to run any nix * command with the local data from nix cache also stops nix shell and nix run from trying to refresh the remote nix version. Alternatively you can do:

  nix.registry = {
    nixpkgs.flake = inputs.nixpkgs;
  };

that pins any nix * command to the same flake.lock version (similar to what channels or npins or nivs would do for nix-* commands)

13:04:24
@ryoschin:matrix.org@ryoschin:matrix.org
In reply to @janik0:matrix.org

you can try with --offline then it will try to run any nix * command with the local data from nix cache also stops nix shell and nix run from trying to refresh the remote nix version. Alternatively you can do:

  nix.registry = {
    nixpkgs.flake = inputs.nixpkgs;
  };

that pins any nix * command to the same flake.lock version (similar to what channels or npins or nivs would do for nix-* commands)

But my problem is in that sudo nix-collect-garbage -d deletes the sources, and sudo nixos-rebuild switch --flake some/path has to download them again (I suppose that is because they count as cache, so it clears them). I need the gc to not clear them, and the rebuild command to download them only if there is an actual update
15:14:32
@ryoschin:matrix.org@ryoschin:matrix.org
In reply to @janik0:matrix.org

you can try with --offline then it will try to run any nix * command with the local data from nix cache also stops nix shell and nix run from trying to refresh the remote nix version. Alternatively you can do:

  nix.registry = {
    nixpkgs.flake = inputs.nixpkgs;
  };

that pins any nix * command to the same flake.lock version (similar to what channels or npins or nivs would do for nix-* commands)

* But my problem is in that sudo nix-collect-garbage -d deletes the sources, and sudo nixos-rebuild switch --flake some/path has to download them again (I suppose that is because they count as cache, so it clears them). I need the gc to not clear them, and the rebuild command to re-download them only if there is an actual update
15:14:57
@2xsaiko:tchncs.de@2xsaiko:tchncs.de
In reply to @ryoschin:matrix.org
But my problem is in that sudo nix-collect-garbage -d deletes the sources, and sudo nixos-rebuild switch --flake some/path has to download them again (I suppose that is because they count as cache, so it clears them). I need the gc to not clear them, and the rebuild command to re-download them only if there is an actual update
if you add those flakes to the local registry then they will not be collected
alternatively I guess you can add them to system.extraDependencies
15:17:08
@janik0:matrix.org@janik0:matrix.org
In reply to @ryoschin:matrix.org
But my problem is in that sudo nix-collect-garbage -d deletes the sources, and sudo nixos-rebuild switch --flake some/path has to download them again (I suppose that is because they count as cache, so it clears them). I need the gc to not clear them, and the rebuild command to re-download them only if there is an actual update
There was some setting like keepDerivations or something to prevent that but I'm not at my laptop currently.
15:17:28
@ryoschin:matrix.org@ryoschin:matrix.org
In reply to @2xsaiko:tchncs.de
if you add those flakes to the local registry then they will not be collected
alternatively I guess you can add them to system.extraDependencies
I see. Mind sharing the process?
15:55:51
@ryoschin:matrix.org@ryoschin:matrix.org
In reply to @janik0:matrix.org
There was some setting like keepDerivations or something to prevent that but I'm not at my laptop currently.
Yup, there is such an option, but I did not fully understand what it does. Does it keep all the packages I install even if they are not needed anymore, or just keep the two things I needed not to be garbage collected?
15:57:03
@ryoschin:matrix.org@ryoschin:matrix.orgSo, as far as I can tell now, all I need to do is make the flake a GC root, right? So, how do I do that...16:07:28
@mr-qubo:matrix.orgmr-qubo
In reply to @ryoschin:matrix.org
So, as far as I can tell now, all I need to do is make the flake a GC root, right? So, how do I do that...
I don't know but direnv does this, so you can check how they do it.
17:00:32
@ryoschin:matrix.org@ryoschin:matrix.orgAlright, I think I managed to apply direnv to this17:20:26

Show newer messages


Back to Room ListRoom Version: 6