diff --git a/.envrc b/.envrc index e52db4a..197c0d5 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,3 @@ #!/bin/bash -nix_direnv_watch_file .ruby-version use flake diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index ac50464..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "dependencyDashboard": true, - "labels": ["dependencies", "renovate"], - "enabledManagers": ["nix", "ruby-version"], - "nix": { - "enabled": true - } -} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c09cb9f..3ccb07b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,16 +14,14 @@ jobs: - uses: actions/checkout@v4 - uses: dprint/check@v2.2 with: - # Keep same version as used in *.nix - dprint-version: '0.40.0' + dprint-version: '0.40.0' # selfup { "regex": "\\d[^']+", "script": "dprint --version | cut -d ' ' -f 2" } typos: timeout-minutes: 15 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # Keep same version as used in *.nix - - uses: crate-ci/typos@v1.16.4 + - uses: crate-ci/typos@v1.16.4 # selfup { "regex": "\\d\\.\\d+\\.\\d+", "script": "typos --version | cut -d ' ' -f 2" } with: files: | . diff --git a/.github/workflows/update-nixpkgs-and-versions-in-ci.yml b/.github/workflows/update-nixpkgs-and-versions-in-ci.yml new file mode 100644 index 0000000..c706d0a --- /dev/null +++ b/.github/workflows/update-nixpkgs-and-versions-in-ci.yml @@ -0,0 +1,23 @@ +name: Update nixpkgs and CI dependencies +on: + pull_request: + paths: + - '.github/workflows/update-nixpkgs-and-versions-in-ci.yml' + schedule: + # Every Monday 10:17 JST + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule + - cron: '17 1 * * 1' + workflow_dispatch: + +jobs: + update-nixpkgs: + uses: kachick/anylang-template/.github/workflows/reusable-update-nixpkgs-and-versions-in-ci.yml@2413fce002263e6675ce084da251be0dbbe2a8fc + if: (github.event.sender.login == 'kachick') || (github.event_name != 'pull_request') + with: + dry-run: ${{ github.event_name == 'pull_request' }} + optional-run: | + ruby -e 'puts RUBY_VERSION' > .ruby-version + git diff-index --quiet HEAD || git commit -m 'Update .ruby-version' .ruby-version + secrets: + APP_ID: ${{ secrets.APP_ID }} + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} diff --git a/flake.lock b/flake.lock index b3858c4..369140c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -34,21 +18,6 @@ "type": "github" } }, - "flake-utils_2": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1691899779, @@ -65,33 +34,10 @@ "type": "github" } }, - "nixpkgs-ruby": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1689399615, - "narHash": "sha256-7Fn99K+dgkip3RtXx4S2btOuSnu+PRtQ+oEI0MFYNXA=", - "owner": "bobvanderlinden", - "repo": "nixpkgs-ruby", - "rev": "9bdc21ccaeae6fdacd48eafa4c5cd520b90c07b7", - "type": "github" - }, - "original": { - "owner": "bobvanderlinden", - "repo": "nixpkgs-ruby", - "type": "github" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "nixpkgs-ruby": "nixpkgs-ruby" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index 9d3a502..69fa8aa 100644 --- a/flake.nix +++ b/flake.nix @@ -6,19 +6,13 @@ # 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"; - nixpkgs-ruby.url = "github:bobvanderlinden/nixpkgs-ruby"; - nixpkgs-ruby.inputs.nixpkgs.follows = "nixpkgs"; 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 { devShells.default = with pkgs; @@ -28,7 +22,7 @@ # https://github.com/kachick/dotfiles/pull/228 bashInteractive - ruby + ruby_3_2 # Required to build psych via irb dependency # https://github.com/kachick/irb-power_assert/issues/116 # https://github.com/ruby/irb/pull/648