• Stars
    star
    198
  • Rank 196,898 (Top 4 %)
  • Language
    Nix
  • License
    GNU General Publi...
  • Created almost 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Experimental deployment tool supporting multi-host abstractions

Nixus: Experimental deployment tool for multiple NixOS systems

This is a work-in-progress deployment tool I'm developing for myself and Niteo. Noteworthy features include:

  • Auto-rollback if the machine can't be reached via SSH anymore, protecting against a number of configuration mistakes such as
    • Messing up the network config
    • Removing your SSH key from the authorized keys
    • The activation script failing in any way
    • The boot activation failing in any way
    • The system crashing during the deployment
  • Multi-host abstraction modules, such as:
    • An SSH access module, allowing you to configure secure SSH access between machines
    • More to follow..
  • Secret management
  • More coming..

How to use it

Note: This is just to demonstrate, this will probably change in the future

Write a file like example/default.nix, then build the deployment script and call it

$ nix-build example/default.nix
these derivations will be built:
  /nix/store/lv8ck2k8b6vmsdp8wlqlpqr4shbkplfa-system-units.drv
  /nix/store/azyfd4qhv2hcdagcr8hmzwa2q284f9rh-etc.drv
  /nix/store/3kzhmi0flgcnpn6s5rym6hv8rs48hrs2-nixos-system-test-20.03pre-git.drv
  /nix/store/q6qx69mzy50llv3i7by5wwqyirqhpijy-deploy-foo.example.com.drv
  /nix/store/l7di8hzwa1m784ycqw01hdrybaxdi1jw-deploy.drv
building '/nix/store/lv8ck2k8b6vmsdp8wlqlpqr4shbkplfa-system-units.drv'...
building '/nix/store/azyfd4qhv2hcdagcr8hmzwa2q284f9rh-etc.drv'...
building '/nix/store/3kzhmi0flgcnpn6s5rym6hv8rs48hrs2-nixos-system-test-20.03pre-git.drv'...
building '/nix/store/q6qx69mzy50llv3i7by5wwqyirqhpijy-deploy-foo.example.com.drv'...
building '/nix/store/l7di8hzwa1m784ycqw01hdrybaxdi1jw-deploy.drv'...
/nix/store/z73pjq6d7n6f3xfhx9rycfk9sxqjmcav-deploy
$ ./result
[foo.example.com] Connecting to host...
[foo.example.com] Copying closure to host...
[foo.example.com] copying 3 paths...
[foo.example.com] copying path '/nix/store/f1028ijc3c2654z8ikzd378ryp644h3f-system-units' to 'ssh://[email protected]'...
[foo.example.com] copying path '/nix/store/9py44f4x9m83pr3j93c1fs95p0qy6175-etc' to 'ssh://[email protected]'...
[foo.example.com] copying path '/nix/store/8hbnksxrhgwpmia833xp8191a5yxw8ii-nixos-system-test-20.03pre-git' to 'ssh://[email protected]'...
[foo.example.com] Triggering system switcher...
[foo.example.com] Trying to confirm success...
[foo.example.com] Successfully activated new system!

Here is an example of a messed up network config:

[foo.example.com] Connecting to host...
[foo.example.com] Copying closure to host...
[foo.example.com] copying 3 paths...
[foo.example.com] copying path '/nix/store/dh08694j23zbp6rra8wbhr9yy4vri49h-system-units' to 'ssh://[email protected]'...
[foo.example.com] copying path '/nix/store/xyslp1r2267vsrlrq73h79w31p2na223-etc' to 'ssh://[email protected]'...
[foo.example.com] copying path '/nix/store/3ndywy808vm6ahbwkmam4sqvxy0hv7hq-nixos-system-test-20.03pre-git' to 'ssh://[email protected]'...
[foo.example.com] Triggering system switcher...
[foo.example.com] Trying to confirm success...
[foo.example.com] Failed to activate new system! Rolled back to previous one

More Repositories

1

all-hies

Cached Haskell IDE Engine Nix builds for all GHC versions
Nix
193
star
2

system

My system configuration
Nix
125
star
3

nixlisp

Nix
61
star
4

sanix

Sane stable stateless NixOS setup
Nix
57
star
5

on-demand-minecraft

Haskell
46
star
6

nixbot

Haskell
24
star
7

nix-xdg

[WIP] Nix overlay for making programs xdg compliant
Nix
19
star
8

soph

Efficiently import pictures while handling duplicates gracefully
Haskell
10
star
9

aoc20

Nix
10
star
10

nix-store-brute

Brute force nix store path prefixes
Shell
9
star
11

nix-rts

Nix
6
star
12

aoc18

Haskell
5
star
13

fastnixarray

An array implementation for Nix with logarithmic update and access operations
Nix
5
star
14

toponix

Toponix will be a bunch of Nix functions that can transform a simple network topology description into useful answers
Nix
4
star
15

nixpkgs-analyzer

Haskell
4
star
16

SwiftUnits

Framework for working with arbitrary units in Swift (WIP, Name and repo might change)
Swift
4
star
17

random-twitch-stream

Shell
3
star
18

guides

Some guides for mainly NixOS
3
star
19

arvy

Bachelor thesis on Arvy Heuristics for Distributed Mutual Exclusion
TeX
2
star
20

ScriptKit

Framework for convenient scripts in Swift (WIP)
Swift
2
star
21

nixperiments

Uncurated Nix experiments
Nix
2
star
22

nix-url-verify

Haskell
2
star
23

non-det-nix-parsing-repro

Reproducer for a non-deterministic parser show result
Nix
2
star
24

github-test

Testing some GitHub features
1
star
25

nixexprs

Nix
1
star
26

aoc19

Haskell
1
star
27

nix-quote-urls

Utility against unquoted Nix URIs
Haskell
1
star
28

linz

Haskell
1
star
29

hnix-test

Haskell
1
star
30

floxpkgs

Nix
1
star
31

picstream

A simple script to stream pictures to clients
1
star
32

modules-ng

Nix
1
star
33

nixos-services

1
star
34

dream2nix-modules

Nix
1
star
35

StackOverflow

Example code for StackOverflow answers
Swift
1
star
36

list-youtube-uploads

Bash script for listing youtube channel uploads
Shell
1
star