Skip to content

Instantly share code, notes, and snippets.

@nicflores
Last active February 16, 2018 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicflores/72f7ec9ca9f0295755fb3306745920f5 to your computer and use it in GitHub Desktop.
Save nicflores/72f7ec9ca9f0295755fb3306745920f5 to your computer and use it in GitHub Desktop.
# /home/demo/project/launcher/default.nix
with import <nixpkgs>{};
stdenv.mkDerivation rec {
name = "Launcher";
version = "master";
benchmark_version = "0.2.0";
src = fetchgitPrivate {
url = "git@github.com:arepo/launcher.git";
rev = "ccfdf243e0e6b12df02488c6e0cdcda1730f70e2";
sha256 = "1ya76myr5vq8gg1p2kpx68iwr6abkzpcc6j78qm8sjrr5g193hdk";
fetchSubmodules = true;
};
phases = "installPhase";
installPhase = ''
mkdir -p $out/bin
cp ${src}/launcher $out/bin/launcher
chmod +x $out/bin/launcher
'';
}
# /etc/nixos/configuration.nix
{ config, options, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/virtualbox-demo.nix>
];
services.sshd.enable = true;
networking.firewall.enable = false;
nix.nixPath = options.nix.nixPath.default ++ [
(let
sshKey =
pkgs.writeText "git_deploy" "/etc/ssh/ssh_host_rsa_key";
sshConfigFile =
pkgs.writeText "ssh_config" ''
Host github.com
IdentityFile ${sshKey}
StrictHostKeyChecking=no
'';
in
"ssh-config-file=${sshConfigFile}"
)
];
environment.systemPackages =
let
launcher = import /home/demo/project/launcher/default.nix;
in
(with pkgs; [
vim
socat
nix-prefetch-git
jq
curl
jre
]) ++ [ launcher ];
}
# error
> sudo nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/4bbx9nrkww8z56vfqhd6yd21s5ywxrc8-launcher-ccfdf24.drv
/nix/store/3sva9ahavq6pa9j2m60sicxmmm2knd85-Launcher.drv
/nix/store/w4xsvicywyich7rx5lbbn8mzb7h4a5zg-system-path.drv
/nix/store/jxx2y1rfh073yrvlgy63sb2haxfsyvs6-dbus-1.drv
/nix/store/pb9lq38ixar1zxq7jf7nj3fdvrj68yb8-unit-dbus.service.drv
/nix/store/j55a8xnvcvglr9kfwhipd8i0mz1wx74k-user-units.drv
/nix/store/gpwy23bi2x54sfaqikm4h38fmy8vhkiz-unit-systemd-fsck-.service.drv
/nix/store/mnyl3j22q5bff7bmws26g7874mnrh4vh-unit-polkit.service.drv
/nix/store/ld28s75jvr6z8yj82cp4ih1iihz2dg0f-system-units.drv
/nix/store/3377a7v8345yh7xsilbrqhy5yi0pfz76-etc.drv
/nix/store/7k9qvfhalalalaz2sjfbmi0j0kn4qqs0-nixos-system-nixos-17.09.2281.b4a0c011e81.drv
building path(s) ‘/nix/store/bnmhd7bqlb0c3qb5a1h0j8a1sm8xpfa4-launcher-ccfdf24’
exporting git@github.com:arepo/launcher.git (rev ccfdf243e0e6b12df02488c6e0cdcda1730f70e2) into /nix/store/bnmhd7bqlb0c3qb5a1h0j8a1sm8xpfa4-launcher-ccfdf24
Initialized empty Git repository in /nix/store/bnmhd7bqlb0c3qb5a1h0j8a1sm8xpfa4-launcher-ccfdf24/.git/
Failed to add the host to the list of known hosts (/var/empty/.ssh/known_hosts). <===================??????
Load key "/nix/store/pk1dm69pwqsf0wr0fdxvm2likkcdsiag-git_deploy": invalid format
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Failed to add the host to the list of known hosts (/var/empty/.ssh/known_hosts).
Load key "/nix/store/pk1dm69pwqsf0wr0fdxvm2likkcdsiag-git_deploy": invalid format
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Unable to checkout ccfdf243e0e6b12df02488c6e0cdcda1730f70e2 from git@github.com:arepo/launcher.git.
builder for ‘/nix/store/4bbx9nrkww8z56vfqhd6yd21s5ywxrc8-launcher-ccfdf24.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/3sva9ahavq6pa9j2m60sicxmmm2knd85-Launcher.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/w4xsvicywyich7rx5lbbn8mzb7h4a5zg-system-path.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/7k9qvfhalalalaz2sjfbmi0j0kn4qqs0-nixos-system-nixos-17.09.2281.b4a0c011e81.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/7k9qvfhalalalaz2sjfbmi0j0kn4qqs0-nixos-system-nixos-17.09.2281.b4a0c011e81.drv’ failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment