mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-04-12 09:24:09 +02:00
move to packed treefmt
This commit is contained in:
parent
d99e6efba9
commit
dc2a4e7512
3 changed files with 21 additions and 39 deletions
23
flake.lock
generated
23
flake.lock
generated
|
@ -665,8 +665,7 @@
|
||||||
"nuschtos": "nuschtos",
|
"nuschtos": "nuschtos",
|
||||||
"snm": "snm",
|
"snm": "snm",
|
||||||
"sops-nix": "sops-nix_2",
|
"sops-nix": "sops-nix_2",
|
||||||
"srvos": "srvos",
|
"srvos": "srvos"
|
||||||
"treefmt-nix": "treefmt-nix_4"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snm": {
|
"snm": {
|
||||||
|
@ -867,26 +866,6 @@
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"treefmt-nix_4": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1743081648,
|
|
||||||
"narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
32
flake.nix
32
flake.nix
|
@ -59,25 +59,17 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.disko.follows = "disko";
|
inputs.disko.follows = "disko";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flake Stuff
|
|
||||||
treefmt-nix = {
|
|
||||||
url = "github:numtide/treefmt-nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs@{
|
inputs@{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
treefmt-nix,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
forSystems = f: nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: f system);
|
forSystems = f: nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: f system);
|
||||||
pkgs' = system: nixpkgs.legacyPackages.${system};
|
pkgs' = system: nixpkgs.legacyPackages.${system};
|
||||||
treefmtEval = system: treefmt-nix.lib.evalModule (pkgs' system) ./treefmt.nix;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
modules.default = import ./modules;
|
modules.default = import ./modules;
|
||||||
|
@ -91,9 +83,25 @@
|
||||||
pkgs = pkgs' system;
|
pkgs = pkgs' system;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
formatter = forSystems (system: (treefmtEval system).config.build.wrapper);
|
formatter = forSystems (
|
||||||
checks = forSystems (system: {
|
system:
|
||||||
formatting = (treefmtEval system).config.build.check self;
|
let
|
||||||
});
|
pkgs = pkgs' system;
|
||||||
|
in
|
||||||
|
pkgs.treefmt.withConfig {
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
nixfmt-rfc-style
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
tree-root-file = ".git/index";
|
||||||
|
formatter = {
|
||||||
|
nixfmt = {
|
||||||
|
command = "nixfmt";
|
||||||
|
includes = [ "*.nix" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
projectRootFile = "flake.nix";
|
|
||||||
programs.nixfmt-rfc-style.enable = true;
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue