diff --git a/flake.nix b/flake.nix index d6f0af0..faaab14 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = nixpkgs.legacyPackages.${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;