project: use ruby-nix

This commit is contained in:
Gabriel Arazas 2023-04-08 22:32:26 +08:00
parent 4650f41d1b
commit 100cb299cc
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 16 additions and 8 deletions

View File

@ -4,12 +4,18 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
ruby-nix.url = "github:sagittaros/ruby-nix";
};
outputs = inputs@{ self, nixpkgs, ... }:
let systems = inputs.flake-utils.lib.defaultSystems;
in inputs.flake-utils.lib.eachSystem systems (system: {
devShells.default =
import ./shell.nix { pkgs = import nixpkgs { inherit system; }; };
devShells.default = let
pkgs = import nixpkgs { inherit system; };
in
import ./shell.nix {
inherit pkgs;
ruby-nix = inputs.ruby-nix.lib pkgs;
};
});
}

View File

@ -1,18 +1,20 @@
{ pkgs ? import <nixpkgs> { } }:
{ pkgs ? import <nixpkgs> { }, ruby-nix }:
with pkgs;
let
gems = bundlerEnv {
localGems = ruby-nix {
name = "hugo-website-gems";
gemdir = ./.;
gemset = ./gemset.nix;
};
in
mkShell {
packages = [
gems
gems.wrappedRuby
buildInputs = [
localGems.env
localGems.ruby
];
packages = [
git
go
hugo