Skip to content

Commit

Permalink
Merge #655: examples/flake.nix: minor improvements
Browse files Browse the repository at this point in the history
742fd8f examples/flake.nix: add `inputs.nixpkgs` (Erik Arvstedt)
89ea349 examples/flake.nix: add comments and extra service (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 742fd8f

Tree-SHA512: 7879d2c4cfa95db7b0310d402f6d8dc78fad1667f6a1021f466b8307e6f62235d113df70cc0932695fd3d80d7b141e7463e03ad45aac93c7e655c59c12c90a2f
  • Loading branch information
jonasnick committed Oct 23, 2023
2 parents 4c96a8d + 742fd8f commit 8a8f32a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ It's easiest to use an existing service as a template:
- [flake.nix](../flake.nix): update `nixpkgs.url`
- [cirrus.yml](../.cirrus.yml): update toplevel container -> image attribute
- [examples/configuration.nix](../examples/configuration.nix): update `system.stateVersion`
- [examples/flakes/flake.nix](../examples/flakes/flake.nix): update `inputs.nix-bitcoin.url`
- Treewide: check if any `TODO-EXTERNAL` comments can be resolved
26 changes: 20 additions & 6 deletions examples/flakes/flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# This is a system configuration template that uses nix-bitcoin.
#
# You can adapt this to an existing system flake by copying the parts
# relevant to nix-bitcoin.
#
# Make sure to check and edit all lines marked by 'FIXME:'

{
description = "A basic nix-bitcoin node";

inputs.nix-bitcoin.url = "github:fort-nix/nix-bitcoin/release";
# You can also use a version branch to track a specific NixOS release
# inputs.nix-bitcoin.url = "github:fort-nix/nix-bitcoin/nixos-23.05";

outputs = { self, nix-bitcoin }: {
inputs.nixpkgs.follows = "nix-bitcoin/nixpkgs";
inputs.nixpkgs-unstable.follows = "nix-bitcoin/nixpkgs-unstable";

outputs = { self, nixpkgs, nix-bitcoin, ... }: {

nixosConfigurations.mynode = nix-bitcoin.inputs.nixpkgs.lib.nixosSystem {
nixosConfigurations.mynode = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nix-bitcoin.nixosModules.default
Expand All @@ -23,21 +33,25 @@
# The secrets are stored in /etc/nix-bitcoin-secrets
nix-bitcoin.generateSecrets = true;

# Enable services.
# Enable some services.
# See ../configuration.nix for all available features.
services.bitcoind.enable = true;
services.clightning.enable = true;

# When using nix-bitcoin as part of a larger NixOS configuration, set the following to enable
# interactive access to nix-bitcoin features (like bitcoin-cli) for your system's main user
nix-bitcoin.operator = {
enable = true;
name = "main"; # Set this to your system's main user
# FIXME: Set this to your system's main user
name = "main";
};

# The system's main unprivileged user. This setting is usually part of your
# existing NixOS configuration.
# The system's main unprivileged user.
# In an existing NixOS configuration, this setting is usually already defined.
users.users.main = {
isNormalUser = true;
# FIXME: This is unsafe. Use `hashedpassword` or `passwordFile` instead in a real
# deployment: https://search.nixos.org/options?show=users.users.%3Cname%3E.hashedPassword
password = "a";
};

Expand Down

0 comments on commit 8a8f32a

Please sign in to comment.