27 Apr 2024 |
Bonus | https://bonusplay.pl/asktoask | 22:14:50 |
Bonus | * https://bonusplay.pl/asktoask :) | 22:15:09 |
sylex-matrix | I'm new to pretty much everything related to nix deployments, so I'm kinda lost on the sense of not knowing where to look for things | 22:15:34 |
sylex-matrix | In reply to @bonus:bonusplay.pl https://bonusplay.pl/asktoask Hey! I was about to articulate my question haha | 22:15:44 |
sylex-matrix | just being polite | 22:15:46 |
sylex-matrix | :) | 22:15:49 |
sylex-matrix | Well the thing is, I'm trynna deploy a server into a compute instance on the cloud (Oracle although irrelevant) | 22:16:31 |
sylex-matrix | And I've gotten most of the things required separatedly | 22:16:51 |
sylex-matrix | I use pulumi (similar to terraform) to get the compute running | 22:17:29 |
sylex-matrix | then I use nixos-anywhere to replace the ubuntu instance by a nixOS machine | 22:17:43 |
sylex-matrix | and I've managed to get Colmena to update the machine too | 22:18:08 |
sylex-matrix | but right now what I want to do is to launch some applications when the machine is updated by colmena, or maybe afterwards? | 22:19:21 |
sylex-matrix | lets say I have a docker image that runs some service on a port, how would I go about fetching some git repo, launching a docker container inside the repo and running it? | 22:20:25 |
sylex-matrix | (Obv I mean how would I do it from nix) | 22:21:04 |
Bonus | option #1: you can nix the application inside the docker container
option #2: run a docker container via virtualisation.oci-containers.containers | 22:22:27 |
Bonus | * option #1: you can nix the application inside the docker container option #2: run a docker container via virtualisation.oci-containers.containers | 22:22:33 |
sylex-matrix | wait | 22:22:44 |
sylex-matrix | docker was just an example | 22:22:47 |
sylex-matrix | maybe I phrased my problem wrong | 22:22:54 |
sylex-matrix | the thing is, how do I tell colmena to execute some actions after the machine has been deployed? | 22:23:18 |
sylex-matrix | maybe its just running git clone x cd blah blah ./run.sh | 22:23:37 |
sylex-matrix | kind of like the RUNs of a dockerfile | 22:23:47 |
Bonus | in theory you shouldn't since it's not "THE NIX WAY" | 22:23:53 |
sylex-matrix | what would be the nix way then? | 22:24:09 |
Bonus | in practice: system.activationScripts | 22:24:13 |
sylex-matrix | I've been struggling pretty hard to learn the nix way | 22:24:19 |
Bonus | colmena is just a wrapper for nix tools (copy closure via ssh, etc.) | 22:25:01 |
Bonus | you want to execute something "after configuration switch" or "everytime you boot" | 22:27:02 |
sylex-matrix | yeah, pretty much | 22:27:23 |
Bonus | then try system.activationScripts | 22:28:46 |