Skip to content

Commit 6484d7f

Browse files
authored
Merge pull request #4 from nikstur/update
treewide: update
2 parents f5ae7f8 + 4a82e82 commit 6484d7f

8 files changed

Lines changed: 114 additions & 215 deletions

File tree

.github/renovate.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:base",
4+
":dependencyDashboard",
5+
":semanticCommitsDisabled",
56
"group:all",
6-
"schedule:monthly"
7+
"schedule:monthly",
8+
":maintainLockFilesMonthly"
79
],
8-
"dependencyDashboard": false,
9-
"lockFileMaintenance": {
10-
"enabled": true
11-
},
1210
"nix": {
1311
"enabled": true
14-
}
12+
},
13+
"separateMajorMinor": false
1514
}

.github/workflows/ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: DeterminateSystems/nix-installer-action@v13
15-
with:
16-
diagnostic-endpoint: ""
17-
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
18-
- uses: DeterminateSystems/magic-nix-cache-action@v7
19-
with:
20-
diagnostic-endpoint: ""
13+
- uses: actions/checkout@v7
14+
- uses: samueldr/lix-gha-installer-action@v2026-06-15
2115
- run: nix flake check --log-format raw-with-logs -L
2216

2317
env:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ homepage = "https://github.com/nikstur/uapi-version"
88
repository = "https://github.com/nikstur/uapi-version"
99
readme = "README.md"
1010
license = "MIT"
11-
edition = "2021"
11+
edition = "2024"
1212

1313
[lints.rust]
1414
unsafe_code = "forbid"

flake.lock

Lines changed: 14 additions & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,93 +5,94 @@
55

66
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
77

8-
systems.url = "github:nix-systems/default";
9-
10-
flake-utils = {
11-
url = "github:numtide/flake-utils";
12-
inputs.systems.follows = "systems";
13-
};
14-
15-
flake-parts = {
16-
url = "github:hercules-ci/flake-parts";
17-
inputs.nixpkgs-lib.follows = "nixpkgs";
18-
};
19-
20-
pre-commit-hooks-nix = {
8+
pre-commit = {
219
url = "github:cachix/pre-commit-hooks.nix";
2210
inputs = {
2311
nixpkgs.follows = "nixpkgs";
24-
flake-utils.follows = "flake-utils";
2512
};
2613
};
2714

2815
};
2916

30-
outputs = inputs@{ self, flake-parts, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
31-
systems = import systems;
32-
33-
imports = [
34-
inputs.pre-commit-hooks-nix.flakeModule
35-
];
36-
37-
perSystem = { config, system, pkgs, lib, ... }:
38-
let
39-
uapiVersion = pkgs.callPackage ./nix/build.nix { };
40-
in
41-
{
42-
43-
packages = {
44-
# This is mostly here for development
45-
inherit uapiVersion;
46-
default = uapiVersion;
47-
};
48-
49-
checks = {
50-
clippy = uapiVersion.overrideAttrs (_: previousAttrs: {
51-
nativeCheckInputs = (previousAttrs.nativeCheckInputs or [ ]) ++ [ pkgs.clippy ];
52-
checkPhase = "cargo clippy";
53-
});
54-
rustfmt = uapiVersion.overrideAttrs (_: previousAttrs: {
55-
nativeCheckInputs = (previousAttrs.nativeCheckInputs or [ ]) ++ [ pkgs.rustfmt ];
56-
checkPhase = "cargo fmt --check";
57-
});
58-
};
59-
60-
pre-commit = {
61-
check.enable = true;
62-
63-
settings = {
17+
outputs =
18+
inputs@{
19+
self,
20+
nixpkgs,
21+
...
22+
}:
23+
let
24+
eachSystem = nixpkgs.lib.genAttrs [
25+
"aarch64-darwin"
26+
"aarch64-linux"
27+
"x86_64-darwin"
28+
"x86_64-linux"
29+
];
30+
in
31+
32+
{
33+
packages = eachSystem (system: {
34+
uapiVersion = nixpkgs.legacyPackages.${system}.callPackage ./nix/build.nix { };
35+
default = self.packages.${system}.uapiVersion;
36+
});
37+
38+
checks = eachSystem (
39+
system:
40+
let
41+
pkgs = nixpkgs.legacyPackages.${system};
42+
in
43+
{
44+
clippy = self.packages.${system}.uapiVersion.overrideAttrs (
45+
_: previousAttrs: {
46+
pname = "${previousAttrs.pname}-clippy";
47+
nativeCheckInputs = (previousAttrs.nativeCheckInputs or [ ]) ++ [ pkgs.clippy ];
48+
checkPhase = "cargo clippy";
49+
}
50+
);
51+
rustfmt = self.packages.${system}.uapiVersion.overrideAttrs (
52+
_: previousAttrs: {
53+
pname = "${previousAttrs.pname}-rustfmt";
54+
nativeCheckInputs = (previousAttrs.nativeCheckInputs or [ ]) ++ [ pkgs.rustfmt ];
55+
checkPhase = "cargo fmt --check";
56+
}
57+
);
58+
pre-commit = inputs.pre-commit.lib.${system}.run {
59+
src = ./.;
6460
hooks = {
65-
nixpkgs-fmt.enable = true;
66-
typos.enable = true;
67-
statix = {
68-
enable = true;
69-
settings.ignore = [ "sources.nix" ];
70-
};
61+
nixfmt.enable = true;
62+
deadnix.enable = true;
7163
};
7264
};
73-
};
74-
75-
devShells.default = pkgs.mkShell {
76-
shellHook = ''
77-
${config.pre-commit.installationScript}
78-
'';
79-
80-
packages = [
81-
pkgs.clippy
82-
pkgs.rustfmt
83-
pkgs.cargo-machete
84-
pkgs.cargo-edit
85-
pkgs.cargo-bloat
86-
pkgs.cargo-deny
87-
pkgs.cargo-cyclonedx
88-
];
89-
90-
inputsFrom = [ uapiVersion ];
91-
92-
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
93-
};
65+
}
66+
);
67+
68+
devShells = eachSystem (
69+
system:
70+
let
71+
pkgs = nixpkgs.legacyPackages.${system};
72+
in
73+
{
74+
default = pkgs.mkShell {
75+
shellHook = ''
76+
${self.checks.${system}.pre-commit.shellHook}
77+
'';
78+
79+
packages = [
80+
pkgs.nixfmt
81+
pkgs.clippy
82+
pkgs.rustfmt
83+
pkgs.cargo-machete
84+
pkgs.cargo-edit
85+
pkgs.cargo-bloat
86+
pkgs.cargo-deny
87+
pkgs.cargo-cyclonedx
88+
];
89+
90+
inputsFrom = [ self.packages.${system}.uapiVersion ];
91+
92+
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
93+
};
94+
}
95+
);
9496

95-
};
96-
};
97+
};
9798
}

0 commit comments

Comments
 (0)