Skip to content

Commit

Permalink
motd added for servers
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Jul 15, 2024
1 parent c40223c commit a507188
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 26 deletions.
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
nix
nil
git
nixd
just
nixpkgs-fmt
nixpkgs-lint
];

# Set environment variables, if needed
Expand All @@ -105,7 +108,7 @@
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter =
forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);

# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
users = import ./users;
maid = import ./maid.nix;
boot = import ./boot.nix;
motd = import ./motd.nix;
data = import ./data.nix;
docker = import ./docker.nix;
network = import ./network.nix;
Expand Down
32 changes: 32 additions & 0 deletions modules/nixos/motd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ config
, lib
, pkgs
, inputs
, ...
}: {
config = {
users.motd = ''
__ __ __ ________ __
/ //_/___ / /_ ______ ___ ____ _ / ____/ //_/
/ ,< / __ \/ / / / / __ `__ \/ __ `/ / / __/ ,<
/ /| / /_/ / / /_/ / / / / / / /_/ / / /_/ / /| |
/_/ |_\____/_/\__, /_/ /_/ /_/\__,_/ \____/_/ |_|
/____/
Welcome to Kolyma's Global Server Infrastructure!
All Kolyma servers are managed via NixOS'es declarative configuration system.
Any global changes has to be applied to the public configuration repository at:
https://github.com/kolyma-labs/instances
# Server Instances & Applications
Any server instances and applications must be hosted at /srv path. Each app
should have its own directory with short and clear name. For example:
/srv/kolyma-website, /srv/kolyma-telegram-bot
# Docker
Only docker compose (not docker run) services can be hosted imperatively, feel
free to to use globally available docker compose for this purposes.
'';
};
}
16 changes: 8 additions & 8 deletions nixos/kolyma-1/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
{ inputs
, outputs
, lib
, config
, pkgs
, ...
}: {
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
Expand All @@ -13,6 +12,7 @@
outputs.nixosModules.boot
outputs.nixosModules.data
outputs.nixosModules.maid
outputs.nixosModules.motd
outputs.nixosModules.network
outputs.nixosModules.nixpkgs

Expand All @@ -36,7 +36,7 @@
security.sudo.wheelNeedsPassword = false;

# To be able to SSH into the system on emergency
users.users.root.openssh.authorizedKeys.keys = [''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness''];
users.users.root.openssh.authorizedKeys.keys = [ ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness'' ];

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
Expand Down
16 changes: 8 additions & 8 deletions nixos/kolyma-2/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
{ inputs
, outputs
, lib
, config
, pkgs
, ...
}: {
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
Expand All @@ -13,6 +12,7 @@
outputs.nixosModules.boot
outputs.nixosModules.data
outputs.nixosModules.maid
outputs.nixosModules.motd
outputs.nixosModules.network
outputs.nixosModules.nixpkgs

Expand All @@ -36,7 +36,7 @@
security.sudo.wheelNeedsPassword = false;

# To be able to SSH into the system on emergency
users.users.root.openssh.authorizedKeys.keys = [''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness''];
users.users.root.openssh.authorizedKeys.keys = [ ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness'' ];

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
Expand Down
16 changes: 8 additions & 8 deletions nixos/kolyma-3/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
{ inputs
, outputs
, lib
, config
, pkgs
, ...
}: {
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
Expand All @@ -13,6 +12,7 @@
outputs.nixosModules.boot
outputs.nixosModules.data
outputs.nixosModules.maid
outputs.nixosModules.motd
outputs.nixosModules.network
outputs.nixosModules.nixpkgs

Expand Down Expand Up @@ -46,7 +46,7 @@
security.sudo.wheelNeedsPassword = false;

# To be able to SSH into the system on emergency
users.users.root.openssh.authorizedKeys.keys = [''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness''];
users.users.root.openssh.authorizedKeys.keys = [ ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAGqU+JleLM0T44P2quirtLPrhFExOi6EOe0GYXkTFcTSjhw9LqiuX1/FbqNdKTaP9k6CdV3xc/8Z5wxbNOhpcPi9XLoupv9oNyIew7QYl+ZoAck6/qPsM7uptGYCwo0/ErzPNLd3ERD3KT1axCqrI6rWJ+JFOMAPtGeAZZxIedksViZ5SuNhpzXCIzS2PACqDTxFj7JwXK/pQ200h9ZS0MSh7iLKggXQfRVDndJxRnVY69NmbRa4MqkjgyxqWSDbqrDAXuTHpqKJ5kpXJ6p2a82EIHcCwXXpEmLwKxatxWJWJb9nurm3aS74BYmT3pRVVSPC6n5a2LWN9GxzvVh3AXXZtWGvjXSqBxHdSyUoDPuZnDneycdRC5vs6I1jSGTyDFdc4Etq1M5uUYb6SqCjJIBvTNqVnOf8nzFwl/ENvc8sbIVtILgAbBdwDiiQSu8xppqWMZfkQJy+uI5Ok7TZ8o5rGIblzfKyTiljCQb7RO7Klg3TwysetREn8ZEykBx0= This world soon will cherish into my darkness of my madness'' ];

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
Expand Down
4 changes: 3 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
nativeBuildInputs = with pkgs; [
nix
nil
alejandra
git
nixd
nixpkgs-fmt
nixpkgs-lint
];
};
}

0 comments on commit a507188

Please sign in to comment.