aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2021-05-24 02:01:43 -0400
committertdro <tdro@users.noreply.github.com>2021-05-24 02:01:43 -0400
commit977aba7d462025b6fb3a06c1e40d17cac81062f7 (patch)
tree25b60cad4d8a87c68ecf893e6ef00ead4e136fe9
parent358cb9f7e872ae3aea22ea5f0ba3531c524c2cad (diff)
downloaddotfiles-977aba7d462025b6fb3a06c1e40d17cac81062f7.tar.gz
dotfiles-977aba7d462025b6fb3a06c1e40d17cac81062f7.tar.bz2
dotfiles-977aba7d462025b6fb3a06c1e40d17cac81062f7.zip
.config/nixpkgs: Bring back ruby
-rw-r--r--.config/nixpkgs/config.nix15
-rw-r--r--.config/nixpkgs/packages/rufo/default.nix33
-rw-r--r--.vimrc1
3 files changed, 46 insertions, 3 deletions
diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix
index 13e43aa..f2174b0 100644
--- a/.config/nixpkgs/config.nix
+++ b/.config/nixpkgs/config.nix
@@ -21,8 +21,8 @@ in
name = "woodpecker";
paths = [
Terminal Graphical Xorg Awesome Fonts Audio LaTeX
- Android JavaScript Python PHP Lua Elixir Html Shell Haskell
- Perl Nix C Golang Rust CSS SQL YAML
+ Android JavaScript Python PHP Lua Elixir HTML Shell Haskell
+ Perl Nix C Golang Rust CSS SQL YAML Ruby
];
};
@@ -371,7 +371,7 @@ in
paths = [ elixir_1_10 ];
};
- Html = pkgs.buildEnv {
+ HTML = pkgs.buildEnv {
name = "html";
paths = [
html-tidy
@@ -401,6 +401,15 @@ in
paths = [ nixos-generators nix-index nix-linter nixfmt nixpkgs-fmt nixpkgs-lint ];
};
+ Ruby = pkgs.buildEnv {
+ name = "ruby";
+ paths = [
+ (callPackage ./packages/rufo/default.nix {})
+ rubocop
+ ruby
+ ];
+ };
+
C = pkgs.buildEnv {
name = "c";
paths = [ astyle clang-tools gcc gdb gnumake meson ninja ];
diff --git a/.config/nixpkgs/packages/rufo/default.nix b/.config/nixpkgs/packages/rufo/default.nix
new file mode 100644
index 0000000..7d0a539
--- /dev/null
+++ b/.config/nixpkgs/packages/rufo/default.nix
@@ -0,0 +1,33 @@
+{ buildRubyGem, fetchgit, lib, ruby, git }:
+
+buildRubyGem rec {
+
+ inherit ruby;
+ gemName = "rufo";
+ name = "${gemName}-${version}";
+ version = "b3f3aedf759d792761ad52e6bddb9ed51ffc6731";
+
+ src = fetchgit {
+ rev = version;
+ url = "https://github.com/ruby-formatter/rufo.git";
+ sha256 = "1z87ivd8xpm3ggbcv3sjr4c0ws6733yfh8l6xg5f0km6ax7s8h1j";
+ };
+
+ buildInputs = [ git ruby ];
+
+ preBuild = ''
+ rm spec/fixtures/file_finder/only_gemfiles/a.gemspec
+ '';
+
+ preFixup = ''
+ cp exe/rufo $out/bin/rufo
+ cp -rT lib $out/lib
+ '';
+
+ meta = with lib; {
+ inherit version;
+ license = licenses.mit;
+ description = "The Ruby Formatter";
+ homepage = "https://github.com/ruby-formatter/rufo";
+ };
+}
diff --git a/.vimrc b/.vimrc
index 7f9b2a7..920f127 100644
--- a/.vimrc
+++ b/.vimrc
@@ -304,6 +304,7 @@ augroup AutoCommands
" Linting file type post write commands.
autocmd FileType css autocmd! BufWritePost <buffer> exe 'Notify(''prettier --write --parser css ' . expand('%') . ' 2>&1'')' | :e
+ autocmd FileType ruby autocmd! BufWritePost <buffer> exe 'Notify(''rufo ' . expand('%') . ' 2>&1 && rubocop ' . expand('%') . ' 2>&1'')' | :e
autocmd FileType rust autocmd! BufWritePost <buffer> exe 'Notify(''rustfmt ' . expand('%') . ' 2>&1 && printf "rustfmt OK: ' . expand('%') . '"'')' | :e
autocmd FileType json autocmd! BufWritePost <buffer> exe 'Notify(''jsonlint -i ' . expand('%') . ' 2>&1 && printf "JSON OK: ' . expand('%') . '"'')' | :e
autocmd FileType haskell autocmd! BufWritePost <buffer> exe 'Notify(''hlint ' . expand('%') . ' 2>&1 && brittany --write-mode inplace ' . expand('%') . ' 2>&1'')' | :e