diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml new file mode 100644 index 0000000..bdc0559 --- /dev/null +++ b/.github/workflows/quality.yaml @@ -0,0 +1,53 @@ +name: quality + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + nix: ${{ steps.changes.outputs.nix }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + nix: + - '**/*.nix' + - 'flake.lock' + - 'flake.nix' + + nix-format: + name: Nix Format Check + runs-on: ubuntu-latest + needs: changes + if: ${{ needs.changes.outputs.nix == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - run: nix fmt -- --ci + + deadnix: + name: Deadnix Check + runs-on: ubuntu-latest + needs: changes + if: ${{ needs.changes.outputs.nix == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - run: nix develop --command deadnix --fail . + + statix: + name: Statix Check + runs-on: ubuntu-latest + needs: changes + if: ${{ needs.changes.outputs.nix == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v31 + - run: nix develop --command statix check . diff --git a/.gitignore b/.gitignore index aeb5ac3..c9407c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ result .direnv/ +.envrc fonts/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d2ce5dc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: local + hooks: + - id: nixfmt + name: nixfmt + entry: nix fmt -- --fail-on-change + language: system + files: \.nix$ + pass_filenames: false diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index 58576cc..46b5c2b 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -54,6 +54,7 @@ unbind ?; bind ? if -F '#{pane_in_mode}' { send-keys -X cancel } { copy-mode ; c bind -T copy-mode-vi v send-keys -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' +# TODO: breaks all the time bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' bind -n TripleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection diff --git a/flake.nix b/flake.nix index f685c78..08cf7bb 100644 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,19 @@ { formatter.x86_64-linux = (mkPkgs "x86_64-linux" [ ]).nixfmt-tree; + devShells.x86_64-linux.default = + let + pkgs = mkPkgs "x86_64-linux" [ ]; + in + pkgs.mkShell { + packages = [ + pkgs.deadnix + pkgs.statix + pkgs.nixfmt + pkgs.pre-commit + ]; + }; + nixosConfigurations.xps15 = nixpkgs.lib.nixosSystem { modules = [ nixos-hardware.nixosModules.dell-xps-15-9500-nvidia diff --git a/home/modules/ui.nix b/home/modules/ui.nix index bab1975..1f3e437 100644 --- a/home/modules/ui.nix +++ b/home/modules/ui.nix @@ -171,7 +171,7 @@ in interval = 1; signal = 1; on-click = "ctl audio sink"; - on-click-right = "pgrep -f 'waybar.*slider' && pkill -f 'waybar.*slider' || (waybar -c ${config.xdg.configHome}/waybar/slider.json &)"; + on-click-right = "pgrep -f 'waybar.*slider' && pkill -f 'waybar.*slider' || hyprctl dispatch exec 'waybar -c ${config.xdg.configHome}/waybar/slider.json'"; on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; pkill -RTMIN+1 waybar"; on-scroll-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1.0; pkill -RTMIN+1 waybar"; on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; pkill -RTMIN+1 waybar";