58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
description = "Self-hosted server setup with Portainer, n8n, and Baserow";
|
|
|
|
inputs = {
|
|
base-config = {
|
|
# url = "path:/home/m3tam3re/p/nix/self-host-playbook-base";
|
|
url = "git+https://code.m3ta.dev/m3tam3re/self-host-playbook-base?ref=stable";
|
|
};
|
|
nixpkgs = {
|
|
url = "github:NixOS/nixpkgs/nixos-24.11";
|
|
follows = "base-config/nixpkgs";
|
|
};
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
deploy-rs = {
|
|
url = "github:serokell/deploy-rs";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
base-config,
|
|
deploy-rs,
|
|
nixpkgs,
|
|
...
|
|
} @ inputs: let
|
|
jsonConfig = builtins.fromJSON (builtins.readFile ./config.json);
|
|
in {
|
|
nixosConfigurations.${jsonConfig.hostname} = nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
(base-config.nixosModules.default {
|
|
tier = "starter";
|
|
inherit jsonConfig;
|
|
}) # Pass tier here
|
|
inputs.disko.nixosModules.disko
|
|
./configuration.nix
|
|
];
|
|
specialArgs = {
|
|
inherit self;
|
|
};
|
|
};
|
|
deploy.nodes.${jsonConfig.hostname} = {
|
|
hostname = jsonConfig.hostname;
|
|
profiles.system = {
|
|
sshUser = jsonConfig.username;
|
|
user = "root";
|
|
interactiveSudo = true;
|
|
path =
|
|
deploy-rs.lib.x86_64-linux.activate.nixos
|
|
self.nixosConfigurations.${jsonConfig.hostname};
|
|
};
|
|
};
|
|
};
|
|
}
|