golgi/flake.nix

62 lines
1.6 KiB
Nix
Raw Normal View History

2022-07-29 15:42:48 +00:00
{
description = "My server flake";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils-plus.url = github:gytis-ivaskevicius/flake-utils-plus;
2022-07-29 17:25:12 +00:00
agenix.url = "github:ryantm/agenix";
2022-07-29 15:42:48 +00:00
deploy-rs = {
url = github:serokell/deploy-rs;
inputs.nixpkgs.follows = "nixpkgs";
};
};
2022-07-29 17:25:12 +00:00
outputs = inputs@{ self, nixpkgs, flake-utils-plus, agenix, ... }:
2022-07-29 15:42:48 +00:00
let
2022-07-29 17:25:12 +00:00
modules = flake-utils-plus.lib.exportModules (
nixpkgs.lib.mapAttrsToList (name: value: ./modules/${name}) (builtins.readDir ./modules)
2022-07-29 15:42:48 +00:00
);
in
flake-utils-plus.lib.mkFlake {
2022-07-29 17:25:12 +00:00
inherit self inputs modules;
2022-07-29 15:42:48 +00:00
hosts = {
2022-07-29 17:25:12 +00:00
golgi.modules = with modules; [
2022-07-29 15:42:48 +00:00
common
admin
hardware-hetzner
2022-07-29 17:25:12 +00:00
agenix.nixosModule
caddy
gitea
2022-07-29 15:42:48 +00:00
];
};
deploy.nodes = {
my-node = {
2022-07-29 17:25:12 +00:00
hostname = "tecosaur.net";
2022-07-29 15:42:48 +00:00
fastConnection = false;
profiles = {
2022-07-29 17:25:12 +00:00
system = {
2022-07-29 15:42:48 +00:00
sshUser = "admin";
path =
inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.golgi;
user = "root";
};
};
};
};
outputsBuilder = (channels: {
2022-07-29 17:25:12 +00:00
devShells.default = channels.nixpkgs.mkShell {
2022-07-29 15:42:48 +00:00
name = "my-deploy-shell";
buildInputs = with channels.nixpkgs; [
nixUnstable
inputs.deploy-rs.defaultPackage.${system}
];
};
});
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
};
}