update
This commit is contained in:
parent
a41850db1b
commit
912e82c032
4 changed files with 128 additions and 12 deletions
42
flake.nix
42
flake.nix
|
@ -4,29 +4,61 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
hooks = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
treefmt = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
...
|
||||
hooks,
|
||||
treefmt,
|
||||
}@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
imports = [
|
||||
hooks.flakeModule
|
||||
treefmt.flakeModule
|
||||
];
|
||||
|
||||
flake.nixosModules.default = import ./module.nix self;
|
||||
systems = nixpkgs.lib.systems.flakeExposed;
|
||||
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
treefmt = {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs.nixfmt = {
|
||||
enable = true;
|
||||
package = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
};
|
||||
|
||||
pre-commit.settings.hooks = {
|
||||
treefmt.enable = true;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
shellHook = ''
|
||||
${config.pre-commit.installationScript}
|
||||
'';
|
||||
};
|
||||
|
||||
packages.default = pkgs.callPackage ./package.nix { };
|
||||
};
|
||||
|
||||
flake.nixosModules.default = import ./module.nix self;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue