Skip to content

Commit ab625c3

Browse files
committed
nix: Switch formatter from nixpkgs-fmt to nixfmt
nixpkgs-fmt was archived[1] in favour of nixfmt[2], which implements the Nix RFC 166[3]. See NixOS/nixfmt#153 for further details about the progress of the implementation. [1]: https://x.com/zimbatm/status/1816148339131343058 [2]: https://github.com/NixOS/nixfmt?tab=readme-ov-file#readme [3]: https://github.com/nix-rfc-101/rfcs/blob/aaf1613f/rfcs/0166-nix-formatting.md
1 parent c89f23c commit ab625c3

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

flake.nix

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,60 @@
11
{
22
description = "GitHub Pages";
33

4-
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; # nixos-unstable
4+
inputs = {
5+
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; # nixos-unstable
56

6-
inputs.ruby-nix = {
7-
url = "github:inscapist/ruby-nix";
8-
inputs.nixpkgs.follows = "nixpkgs";
9-
};
7+
ruby-nix = {
8+
url = "github:inscapist/ruby-nix";
9+
inputs.nixpkgs.follows = "nixpkgs";
10+
};
1011

11-
inputs.bundix = {
12-
url = "github:inscapist/bundix/main";
13-
inputs.nixpkgs.follows = "nixpkgs";
14-
};
12+
bundix = {
13+
url = "github:inscapist/bundix/main";
14+
inputs.nixpkgs.follows = "nixpkgs";
15+
};
1516

16-
inputs.flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/0.1.*.tar.gz";
17+
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/0.1.*.tar.gz";
18+
};
1719

18-
outputs = { self, nixpkgs, ruby-nix, bundix, flake-schemas }:
20+
outputs =
21+
{
22+
self,
23+
nixpkgs,
24+
ruby-nix,
25+
bundix,
26+
flake-schemas,
27+
}:
1928
let
2029
allSystems = [
2130
"x86_64-linux"
2231
"aarch64-darwin"
2332
];
2433

25-
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
26-
# Current 'ruby' package version: 3.3.4
27-
# Should match https://github.com/actions/jekyll-build-pages/blob/v1.0.13/Dockerfile
28-
pkgs = import nixpkgs { inherit system; };
29-
});
34+
forAllSystems =
35+
f:
36+
nixpkgs.lib.genAttrs allSystems (
37+
system:
38+
f {
39+
# Current 'ruby' package version: 3.3.4
40+
# Should match https://github.com/actions/jekyll-build-pages/blob/v1.0.13/Dockerfile
41+
pkgs = import nixpkgs { inherit system; };
42+
}
43+
);
3044
in
3145
{
3246
inherit (flake-schemas) schemas;
3347

34-
formatter = forAllSystems ({ pkgs }: pkgs.nixpkgs-fmt);
48+
formatter = forAllSystems ({ pkgs }: pkgs.nixfmt-rfc-style);
3549

36-
devShells = forAllSystems ({ pkgs }:
50+
devShells = forAllSystems (
51+
{ pkgs }:
3752
let
38-
ruby-env = (ruby-nix.lib pkgs {
39-
name = "github-pages";
40-
gemset = ./gemset.nix;
41-
}).env;
53+
ruby-env =
54+
(ruby-nix.lib pkgs {
55+
name = "github-pages";
56+
gemset = ./gemset.nix;
57+
}).env;
4258

4359
bundix-cli = bundix.packages.${pkgs.system}.default;
4460

0 commit comments

Comments
 (0)