golgi/flake.nix

68 lines
1.7 KiB
Nix
Raw Permalink 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;
2023-11-18 18:13:08 +00:00
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";
};
};
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
admin
2023-11-18 18:13:08 +00:00
agenix.nixosModules.default
2022-08-05 12:29:25 +00:00
caddy
2023-12-10 17:23:29 +00:00
common
forgejo
hardened
hardware-hetzner
syncthing
zsh
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;
};
}