use nixfmt

This commit is contained in:
Callum Leslie 2026-04-22 18:43:13 +01:00
parent 262f069d7d
commit d97ae3b090
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90

136
flake.nix
View file

@ -1,24 +1,26 @@
{ {
description = "C's Nix-Config"; description = "C's Nix-Config";
outputs = { outputs =
self, {
nixpkgs, self,
flake-parts, nixpkgs,
... flake-parts,
} @ inputs: let ...
cLib = import ./lib {inherit (nixpkgs) lib;}; }@inputs:
mkLinuxSystem = mod: ovl: let
nixpkgs.lib.nixosSystem { cLib = import ./lib { inherit (nixpkgs) lib; };
specialArgs = {inherit inputs cLib;}; mkLinuxSystem =
modules = mod: ovl:
[ nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs cLib; };
modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
{ {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [self.overlays.default] ++ ovl; nixpkgs.overlays = [ self.overlays.default ] ++ ovl;
} }
self.nixosModules.nix-config self.nixosModules.nix-config
self.nixosModules.boot self.nixosModules.boot
@ -30,9 +32,9 @@
self.nixosModules.deploy self.nixosModules.deploy
] ]
++ mod; ++ mod;
}; };
in in
flake-parts.lib.mkFlake {inherit self inputs;} { flake-parts.lib.mkFlake { inherit self inputs; } {
imports = [ imports = [
inputs.flake-parts.flakeModules.easyOverlay inputs.flake-parts.flakeModules.easyOverlay
inputs.pre-commit-hooks.flakeModule inputs.pre-commit-hooks.flakeModule
@ -45,71 +47,71 @@
flake = { flake = {
# TODO: use ./hosts/ # TODO: use ./hosts/
nixosConfigurations = { nixosConfigurations = {
artemis = mkLinuxSystem [./hosts/artemis] []; artemis = mkLinuxSystem [ ./hosts/artemis ] [ ];
hermes = hermes =
mkLinuxSystem mkLinuxSystem
[./hosts/hermes inputs.nocodb.nixosModules.nocodb inputs.copyparty.nixosModules.default] [ ./hosts/hermes inputs.nocodb.nixosModules.nocodb inputs.copyparty.nixosModules.default ]
[inputs.copyparty.overlays.default]; [ inputs.copyparty.overlays.default ];
}; };
diskoConfigurations = {}; # maybe? diskoConfigurations = { }; # maybe?
om.health.default = { om.health.default = {
nix-version.min-required = "2.18.5"; nix-version.min-required = "2.18.5";
}; };
}; };
perSystem = { perSystem =
config, {
pkgs, config,
final, pkgs,
inputs', final,
... inputs',
}: { ...
_module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend self.overlays.default; }:
overlayAttrs = {
config.packages _module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend self.overlays.default;
// { overlayAttrs = config.packages // {
unstable = inputs'.unstable.legacyPackages; unstable = inputs'.unstable.legacyPackages;
scenics = inputs'.scenics.packages; scenics = inputs'.scenics.packages;
}; };
pre-commit = { pre-commit = {
check.enable = false; check.enable = false;
settings.hooks.alejandra.enable = true; settings.hooks.alejandra.enable = true;
settings.hooks.deadnix.enable = true; settings.hooks.deadnix.enable = true;
};
treefmt.config = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.deadnix.enable = true;
};
devShells.default = final.mkShell {
meta.description = "Default dev shell";
inputsFrom = [
config.pre-commit.devShell
config.treefmt.build.devShell
];
packages = with final; [
just
git
nvf
cachix
jq
devour-flake
om
agenix
deadnix
];
};
apps = nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair ("deploy-" + name) value) (
inputs'.nixinate.packages self
);
packages = import ./packages { inherit pkgs inputs inputs'; };
}; };
treefmt.config = {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
programs.deadnix.enable = true;
};
devShells.default = final.mkShell {
meta.description = "Default dev shell";
inputsFrom = [
config.pre-commit.devShell
config.treefmt.build.devShell
];
packages = with final; [
just
git
nvf
cachix
jq
devour-flake
om
agenix
deadnix
];
};
apps = nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair ("deploy-" + name) value) (
inputs'.nixinate.packages self
);
packages = import ./packages {inherit pkgs inputs inputs';};
};
debug = false; debug = false;
}; };