59 lines
1.4 KiB
Nix
59 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.m3tam3re.com/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";
|
|
follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
base-config,
|
|
deploy-rs,
|
|
nixpkgs,
|
|
...
|
|
} @ inputs: let
|
|
jsonConfig = builtins.fromJSON (builtins.readFile ./config.json);
|
|
in {
|
|
nixosConfigurations.server = 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.server = {
|
|
hostname = "self-host-playbook";
|
|
profiles.system = {
|
|
sshUser = jsonConfig.username;
|
|
user = "root";
|
|
interactiveSudo = true;
|
|
path =
|
|
deploy-rs.lib.x86_64-linux.activate.nixos
|
|
self.nixosConfigurations.server;
|
|
};
|
|
};
|
|
};
|
|
}
|