!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

904 Members
185 Servers

Load older messages


SenderMessageTime
26 Dec 2021
@balsoft:balsoft.rubalsoft
In reply to @withoutwithin:matrix.org
I'm trying to flakify an app of mine and it's not working: https://tulpa.dev/cadey/printerfacts/src/branch/main/flake.nix
i tried to define the nixos module and the tests inside the flake.nix file. but the test is claiming that the service can't cd into the package on disk. here is the test output: http://ix.io/3JAp. what am i doing wrong?
You don't need to filter out target since it's gitignored already
18:18:37
@balsoft:balsoft.rubalsoft Also, you're trying to chdir to /srv/within, but the service creating those directories may not have started at that point 18:20:41
@balsoft:balsoft.rubalsoftAlso, it's better to use systemd's internal mechanisms for this I think18:20:51
@balsoft:balsoft.rubalsoftTry `StateDirectory``18:20:56
@balsoft:balsoft.rubalsoft * Try StateDirectory 18:20:58
@balsoft:balsoft.rubalsoft * Try StateDirectory 18:21:00
@balsoft:balsoft.rubalsoft (and it's also going to put it in the right place, i.e. /var/lib 18:21:26
@balsoft:balsoft.rubalsoft * (and it's also going to put it in the right place, i.e. /var/lib) 18:21:28
@balsoft:balsoft.rubalsoft Oh, it looks like RuntimeDirectory may be a better fit here 18:21:47
@balsoft:balsoft.rubalsoft And if you're adamant on creating a non-standard directory in the root (which I think is a bad idea), do it with systemd.tmpfiles.rules instead of custom things 18:22:14
@balsoft:balsoft.rubalsoft Or, if you just want to fix what you have, add before = [ "within.printerfacts.service" ]; to within-homedir-setup 18:22:57
@withoutwithin:matrix.orgXeis there a way to make systemd.tmpfiles.rules create permanent persistent directories?18:24:22
@withoutwithin:matrix.orgXei thought that would create time bombs that would vanish randomly18:24:35
@withoutwithin:matrix.orgXe * i thought that would create time bombs that could vanish randomly18:27:22
@balsoft:balsoft.rubalsofttmpfiles create persistent directories18:27:39
@balsoft:balsoft.rubalsoft (unless you use d, D or e, that is) 18:29:03
@balsoft:balsoft.rubalsoft * (unless you use d, D or e, that is, and specify the cleanup-age) 18:29:47
@withoutwithin:matrix.orgXei see, thanks18:53:19
@withoutwithin:matrix.orgXebut yeah i was just doing things really wrongly with how i was copying things into my flake.nix18:53:36
@withoutwithin:matrix.orgXeScreenshot from 2021-12-26 13-53-12.png
Download Screenshot from 2021-12-26 13-53-12.png
18:53:50
@withoutwithin:matrix.orgXeit works now 😀18:53:54
28 Dec 2021
@ilkecan:matrix.orgilkecan
In reply to @andi:kack.it
So, how do I write a flake that doesn't rebuild all the packages that have their source in the same repo (root) whenever I change a whitespace in my flake.nix? Is filterSource compatible/supported with flakes?
You need to use nix-filter or something equivalent.
18:57:38
@andi:kack.itandi-I wrote a filter expression that only accepted a single file. It still copied everything in the store.18:58:26
@ilkecan:matrix.orgilkecan
In reply to @flyx:flyx.org
hi folks! how can I prevent every edit of flake.nix to cause everything depending on self being rebuilt on the next nix build? flake.nix is checked into git so it is part of self, but obviously not part of the sources being built, so an edit should only affect those derivations whose definitions were changed by the edit
please see the message above
18:58:27
@ilkecan:matrix.orgilkecan
In reply to @andi:kack.it
I wrote a filter expression that only accepted a single file. It still copied everything in the store.
The repo is copied to the Nix store before each evaluation but using nix-filter should prevent unnecessary rebuilds.
18:59:57
@andi:kack.itandi-yeah but the former is the issue I am trying to avoid.19:00:14
@andi:kack.itandi-No point in copying everythin ginto the repo for just a few files..19:00:22
@ilkecan:matrix.orgilkecanYou didn't say that in you original message. You asked how to write a flake that doesn't rebuild all packages not how to prevent Nix copying the full repo to the store.19:02:15
29 Dec 2021
@putch4r:matrix.orgputchar joined the room.12:46:08
@v0id:nltrix.netv0|d joined the room.18:19:47

There are no newer messages yet.


Back to Room ListRoom Version: 6