Skip to content

Commit

Permalink
Add GitHub action for checking formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stusmall committed Feb 26, 2024
1 parent cab3c45 commit 9f88bfa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
format:
name: Check formatting
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Check project formatting
run: nix-shell -p nixpkgs-fmt --command "nixpkgs-fmt --check ."
50 changes: 25 additions & 25 deletions modules/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
rustup
];

services.opensnitch.rules = {
rule-500-cargo = {
name = "Allow cargo to reach crates.io";
enabled = true;
action = "allow";
duration = "always";
operator = {
type = "list";
operand = "list";
list = [
{
type = "regex";
sensitive = false;
operand = "process.path";
data = "^/home/stusmall/.rustup/toolchains/*/bin/cargo$";
}
{
type = "regexp";
operand = "dest.host";
sensitive = false;
data = "^(([a-z0-9|-]+\.)*crates\.io)$";
}
];
};
};
services.opensnitch.rules = {
rule-500-cargo = {
name = "Allow cargo to reach crates.io";
enabled = true;
action = "allow";
duration = "always";
operator = {
type = "list";
operand = "list";
list = [
{
type = "regex";
sensitive = false;
operand = "process.path";
data = "^/home/stusmall/.rustup/toolchains/*/bin/cargo$";
}
{
type = "regexp";
operand = "dest.host";
sensitive = false;
data = "^(([a-z0-9|-]+\.)*crates\.io)$";
}
];
};
};
};
}

0 comments on commit 9f88bfa

Please sign in to comment.