feat(42/irc): setup the irc server service
This commit is contained in:
parent
dc68443661
commit
a1bc1e4074
5 changed files with 75 additions and 2 deletions
45
services/forty_two/irc.nix
Normal file
45
services/forty_two/irc.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.service.forty_two.irc;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg {
|
||||
environment.systemPackages = with pkgs; [
|
||||
llvmPackages.clang
|
||||
llvmPackages.clang-tools
|
||||
gnumake
|
||||
];
|
||||
users = {
|
||||
groups.ft_irc = {
|
||||
name = "ft_irc";
|
||||
};
|
||||
users.ft_irc = {
|
||||
description = "Utilisateur the ft_irc server";
|
||||
group = "ft_irc";
|
||||
home = "/opt/irc/";
|
||||
isSystemUser = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ft_irc = {
|
||||
description = "Upload our irc on my own server";
|
||||
after = [
|
||||
"network.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"multi-user.target"
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "ft_irc";
|
||||
WorkingDirectory = "/opt/irc";
|
||||
ExecStartPre = "${pkgs.git}/bin/git pull";
|
||||
ExecStart = "/opt/irc/ircserv 4243 irc";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
RemainAfterExit = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue