Skip to content

Commit

Permalink
Use treefmt to format repo
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Jan 12, 2024
1 parent 0402066 commit ec9011c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 15 deletions.
37 changes: 36 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 19 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
inputs = {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";

treefmt-nix.url = "github:numtide/treefmt-nix";

nixpkgs = {
url = "github:numtide/nixpkgs-unfree";
inputs.nixpkgs.follows = "nixpkgs-unstable";
Expand Down Expand Up @@ -37,17 +39,12 @@
};
};

outputs = {
outputs = inputs @ {
self,
nixpkgs,
home-manager,
disko,
nixvim,
nixos-hardware,
nix-index-database,
nixpkgs-unstable,
bin,
} @ inputs: let
treefmt-nix,
...
}: let
inherit (self) outputs;
specialArgs = {inherit inputs outputs;};
in {
Expand Down Expand Up @@ -76,5 +73,18 @@
modules = [./hosts/hetzner/configuration.nix];
};
};

formatter.x86_64-linux =
treefmt-nix.lib.mkWrapper
nixpkgs.legacyPackages.x86_64-linux
{
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true; # nix formatter https://github.com/kamadorueda/alejandra
deadnix.enable = true; # removes dead nix code https://github.com/astro/deadnix
statix.enable = true; # prevents use of nix anti-patterns https://github.com/nerdypepper/statix
shellcheck.enable = true; # lints shell scripts https://github.com/koalaman/shellcheck
};
};
};
}
2 changes: 1 addition & 1 deletion home-modules/xinitrc.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{
home.file.".xinitrc".text = ''
#!/usr/bin/env bash
Expand Down
4 changes: 2 additions & 2 deletions overlays/dwm.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{pkgs, ...}: final: prev: {
dwm = prev.dwm.overrideAttrs (old: {
{pkgs, ...}: _final: prev: {
dwm = prev.dwm.overrideAttrs (_old: {
src = pkgs.fetchFromGitHub {
owner = "joinemm";
repo = "dwm";
Expand Down
4 changes: 2 additions & 2 deletions overlays/dwmblocks.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{pkgs, ...}: final: prev: {
dwmblocks = prev.dwmblocks.overrideAttrs (old: {
{pkgs, ...}: _final: prev: {
dwmblocks = prev.dwmblocks.overrideAttrs (_old: {
src = pkgs.fetchFromGitHub {
owner = "joinemm";
repo = "dwmblocks";
Expand Down

0 comments on commit ec9011c

Please sign in to comment.