Merge pull request #1500 from NixOS/feat/improve-developer-expercience

Improve general developer experience
This commit is contained in:
Janne Heß
2025-08-02 12:05:41 +00:00
committed by GitHub
5 changed files with 18 additions and 14 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

4
.gitignore vendored
View File

@@ -1,5 +1,9 @@
*~ *~
/.direnv/
.test_info.* .test_info.*
/src/root/static/bootstrap
/src/root/static/fontawesome
/src/root/static/js/flot
/src/sql/hydra-postgresql.sql /src/sql/hydra-postgresql.sql
/src/sql/hydra-sqlite.sql /src/sql/hydra-sqlite.sql
/src/sql/tmp.sqlite /src/sql/tmp.sqlite

View File

@@ -80,10 +80,15 @@ $ nix build
You can use the provided shell.nix to get a working development environment: You can use the provided shell.nix to get a working development environment:
``` ```
$ nix develop $ nix develop
$ mesonConfigurePhase $ ln -svf ../../../build/src/bootstrap src/root/static/bootstrap
$ ninja $ ln -svf ../../../build/src/fontawesome src/root/static/fontawesome
$ ln -svf ../../../../build/src/flot src/root/static/js/flot
$ meson setup build
$ ninja -C build
``` ```
The development environment can also automatically be established using [nix-direnv](https://github.com/nix-community/nix-direnv).
### Executing Hydra During Development ### Executing Hydra During Development
When working on new features or bug fixes you need to be able to run Hydra from your working copy. This When working on new features or bug fixes you need to be able to run Hydra from your working copy. This

View File

@@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
export PATH=$(pwd)/src/script:$PATH
# wait for hydra-server to listen # wait for hydra-server to listen
while ! nc -z localhost 63333; do sleep 1; done while ! nc -z localhost 63333; do sleep 1; done

View File

@@ -57,20 +57,12 @@ fontawesome = custom_target(
command: ['unzip', '-u', '-d', '@OUTDIR@', '@INPUT@'], command: ['unzip', '-u', '-d', '@OUTDIR@', '@INPUT@'],
) )
custom_target( custom_target(
'name-fontawesome-css', 'name-fontawesome',
input: fontawesome, input: fontawesome,
output: 'css', output: 'fontawesome',
command: ['cp', '-r', '@INPUT@/css', '@OUTPUT@'], command: ['cp', '-r', '@INPUT@' , '@OUTPUT@'],
install: true, install: true,
install_dir: hydra_libexecdir_static / 'fontawesome', install_dir: hydra_libexecdir_static,
)
custom_target(
'name-fontawesome-webfonts',
input: fontawesome,
output: 'webfonts',
command: ['cp', '-r', '@INPUT@/webfonts', '@OUTPUT@'],
install: true,
install_dir: hydra_libexecdir_static / 'fontawesome',
) )
# Scripts # Scripts