32 lines
883 B
Nix
32 lines
883 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# Install Git, curl, and other required tools
|
|
environment.systemPackages = with pkgs; [ git curl ];
|
|
|
|
# Enable unsecured SSH for initial deployment
|
|
services.openssh = {
|
|
enable = true;
|
|
permitRootLogin = "yes";
|
|
passwordAuthentication = true;
|
|
};
|
|
|
|
# Deployment script
|
|
system.activationScripts.setup-deploy = ''
|
|
#!${pkgs.bash}/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Télécharger le script de déploiement depuis Gitea
|
|
curl -o /usr/local/bin/deploy-nixos https://gitea.lagraula.fr/xavier/nixos-infra/raw/main/scripts/deploy.sh
|
|
chmod +x /usr/local/bin/deploy-nixos
|
|
|
|
# Cloner le dépôt (si ce n'est pas déjà fait)
|
|
mkdir -p /etc/nixos-infra
|
|
if [ ! -d "/etc/nixos-infra/.git" ]; then
|
|
git clone https://gitea.lagraula.fr/xavier/nixos-infra.git /etc/nixos-infra
|
|
fi
|
|
'';
|
|
|
|
system.stateVersion = "25.11";
|
|
|
|
} |