Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,16 @@ insert_final_newline = false

# see https://nixos.org/nixpkgs/manual/#chap-conventions

[*.{bash,css,js,json,lock,md,nix,pl,pm,py,rb,sh,xml}]
[*.{bash,css,js,json,lock,md,nix,nu,pl,pm,py,rb,sh,xml}]
indent_style = space

# Match docbook files, set indent width of one
[*.xml]
indent_size = 1

# Match json/lockfiles/markdown/nix/ruby files, set indent width of two
[*.{js,json,lock,md,nix,rb}]
[*.{bash,js,json,lock,md,nix,rb,sh}]
indent_size = 2

# Match all the Bash code in Nix files, set indent width of two
[*.{bash,sh}]
indent_size = 2

# Match Perl and Python scripts, set indent width of four
[*.{pl,pm,py}]
[*.{nu,pl,pm,py}]
indent_size = 4

# Match gemfiles, set indent to spaces with width of two
Expand Down
43 changes: 43 additions & 0 deletions maintainers/scripts/haskell/exclude.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env nix-shell
#! nix-shell -i nu -p nushell flock gnused -I nixpkgs=.

# This script will add all packages that match the following criteria to the exclusion list:
# - Is either marked directly or transitively broken.
# - Has not been updated on hackage in the last 5 years.
# - Is not listed in the Stackage snapshot.
# hackage2nix will not create expressions for excluded packages.

use std log

let broken_config = "pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml"
let transitive_broken_config = "pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml"
let stackage_config = "pkgs/development/haskell-modules/configuration-hackage2nix/stackage.yaml"
let excluded_config = "pkgs/development/haskell-modules/configuration-hackage2nix/excluded.json"

def main [] {
let broken = $broken_config | open | get broken-packages
let transitive_broken = $transitive_broken_config | open | get dont-distribute-packages
let stackage = $stackage_config | open | get default-package-overrides | parse "{name} {constraint}"

$broken ++ $transitive_broken
| where ($it not-in $stackage.name)
| par-each {|package|
try {
let updated = http get $"https://hackage.haskell.org/package/($package)/upload-time" | into datetime
if $updated < ("5 years ago" | date from-human) {
log info $"($package): last updated at ($updated)"
# This is not efficient at all, but will:
# - keep comments in broken.yaml
# - allow to cancel the script at any time without losing progress
^flock -x $broken_config -c $"sed -i -e '/^ - ($package) /d' ($broken_config)"
^flock -x $transitive_broken_config -c $"sed -i -e '/^ - ($package)$/d' ($transitive_broken_config)"
^flock -x $excluded_config -c $"sed -i -e '/"__insert-target-for-script__"/a\\ "($package)",' ($excluded_config)"
}
} catch {|err|
# "Network failure" happens for 404 responses, for example for versioned attributes like aeson_1_5_6_0
log warning $"($package): ($err.msg)"
}
}

^treefmt $excluded_config
}
3 changes: 2 additions & 1 deletion maintainers/scripts/haskell/regenerate-hackage-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ run_hackage2nix() {
--config "$config_dir/main.yaml" \
--config "$config_dir/stackage.yaml" \
--config "$config_dir/broken.yaml" \
--config "$config_dir/transitive-broken.yaml"
--config "$config_dir/transitive-broken.yaml" \
--config "$config_dir/excluded.json"
}

echo "Obtaining Hackage data …"
Expand Down
7 changes: 0 additions & 7 deletions pkgs/development/haskell-modules/configuration-arm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,13 @@ self: super:
autoapply = dontCheck super.autoapply;
construct = dontCheck super.construct;
exact-real = dontCheck super.exact-real;
flight-kml = dontCheck super.flight-kml;
focuslist = dontCheck super.focuslist;
grammatical-parsers = dontCheck super.grammatical-parsers;
greskell = dontCheck super.greskell;
groupBy = dontCheck super.groupBy;
haskell-time-range = dontCheck super.haskell-time-range;
headroom = dontCheck super.headroom;
hgeometry = dontCheck super.hgeometry;
hhp = dontCheck super.hhp;
hsakamai = dontCheck super.hsakamai;
hsemail-ns = dontCheck super.hsemail-ns;
html-validator-cli = dontCheck super.html-validator-cli;
hw-fingertree-strict = dontCheck super.hw-fingertree-strict;
Expand All @@ -86,17 +83,13 @@ self: super:
hw-xml = dontCheck super.hw-xml;
language-nix = dontCheck super.language-nix;
lens-regex = dontCheck super.lens-regex;
meep = dontCheck super.meep;
openapi3 = dontCheck super.openapi3;
orbits = dontCheck super.orbits;
ranged-list = dontCheck super.ranged-list;
rank2classes = dontCheck super.rank2classes;
schedule = dontCheck super.schedule;
static = dontCheck super.static;
strict-writer = dontCheck super.strict-writer;
termonad = dontCheck super.termonad;
trifecta = dontCheck super.trifecta;
twiml = dontCheck super.twiml;
twitter-conduit = dontCheck super.twitter-conduit;
validationt = dontCheck super.validationt;
vgrep = dontCheck super.vgrep;
Expand Down
Loading
Loading