Skip to content

Commit

Permalink
Merge pull request #415 from kachick/bump-nixpkgs
Browse files Browse the repository at this point in the history
Bump dependencies with new nixpath
  • Loading branch information
kachick authored Sep 1, 2023
2 parents 95e7305 + f280ba2 commit cd912bf
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 140 deletions.
1 change: 0 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

nix_direnv_watch_file .ruby-version
use flake
File renamed without changes.
6 changes: 1 addition & 5 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ on:
- '.github/workflows/ci-nix.yml'
- '**.nix'
- 'flake.*'
- '.ruby-version'
- 'dprint.json'
pull_request:
paths:
- '.github/workflows/ci-nix.yml'
- '**.nix'
- 'flake.*'
- '.ruby-version'
- 'dprint.json'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
Expand All @@ -34,7 +30,7 @@ jobs:
- run: nix run .#console
- run: nix develop --command bundle install
- name: Log current versions
run: nix develop --command bundle exec rake inspect_dependencies
run: nix develop --command bundle exec rake deps
- name: Test with external dependencies
run: nix develop --command bundle exec rake check_non_ruby
- name: Test with Ruby
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ jobs:
- uses: actions/checkout@v3
- uses: dprint/check@v2.2
with:
# Keep same version as *.nix
dprint-version: '0.36.1'
# Keep same version as used in *.nix
dprint-version: '0.40.2'

typos:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Keep same version as *.nix
- uses: crate-ci/typos@v1.14.10
# Keep same version as used in *.nix
- uses: crate-ci/typos@v1.16.8
with:
# https://github.com/crate-ci/typos/issues/779
files: |
.
.github
.vscode
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"editorconfig.editorconfig",
"github.vscode-github-actions",
"tekumara.typos-vscode",
"koichisasada.vscode-rdbg",
"soutaro.steep-vscode",
"soutaro.rbs-syntax",
"dprint.dprint",
Expand Down
30 changes: 0 additions & 30 deletions .vscode/launch.json

This file was deleted.

4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ task(:update) do
end

desc 'Print dependencies'
task :inspect_dependencies do
task :deps do
sh('ruby --version')
sh('dprint --version')
sh('tree --version')
Expand All @@ -141,7 +141,7 @@ end
desc 'Tests except ruby'
task :check_non_ruby do
Rake::Task['dprint'].invoke
sh('typos')
sh('typos . .github .vscode')
sh('actionlint')
sh('nixpkgs-fmt --check ./*.nix')
end
3 changes: 0 additions & 3 deletions _typos.toml

This file was deleted.

5 changes: 2 additions & 3 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"printWidth": 120,
"singleQuote": true
},
"includes": ["**/*.{json,md,yml,html,css}"],
"excludes": [
".git",
"**/*lock.json",
Expand All @@ -18,7 +17,7 @@
],
"plugins": [
"https://plugins.dprint.dev/json-0.17.4.wasm",
"https://plugins.dprint.dev/markdown-0.15.3.wasm",
"https://plugins.dprint.dev/prettier-0.26.6.json@0118376786f37496e41bb19dbcfd1e7214e2dc859a55035c5e54d1107b4c9c57"
"https://plugins.dprint.dev/markdown-0.16.0.wasm",
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe"
]
}
88 changes: 8 additions & 80 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 13 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-ruby.url = "github:bobvanderlinden/nixpkgs-ruby";
nixpkgs-ruby.inputs.nixpkgs.follows = "nixpkgs";
# Candidate channels
# - https://github.com/kachick/anylang-template/issues/17
# - https://discourse.nixos.org/t/differences-between-nix-channels/13998
# How to update the revision
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, nixpkgs-ruby, flake-utils }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ruby = nixpkgs-ruby.lib.packageFromRubyVersionFile {
file = ./.ruby-version;
inherit system;
};
in
rec {
devShells.default = with pkgs;
mkShell {
buildInputs = [
ruby
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
bashInteractive

ruby_3_2
dprint
tree
nil
Expand All @@ -42,10 +44,10 @@
cp -rf ./lib $out
install -t $out/bin bin/pure-console.rb
makeWrapper $out/bin/pure-console.rb $out/bin/console \
--prefix PATH : ${nixpkgs.lib.makeBinPath [ ruby ]}
--prefix PATH : ${nixpkgs.lib.makeBinPath [ pkgs.ruby ]}
'';
runtimeDependencies = [
ruby
pkgs.ruby
];
};

Expand Down

0 comments on commit cd912bf

Please sign in to comment.