File tree Expand file tree Collapse file tree 1 file changed +4
-42
lines changed Expand file tree Collapse file tree 1 file changed +4
-42
lines changed Original file line number Diff line number Diff line change 74
74
'' ;
75
75
} ;
76
76
77
- devmode =
78
- let
79
- pythonEnvironment = pkgs . python310 . withPackages ( ps : with ps ; [
80
- livereload
81
- ] ) ;
82
- script = ''
83
- from livereload import Server
84
- from subprocess import Popen, PIPE
85
- import shlex
86
- import sys
87
-
88
- server = Server()
89
-
90
- def nix_build():
91
- p = Popen(
92
- shlex.split("nix-build -A build") + sys.argv[1:],
93
- # capture output as text
94
- stdout=PIPE,
95
- stderr=PIPE,
96
- text=True,
97
- )
98
- # we only care about failures
99
- stdout, stderr = p.communicate()
100
- if p.returncode:
101
- print(stderr)
102
- return p
103
-
104
- # (re-)build once before serving
105
- nix_build().wait()
106
-
107
- server.watch("source/*", nix_build)
108
- server.watch("source/**/*", nix_build)
109
- server.serve(root="result")
110
- '' ;
111
- in
112
- pkgs . writeShellApplication {
113
- name = "devmode" ;
114
- runtimeInputs = [ pythonEnvironment ] ;
115
- text = ''
116
- python ${ pkgs . writeText "live.py" script }
117
- '' ;
118
- } ;
77
+ devmode = pkgs-unstable . devmode . override {
78
+ buildArgs = ''-A build --show-trace'' ;
79
+ open = "/index.html" ;
80
+ } ;
119
81
update-nix-releases = pkgs-unstable . callPackage ./nix/update-nix-releases.nix { } ;
120
82
update-nixpkgs-releases = pkgs-unstable . callPackage ./nix/update-nixpkgs-releases.nix { } ;
121
83
in
You can’t perform that action at this time.
0 commit comments