File tree Expand file tree Collapse file tree 8 files changed +94
-92
lines changed Expand file tree Collapse file tree 8 files changed +94
-92
lines changed Original file line number Diff line number Diff line change 1+ # This file contains commits that should be ignored by git blame
2+ # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-file
3+ # and https://github.com/NixOS/nixpkgs/blob/master/.git-blame-ignore-revs for more info
4+
5+ # To enable this in your local repository, run:
6+ # git config blame.ignoreRevsFile .git-blame-ignore-revs
7+
8+ # For rebasing PRs, commits marked with !autorebase will be automatically
9+ # reapplied by the auto-rebase script
10+
11+ # nixfmt-rfc-style formatting
12+ 51e51e601448705c0d2f92ef90ec7b680123077c # !autorebase cd tests && nix fmt ..
Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - master
7+ merge_group :
78jobs :
9+ nixfmt :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ - uses : cachix/install-nix-action@v31
14+ - run : cd tests && nix fmt .. -- --fail-on-change
815 tests :
16+ needs : nixfmt
917 runs-on : ubuntu-latest
1018 steps :
1119 - uses : actions/checkout@v4
1220 - uses : cachix/install-nix-action@v31
13- - run : nix run ./tests#run .
21+ - run : nix run ./tests#run .
Original file line number Diff line number Diff line change 11{
22 description = "nixos-hardware" ;
33
4- inputs = {
5- nixpkgs . url = "github:NixOS/nixpkgs/nixos-25.05-small" ;
6- treefmt-nix . url = "github:numtide/treefmt-nix" ;
7- } ;
8-
94 outputs =
5+ { ... } :
106 {
11- nixpkgs ,
12- self ,
13- treefmt-nix ,
14- } :
15- let
16- systems = [
17- "aarch64-darwin"
18- "aarch64-linux"
19- "x86_64-darwin"
20- "x86_64-linux"
21- ] ;
22- forEachSystem =
23- function : nixpkgs . lib . genAttrs ( systems ) ( system : function nixpkgs . legacyPackages . ${ system } ) ;
24-
25- treefmtEval = forEachSystem ( pkgs : treefmt-nix . lib . evalModule pkgs ./treefmt.nix ) ;
26- in
27- {
28- checks = forEachSystem ( pkgs : {
29- formatting = treefmtEval . ${ pkgs. system } . config . build . check self ;
30- } ) ;
31- formatter = forEachSystem ( pkgs : treefmtEval . ${ pkgs. system } . config . build . wrapper ) ;
327
338 nixosModules =
349 let
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Helper script to update the tests flake hash
3+ set -euo pipefail
4+
5+ # Go to the root of the repository
6+ cd " $( dirname " $0 " ) /.."
7+
8+ echo " Updating tests.narHash..." >&2
9+
10+ # Update the flake lock file
11+ nix --extra-experimental-features ' flakes nix-command' flake lock ./tests
12+
13+ # Generate the hash
14+ nix --extra-experimental-features ' flakes nix-command' hash path ./tests > ./tests.narHash
15+
16+ echo " Hash updated successfully: $( cat tests.narHash) "
Original file line number Diff line number Diff line change 33
44 inputs = {
55 nixos-unstable-small . url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-unstable-small" ;
6- nixos-stable . url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-24.11 " ;
6+ nixos-stable . url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixos-25.05 " ;
77 # override in the test
88 nixos-hardware . url = "github:NixOS/nixos-hardware" ;
99 flake-parts . url = "github:hercules-ci/flake-parts" ;
1010 flake-parts . inputs . nixpkgs-lib . follows = "nixos-unstable-small" ;
11+ treefmt-nix . url = "github:numtide/treefmt-nix" ;
12+ treefmt-nix . inputs . nixpkgs . follows = "nixos-unstable-small" ;
1113 } ;
1214
1315 outputs =
1416 inputs @{ flake-parts , ... } :
1517 flake-parts . lib . mkFlake { inherit inputs ; } {
18+ imports = [
19+ inputs . treefmt-nix . flakeModule
20+ ] ;
1621 systems = [
1722 "aarch64-linux"
1823 "x86_64-linux"
8590 in
8691 {
8792 _module . args . pkgs = nixpkgsUnstable ;
93+
94+ treefmt = {
95+ flakeCheck = pkgs . hostPlatform . system != "riscv64-linux" ;
96+ projectRootFile = "COPYING" ;
97+ programs = {
98+ deadnix = {
99+ enable = true ;
100+ no-lambda-pattern-names = true ;
101+ } ;
102+ nixfmt = {
103+ enable = true ;
104+ package = pkgs . nixfmt-rfc-style ;
105+ } ;
106+ } ;
107+ settings = {
108+ on-unmatched = "info" ;
109+ } ;
110+ } ;
111+
88112 checks =
89113 checksForNixpkgs "nixos-unstable" nixpkgsUnstable
90114 // checksForNixpkgs "nixos-stable" nixpkgsStable ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments