Switch to stable channel but pull the bitcoind and clightning packages and the tor module from unstable
This commit is contained in:
parent
54b4eb24a6
commit
5e4e959e26
@ -6,7 +6,7 @@ Work in progress.
|
|||||||
|
|
||||||
Profiles
|
Profiles
|
||||||
---
|
---
|
||||||
`nixbitcoin.nix` provides the two profiles "minimal" and "all":
|
`nix-bitcoin.nix` provides the two profiles "minimal" and "all":
|
||||||
|
|
||||||
* minimal
|
* minimal
|
||||||
* bitcoind (pruned) with outbound connections through Tor and inbound connections through a hidden
|
* bitcoind (pruned) with outbound connections through Tor and inbound connections through a hidden
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
let
|
|
||||||
# Custom packages
|
|
||||||
nodeinfo = (import pkgs/nodeinfo.nix);
|
|
||||||
lightning-charge = import pkgs/lightning-charge.nix { inherit pkgs; };
|
|
||||||
nanopos = import pkgs/nanopos.nix { inherit pkgs; };
|
|
||||||
spark-wallet = import pkgs/spark-wallet.nix { inherit pkgs; };
|
|
||||||
liquidd = import pkgs/liquidd.nix;
|
|
||||||
in {
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./modules/nixbitcoin.nix
|
|
||||||
];
|
|
||||||
# Turn off binary cache by setting binaryCaches to empty list
|
|
||||||
# nix.binaryCaches = [];
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
|
||||||
inherit nodeinfo;
|
|
||||||
inherit lightning-charge;
|
|
||||||
inherit nanopos;
|
|
||||||
inherit spark-wallet;
|
|
||||||
liquidd = (pkgs.callPackage liquidd { });
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "UTC";
|
|
||||||
services.openssh.enable = true;
|
|
||||||
networking.firewall.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
vim tmux
|
|
||||||
htop
|
|
||||||
];
|
|
||||||
|
|
||||||
# This value determines the NixOS release with which your system is to be
|
|
||||||
# compatible, in order to avoid breaking some software such as database
|
|
||||||
# servers. You should change this only after NixOS release notes say you
|
|
||||||
# should.
|
|
||||||
system.stateVersion = "18.09"; # Did you read the comment?
|
|
||||||
}
|
|
@ -4,25 +4,43 @@
|
|||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
services.nixbitcoin.enable = true;
|
|
||||||
# Install and use minimal or all modules
|
|
||||||
services.nixbitcoin.modules = "all";
|
|
||||||
|
|
||||||
# FIXME: Define your hostname.
|
|
||||||
networking.hostName = "nix-bitcoin";
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./configuration-nixbitcoin.nix
|
./nix-bitcoin.nix
|
||||||
# FIXME: Uncomment next line to import your hardware configuration. If so,
|
# FIXME: Uncomment next line to import your hardware configuration. If so,
|
||||||
# add the hardware configuration file to the same directory as this file.
|
# add the hardware configuration file to the same directory as this file.
|
||||||
#./hardware-configuration.nix
|
#./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
services.nix-bitcoin.enable = true;
|
||||||
|
# FIXME Install and use minimal or all modules
|
||||||
|
services.nix-bitcoin.modules = "all";
|
||||||
|
|
||||||
|
# FIXME: Define your hostname.
|
||||||
|
networking.hostName = "nix-bitcoin";
|
||||||
|
time.timeZone = "UTC";
|
||||||
|
|
||||||
# FIXME: Add your SSH pubkey
|
# FIXME: Add your SSH pubkey
|
||||||
|
services.openssh.enable = true;
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
openssh.authorizedKeys.keys = [ "" ];
|
openssh.authorizedKeys.keys = [ "" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# FIXME: add packages you need in your system
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
];
|
||||||
|
|
||||||
|
# FIXME: Turn off the binary cache by setting binaryCaches to empty list.
|
||||||
|
# This means that it will take a while for all packages to be built but it
|
||||||
|
# prevents a compromised cache taking over your system. As a result, the next
|
||||||
|
# line should be uncommented in production systems.
|
||||||
|
# nix.binaryCaches = [];
|
||||||
|
|
||||||
# FIXME: Add custom options options (like boot options):
|
# FIXME: Add custom options options (like boot options):
|
||||||
|
|
||||||
|
|
||||||
|
# This value determines the NixOS release with which your system is to be
|
||||||
|
# compatible, in order to avoid breaking some software such as database
|
||||||
|
# servers. You should change this only after NixOS release notes say you
|
||||||
|
# should.
|
||||||
|
system.stateVersion = "18.09"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.port;
|
type = types.ints.u16;
|
||||||
default = 9116;
|
default = 9116;
|
||||||
description = ''
|
description = ''
|
||||||
"The port on which to listen for connections.";
|
"The port on which to listen for connections.";
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.nixbitcoin-webindex;
|
cfg = config.services.nix-bitcoin-webindex;
|
||||||
indexFile = pkgs.writeText "index.html" ''
|
indexFile = pkgs.writeText "index.html" ''
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
@ -35,7 +35,7 @@ let
|
|||||||
sed -i "s/CLIGHTNING_ID/$CLIGHTNING_ID/g" /var/www/index.html
|
sed -i "s/CLIGHTNING_ID/$CLIGHTNING_ID/g" /var/www/index.html
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
options.services.nixbitcoin-webindex = {
|
options.services.nix-bitcoin-webindex = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
@ -3,7 +3,7 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.nixbitcoin;
|
cfg = config.services.nix-bitcoin;
|
||||||
minimalPackages = with pkgs; [
|
minimalPackages = with pkgs; [
|
||||||
tor
|
tor
|
||||||
bitcoin
|
bitcoin
|
||||||
@ -36,12 +36,12 @@ in {
|
|||||||
./clightning.nix
|
./clightning.nix
|
||||||
./lightning-charge.nix
|
./lightning-charge.nix
|
||||||
./nanopos.nix
|
./nanopos.nix
|
||||||
./nixbitcoin-webindex.nix
|
./nix-bitcoin-webindex.nix
|
||||||
./liquid.nix
|
./liquid.nix
|
||||||
./spark-wallet.nix
|
./spark-wallet.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.nixbitcoin = {
|
options.services.nix-bitcoin = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -59,6 +59,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
|
||||||
# Tor
|
# Tor
|
||||||
services.tor.enable = true;
|
services.tor.enable = true;
|
||||||
services.tor.client.enable = true;
|
services.tor.client.enable = true;
|
||||||
@ -69,7 +71,7 @@ in {
|
|||||||
port = 22;
|
port = 22;
|
||||||
}];
|
}];
|
||||||
version = 3;
|
version = 3;
|
||||||
}
|
};
|
||||||
|
|
||||||
# bitcoind
|
# bitcoind
|
||||||
services.bitcoind.enable = true;
|
services.bitcoind.enable = true;
|
||||||
@ -143,7 +145,7 @@ in {
|
|||||||
|
|
||||||
services.lightning-charge.enable = cfg.modules == "all";
|
services.lightning-charge.enable = cfg.modules == "all";
|
||||||
services.nanopos.enable = cfg.modules == "all";
|
services.nanopos.enable = cfg.modules == "all";
|
||||||
services.nixbitcoin-webindex.enable = cfg.modules == "all";
|
services.nix-bitcoin-webindex.enable = cfg.modules == "all";
|
||||||
services.clightning.autolisten = cfg.modules == "all";
|
services.clightning.autolisten = cfg.modules == "all";
|
||||||
services.spark-wallet.enable = cfg.modules == "all";
|
services.spark-wallet.enable = cfg.modules == "all";
|
||||||
services.tor.hiddenServices.spark-wallet = {
|
services.tor.hiddenServices.spark-wallet = {
|
37
nix-bitcoin.nix
Normal file
37
nix-bitcoin.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
unstable-pkgs-git = builtins.fetchGit {
|
||||||
|
url = "https://github.com/nixos/nixpkgs-channels";
|
||||||
|
ref = "nixos-unstable";
|
||||||
|
rev = "201d739b0ffbebceb444864d1856babcd1a666a8";
|
||||||
|
};
|
||||||
|
unstable-pkgs = import unstable-pkgs-git { };
|
||||||
|
|
||||||
|
# Custom packages
|
||||||
|
nodeinfo = (import pkgs/nodeinfo.nix);
|
||||||
|
lightning-charge = import pkgs/lightning-charge.nix { inherit pkgs; };
|
||||||
|
nanopos = import pkgs/nanopos.nix { inherit pkgs; };
|
||||||
|
spark-wallet = import pkgs/spark-wallet.nix { inherit pkgs; };
|
||||||
|
liquidd = import pkgs/liquidd.nix;
|
||||||
|
in {
|
||||||
|
disabledModules = [ "services/security/tor.nix" ];
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./modules/nix-bitcoin.nix
|
||||||
|
(unstable-pkgs-git + "/nixos/modules/services/security/tor.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
# Use bitcoin and clightning from unstable
|
||||||
|
bitcoin = unstable-pkgs.bitcoin.override { };
|
||||||
|
altcoins.bitcoind = unstable-pkgs.altcoins.bitcoind.override { };
|
||||||
|
clightning = unstable-pkgs.clightning.override { };
|
||||||
|
|
||||||
|
# Add custom packages
|
||||||
|
inherit nodeinfo;
|
||||||
|
inherit lightning-charge;
|
||||||
|
inherit nanopos;
|
||||||
|
inherit spark-wallet;
|
||||||
|
liquidd = (pkgs.callPackage liquidd { });
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user