Giter Club home page Giter Club logo

nixos-pcsd's Introduction

NixOS pcsd

This is a Nix flake containing the package pcs and a module for it that allows you to manage a Pacemaker cluster declaratively in nix code.

Docs

You can read about the options this module exposes here: https://matt1432.github.io/nixos-pcsd/all/

Usage

In your flake.nix inputs:

...
pcsd = {
  # This way of declaring inputs is way cleaner IMO
  type = "github";
  owner = "matt1432";
  repo = "nixos-pcsd";

  # Here is the classic one
  # url = "github:matt1432/nixos-pcsd";
};
...

Before enabling this module, it is very important to know that it will manage services.pacemaker and services.corosync for you. Any of their settings could be replaced by the ones you declare in services.pcsd.

In your server config, this would be the most barebones settings:

{pcsd, ...}: {
  imports = [pcsd.nixosModules.default];

  services.pcsd = {
    enable = true;
    enableBinaryCache = true;

    # I highly recommend using sops-nix or agenix for these settings
    corosyncKeyFile = builtins.toFile "keyfile" "some128charLongText";
    clusterUserPasswordFile = builtins.toFile "password" "somePassword";

    nodes = [
      {
        name = "this Machine's Hostname";
        nodeid = 1;
        ring_addrs = [
          # This is where your machine's local ips go
          "192.168.0.255"
        ];
      }

      # the other nodes of your cluster go here
    ];
  };
}

You can also take a look at my pcsd setup to see more options and a real world example.

Credits

nixos-pcsd's People

Contributors

matt1432 avatar

Stargazers

MiSumiSumi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.