File tree Expand file tree Collapse file tree 4 files changed +59
-40
lines changed Expand file tree Collapse file tree 4 files changed +59
-40
lines changed Original file line number Diff line number Diff line change 1
1
{ pkgs , ... } :
2
+ let
3
+ pwd = "/tmp/" ;
2
4
5
+ in
3
6
{
4
7
# NOTE: still can't remember it...
5
8
# ports = [ "host:container" ]
15
18
image = "nginx:1.20.2-alpine" ;
16
19
ports = [ "8080:80" ] ;
17
20
volumes = [
18
- "${ toString ./. } /nft-marketplace/build:/usr/share/nginx/html"
21
+ # "${toString ./.}/nft-marketplace/build:/usr/share/nginx/html"
19
22
"${ toString ./. } /config/nginx.conf:/etc/nginx/nginx.conf"
20
23
] ;
21
24
healthcheck = {
54
57
image = "cardanosolutions/ogmios:v5.2.0-testnet" ;
55
58
ports = [ "1337:1337" ] ;
56
59
volumes = [
57
- "${ toString ./. } /data/cardano-node/ipc:/ipc"
60
+ "${ pwd } /data/cardano-node/ipc:/ipc"
58
61
"${ toString ./. } /config:/config"
59
62
] ;
60
63
} ;
76
79
environment = { NETWORK = "testnet" ; } ;
77
80
image = "inputoutput/cardano-node:1.33.0" ;
78
81
volumes = [
79
- "${ toString ./. } /data/cardano-node/ipc:/ipc"
80
- "${ toString ./. } /data/cardano-node/cardano-node-data:/data"
82
+ "${ pwd } /data/cardano-node/ipc:/ipc"
83
+ "${ pwd } /data/cardano-node/cardano-node-data:/data"
81
84
] ;
82
85
healthcheck = {
83
86
test = [
105
108
timeout = "5s" ;
106
109
retries = 3 ;
107
110
} ;
108
- volumes =
109
- [ "${ toString ./. } /data/postgres-data:/var/lib/postgresql/data" ] ;
111
+ volumes = [
112
+ "${ pwd } /data/postgres-data:/var/lib/postgresql/data"
113
+ ] ;
110
114
} ;
111
115
nft-marketplace-server . service = {
112
116
command = [
135
139
} ;
136
140
useHostStore = true ;
137
141
restart = "always" ;
138
- volumes = [ "${ toString ./. } /config/tmp:/tmp" ] ;
142
+ volumes = [
143
+ "${ pwd } /config/tmp:/tmp"
144
+ ] ;
139
145
} ;
140
146
} ;
141
147
}
Original file line number Diff line number Diff line change 66
66
;
67
67
68
68
# TODO: system-agnostic
69
- # inherit (inputs.ogmios-datum-cache.packages.${system}) ogmios-datum-cache;
69
+ inherit ( inputs . ogmios-datum-cache . packages . ${ system } ) ogmios-datum-cache ;
70
70
71
71
cardano-transaction-lib-server =
72
72
cardano-transaction-lib . packages . ${ system } . "cardano-browser-tx-server:exe:cardano-browser-tx-server" ;
130
130
let
131
131
pkgs = pkgsFor system ;
132
132
vm = nixosConfigurations . seabug-vm . config . system . build . vm ;
133
+ program = pkgs . writeShellScript "run-vm" ''
134
+ set -euo pipefail
135
+ # set -x
136
+
137
+ [ -x nixos.qcow2 ] && echo "⚠️ nixos.qcow2 already exists..."
138
+
139
+ export QEMU_NET_OPTS="hostfwd=tcp::2221-:22,hostfwd=tcp::8080-:8008"
140
+ export QEMU_OPTS
141
+ ${ vm } /bin/run-nixos-vm &
142
+ PID=$!
143
+
144
+ # Wait for the VM to start
145
+ while ! curl -m 1 -s http://localhost:8080/;
146
+ do
147
+ if ! kill -0 $PID; then
148
+ echo "❌ VM failed to start"
149
+ exit 1
150
+ fi
151
+ sleep 1;
152
+ done
153
+
154
+ ${ pkgs . python3 } /bin/python -c 'import webbrowser; webbrowser.open("http://localhost:8080/")' &
155
+
156
+ # Wait for the VM to exit
157
+ wait $PID
158
+ '' ;
133
159
in
134
160
{
135
161
default = {
136
162
type = "app" ;
137
- program = pkgs . writeShellScript "run-vm" ''
138
- export QEMU_NET_OPTS="hostfwd=tcp::2221-:22,hostfwd=tcp::8080-:80"
139
- ${ vm } /bin/run-nixos-vm
140
- '' ;
163
+ program = "${ program } " ;
141
164
} ;
142
165
} ) ;
143
166
Original file line number Diff line number Diff line change 1
- { arionModule , seabugOverlay } : {
2
- lib ,
3
- config ,
4
- ...
5
- } :
1
+ { arionModule , seabugOverlay } : { lib
2
+ , config
3
+ , ...
4
+ } :
6
5
with lib ; let
7
6
cfg = config . services . seabug ;
8
- in {
7
+ in
8
+ {
9
9
options . services . seabug = {
10
10
enable = mkEnableOption ''
11
11
Seabug
17
17
] ;
18
18
19
19
config = mkIf cfg . enable {
20
- nixpkgs . overlays = [ seabugOverlay ] ;
20
+ networking . firewall . enable = false ;
21
+ nixpkgs . overlays = [ seabugOverlay ] ;
21
22
virtualisation . arion = {
22
- backend = "podman-socket" ;
23
- projects . seabug . settings . imports = [ ./arion-compose.nix ] ;
23
+ # backend = "podman-socket";
24
+ backend = "docker" ;
25
+ projects . seabug . settings . imports = [ ./arion-compose.nix ] ;
26
+
24
27
} ;
25
28
} ;
26
29
}
You can’t perform that action at this time.
0 commit comments