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 = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
ruby-nix.url = "github:sagittaros/ruby-nix";
}; };
outputs = inputs@{ self, nixpkgs, ... }: outputs = inputs@{ self, nixpkgs, ... }:
let systems = inputs.flake-utils.lib.defaultSystems; let systems = inputs.flake-utils.lib.defaultSystems;
in inputs.flake-utils.lib.eachSystem systems (system: { in inputs.flake-utils.lib.eachSystem systems (system: {
devShells.default = devShells.default = let
import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; 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; with pkgs;
let let
gems = bundlerEnv { localGems = ruby-nix {
name = "hugo-website-gems"; name = "hugo-website-gems";
gemdir = ./.; gemset = ./gemset.nix;
}; };
in in
mkShell { mkShell {
packages = [ buildInputs = [
gems localGems.env
gems.wrappedRuby localGems.ruby
];
packages = [
git git
go go
hugo hugo