!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

890 Members
179 Servers

Load older messages


SenderMessageTime
22 Jan 2024
@ThorHop:matrix.org@ThorHop:matrix.org changed their display name from hopland to IdeallyYes.15:05:35
@ahoneybun:matrix.orgahoneybun joined the room.19:28:54
23 Jan 2024
@2xsaiko:tchncs.de@2xsaiko:tchncs.de changed their display name from 2xsaiko to Marco.17:54:54
@2xsaiko:tchncs.de@2xsaiko:tchncs.de changed their display name from Marco to 2xsaiko.18:17:33
@lovesegfault:matrix.orglovesegfault changed their display name from lovesegfault (Old) to lovesegfault.19:28:47
@lovesegfault:matrix.orglovesegfault changed their profile picture.19:28:58
@lovesegfault:matrix.orglovesegfault changed their profile picture.19:29:12
24 Jan 2024
@nm0i:matrix.org@nm0i:matrix.org joined the room.07:46:37
27 Jan 2024
@sethrankada52:matrix.org@sethrankada52:matrix.org joined the room.14:04:20
@lehmanator:gnulinux.club@lehmanator:gnulinux.club removed their profile picture.16:55:37
@lehmanator:gnulinux.club@lehmanator:gnulinux.club removed their display name Sam Lehman.16:59:44
@lehmanator:gnulinux.club@lehmanator:gnulinux.club left the room.17:05:49
28 Jan 2024
@ncfavier:matrix.orgnf changed their profile picture.14:04:00
@lxsameer:matrix.orglxsameer hey folkss, when running nix store gc, how does nix know what to delete? does it know what flake.lock files do I have? 21:13:05
@qyriad:matrix.org@qyriad:matrix.org nix-store --gc --print-roots 21:30:14
@qyriad:matrix.org@qyriad:matrix.orgAny store paths that are transitively referenced by any gc roots — which in practice are running processes and any symlinks outside of the store to paths inside the store — won't be deleted21:30:56
@qyriad:matrix.org@qyriad:matrix.orgflake.lock doesn't come into the picture directly21:31:45
@mr-qubo:matrix.orgmr-qubo
In reply to @lxsameer:matrix.org
hey folkss, when running nix store gc, how does nix know what to delete? does it know what flake.lock files do I have?
It doesn't know about flake.lock by default. But it's possible to add it as a root manually. Some projects, e.g. direnv, do that for you.
22:24:36
@lxsameer:matrix.orglxsameerInteresting22:41:29
@lxsameer:matrix.orglxsameerI'm not on nixos and i want to gc the store without removing my flake related packages22:42:09
@qyriad:matrix.org@qyriad:matrix.orgwhat do you mean by "flake related packages"?22:43:34
@lxsameer:matrix.orglxsameer I use flakes to manage the dependencies in my projects. for example i install clang toolchain and few other things in my flake, when I do nix store gc I don't want nix to remove them 22:45:06
@qyriad:matrix.org@qyriad:matrix.org if you have done something like nix build, that creates a result symlink in the flake directory. That symlink will keep those packages from being garbage collected 22:46:17
@lxsameer:matrix.orglxsameerah ok, what about packages that I add to my devshell ?22:47:14
@qyriad:matrix.org@qyriad:matrix.org nix develop doesn't create a gc root (except for processes running in that shell) 22:52:16
@qyriad:matrix.org@qyriad:matrix.org If you want to create a symlink to those you can run something like nix build --impure --expr 'let flake = builtins.getFlake "/full/path/to/flakedir"; in flake.outputs.devShells.x86_64-linux.default' to create that result symlink 22:53:46
@qyriad:matrix.org@qyriad:matrix.org Or you can find the /nix/store path manually and use nix-store --gc --add-root on it 22:54:04
@qyriad:matrix.org@qyriad:matrix.orgI'm not aware of another way22:54:12
@qyriad:matrix.org@qyriad:matrix.org but also if you run nix store gc you can just re-run nix develop to re-download/build those store paths 22:54:49
@charles:computer.surgeryCharles
In reply to @lxsameer:matrix.org
I use flakes to manage the dependencies in my projects. for example i install clang toolchain and few other things in my flake, when I do nix store gc I don't want nix to remove them
if you use direnv and nix-direnv, it will create gc roots for your flakes
22:57:02

Show newer messages


Back to Room ListRoom Version: 6