Add pre-commit check and devShell
Some checks failed
Check flake / build-amd64-linux (push) Failing after 2m54s
Some checks failed
Check flake / build-amd64-linux (push) Failing after 2m54s
This commit is contained in:
parent
ccb57f954e
commit
a8362771cf
59
flake.nix
59
flake.nix
@ -73,7 +73,7 @@
|
||||
user = "root";
|
||||
path =
|
||||
inputs.deploy-rs.lib.${
|
||||
self.nixosConfigurations.${hostName}.config.system.build.toplevel.system
|
||||
self.nixosConfigurations.${hostName}.config.system.build.toplevel.system
|
||||
}.activate.nixos
|
||||
self.nixosConfigurations.${hostName};
|
||||
};
|
||||
@ -98,30 +98,44 @@
|
||||
(lib.filterAttrs (name: value: value == "directory"))
|
||||
(lib.mapAttrs (
|
||||
name: value:
|
||||
lib.nixosSystem {
|
||||
specialArgs = { inherit self; };
|
||||
lib.nixosSystem {
|
||||
specialArgs = { inherit self; };
|
||||
|
||||
modules = [
|
||||
{
|
||||
networking = {
|
||||
inherit domain;
|
||||
hostName = name;
|
||||
};
|
||||
}
|
||||
./hosts/${name}
|
||||
];
|
||||
}
|
||||
modules = [
|
||||
{
|
||||
networking = {
|
||||
inherit domain;
|
||||
hostName = name;
|
||||
};
|
||||
}
|
||||
./hosts/${name}
|
||||
];
|
||||
}
|
||||
))
|
||||
];
|
||||
|
||||
checks =
|
||||
builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib
|
||||
// (forEachSystem (system: {
|
||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
};
|
||||
};
|
||||
}));
|
||||
|
||||
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
||||
|
||||
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
||||
buildInputs = [
|
||||
inputs.agenix.packages.x86_64-linux.agenix
|
||||
inputs.deploy-rs.packages.x86_64-linux.deploy-rs
|
||||
];
|
||||
};
|
||||
devShells = forEachSystem (system: {
|
||||
default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
buildInputs = [
|
||||
inputs.agenix.packages.${system}.agenix
|
||||
inputs.deploy-rs.packages.${system}.deploy-rs
|
||||
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
||||
};
|
||||
});
|
||||
|
||||
deploy = {
|
||||
magicRollback = true;
|
||||
@ -132,11 +146,8 @@
|
||||
# "pi"
|
||||
# "skycam"
|
||||
"vps1"
|
||||
] mkDeployNode;
|
||||
]
|
||||
mkDeployNode;
|
||||
};
|
||||
|
||||
checks = builtins.mapAttrs (
|
||||
system: deployLib: deployLib.deployChecks self.deploy
|
||||
) inputs.deploy-rs.lib;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user