Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Home
Ecosystem
Overview
NixOS
Package Manager
Nix Language
Nixpkgs
Hydra
Applications
Topics
Software
Hardware
Desktop
Server
Community
Learn NixOS
Overview
Guides
Tutorials
References
Cookbooks
Wiki
Contribute
Manual of Style
Recent changes
Random page
NixOS Wiki
Search
Search
English
Appearance
Create account
Log in
Personal tools
Create account
Log in
Export translations
Translate
English
Language statistics
Message group statistics
Export
Tools
Tools
move to sidebar
hide
Actions
Language statistics
Message group statistics
Export
General
Special pages
Printable version
Appearance
move to sidebar
hide
Settings
Group
Accelerated Video Playback
Appimage
Applications
Category:Community
Category:Desktop environment
Category:Hardware
Category:Server
Category:Software
Creating a NixOS live CD
Disko
Doas
Docker
FAQ
Firefox
Flakes
Hardware/System76/galp5
Honk
Hugo
Hydra
Install NixOS on Amazon EC2
Kitty
Konqueror
MediaWiki:Sidebar
Mihomo
Neovim
Nitrokey
Nix (language)
Nix (package manager)
Nix ecosystem
NixOS
NixOS as a desktop
NixOS Installation Guide
NixOS on ARM
NixOS on ARM/UEFI
NixOS Wiki
NixOS Wiki/documentation topics
NixOS Wiki/get in touch
NixOS Wiki/getting started
NixOS Wiki/setting up
NixOS Wiki/special pages
NixOS Wiki/welcome
NixOS Wiki:News
Nixpkgs
Packaging/Icons
Plymouth
Secure Boot
Smartmontools
Starship
Steam
Sudo
Systemd/Hardening
Systemd/logind
Systemd/timers
Systemd/User Services
Terms and Definitions in Nix Project
Vim
VR
Language
aa - Qafár af
aae - Arbërisht
ab - аԥсшәа
abs - bahasa ambon
ace - Acèh
acf - Kwéyòl Sent Lisi
acm - عراقي
ady - адыгабзэ
ady-cyrl - адыгабзэ
aeb - تونسي / Tûnsî
aeb-arab - تونسي
aeb-latn - Tûnsî
af - Afrikaans
aln - Gegë
alt - алтай тил
am - አማርኛ
ami - Pangcah
an - aragonés
ang - Ænglisc
ann - Obolo
anp - अंगिका
apc - شامي
ar - العربية
arc - ܐܪܡܝܐ
arn - mapudungun
arq - جازايرية
ary - الدارجة
arz - مصرى
as - অসমীয়া
ase - American sign language
ast - asturianu
atj - Atikamekw
av - авар
avk - Kotava
awa - अवधी
ay - Aymar aru
az - azərbaycanca
azb - تۆرکجه
ba - башҡортса
ban - Basa Bali
ban-bali - ᬩᬲᬩᬮᬶ
bar - Boarisch
bbc - Batak Toba
bbc-latn - Batak Toba
bcc - جهلسری بلوچی
bci - wawle
bcl - Bikol Central
bdr - Bajau Sama
be - беларуская
be-tarask - беларуская (тарашкевіца)
bew - Betawi
bg - български
bgc - हरियाणवी
bgn - روچ کپتین بلوچی
bh - भोजपुरी
bho - भोजपुरी
bi - Bislama
bjn - Banjar
blk - ပအိုဝ်ႏဘာႏသာႏ
bm - bamanankan
bn - বাংলা
bo - བོད་ཡིག
bpy - বিষ্ণুপ্রিয়া মণিপুরী
bqi - بختیاری
br - brezhoneg
brh - Bráhuí
bs - bosanski
btm - Batak Mandailing
bto - Iriga Bicolano
bug - Basa Ugi
bxr - буряад
ca - català
cbk-zam - Chavacano de Zamboanga
ccp - 𑄌𑄋𑄴𑄟𑄳𑄦
cdo - 閩東語 / Mìng-dĕ̤ng-ngṳ̄
ce - нохчийн
ceb - Cebuano
ch - Chamoru
chn - chinuk wawa
cho - Chahta anumpa
chr - ᏣᎳᎩ
chy - Tsetsêhestâhese
ckb - کوردی
co - corsu
cps - Capiceño
cpx - 莆仙語 / Pó-sing-gṳ̂
cpx-hans - 莆仙语(简体)
cpx-hant - 莆仙語(繁體)
cpx-latn - Pó-sing-gṳ̂ (Báⁿ-uā-ci̍)
cr - Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ
crh - qırımtatarca
crh-cyrl - къырымтатарджа (Кирилл)
crh-latn - qırımtatarca (Latin)
crh-ro - tatarşa
cs - čeština
csb - kaszëbsczi
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
cv - чӑвашла
cy - Cymraeg
da - dansk
dag - dagbanli
de - Deutsch
de-at - Österreichisches Deutsch
de-ch - Schweizer Hochdeutsch
de-formal - Deutsch (Sie-Form)
dga - Dagaare
din - Thuɔŋjäŋ
diq - Zazaki
dsb - dolnoserbski
dtp - Kadazandusun
dty - डोटेली
dua - Duálá
dv - ދިވެހިބަސް
dz - ཇོང་ཁ
ee - eʋegbe
efi - Efịk
egl - Emiliàn
el - Ελληνικά
eml - emiliàn e rumagnòl
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - español
es-419 - español de América Latina
es-formal - español (formal)
et - eesti
eu - euskara
ext - estremeñu
fa - فارسی
fat - mfantse
ff - Fulfulde
fi - suomi
fit - meänkieli
fj - Na Vosa Vakaviti
fo - føroyskt
fon - fɔ̀ngbè
fr - français
frc - français cadien
frp - arpetan
frr - Nordfriisk
fur - furlan
fy - Frysk
ga - Gaeilge
gaa - Ga
gag - Gagauz
gan - 贛語
gan-hans - 赣语(简体)
gan-hant - 贛語(繁體)
gcf - kréyòl Gwadloup
gcr - kriyòl gwiyannen
gd - Gàidhlig
gl - galego
gld - на̄ни
glk - گیلکی
gn - Avañe'ẽ
gom - गोंयची कोंकणी / Gõychi Konknni
gom-deva - गोंयची कोंकणी
gom-latn - Gõychi Konknni
gor - Bahasa Hulontalo
got - 𐌲𐌿𐍄𐌹𐍃𐌺
gpe - Ghanaian Pidgin
grc - Ἀρχαία ἑλληνικὴ
gsw - Alemannisch
gu - ગુજરાતી
guc - wayuunaiki
gur - farefare
guw - gungbe
gv - Gaelg
ha - Hausa
hak - 客家語 / Hak-kâ-ngî
hak-hans - 客家语(简体)
hak-hant - 客家語(繁體)
hak-latn - Hak-kâ-ngî (Pha̍k-fa-sṳ)
haw - Hawaiʻi
he - עברית
hi - हिन्दी
hif - Fiji Hindi
hif-latn - Fiji Hindi
hil - Ilonggo
hno - ہندکو
ho - Hiri Motu
hr - hrvatski
hrx - Hunsrik
hsb - hornjoserbsce
hsn - 湘語
ht - Kreyòl ayisyen
hu - magyar
hu-formal - magyar (formal)
hy - հայերեն
hyw - Արեւմտահայերէն
hz - Otsiherero
ia - interlingua
iba - Jaku Iban
ibb - ibibio
id - Bahasa Indonesia
ie - Interlingue
ig - Igbo
igl - Igala
ii - ꆇꉙ
ik - Iñupiatun
ike-cans - ᐃᓄᒃᑎᑐᑦ
ike-latn - inuktitut
ilo - Ilokano
inh - гӀалгӀай
io - Ido
is - íslenska
isv-cyrl - меджусловјанскы
isv-latn - medžuslovjansky
it - italiano
iu - ᐃᓄᒃᑎᑐᑦ / inuktitut
ja - 日本語
jam - Patois
jbo - la .lojban.
jut - jysk
jv - Jawa
ka - ქართული
kaa - Qaraqalpaqsha
kab - Taqbaylit
kai - Karai-karai
kbd - адыгэбзэ
kbd-cyrl - адыгэбзэ
kbp - Kabɩyɛ
kcg - Tyap
kea - kabuverdianu
kg - Kongo
kge - Kumoring
khw - کھوار
ki - Gĩkũyũ
kiu - Kırmancki
kj - Kwanyama
kjh - хакас
kjp - ဖၠုံလိက်
kk - қазақша
kk-arab - قازاقشا (تٴوتە)
kk-cn - قازاقشا (جۇنگو)
kk-cyrl - қазақша (кирил)
kk-kz - қазақша (Қазақстан)
kk-latn - qazaqşa (latın)
kk-tr - qazaqşa (Türkïya)
kl - kalaallisut
km - ភាសាខ្មែរ
kn - ಕನ್ನಡ
knc - Yerwa Kanuri
ko - 한국어
ko-kp - 조선말
koi - перем коми
kr - kanuri
krc - къарачай-малкъар
kri - Krio
krj - Kinaray-a
krl - karjal
ks - कॉशुर / کٲشُر
ks-arab - کٲشُر
ks-deva - कॉशुर
ksh - Ripoarisch
ksw - စှီၤ
ku - kurdî
ku-arab - کوردی (عەرەبی)
ku-latn - kurdî (latînî)
kum - къумукъ
kus - Kʋsaal
kv - коми
kw - kernowek
ky - кыргызча
la - Latina
lad - Ladino
lb - Lëtzebuergesch
lbe - лакку
lez - лезги
lfn - Lingua Franca Nova
lg - Luganda
li - Limburgs
lij - Ligure
liv - Līvõ kēļ
lki - لەکی
lld - Ladin
lmo - lombard
ln - lingála
lo - ລາວ
loz - Silozi
lrc - لۊری شومالی
lt - lietuvių
ltg - latgaļu
lua - ciluba
lus - Mizo ţawng
luz - لئری دوٙمینی
lv - latviešu
lzh - 文言
lzz - Lazuri
mad - Madhurâ
mag - मगही
mai - मैथिली
map-bms - Basa Banyumasan
mdf - мокшень
mg - Malagasy
mh - Ebon
mhr - олык марий
mi - Māori
min - Minangkabau
mk - македонски
ml - മലയാളം
mn - монгол
mnc - manju gisun
mnc-latn - manju gisun
mnc-mong - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
mni - ꯃꯤꯇꯩ ꯂꯣꯟ
mnw - ဘာသာမန်
mo - молдовеняскэ
mos - moore
mr - मराठी
mrh - Mara
mrj - кырык мары
ms - Bahasa Melayu
ms-arab - بهاس ملايو
mt - Malti
mui - Baso Palembang
mus - Mvskoke
mwl - Mirandés
my - မြန်မာဘာသာ
myv - эрзянь
mzn - مازِرونی
na - Dorerin Naoero
nah - Nāhuatl
nan - 閩南語 / Bân-lâm-gú
nan-hant - 閩南語(傳統漢字)
nan-latn-pehoeji - Bân-lâm-gú (Pe̍h-ōe-jī)
nan-latn-tailo - Bân-lâm-gú (Tâi-lô)
nap - Napulitano
nb - norsk bokmål
nds - Plattdüütsch
nds-nl - Nedersaksies
ne - नेपाली
new - नेपाल भाषा
ng - Oshiwambo
nia - Li Niha
nit - కొలామి
niu - Niuē
nl - Nederlands
nl-informal - Nederlands (informeel)
nmz - nawdm
nn - norsk nynorsk
no - norsk
nod - ᨣᩤᩴᨾᩮᩬᩥᨦ
nog - ногайша
nov - Novial
nqo - ߒߞߏ
nr - isiNdebele seSewula
nrm - Nouormand
nso - Sesotho sa Leboa
nup - Nupe
nv - Diné bizaad
ny - Chi-Chewa
nyn - runyankore
nyo - Orunyoro
nys - Nyunga
oc - occitan
ojb - Ojibwemowin
olo - livvinkarjala
om - Oromoo
or - ଓଡ଼ିଆ
os - ирон
pa - ਪੰਜਾਬੀ
pag - Pangasinan
pam - Kapampangan
pap - Papiamentu
pcd - Picard
pcm - Naijá
pdc - Deitsch
pdt - Plautdietsch
pfl - Pälzisch
pi - पालि
pih - Norfuk / Pitkern
pl - polski
pms - Piemontèis
pnb - پنجابی
pnt - Ποντιακά
prg - prūsiskan
ps - پښتو
pt - português
pt-br - português do Brasil
pwn - pinayuanan
qu - Runa Simi
qug - Runa shimi
rgn - Rumagnôl
rif - Tarifit
rki - ရခိုင်
rm - rumantsch
rmc - romaňi čhib
rmy - romani čhib
rn - ikirundi
ro - română
roa-tara - tarandíne
rsk - руски
ru - русский
rue - русиньскый
rup - armãneashti
ruq - Vlăheşte
ruq-cyrl - Влахесте
ruq-latn - Vlăheşte
rut - мыхаӀбишды
rw - Ikinyarwanda
ryu - うちなーぐち
sa - संस्कृतम्
sah - саха тыла
sat - ᱥᱟᱱᱛᱟᱲᱤ
sc - sardu
scn - sicilianu
sco - Scots
sd - سنڌي
sdc - Sassaresu
sdh - کوردی خوارگ
se - davvisámegiella
se-fi - davvisámegiella (Suoma bealde)
se-no - davvisámegiella (Norgga bealde)
se-se - davvisámegiella (Ruoŧa bealde)
sei - Cmique Itom
ses - Koyraboro Senni
sg - Sängö
sgs - žemaitėška
sh - srpskohrvatski / српскохрватски
sh-cyrl - српскохрватски (ћирилица)
sh-latn - srpskohrvatski (latinica)
shi - Taclḥit
shi-latn - Taclḥit
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
shn - ၽႃႇသႃႇတႆး
shy - tacawit
shy-latn - tacawit
si - සිංහල
simple - Simple English
sjd - кӣллт са̄мь кӣлл
sje - bidumsámegiella
sk - slovenčina
skr - سرائیکی
skr-arab - سرائیکی
sl - slovenščina
sli - Schläsch
sm - Gagana Samoa
sma - åarjelsaemien
smn - anarâškielâ
sms - nuõrttsääʹmǩiõll
sn - chiShona
so - Soomaaliga
sq - shqip
sr - српски / srpski
sr-ec - српски (ћирилица)
sr-el - srpski (latinica)
srn - Sranantongo
sro - sardu campidanesu
ss - SiSwati
st - Sesotho
stq - Seeltersk
sty - себертатар
su - Sunda
sv - svenska
sw - Kiswahili
syl - ꠍꠤꠟꠐꠤ
szl - ślůnski
szy - Sakizaya
ta - தமிழ்
tay - Tayal
tcy - ತುಳು
tdd - ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
te - తెలుగు
tet - tetun
tg - тоҷикӣ
tg-cyrl - тоҷикӣ
tg-latn - tojikī
th - ไทย
ti - ትግርኛ
tig - ትግሬ
tk - Türkmençe
tl - Tagalog
tly - tolışi
tly-cyrl - толыши
tn - Setswana
to - lea faka-Tonga
tok - toki pona
tpi - Tok Pisin
tr - Türkçe
tru - Ṫuroyo
trv - Seediq
ts - Xitsonga
tt - татарча / tatarça
tt-cyrl - татарча
tt-latn - tatarça
ttj - Orutooro
tum - chiTumbuka
tw - Twi
ty - reo tahiti
tyv - тыва дыл
tzm - ⵜⴰⵎⴰⵣⵉⵖⵜ
udm - удмурт
ug - ئۇيغۇرچە / Uyghurche
ug-arab - ئۇيغۇرچە
ug-latn - Uyghurche
uk - українська
ur - اردو
uz - oʻzbekcha / ўзбекча
uz-cyrl - ўзбекча
uz-latn - oʻzbekcha
ve - Tshivenda
vec - vèneto
vep - vepsän kel’
vi - Tiếng Việt
vls - West-Vlams
vmf - Mainfränkisch
vmw - emakhuwa
vo - Volapük
vot - Vaďďa
vro - võro
wa - walon
wal - wolaytta
war - Winaray
wls - Fakaʻuvea
wo - Wolof
wuu - 吴语
wuu-hans - 吴语(简体)
wuu-hant - 吳語(正體)
xal - хальмг
xh - isiXhosa
xmf - მარგალური
xsy - saisiyat
yi - ייִדיש
yo - Yorùbá
yrl - Nhẽẽgatú
yue - 粵語
yue-hans - 粵语(简体)
yue-hant - 粵語(繁體)
za - Vahcuengh
zea - Zeêuws
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
zgh-latn - tamaziɣt tanawayt
zh - 中文
zh-cn - 中文(中国大陆)
zh-hans - 中文(简体)
zh-hant - 中文(繁體)
zh-hk - 中文(香港)
zh-mo - 中文(澳門)
zh-my - 中文(马来西亚)
zh-sg - 中文(新加坡)
zh-tw - 中文(臺灣)
zu - isiZulu
Format
Export for off-line translation
Export in native format
Export in CSV format
Fetch
<languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> {{note| Hydra is intended to be used by Nix/NixOS package developers; it is not needed to simply use NixOS.}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Hydra is a tool for continuous integration testing and software release that uses a purely functional language to describe build jobs and their dependencies. Continuous integration is a simple technique to improve the quality of the software development process. An automated system continuously or periodically checks out the source code of a project, builds it, runs tests, and produces reports for the developers. Thus, various errors that might accidentally be committed into the code base are automatically caught. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The official Hydra servers provide pre-built binary packages to speed up the update time for Nixpgs: Users do not have to compile them on their own computers. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The [https://nixos.org/hydra/manual/ Hydra manual] provides an overview of the functionality and features of Hydra, as well as an up-to-date installation guide. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A full deployment can be enabled as easy as: </div> <syntaxHighlight lang=nix> services.hydra = { enable = true; hydraURL = "http://localhost:3000"; # externally visible URL notificationSender = "hydra@localhost"; # e-mail of Hydra service # a standalone Hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines buildMachinesFiles = []; # you will probably also want, otherwise *everything* will be built from scratch useSubstitutes = true; }; </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The module will automatically enable [[PostgreSQL|postgresql]] if you do not change the <code>services.hydra.dbi</code> option. Database layout will be created automatically by the Hydra service, however keep in mind that some state will be stored in the database and a complete stateless configuration is currently not possible - do your backups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * See nixos-option or the [https://search.nixos.org/options?query=services.hydra Nixos Options page] for all options </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Web Configuration === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Hydra will provide the web interface [http://localhost:3000/ at localhost] port 3000. However you need to create a new admin user (as UNIX user <code>hydra</code>) before being able to perform any changes: </div> <syntaxHighlight lang=bash> # su - hydra $ hydra-create-user alice --full-name 'Alice Q. User' \ --email-address 'alice@example.org' --password-prompt --role admin </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Virtual machine === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If not configured explicitly to do otherwise, Hydra will specify localhost as the default build machine. By default, system features enabling builds to be performed in virtual machines like "kvm" or "nixos-test" are not enabled. Such jobs will be queued indefinitely. Those options can be activated as follows: </div> <syntaxHighlight lang=nix> { nix.buildMachines = [ { hostName = "localhost"; protocol = null; system = "x86_64-linux"; supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; maxJobs = 8; } ]; } </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This option leads to the file /etc/nix/machines being created. If the hydra service config is still set to buildMachinesFiles = [], then it will be ignored, so remove this option again or add <code>/etc/nix/machines</code> to it. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Flake jobset == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Configure jobset to the following: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Type: [[Flakes|Flake]] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Flake URI: an URI to a repo containing a Flake like git+https://git.myserver.net/user/repo.git </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The Flake output should have the attribute <code>hydraJobs</code> containing an attribute set that may be nested and reference derivations. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A sample Flake output that makes Hydra build all packages could look like this: </div> <syntaxHighlight lang=nix> { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = { self, nixpkgs, ... }: { packages.x86_64-linux = { ... }; hydraJobs = { inherit (self) packages; }; }; } </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Restricted Mode === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Hydra evaluates flakes in [https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-restrict-eval restricted mode]. This prevents access to files outside of the nix store, including those fetched as flake inputs. Update your <code>nix.settings.allowed-uris</code> to include URI prefixes from which you expect flake inputs to be fetched: </div> <syntaxHighlight lang=nix> nix.settings.allowed-uris = [ "github:" "git+https://github.com/" "git+ssh://github.com/" ]; </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Build a single Package from nixpkgs == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Right now it is not possible to build a single package from nixpkgs with just that input. You will need to provide a supplementary repository which defines what to build. For examples you can check the [https://github.com/makefu/hydra-example hydra-example by makefu] and in the [https://nixos.org/hydra/manual/#idm140737315920320 Hydra Manual]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Imperative Building === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> These steps are required to build the <code>hello</code> package. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> # log into Hydra after creating a user with <code>hydra-create-user</code> </div> <div lang="en" dir="ltr" class="mw-content-ltr"> # create new project </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * identifier: example-hello </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * display name: example-hello </div> <div lang="en" dir="ltr" class="mw-content-ltr"> # Actions -> Create jobset </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * identifier: hello </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Nix expression: <code>release.nix</code> in <code>hydra-example</code> -> will evaluate the file release.nix in the given input </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * check interval: 60 </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * scheduling shares: 1 </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Inputs: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {| class="wikitable" |- ! Input Name !! Type !! Value !! Note |- | nixpkgs || git checkout || https://github.com/nixos/nixpkgs nixos-21.11 || will check out branch nixos-21.11, will be made available to the nix expression via <code><nixpkgs></code>. |- | hydra-example || git checkout || https://github.com/makefu/hydra-example || hydra-example is used by the jobset as input, <code>release.nix</code> is in the root directory |} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> After creation, the jobset should be in the '''evaluation phase''' where inputs will be fetched. This phase may take some time as the complete <code>nixpkgs</code> repository needs to be downloaded before continuing. The result of the evaluation should be a single job which will get built. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Declarative Building === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Since 2016, Hydra supports declarative creation of jobsets. Check out the [https://github.com/shlevy/declarative-hydra-example example repository and description by Shea Levy]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Hydra Internals == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Definitions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This subsection provides an overview of the Hydra-specific definitions and how to configure them. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Project ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A cluster of Jobs which are all coming from a single input (like a git checkout), the first thing you will need to create. Every Job should be able to be built independently from another. Most of the time the project maps to a single repository like <code>nixpkgs</code>. It is comparable to the project definition in Jenkins. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Jobsets ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A Jobset is a list of jobs which will be run. Often a jobset fits to a certain branch (master, staging, stable). A Jobset is defined by its inputs and will trigger if these inputs change. For example when a new commit onto a branch is added. Jobsets may depend on each other. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Job ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A closure which will be built as part of a job set (like a single package, iso image or tarball). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Release Set ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Defines all the jobs which are described in your release. By convention a file called<code>release.nix</code> is being used. See the [https://nixos.org/hydra/manual/#idm140737315920320 Hydra manual for Build Recipes] for a thorough description of the structure. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Evaluation ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The process of interpreting nix code into a list of <code>.drv files</code>. These files are the build recipes for all related outputs. You can introspect these files by running <code>nix show-derivation nixpkgs.hello</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Build ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Instantiation of a Job which is being triggered by being part of the release set. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known Issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * hydra-queue-runner sometimes gets stuck even with builds are in the queue, and the builds are not scheduled. The issue is being tracked [https://github.com/NixOS/hydra/issues/366 here]. In the meantime, a workaround is to add a cron job that regularly restarts the hydra-queue-runner systemd service. Possible fix: [https://github.com/NixOS/hydra/commit/73ca325d1c0f7914640a63764c9a6d448fde5bd0] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * If you see <code>error: unexpected end-of-file</code> it can mean multiple things, some of them are: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> # You have a miss-match between nix versions on the Hydra server and the builder </div> <div lang="en" dir="ltr" class="mw-content-ltr"> # It can also mean that <code>hydra-queue-runner</code> needs privileges on the build server. Reference: [https://github.com/NixOS/nix/issues/2789] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * The default timeout for git operations is 600 seconds [https://github.com/NixOS/hydra/issues/1181], which might cause fetches of large repositories like [https://github.com/NixOS/nixpkgs nixos/nixpkgs] to fail: <code>error fetching latest change from git repo at `https://github.com/nixos/nixpkgs': timeout</code>. The timeout can be increased with the following configuration.nix snippet: </div> <syntaxHighlight lang=nix> { services.hydra.extraConfig = '' <git-input> timeout = 3600 </git-input> ''; } </syntaxHighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Hydra for NixOS releases == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Hydra is used for managing official Nix project releases. The project Hydra server: https://hydra.nixos.org/ </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Some Hydra trackers for Nix projects: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * [https://hydra.nixos.org/project/nixpkgs Nixpkgs] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * [https://hydra.nixos.org/project/nixos NixOS] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Resources == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * [https://www.youtube.com/watch?v=RXV0Y5Bn-QQ Video: Setting up a Hydra Build Farm by Peter Simons (2016)] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * [https://gist.github.com/joepie91/c26f01a787af87a96f967219234a8723 Hydra Caveats by Joepie91] </div> [[Category:Pedias]] [[Category:Hydra]] [[Category:Nix]] [[Category:Incomplete]] [[Category:Software]] [[Category:Server]]