Skip to content

Commit

Permalink
mistral: ms-sql-server
Browse files Browse the repository at this point in the history
  • Loading branch information
moni-dz committed Sep 8, 2024
1 parent 030848b commit 755bba6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
10 changes: 10 additions & 0 deletions hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
server = true;

modules = [
inputs.agenix.nixosModules.default

{
age.secrets.ms-sql-server = {
file = ../secrets/ms-sql-server.age;
owner = "moni";
mode = "0444";
};
}

inputs.nix-minecraft.nixosModules.minecraft-servers
./mistral/configuration.nix
];
Expand Down
24 changes: 22 additions & 2 deletions hosts/mistral/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
inputs,
modulesPath,
config,
lib,
pkgs,
...
Expand Down Expand Up @@ -30,8 +31,10 @@
programs.fish.enable = true;

networking.firewall = {
allowedTCPPorts = [ 4747 ];
allowedUDPPorts = [ 4747 ];
allowedTCPPorts = [
1433
4747
];
};

services = {
Expand Down Expand Up @@ -195,4 +198,21 @@
shell = pkgs.fish;
extraGroups = [ "wheel" ];
};

virtualisation = {
docker.enable = true;

oci-containers = {
backend = "docker";

containers.ms-sql-server = {
image = "mcr.microsoft.com/mssql/server:2022-latest";
autoStart = true;
ports = [ "1433:1433" ];
extraOptions = [ ];
environment.ACCEPT_EULA = "y";
environmentFiles = [ config.age.secrets.ms-sql-server.file ];
};
};
};
}
8 changes: 4 additions & 4 deletions hosts/starcruiser/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@
# $ sudo smbpasswd -a yourusername

# This adds to the [global] section:
extraConfig = ''
browseable = yes
smb encrypt = required
'';
settings."global" = {
browseable = "yes";
"smb encrypt" = "required";
};

shares = {
homes = {
Expand Down
11 changes: 11 additions & 0 deletions secrets/ms-sql-server.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
age-encryption.org/v1
-> ssh-ed25519 KAuKJQ uNmFlnOJrSfCYukis4yKo/R0vPbtft6l7bFLL2rhEzM
3VUCbsImDTPwORsfdV2Upwm2oxdcamCEUrScDnbUOF8
-> ssh-ed25519 OasC+A vDF4rFXn4Ej6s58w3DIO1CcwxsLc1ea9xI5ziiSe8AY
JIGPq4U2ekfmm6l2e9EW7oq91Vw0KvKutIaIdt/vOwQ
-> ssh-ed25519 KAuKJQ K6HF9PlDt8n3J6cQg7FY0UYMWON1dC/XQIyrOS6WKEk
n33slXMowtZWwmbiG/LxOx0UO6uUMglYsugMlhi2GNM
-> ssh-ed25519 fKg5bA EPjboK4/bFjUyh/5bSJEvhkpC8nTrS7tSskDzD20Om4
burv5DChCvC+rhkeei4n+V8Lg+fA8BEfCR8WeiuaI90
--- 1ru76Rtfhr56aDxjc1G9y719Y662nCWVA1qgqtEF5Es
�ő��ޫ�?[s��2ՕN**xZ�:YrZ����I�X����J|x��)�!r���<�Sr��w
10 changes: 6 additions & 4 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ let
zero = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOf7dkQDloUFN1Hxn/yWrcqMaJiH/jsXUGAAtL9l92xQ";
starcruiser = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKrPdqIiTrGqnN6eAhRuGl9ZV2sUz/IR85T3/TzUT4Ol";
riscake = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEeZg4xxANKadIm8hnhM/rQrl77Xwwp0tFRnnANtFgI3";
mistral = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDRGyDQlHPogYIt0IIwI+/1D+U3qbOHOZOyPsAN2NWt";

users = [
moni.linux
moni.darwin
zero
];
hosts = [
in
{
"tokens.age".publicKeys = users ++ [
starcruiser
riscake
];
in
{
"tokens.age".publicKeys = users ++ hosts;

"ms-sql-server.age".publicKeys = users ++ [ mistral ];
}

0 comments on commit 755bba6

Please sign in to comment.