mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
templates/local-ruby-nix: init
This commit is contained in:
parent
3fc2d6dbc3
commit
cae874e52f
@ -460,6 +460,10 @@
|
||||
path = ./templates/sample-nixos-template;
|
||||
description = "Simple sample Nix flake with NixOS and home-manager";
|
||||
};
|
||||
local-ruby-nix = {
|
||||
path = ./templates/local-ruby-nix;
|
||||
description = "Local Ruby app development with ruby-nix";
|
||||
};
|
||||
};
|
||||
|
||||
# No amount of formatters will make this codebase nicer but it sure does
|
||||
|
12
templates/local-ruby-nix/Gemfile
Normal file
12
templates/local-ruby-nix/Gemfile
Normal file
@ -0,0 +1,12 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gemspec
|
||||
|
||||
group :development do
|
||||
gem 'rake'
|
||||
gem 'ruby-lsp', require: false
|
||||
end
|
||||
|
||||
group :lint do
|
||||
gem 'rubocop', require: false
|
||||
end
|
24
templates/local-ruby-nix/flake.nix
Normal file
24
templates/local-ruby-nix/flake.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
description = "Basic flake template for setting up development shells";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
ruby-nix.url = "github:sagittaros/ruby-nix";
|
||||
ruby-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, ruby-nix, nixpkgs, ... }:
|
||||
let systems = inputs.flake-utils.lib.defaultSystems;
|
||||
in inputs.flake-utils.lib.eachSystem systems (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
devShells.default =
|
||||
import ./shell.nix { inherit pkgs ruby-nix; };
|
||||
|
||||
formatter = pkgs.treefmt;
|
||||
});
|
||||
}
|
25
templates/local-ruby-nix/shell.nix
Normal file
25
templates/local-ruby-nix/shell.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{ pkgs ? import <nixpkgs> { }, ruby-nix }:
|
||||
|
||||
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
|
||||
];
|
||||
|
||||
packages = [
|
||||
# Formatters
|
||||
nixpkgs-fmt
|
||||
|
||||
# Language servers
|
||||
rnix-lsp
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue
Block a user