Commit Graph

21 Commits

Author SHA1 Message Date
R. Ryantm
5c2bbf7efa codecrafters-cli: 53 -> 54 2026-04-21 14:56:20 +00:00
R. Ryantm
6094ba2ec2 codecrafters-cli: 52 -> 53 2026-03-11 21:34:09 +00:00
R. Ryantm
3ae7038d79 codecrafters-cli: 49 -> 52 2026-03-03 20:15:32 +00:00
R. Ryantm
c23bfd7a6b codecrafters-cli: 47 -> 49 2026-02-23 09:58:15 +00:00
R. Ryantm
57591f4879 codecrafters-cli: 46 -> 47 2026-02-16 02:26:52 +00:00
quantenzitrone
9380e05c3c various: switch buildGoModule packages to use finalAttrs
this shouldn't create any rebuilds

the following script was used to generate this:
```fish
#!/usr/bin/env fish

# nix shell .#nixfmt nixpkgs#{nixf-diagnose,ripgrep,sd}

set base (git rev-parse HEAD)

set scope pkgs/by-name
set builder buildGoModule

set files (rg --files-with-matches -F "$builder rec {" $scope | sort -u)

for file in $files
    echo $file
    sd -F "$builder rec {" "$builder (finalAttrs: {" $file
    # version
    sd -F 'version}' 'finalAttrs.version}' $file
    sd -F '${version' '${finalAttrs.version' $file
    sd -F '= version' '= finalAttrs.version' $file
    sd -F 'inherit version;' 'inherit (finalAttrs) version;' $file
    sd -F ' + version;' ' + finalAttrs.version;' $file
    sd 'replaceStrings (.*) version' 'replaceStrings $1 finalAttrs.version' $file
    sd -F 'splitVersion version' 'splitVersion finalAttrs.version' $file
    sd -F 'versionAtLeast version' 'versionAtLeast finalAttrs.version' $file
    sd 'versions\.([a-z]+) version' 'versions.$1 finalAttrs.version' $file
    # src
    sd -F 'src}' 'finalAttrs.src}' $file
    sd -F '${src' '${finalAttrs.src' $file
    sd -F '= src' '= finalAttrs.src' $file
    sd -F 'inherit src;' 'inherit (finalAttrs) src;' $file
    sd -F 'inherit (src' 'inherit (finalAttrs.src' $file
    # meta
    sd -F '${meta' '${finalAttrs.meta' $file
    sd -F '= meta' '= finalAttrs.meta' $file
    sd -F 'inherit (meta' 'inherit (finalAttrs.meta' $file
    # other
    sd -F 'inherit version src;' 'inherit (finalAttrs) version src;' $file
    sd -F 'inherit src version;' 'inherit (finalAttrs) src version;' $file
    sd -F 'makeLibraryPath buildInputs' 'makeLibraryPath finalAttrs.buildInputs' $file
    sd -F 'buildInputs}' 'finalAttrs.buildInputs}' $file
    sd -F 'desktopItem}' 'finalAttrs.desktopItem}' $file
    sd -F 'runtimeLibs}' 'finalAttrs.runtimeLibs}' $file
    sd -F 'libPath}' 'finalAttrs.libPath}' $file
    sd -F 'runtimeDependencies}' 'finalAttrs.runtimeDependencies}' $file
    sd -F 'nativeRuntimeInputs}' 'finalAttrs.nativeRuntimeInputs}' $file
    sd -F '(!doCheck)' '(!finalAttrs.doCheck)' $file
    sd -F 'optional doCheck' 'optional finalAttrs.doCheck' $file
    sd -F 'optionals doCheck' 'optionals finalAttrs.doCheck' $file
    sd -F '++ runtimeDependencies' '++ finalAttrs.runtimeDependencies' $file
    # pname (restored afterwards)
    sd -F 'pname}' 'finalAttrs.pname}' $file
    sd -F '${pname' '${finalAttrs.pname' $file
    sd -F '= pname' '= finalAttrs.pname' $file
    # close finalAttrs lambda
    echo ')' >>$file
    # catch some errors early
    if ! nixfmt $file
        git restore $file
        continue
    end
    if ! nixf-diagnose -i sema-primop-overridden $file
        git restore $file
        continue
    end
end

set torestore (rg -F .finalAttrs --files-with-matches $scope)
if test (count $torestore) -gt 0
    git restore $torestore
end
set torestore (rg -F finalAttrs.pname --files-with-matches $scope)
if test (count $torestore) -gt 0
    git restore $torestore
end

# commit for faster eval times
git add pkgs
git commit --no-gpg-sign -m temp
set torestore

for file in $files
    # file hasn't changed
    if git diff --quiet $base $file
        continue
    end
    # try to eval the package to definitely catch all errors
    echo $file
    set pname (string split / $file -f 4)
    if ! nix eval .#$pname
        set torestore $torestore $file
    end
end

# restore files that don't eval
git reset --soft $base
git restore --staged .
if test (count $torestore) -gt 0
    git restore $torestore
end
```

after that some manual cleanup was done:
- restoring files that cause changes in the number of lines
- restoring files that cause rebuilds
- restoring files that cause merge conflicts with staging
2026-02-07 09:28:59 +01:00
R. Ryantm
16be29e1d9 codecrafters-cli: 45 -> 46 2026-01-13 01:41:23 +00:00
R. Ryantm
3b76402f5c codecrafters-cli: 44 -> 45 2026-01-06 17:07:52 +00:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
R. Ryantm
d084bda5ca codecrafters-cli: 43 -> 44 2025-11-04 06:37:48 +00:00
R. Ryantm
99674de0a4 codecrafters-cli: 42 -> 43 2025-10-21 23:18:25 +00:00
R. Ryantm
f2b017b6c2 codecrafters-cli: 40 -> 42 2025-10-16 03:55:46 +00:00
R. Ryantm
8daac8f5af codecrafters-cli: 39 -> 40 2025-10-09 20:38:26 +00:00
R. Ryantm
cc36ea33ae codecrafters-cli: 37 -> 39 2025-09-11 02:40:46 +00:00
R. Ryantm
dd769802f7 codecrafters-cli: 36 -> 37 2025-08-30 14:54:53 +00:00
mivorasu
7091e75f78 treewide: replace rev with tag in fetchFromGitHub 2025-08-04 10:46:30 +00:00
Winter
a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00
Pol Dellaiera
65a333600d treewide: replace rev with tag 2025-04-07 16:57:22 +02:00
R. Ryantm
8e396127be codecrafters-cli: 35 -> 36 2025-01-12 15:56:26 +00:00
Builditluc
27f7066b00 codecrafters-cli: 34 -> 35 2024-11-23 13:48:56 +01:00
Builditluc
57acdbdb66 codecrafters-cli: init at 34 2024-08-08 10:29:00 +02:00