blob: fa7ee5d41f63829c6d4e2590a95580241fe81e44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
{
description = "CrashOverBurn.com";
# TODO: cgit, ejabber signup
inputs = {
nixinate = {
url = "github:DarthPJB/nixinate";
inputs.nixpkgs.follows = "nixpkgs";
};
secrix.url = "github:platonic-systems/secrix";
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
#nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-25.05";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
};
outputs = inputs@{ self, nixpkgs, secrix, nixinate, simple-nixos-mailserver }:
let
inherit (inputs.secrix) secrix;
pkgs = nixpkgs.legacyPackages.x86_64-linux;
webroot = "${self}/webroot";
fqdn = "crashoverburn.com";
hashedPasswordFile = "${self}/password.file";
in
{
formatter.x86_64-linux = pkgs.nixpkgs-fmt;
apps.x86_64-linux = (nixinate.lib.genDeploy.x86_64-linux self) // ({ secrix = secrix self; });
devShells.x86_64-linux.default =
pkgs.mkShell {
buildInputs = with pkgs; [ figlet tmux ];
shellHook = ''
# Session Name
session="project-env-sh"
# Check if the session exists, discarding output
# We can check $? for the exit status (zero for success, non-zero for failure)
tmux has-session -t $session 2>/dev/null
if [ $? != 0 ]; then
# Start New Session with our name
tmux new-session -d -s $session
# Name first Window and start zsh
tmux rename-window -t 0 'Main'
tmux send-keys -t 'Main' 'nix flake show' C-m
tmux send-keys -t 'Main' 'clear' C-m
# Create and setup pane for btop
tmux split-window -h
tmux rename-window 'btop'
tmux send-keys -t 'btop' 'ssh -t commander@193.16.42.36 btop' C-m
tmux select-pane -t 0
# Create and setup pane for btop
tmux split-window -v
tmux rename-window 'ssh'
tmux send-keys -t 'ssh' 'ssh commander@193.16.42.36' C-m
tmux select-pane -t 0
fi
tmux attach-session -t $session'';
};
nixosConfigurations = {
crash-over-burn-1 =
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
simple-nixos-mailserver.nixosModule
inputs.secrix.nixosModules.default
./openstack.nix
./users/commander.nix
(import ./services/acme_server.nix { fqdn = "crashoverburn.com"; })
(import ./services/cgit.nix { fqdn = "code.${fqdn}"; })
(import ./services/murmur.nix { fqdn = "mumble.${fqdn}"; })
(import ./services/movim.nix { fqdn = "social.${fqdn}"; })
(import ./services/website.nix { inherit webroot; })
(import ./services/ejabberd.nix { inherit fqdn; })
(import ./services/mailserver.nix { inherit hashedPasswordFile; })
./machines/overburn-1.nix
{
secrix.hostPubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII3ElH/WQjW3B2yUBFFPpF8IIHsYrHODwTid6YM2npiw root@web-crash-over-burn";
secrix.defaultEncryptKeys = {
crash = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILhzz/CAb74rLQkDF2weTCb0DICw1oyXNv6XmdLfEsT5 crash@crashoverburn.com" ];
};
imports = [
"${nixpkgs}/nixos/modules/virtualisation/openstack-config.nix"
];
_module.args =
{
inherit self inputs;
nixinate = {
host = "193.16.42.36";
port = 1108;
sshUser = "commander";
substituteOnTarget = false;
hermetic = true;
buildOn = "local";
};
};
}
];
};
};
};
}
|