diff --git a/templates/local-ruby-nix/flake.nix b/templates/local-ruby-nix/flake.nix index baad1bbe..a9fe10ad 100644 --- a/templates/local-ruby-nix/flake.nix +++ b/templates/local-ruby-nix/flake.nix @@ -5,8 +5,11 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; - ruby-nix.url = "github:sagittaros/ruby-nix"; + ruby-nix.url = "github: inscapist/ruby-nix"; ruby-nix.inputs.nixpkgs.follows = "nixpkgs"; + + ruby-nix-bundix.url = "github:inscapist/bundix"; + ruby-nix-bundix.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs@{ self, ruby-nix, nixpkgs, ... }: @@ -14,10 +17,24 @@ in inputs.flake-utils.lib.eachSystem systems (system: let pkgs = import nixpkgs { inherit system; }; + gems = ruby-nix.lib pkgs { + name = "ruby-nix-env"; + ruby = pkgs.ruby_3_1; + gemset = ./gemset.nix; + }; in { devShells.default = - import ./shell.nix { inherit pkgs ruby-nix; }; + import ./shell.nix { + inherit pkgs; + extraBuildInputs = [ + gems.env + gems.ruby + ]; + extraPackages = [ + inputs.ruby-nix-bundix.packages."${system}".default + ]; + }; formatter = pkgs.treefmt; }); diff --git a/templates/local-ruby-nix/shell.nix b/templates/local-ruby-nix/shell.nix index e91f593a..998460f1 100644 --- a/templates/local-ruby-nix/shell.nix +++ b/templates/local-ruby-nix/shell.nix @@ -1,19 +1,12 @@ -{ pkgs ? import { }, ruby-nix }: +{ pkgs ? import { } +, extraBuildInputs ? [ ] +, extraPackages ? [ ] +}: with pkgs; -let - gems = ruby-nix.lib pkgs { - name = "ruby-nix-env"; - ruby = ruby_3_1; - gemset = ./gemset.nix; - }; -in mkShell { - buildInputs = [ - gems.env - gems.ruby - ]; + buildInputs = extraBuildInputs; packages = [ # Formatters @@ -21,5 +14,5 @@ mkShell { # Language servers rnix-lsp - ]; + ] ++ extraPackages; }