!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

609 Members
121 Servers

Load older messages


SenderMessageTime
1 May 2024
@pmbauer:matrix.orgpmbauer joined the room.03:24:33
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:06:25
@daschw:matrix.org@daschw:matrix.org joined the room.18:52:56
2 May 2024
@rick:matrix.ciphernetics.nlMindaviDoes a FOD also need a system parameter?05:30:03
@aloisw:kde.org@aloisw:kde.orgYes (even for builtin builders).05:36:47
@azazel75:matrix.orgazazel75 hello guys, I've a flake with both packages and system configurations that use those packages. What happens is that if I change a system configuration, the packages get rebuilt, because the overall source of the flake is changed, but the final contents of the package do not change... is there a way to disconnect this dependency? I've tried with lib.cleanSourceWith, but apparently without success... 15:06:52
@mewp:nurupo.pl@mewp:nurupo.pldoes the package src include the flake?15:07:56
@azazel75:matrix.orgazazel75

I've tried to avoid it by reimplementing gitignore.gitignoreSourceWith as

          gitignoreSourceWith = path:
            pkgs.lib.cleanSourceWith {
              name = "tinia-src";
              filter = gitignoreFilterWith {
                basePath = path.origSrc or path;
                extraRules = ''
                  ./nix
                  flake.*
                '';
              };
              src = path;
            };
          pkgsSrc = gitignoreSourceWith ./.;

15:10:55
@azazel75:matrix.orgazazel75but I'm not 100% certain that works as I expected...15:11:34
@mewp:nurupo.pl@mewp:nurupo.plthat I don't know. but you can build the package with a builder that will emit the list of source files and check15:13:59
@mewp:nurupo.pl@mewp:nurupo.pl such as find . > $out 15:14:12
@mewp:nurupo.pl@mewp:nurupo.pl(there are probably better methods, just none of them come to mind right now)15:14:59
@azazel75:matrix.orgazazel75thanks, I'll try to do that15:15:35
@azazel75:matrix.orgazazel75gitIgnoreFilterWith is https://github.com/hercules-ci/gitignore.nix/blob/master/find-files.nix#L2415:16:34
@cabalcrow:matrix.orgCabalCrow joined the room.15:41:17
@cabalcrow:matrix.orgCabalCrow left the room.15:45:53
@cabalcrow:matrix.orgCabalCrow joined the room.15:46:29
@cabalcrow:matrix.orgCabalCrowis there a way to force nixos-rebuild to copy .git folders into the store directory?15:48:25
@mewp:nurupo.pl@mewp:nurupo.plyou could likely create a package with the current configuration repo if that's what you want. no built-in module for that afaik15:50:07
@azazel75:matrix.orgazazel75

so, i did what you suggested mewp , whit a new package like:

          pkgsSrcContents = pkgs.stdenvNoCC.mkDerivation {
            name = "src-contents";
            src = pkgsSrc;
            builder = pkgs.writeText "builder.sh" ''
              ${pkgs.findutils}/bin/find $src >> $out
            '';
          };
15:55:20
@cabalcrow:matrix.orgCabalCrowwell that is a shame15:55:26
@azazel75:matrix.orgazazel75 it turns out that even if flake.nix isn't in the resulting $src, if I change it between two runs the hash of that $src store path will change 15:57:12
@mewp:nurupo.pl@mewp:nurupo.plinteresting, what about this last package containing only the names? does it also change?15:58:04
@azazel75:matrix.orgazazel75it changes because the path of $src changes... I should calculate a checksum of the whole contents of $src, maybe with a volatile tar command..15:59:35
@mewp:nurupo.pl@mewp:nurupo.pl you can avoid that by cding to the directory before find 16:00:18
@azazel75:matrix.orgazazel75yes16:00:53
@mewp:nurupo.pl@mewp:nurupo.pl then you'll be able to see if the list of files changes. you can also do find -type f . | sha1sum to see if the hashes differ 16:02:10
@mewp:nurupo.pl@mewp:nurupo.plit would be very weird for the hash to change without src changing16:02:45
@mewp:nurupo.pl@mewp:nurupo.pl(none of this has anything to do with flakes btw, this would work the same without them)16:04:19
@azazel75:matrix.orgazazel75 find -type f . | sha1sum would expose only a difference in the names of the contents though 16:08:54

Show newer messages


Back to Room ListRoom Version: 6