Add formatter
This commit is contained in:
parent
08b0fbcd0c
commit
db14de3471
3 changed files with 61 additions and 1 deletions
20
flake.nix
20
flake.nix
|
@ -7,6 +7,7 @@
|
|||
nur.url = "github:nix-community/NUR";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
stylix.url = "github:pizzapim/stylix/release-24.05";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
|
||||
nix-index-database = {
|
||||
url = "github:nix-community/nix-index-database";
|
||||
|
@ -52,6 +53,23 @@
|
|||
, ...
|
||||
}@inputs:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"i686-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forAllSystems' = nixpkgs.lib.genAttrs;
|
||||
forAllSystems = forAllSystems' supportedSystems;
|
||||
pkgsForSystem =
|
||||
system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
|
||||
treefmtEval = forAllSystems (
|
||||
system: inputs.treefmt-nix.lib.evalModule (pkgsForSystem system) ./treefmt.nix
|
||||
);
|
||||
|
||||
mkNixosSystem = {extraModule, nixpkgs' ? nixpkgs, useDefaultConfiguration ? true}: nixpkgs'.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
|
||||
|
@ -66,6 +84,8 @@
|
|||
};
|
||||
in
|
||||
{
|
||||
formatter = forAllSystems (system: (treefmtEval.${system}.config.build.wrapper));
|
||||
|
||||
nixosConfigurations = {
|
||||
x260 = mkNixosSystem { extraModule = ({ pkgs, lib, ... }: {
|
||||
imports = [ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x260 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue