golgi/flake.nix

67 lines
1.7 KiB
Nix
Raw Normal View History

2022-07-29 15:42:48 +00:00
{
description = "My server flake";
inputs = {
2022-10-01 16:05:47 +00:00
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils-plus.url = github:ravensiris/flake-utils-plus?ref=ravensiris/fix-devshell-legacy-packages;
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";
};
};
nixConfig.sandbox = "relaxed";
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
zsh
2022-07-29 15:42:48 +00:00
hardware-hetzner
2023-06-26 12:56:17 +00:00
hardened
2022-07-29 17:25:12 +00:00
agenix.nixosModule
2023-06-24 05:16:32 +00:00
forgejo
2022-08-05 12:29:25 +00:00
caddy
2022-07-29 15:42:48 +00:00
];
};
deploy.nodes = {
golgi = {
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";
2023-06-24 04:52:41 +00:00
sshOpts = ["-o" "ControlMaster=no"];
2022-07-29 15:42:48 +00:00
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 {
2023-06-24 03:52:46 +00:00
name = "deploy";
2022-07-29 15:42:48 +00:00
buildInputs = with channels.nixpkgs; [
nixUnstable
inputs.deploy-rs.defaultPackage.${system}
];
};
});
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
};
}