nixos-config/modules/nixos/tildefriends.nix
2024-05-23 13:45:32 +02:00

43 lines
1.2 KiB
Nix

{
lib,
pkgs,
config,
...
}:
with lib; let
# WORK IN PROGRESS
# WORK IN PROGRESS
# WORK IN PROGRESS
# Shorter name to access final settings a
# user of hello.nix module HAS ACTUALLY SET.
# cfg is a typical convention.
cfg = config.services.tildefriends;
in {
# Declare what settings a user of this "hello.nix" module CAN SET.
options.services.tildefriends = {
enable = mkEnableOption "tildefriends service";
# greeter = mkOption {
# type = types.str;
# default = "world";
# };
};
# Define what other settings, services and resources should be active IF
# a user of this "hello.nix" module ENABLED this module
# by setting "services.hello.enable = true;".
config = mkIf cfg.enable {
systemd.services.tildefriends = {
after = ["network.target"];
wantedBy = ["multi-user.target"];
serviceConfig = {
WorkingDirectory = /home/tasia/Documents/tildefriends-db;
ExecStart = "${pkgs.tildefriends}/bin/tildefriends";
# ExecStart = "${pkgs.tmux}/bin/tmux -S /tmp/tmux.socket new-session -s my-session -d";
# ExecStop = "${pkgs.tmux}/bin/tmux -S /tmp/tmux.socket kill-session -t my-session";
# Type = "forking";
};
};
};
}