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 5870f32 commit 3a6e6bb
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
{
description = "GitHub Pages";

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

inputs.ruby-nix = {
url = "github:inscapist/ruby-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
ruby-nix = {
url = "github:inscapist/ruby-nix";
inputs.nixpkgs.follows = "nixpkgs";
};

inputs.bundix = {
url = "github:inscapist/bundix/main";
inputs.nixpkgs.follows = "nixpkgs";
};
bundix = {
url = "github:inscapist/bundix/main";
inputs.nixpkgs.follows = "nixpkgs";
};

inputs.flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/0.1.*.tar.gz";
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 3a6e6bb

Please sign in to comment.