File tree Expand file tree Collapse file tree 5 files changed +91
-3
lines changed
by-name/ni/nixfmt-classic
development/haskell-modules Expand file tree Collapse file tree 5 files changed +91
-3
lines changed Original file line number Diff line number Diff line change
1
+ # This file has been autogenerate with cabal2nix.
2
+ # Update via ./update.sh
3
+ {
4
+ mkDerivation ,
5
+ base ,
6
+ cmdargs ,
7
+ directory ,
8
+ fetchgit ,
9
+ filepath ,
10
+ lib ,
11
+ megaparsec ,
12
+ parser-combinators ,
13
+ safe-exceptions ,
14
+ scientific ,
15
+ text ,
16
+ unix ,
17
+ } :
18
+ mkDerivation {
19
+ pname = "nixfmt" ;
20
+ version = "0.6.0" ;
21
+ src = fetchgit {
22
+ url = "https://github.com/NixOS/nixfmt.git" ;
23
+ sha256 = "0yh1baanifnv5fl3d7ixkgaki7ka1big0kxkiv4h5rik6zkqfyqz" ;
24
+ rev = "7e9e06eefed52d6d698b828ee83b83ea5c163f3b" ;
25
+ fetchSubmodules = true ;
26
+ } ;
27
+ isLibrary = true ;
28
+ isExecutable = true ;
29
+ libraryHaskellDepends = [
30
+ base
31
+ megaparsec
32
+ parser-combinators
33
+ scientific
34
+ text
35
+ ] ;
36
+ executableHaskellDepends = [
37
+ base
38
+ cmdargs
39
+ directory
40
+ filepath
41
+ safe-exceptions
42
+ text
43
+ unix
44
+ ] ;
45
+ jailbreak = true ;
46
+ homepage = "https://github.com/serokell/nixfmt" ;
47
+ description = "An opinionated formatter for Nix" ;
48
+ license = lib . licenses . mpl20 ;
49
+ mainProgram = "nixfmt" ;
50
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ haskell ,
3
+ haskellPackages ,
4
+ lib ,
5
+ } :
6
+ let
7
+ inherit ( haskell . lib . compose ) overrideCabal justStaticExecutables ;
8
+
9
+ overrides . passthru . updateScript = ./update.sh ;
10
+ raw-pkg = haskellPackages . callPackage ./generated-package.nix { } ;
11
+ in
12
+ lib . pipe raw-pkg [
13
+ ( overrideCabal overrides )
14
+ justStaticExecutables
15
+ ]
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env nix-shell
2
+ #! nix-shell -i bash -p cabal2nix curl jq
3
+ #
4
+ # This script will update the nixfmt-classic derivation to the latest version using
5
+ # cabal2nix.
6
+
7
+ set -eo pipefail
8
+
9
+ # This is the directory of this update.sh script.
10
+ script_dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
11
+ derivation_file=" ${script_dir} /generated-package.nix"
12
+ latest_version=" $( curl --silent ' https://api.github.com/repos/NixOS/nixfmt/releases/latest' | jq --raw-output ' .tag_name' ) "
13
+
14
+ echo " Updating nixfmt-classic to version $new_date ."
15
+ echo " Running cabal2nix and outputting to ${derivation_file} ..."
16
+
17
+ cat > " $derivation_file " << EOF
18
+ # This file has been autogenerate with cabal2nix.
19
+ # Update via ./update.sh
20
+ EOF
21
+
22
+ cabal2nix ' https://github.com/NixOS/nixfmt.git' --revision " ${latest_version} " --jailbreak >> " ${derivation_file} "
23
+ nixfmt " ${derivation_file} "
24
+
25
+ echo " Finished."
Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ self: super: {
435
435
postPatch = "sed -i s/home/tmp/ test/Spec.hs" ;
436
436
} ) super . shell-conduit ;
437
437
438
- # https://github.com/serokell /nixfmt/issues/130
438
+ # https://github.com/NixOS /nixfmt/issues/130
439
439
nixfmt = doJailbreak super . nixfmt ;
440
440
441
441
# Too strict upper bounds on turtle and text
Original file line number Diff line number Diff line change @@ -18497,8 +18497,6 @@ with pkgs;
18497
18497
inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration IOKit;
18498
18498
};
18499
18499
18500
- nixfmt-classic = haskellPackages.nixfmt.bin;
18501
-
18502
18500
nixpkgs-manual = callPackage ../../doc/doc-support/package.nix { };
18503
18501
18504
18502
nixos-artwork = callPackage ../data/misc/nixos-artwork { };
You can’t perform that action at this time.
0 commit comments