Skip to content

Commit

Permalink
nix: Switch formatter from nixpkgs-fmt to nixfmt
Browse files Browse the repository at this point in the history
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
  • Loading branch information
antoineco committed Sep 6, 2024
1 parent c89f23c commit 1ca1b65
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,44 @@

inputs.flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/0.1.*.tar.gz";

outputs = { self, nixpkgs, ruby-nix, bundix, flake-schemas }:
outputs =
{
self,
nixpkgs,
ruby-nix,
bundix,
flake-schemas,
}:
let
allSystems = [
"x86_64-linux"
"aarch64-darwin"
];

forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
# Current 'ruby' package version: 3.3.4
# Should match https://github.com/actions/jekyll-build-pages/blob/v1.0.13/Dockerfile
pkgs = import nixpkgs { inherit system; };
});
forAllSystems =
f:
nixpkgs.lib.genAttrs allSystems (
system:
f {
# Current 'ruby' package version: 3.3.4
# Should match https://github.com/actions/jekyll-build-pages/blob/v1.0.13/Dockerfile
pkgs = import nixpkgs { inherit system; };
}
);
in
{
inherit (flake-schemas) schemas;

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

devShells = forAllSystems ({ pkgs }:
devShells = forAllSystems (
{ pkgs }:
let
ruby-env = (ruby-nix.lib pkgs {
name = "github-pages";
gemset = ./gemset.nix;
}).env;
ruby-env =
(ruby-nix.lib pkgs {
name = "github-pages";
gemset = ./gemset.nix;
}).env;

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

Expand Down

0 comments on commit 1ca1b65

Please sign in to comment.