-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config(pre-commit/nix): Switch to nixfmt-rfc-style for *.nix files
Nix RFC 166 [1] has been officially accepted and `nixfmt-rfc-style` [2] is the official formatter implementation conforming to the rules agreed upon in the RFC. This commit configures the the Devenv `pre-commit` [3] options to replace our previous formatter `alejandra` [4] with `nixfmt-rfc-style` [2].
- Loading branch information
1 parent
30b16fa
commit 68e732c
Showing
31 changed files
with
1,414 additions
and
1,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nix/store/m71jg4b72kwxj1n9knbdjvlvm67xawra-pre-commit-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
let | ||
currentFlake = builtins.fromJSON (builtins.readFile ../flake.lock); | ||
inherit (currentFlake.nodes.nixos-2311.locked) owner repo rev narHash; | ||
inherit (currentFlake.nodes.nixos-2311.locked) | ||
owner | ||
repo | ||
rev | ||
narHash | ||
; | ||
nixpkgs = builtins.fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; | ||
sha256 = narHash; | ||
}; | ||
flake = import ../flake.nix; | ||
in { | ||
in | ||
{ | ||
inherit currentFlake flake; | ||
lib = (import nixpkgs {system = "x86_64-linux";}).lib; | ||
lib = (import nixpkgs { system = "x86_64-linux"; }).lib; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
lib: { | ||
shardAttrs = attrs: shardSize: let | ||
attrNames = builtins.attrNames attrs; | ||
shardCount = builtins.ceil ((0.0 + (builtins.length attrNames)) / shardSize); | ||
attrNameShards = lib.pipe (lib.range 0 (shardCount - 1)) [ | ||
(builtins.map (i: lib.sublist (i * shardSize) shardSize attrNames)) | ||
]; | ||
shards = lib.pipe attrNameShards [ | ||
(lib.imap0 (i: shard: { | ||
name = builtins.toString i; | ||
value = lib.genAttrs shard (key: attrs.${key}); | ||
})) | ||
lib.listToAttrs | ||
]; | ||
in | ||
shardAttrs = | ||
attrs: shardSize: | ||
let | ||
attrNames = builtins.attrNames attrs; | ||
shardCount = builtins.ceil ((0.0 + (builtins.length attrNames)) / shardSize); | ||
attrNameShards = lib.pipe (lib.range 0 (shardCount - 1)) [ | ||
(builtins.map (i: lib.sublist (i * shardSize) shardSize attrNames)) | ||
]; | ||
shards = lib.pipe attrNameShards [ | ||
(lib.imap0 ( | ||
i: shard: { | ||
name = builtins.toString i; | ||
value = lib.genAttrs shard (key: attrs.${key}); | ||
} | ||
)) | ||
lib.listToAttrs | ||
]; | ||
in | ||
shards; | ||
} |
Oops, something went wrong.