Compare commits

...

10 commits

Author SHA1 Message Date
Vic
5a217c9f80 make redis simple 2024-08-16 10:59:52 +02:00
Vic
c65a6134b4 typo 2024-08-16 10:58:16 +02:00
Vic
5ea10df4f8 fix typos 2024-08-16 10:56:11 +02:00
Vic
f2a0ae2c6a Modularize+ redis systemd 2024-08-16 10:54:22 +02:00
Vic
e8a36e88b3 oh comments werent like that 2024-08-16 10:44:22 +02:00
Vic
7da7459717 fix Environment typo 2024-08-16 10:43:17 +02:00
Vic
bbea040b99 fix enviroment 2024-08-16 10:35:40 +02:00
Vic
a1825bf0cd this? 2024-08-16 10:31:35 +02:00
Vic
a1ff792e6d fix? 2024-08-16 10:30:34 +02:00
Vic
55254f61da more fixes sorry 2024-08-16 10:27:32 +02:00
3 changed files with 80 additions and 41 deletions

37
Hackey/Hackey.nix Normal file
View file

@ -0,0 +1,37 @@
{ pkgs, ...}:{
home.file = {
"Hackey/Sharkey/.config/default.yml" = {
source = ./default.yml;
};
};
systemd.user.services = {
Hackey = {
Unit = {
Description = "Hackey instance";
After = [ "network-online.target" ];
};
Service = {
Type = "simple";
ExecStart = "pnpm start";
WorkingDirectory = "/home/vic/Hackey/Sharkey";
Environment = [
"NODE_ENV=production"
"NODE_OPTIONS=--max-old-space-size=2048"
"MK_CONFIG_DB_PASS_FILE=/home/vic/.config/pass"
];
SyslogIdentifier = "hackey";
Restart = "always";
TimeoutSec = 60;
};
Install = {
WantedBy = [ "default.target" ];
};
};
};
}

View file

@ -1,5 +1,10 @@
{ configs, pkgs }: {
{ configs, pkgs, ... }:
{
imports = [
./redis/Redis.nix
./Hackey/Hackey.nix
];
home.username = "vic";
@ -7,7 +12,8 @@
home.packages = [
pkgs.helix
pkgs.helix #editor
pkgs.bat #modern cat
];
home.stateVersion = "24.05";
@ -17,51 +23,13 @@
PAGER = "less";
};
home.file = {
".config/redis/redis.conf" = {
source = ./redis/redis.conf;
};
}
home.file = {
"Hackey/Sharkey/.config/default.yml" = {
source = ./Hackey/default.yml;
};
};
systemd.user.services = {
Hackey = {
Unit = {
Description = "Hackey instance";
After = [ "network-online.target" ];
};
Service = {
Type = "simple";
ExecStart = "pnpm start";
WorkingDirectory = "${home.homeDirectory}/Hackey/Sharkey";
Enviroment = {
NODE_ENV = "production";
NODE_OPTIONS = "--max-old-space-size=2048";
MK_CONFIG_DB_PASS_FILE="${home.homeDirectory}/.config/pass";
};
SyslogIdentifier = "hackey";
Restart = "always";
TimeoutSec = 60;
};
Install = {
WantedBy = [ "default.target" ];
};
}
}
programs.home-manager.enable = true;
}
}

34
redis/Redis.nix Normal file
View file

@ -0,0 +1,34 @@
{ pkgs, ... }:
{
home.file = {
".config/redis/redis.conf" = {
source = ./redis.conf;
};
};
systemd.user.services = {
Redis = {
Unit = {
Description = "Vic's redis";
After = [ "network-online.target" ];
};
Service = {
Type = "simple";
ExecStart = "redis-server .config/redis/redis.conf";
SyslogIdentifier = "hackey";
Restart = "always";
TimeoutSec = 0;
};
Install = {
WantedBy = [ "default.target" ];
};
};
};
}