diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4668525d..29fbe859 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,9 +1,15 @@ name: 👕 +# Keep lightweght to run on every events. +# See https://github.com/kachick/selfup/blob/c53aad349e3577295a68b1b78ee4cb0eddc4e2b9/README.md#L97-L103 for the motivation on: push: branches: [main] pull_request: workflow_dispatch: + schedule: + # Every 10:42 JST + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule + - cron: '42 1 * * *' jobs: dprint: @@ -39,3 +45,26 @@ jobs: token: ${{ github.token }} version: '0.20.0' # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["stylua", "--version"], "nth": 2} args: --check . + + # Don't use lycheeverse/lychee-action. There is no benefit rather than using the CLI for my use. And considering the targets should be simple with `git ls-files` rather than built-in glob + link-checker: + runs-on: ubuntu-24.04 + env: + CLI_VERSION: '0.18.0' # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["lychee", "--version"], "nth": 2} + steps: + - uses: actions/checkout@v4 + - name: Install + run: | + curl -OL 'https://github.com/lycheeverse/lychee/releases/download/lychee-v${{ env.CLI_VERSION }}/lychee-x86_64-unknown-linux-gnu.tar.gz' + tar zxvf lychee-x86_64-unknown-linux-gnu.tar.gz + mkdir --parents /home/runner/.lychee/bin + mv lychee /home/runner/.lychee/bin + echo '/home/runner/.lychee/bin' >> $GITHUB_PATH + - name: Run + env: + # Not GH_TOKEN for lychee. + # https://github.com/lycheeverse/lychee/blob/fc006bddc5a63067895799b83cbb9a4cbcabca6a/lychee-bin/src/options.rs#L459-L462 + GITHUB_TOKEN: ${{ github.token }} + # Don't use glob. It often ignores .gitignore (why?) + run: | + git ls-files '*.md' '*.nix' | xargs lychee -- diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..a398f3a9 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,8 @@ +# It returns 403 error agains lychee requests for each word +https://www.collinsdictionary.com/dictionary/ + +# False positve detection and hard to debug by https://github.com/lycheeverse/lychee/issues/1304 +user:password + +# reddit often rejects request from GitHub Actions +www.reddit.com/ diff --git a/cmd/lint/main.go b/cmd/lint/main.go index 64d351bf..c4edfaea 100644 --- a/cmd/lint/main.go +++ b/cmd/lint/main.go @@ -31,6 +31,7 @@ func main() { } if *allFlag { + // FIXME: Adding lychee here making Network error cmds = append(cmds, runner.Cmd{Path: "trivy", Args: []string{"config", "--exit-code", "1", "."}}) cmds = append(cmds, runner.Cmd{Path: "nix", Args: []string{"run", ".#check_nixf"}}) } diff --git a/config/firefox/README.md b/config/firefox/README.md index d4e00392..2180698a 100644 --- a/config/firefox/README.md +++ b/config/firefox/README.md @@ -7,7 +7,7 @@ 1. Modify config with `about:preferences` 1. Open `about:config` again -And helps to know the overview. +And helps to know the overview. ## How to change finder in page position from bottom to top? diff --git a/flake.nix b/flake.nix index f785b4c5..e129db12 100644 --- a/flake.nix +++ b/flake.nix @@ -134,6 +134,7 @@ trufflehog # https://github.com/NixOS/nixpkgs/pull/362139 dprint + lychee ]) ++ (with pkgs.my; [ nix-hash-url ]) ++ [ diff --git a/home-manager/README.md b/home-manager/README.md index 7fd4f9da..0ca65d27 100644 --- a/home-manager/README.md +++ b/home-manager/README.md @@ -11,7 +11,7 @@ nix-hash-url https://pkg.cloudflareclient.com/pool/noble/main/c/cloudflare-warp/ ## How to convert JSON to Nix? -See [this comment](https://gist.github.com/Scoder12/0538252ed4b82d65e59115075369d34d?permalink_comment_id=4999658#gistcomment-4999658) +See [this comment](https://gist.github.com/spencerpogo/0538252ed4b82d65e59115075369d34d?permalink_comment_id=4999658#gistcomment-4999658) ```bash nix-instantiate --eval -E 'builtins.fromJSON (builtins.readFile ./dprint.json)' | nixfmt diff --git a/nixos/hosts/moss/fingerprint.nix b/nixos/hosts/moss/fingerprint.nix index bd8219ae..2ab07d47 100644 --- a/nixos/hosts/moss/fingerprint.nix +++ b/nixos/hosts/moss/fingerprint.nix @@ -10,7 +10,7 @@ enable = true; # This select is a bit different of https://github.com/ramaureirac/thinkpad-e14-linux/blob/7539f51b1c29d116a549265f992032aa9642d4a5/tweaks/fingerprint/README.md#L19 # You should check actual vendor with `lsusb | grep FingerPrint` - # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix#L9 + # https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/by-name/li/libfprint-2-tod1-goodix-550a/package.nix driver = pkgs.libfprint-2-tod1-goodix-550a; }; diff --git a/windows/Multi-booting.md b/windows/Multi-booting.md index 2b00eb5e..9cb86314 100644 --- a/windows/Multi-booting.md +++ b/windows/Multi-booting.md @@ -7,8 +7,8 @@ Here is a note for me. Problems - - [Unstable Wifi](/../../issues/663) - - [Wrong timestamp on dmesg](/../../issues/664) + - [Unstable Wifi](https://github.com/kachick/dotfiles/issues/663) + - [Wrong timestamp on dmesg](https://github.com/kachick/dotfiles/issues/664) Solutions diff --git a/windows/Podman.md b/windows/Podman.md index 776f32d7..62af73b2 100644 --- a/windows/Podman.md +++ b/windows/Podman.md @@ -8,35 +8,6 @@ See sudo mount --make-rshared / ``` -## How to install - -Use one of following. - -- Directly Install podman into the debian family # Now using. The whole steps are written in [README](../README.md) and [WSL](WSL/README.md) -- [Install podman-desktop](./Podman-Remote.md), it easy to install but requires annoy setups with another WSL instance. # Old way, Written in this file - -It needs special WSL distribution. How to run it from standard WSL ubuntu is written in [this document](https://podman-desktop.io/docs/podman/accessing-podman-from-another-wsl-instance).\ -Make sure you are using podman binary as podman-remote, nixpkgs product does not satisfy.\ -This repository aliases podman command to mise installed binary. - -This is an worked example - -```bash -# WSL - Ubuntu - -podman system connection add --default podman-machine-default-user unix:///mnt/wsl/podman-sockets/podman-machine-default/podman-user.sock - -# Since Ubuntu 24.04, you may need to update the usergroup of socket file -sudo chgrp "$(whoami)" /mnt/wsl/podman-sockets/podman-machine-default/podman-user.sock - -# See wsl.nix for detail -# TODO: Update cmd/wsl-init -sudo systemctl enable ~/.config/systemd/user/mnt-wsl-instances-ubuntu24.mount --now - -cdrepo irb-power_assert -podman run --volume /mnt/wsl/instances/ubuntu24/"$(pwd)":/workdir --workdir /workdir -it ghcr.io/ruby/ruby:master-dev-jammy-amd64-da66abc584a9a33693d1b5bbf70881a008b0935d -``` - ## After updating podman from 4.x -> 5.0.0, cannot do any operation even if the setup VM ```plaintext @@ -67,7 +38,7 @@ Track the [official discussion](https://github.com/containers/podman/discussions This repository provides a mount based solution, mount from another instance as /mnt/wsl/..., then podman-machine also can access there. 1. Ubuntu: Activate the home-manager with `--flake '.#kachick@wsl-ubuntu'`. -2. Look the [definitions](../../home-manager/wsl.nix), it includes how to mount with systemd. +2. Look the [definitions](../home-manager/wsl.nix), it includes how to mount with systemd. 3. podman-machine: Make sure podman-machine can read there `ls /mnt/wsl/instances/ubuntu24/home` 4. Ubuntu: `cdrepo project_path` 5. Ubuntu: `podman run -v /mnt/wsl/instances/ubuntu24/"$(pwd)":/workdir -it ghcr.io/ruby/ruby:master-dev-76732b3e7b42d23290cd96cd695b2373172c8a43-jammy`