Skip to content

Instantly share code, notes, and snippets.

@sputn1ck
Created July 24, 2020 07:57
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 sputn1ck/8d774c26674a64833f473e0e35951732 to your computer and use it in GitHub Desktop.
Save sputn1ck/8d774c26674a64833f473e0e35951732 to your computer and use it in GitHub Desktop.
# configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration
./bitcoin
];
services.openssh.enable = true;
services.openssh.permitRootLogin = "prohibit-password";
users.users.root.openssh.authorizedKeys.keys = [
];
system.stateVersion = "20.03";
# bitcoin.nix
{ config, pkgs, lib, ... }: {
imports = [
<nix-bitcoin/modules/presets/secure-node.nix>
<nix-bitcoin/modules/secrets/generate-secrets.nix>
];
services.lnd.enable = true;
services.lnd.extraConfig = ''
accept-keysend=1
rpclisten=127.0.0.1:10009
rpclisten=10.100.0.4:10009
'';
services.lightning-loop.enable = true;
}
## krops.nix
let
krops = builtins.fetchGit {
url = "https://cgit.krebsco.de/krops/";
};
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" {};
nodeSource = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-20.03";
url = https://github.com/NixOS/nixpkgs-channels;
};
nix-bitcoin.git = {
ref = "origin/lightning-loop";
url = "https://github.com/nixbitcoin/nix-bitcoin.git";
};
nixos-config.file = toString ./node/configuration.nix;
hardware-configuration.file = toString ./node/hardware-configuration.nix;
bitcoin.file = toString ./node/bitcoin.nix;
}
];
in {
node = pkgs.krops.writeDeploy "deploy-server01" {
source = nodeSource;
target = "root@x.x.x.x";
};
}
@sputn1ck
Copy link
Author

deploy with nix-build --show-trace ./krops.nix -A node && ./result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment