chore: Switch to pkgs.nixfmt-rfc-style

This commit is contained in:
ditsuke 2024-03-01 23:37:19 +05:30
parent 2559f5ff0d
commit a0f4cdd5d5
No known key found for this signature in database
GPG key ID: 71B6C31C8A5A9D21
3 changed files with 6 additions and 101 deletions

90
flake.lock generated
View file

@ -1,21 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@ -34,48 +18,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixfmt": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1707402853,
"narHash": "sha256-d7a6xfqhbyLikHultxjHO33SqUcif/8eGyxhRZ9PvZk=",
"owner": "piegamesde",
"repo": "nixfmt",
"rev": "ca1fe3572ea6134551ee6af40ae735a1a1ed0d35",
"type": "github"
},
"original": {
"owner": "piegamesde",
"ref": "rfc101-style",
"repo": "nixfmt",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1708118438, "lastModified": 1708118438,
@ -110,43 +52,11 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1696039360,
"narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "32dcb45f66c0487e92db8303a798ebc548cadedc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixfmt": "nixfmt",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -18,10 +18,6 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
nixfmt = {
url = "github:piegamesde/nixfmt/rfc101-style";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
# There's an optional binary cache available. The details are below, but they're commented out. # There's an optional binary cache available. The details are below, but they're commented out.
@ -111,11 +107,12 @@
# ``` # ```
# #
# Cf. https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html?highlight=flake#flake-format # Cf. https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html?highlight=flake#flake-format
flake.overlays.default = flake.overlays.default = (
(final: prev: { final: prev: {
llamaPackages = final.callPackage .devops/nix/scope.nix { inherit llamaVersion; }; llamaPackages = final.callPackage .devops/nix/scope.nix { inherit llamaVersion; };
inherit (final.llamaPackages) llama-cpp; inherit (final.llamaPackages) llama-cpp;
}); }
);
systems = [ systems = [
"aarch64-darwin" "aarch64-darwin"
@ -136,9 +133,7 @@
}: }:
{ {
# For standardised reproducible formatting with `nix fmt` # For standardised reproducible formatting with `nix fmt`
# HELP: why does the per system formatter not work? formatter = pkgs.nixfmt-rfc-style;
# formatter = inputs.nixfmt.packages.${system}.nixfmt;
formatter = if (system == "x86_64-linux") then inputs.nixfmt.packages.${system}.nixfmt else null;
# Unlike `.#packages`, legacyPackages may contain values of # Unlike `.#packages`, legacyPackages may contain values of
# arbitrary types (including nested attrsets) and may even throw # arbitrary types (including nested attrsets) and may even throw