]> Git — Sourcephile - sourcephile-nix.git/blob - .lib/nixops/Makefile.make
nix: move build/ package within shell.nix
[sourcephile-nix.git] / .lib / nixops / Makefile.make
1 #
2 ## vmdk
3 ###
4 nixops-vmdk: $(dir $(NIXOPS_STATE))/virtualbox/nixops.vmdk
5 .PHONY: $(dir $(NIXOPS_STATE))/virtualbox/nixops.vmdk
6 $(dir $(NIXOPS_STATE))/virtualbox/nixops.vmdk:
7 # NOTE: user's TMPDIR may be too small
8 TMPDIR=/tmp \
9 time nix $(NIX_FLAGS) build \
10 --out-link .cache/nixops/virtualbox \
11 --argstr system x86_64-linux \
12 -f "<nixpkgs-commonsoft/build/pkgs/installer/nixops-virtualbox>"
13
14 #
15 ## create
16 ###
17 nixops-create: $(dir $(NIXOPS_STATE))
18 $(if $(filter $(NIXOPS_DEPLOYMENT),$(nixops-deployment)),,\
19 nixops create \
20 $(NIXOPS_CREATE) \
21 install/logical.nix \
22 install/physical.nix)
23 nixops-modify: $(NIXOPS_STATE)
24 nixops modify \
25 $(NIXOPS_MODIFY) \
26 install/logical.nix \
27 install/physical.nix
28 $(dir $(NIXOPS_STATE)):
29 mkdir -p $@
30 nixops-deployment = $(shell \
31 test ! -f $(NIXOPS_STATE) || \
32 sqlite3 $(NIXOPS_STATE) \
33 "select value from DeploymentAttrs \
34 where name='name' and value='$(NIXOPS_DEPLOYMENT)';")
35
36 #
37 ## deploy
38 ###
39 nixops-deploy: nixops-create
40 time nixops deploy $(NIXOPS_OPTS) $(NIX_DEPLOY_FLAGS)
41 #TMPDIR=/tmp \
42 #time disnixos-env --use-nixops \
43 # -s install/disnix/services.nix \
44 # -d install/disnix/distribution.nix \
45 # -n install/logical.nix \
46 # -n install/physical.nix
47 %/offline: NIX_BUILD_FLAGS+=--option substituters ""
48 %/offline: NIX_DEPLOY_FLAGS+=--option substituters ""
49 %/offline: %
50
51 %/verbose: NIX_FLAGS+=-v -v -v
52 %/verbose: %
53
54
55 nixops-stop:
56 nixops stop
57
58 #
59 ## state
60 ###
61 nixops-state-dump: $(NIXOPS_STATE)
62 sqlite3 $(NIXOPS_STATE) .dump
63 nixops-privateIpv4:
64 sqlite3 $(NIXOPS_STATE) \
65 'update ResourceAttrs set value = "$(IPv4)" where name="privateIpv4"'