https://github.com/peti/hydra-tutorial/blob/master/hydra-master.nix#L51-L73
On Sun, Mar 5, 2017 at 12:49 AM, Bas van Dijk <[email protected]> wrote: > Hi Bjørn, > > At LumiGuide I use the following systemd service to setup hydra: > > # Create a hydra admin user named "xxxx" and copy the GitHub private SSH > # key to hydra's home directory so that it can connect to GitHub to clone > # our repo's. > systemd.services.lumi-hydra-setup = { > wantedBy = [ "multi-user.target" ]; > requires = [ "hydra-init.service" "postgresql.service" ]; > after = [ "hydra-init.service" "postgresql.service" ]; > environment = config.systemd.services.hydra-init.environment; > path = [ config.services.hydra.package ]; > script = > let hydraHome = config.users.users.hydra.home; > hydraQueueRunnerHome = config.users.users.hydra-queue-runner.home; > in '' > hydra-create-user xxxx \ > --full-name 'XXXX' \ > --email-address '[email protected]' \ > --password '${cfg.xxxxPassword}' \ > --role admin > > mkdir -p "${hydraHome}/.ssh" > chmod 700 "${hydraHome}/.ssh" > cp "*xxxx*" "${hydraHome}/.ssh/id_rsa" > chown -R hydra:hydra "${hydraHome}/.ssh" > chmod 600 "${hydraHome}/.ssh/id_rsa" > mkdir -p "${hydraQueueRunnerHome}/.ssh" > chmod 700 "${hydraQueueRunnerHome}/.ssh" > cp "*xxxx*" "${hydraQueueRunnerHome}/.ssh/id_rsa" > chown -R hydra-queue-runner:hydra "${hydraQueueRunnerHome}/.ssh" > chmod 600 "${hydraQueueRunnerHome}/.ssh/id_rsa" > ''; > serviceConfig = { > Type = "oneshot"; > RemainAfterExit = true; > }; > }; Note that I set the environment to be the hydra-init environment. With > a bit of luck that's the solution for your problem. > > Bas > > On 4 March 2017 at 11:59, Bjørn Forsman <[email protected]> wrote: > >> Hi all Hydra + Nixpkgs users, >> >> How did you manage to run "hydra-create-user"? It fails for me: >> >> $ sudo -u hydra hydra-create-user alice --full-name 'Alice Q. User' >> --email-address '[email protected]' --password alice --role admin >> DBIx::Class::Storage::DBI::_prepare_sth(): DBI Exception: >> DBD::SQLite::db prepare_cached failed: no such table: Users at >> /nix/store/2jy4y3nml6qljayqjlrf8mx6rrgj8g4l-hydra-2017-02- >> 03/bin/.hydra-create-user-wrapped >> line 56 >> >> This is on NixOS 17.03, using the hydra module provided by nixpkgs. >> I've set "services.hydra.enable = true" in configuration.nix, >> activated the configuration and verified that the hydra webUI is up. I >> even have the 'Users' table that "hydra-create-user" says does not >> exist: >> >> $ sudo psql -U hydra >> psql (9.5.6) >> Type "help" for help. >> >> hydra=> select * from Users; >> username | fullname | emailaddress | password | emailonerror | type >> | publicdashboard >> ----------+----------+--------------+----------+------------ >> --+------+----------------- >> (0 rows) >> >> Any suggestions? >> >> Best regards, >> Bjørn Forsman >> _______________________________________________ >> nix-dev mailing list >> [email protected] >> http://lists.science.uu.nl/mailman/listinfo/nix-dev >> > > > _______________________________________________ > nix-dev mailing list > [email protected] > http://lists.science.uu.nl/mailman/listinfo/nix-dev > >
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
