nixos-config/flake.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

{
description = "c8h4.io NixOS configuration";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "refs/heads/nixos-unstable";
rev = "3d4e386a08fbb43fc8b2f81cd6e6a02671ec73ca"; # 31-08-2023
};
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
treefmt = treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
stylua.enable = true;
statix.enable = true;
deadnix.enable = true;
shellcheck.enable = true;
};
};
in {
checks.formatting = treefmt.config.build.check self;
formatter = treefmt.config.build.wrapper;
devShells.default =
pkgs.mkShell { inputsFrom = [ treefmt.config.build.devShell ]; };
});
}