From 55254f61da6c405fbf9f706cf0272340e4a65d80 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:27:32 +0200 Subject: [PATCH 01/10] more fixes sorry --- home.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home.nix b/home.nix index 81ea15d..bf19b40 100644 --- a/home.nix +++ b/home.nix @@ -21,7 +21,7 @@ ".config/redis/redis.conf" = { source = ./redis/redis.conf; }; - } + }; home.file = { @@ -57,9 +57,9 @@ WantedBy = [ "default.target" ]; }; - } + }; - } + }; programs.home-manager.enable = true; From a1ff792e6d136bf78fbd006c8f859dcb77b0b068 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:30:34 +0200 Subject: [PATCH 02/10] fix? --- home.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.nix b/home.nix index bf19b40..9b26b1f 100644 --- a/home.nix +++ b/home.nix @@ -42,11 +42,11 @@ Service = { Type = "simple"; ExecStart = "pnpm start"; - WorkingDirectory = "${home.homeDirectory}/Hackey/Sharkey"; + WorkingDirectory = "/home/vic/Hackey/Sharkey"; Enviroment = { NODE_ENV = "production"; NODE_OPTIONS = "--max-old-space-size=2048"; - MK_CONFIG_DB_PASS_FILE="${home.homeDirectory}/.config/pass"; + MK_CONFIG_DB_PASS_FILE="/home/vic/.config/pass"; }; SyslogIdentifier = "hackey"; Restart = "always"; From a1825bf0cd4d3189e84564f26707fc91c668763a Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:31:35 +0200 Subject: [PATCH 03/10] this? --- home.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home.nix b/home.nix index 9b26b1f..7d45f96 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,5 @@ -{ configs, pkgs }: { +{ configs, pkgs, ... }: +{ @@ -64,4 +65,4 @@ programs.home-manager.enable = true; -} \ No newline at end of file +} \ No newline at end of file From bbea040b99eb106baec3753c39e95ac65880fa73 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:35:40 +0200 Subject: [PATCH 04/10] fix enviroment --- home.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/home.nix b/home.nix index 7d45f96..60317fc 100644 --- a/home.nix +++ b/home.nix @@ -44,11 +44,11 @@ Type = "simple"; ExecStart = "pnpm start"; WorkingDirectory = "/home/vic/Hackey/Sharkey"; - Enviroment = { - NODE_ENV = "production"; - NODE_OPTIONS = "--max-old-space-size=2048"; - MK_CONFIG_DB_PASS_FILE="/home/vic/.config/pass"; - }; + Enviroment = [ + "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; From 7da74597170a5d301da5d4f2f5c307c3b65a0686 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:43:17 +0200 Subject: [PATCH 05/10] fix Environment typo --- home.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home.nix b/home.nix index 60317fc..ccbefc2 100644 --- a/home.nix +++ b/home.nix @@ -8,7 +8,8 @@ home.packages = [ - pkgs.helix + pkgs.helix //editor + pkgs.bat //modern cat ]; home.stateVersion = "24.05"; @@ -44,7 +45,7 @@ Type = "simple"; ExecStart = "pnpm start"; WorkingDirectory = "/home/vic/Hackey/Sharkey"; - Enviroment = [ + Environment = [ "NODE_ENV=production" "NODE_OPTIONS=--max-old-space-size=2048" "MK_CONFIG_DB_PASS_FILE=/home/vic/.config/pass" From e8a36e88b3aaafda74012eddac2522160d3c2f08 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:44:22 +0200 Subject: [PATCH 06/10] oh comments werent like that --- home.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.nix b/home.nix index ccbefc2..170003a 100644 --- a/home.nix +++ b/home.nix @@ -8,8 +8,8 @@ home.packages = [ - pkgs.helix //editor - pkgs.bat //modern cat + pkgs.helix #editor + pkgs.bat #modern cat ]; home.stateVersion = "24.05"; From f2a0ae2c6af75922893a94037b3c4ad2cc0ade4b Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:54:22 +0200 Subject: [PATCH 07/10] Modularize+ redis systemd --- Hackey/Hackey.nix | 37 +++++++++++++++++++++++++++++++++++++ home.nix | 41 +++-------------------------------------- redis/redis.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 38 deletions(-) create mode 100644 Hackey/Hackey.nix create mode 100644 redis/redis.nix diff --git a/Hackey/Hackey.nix b/Hackey/Hackey.nix new file mode 100644 index 0000000..b92914b --- /dev/null +++ b/Hackey/Hackey.nix @@ -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" ]; + }; + + }; + }; +} \ No newline at end of file diff --git a/home.nix b/home.nix index 170003a..f12e269 100644 --- a/home.nix +++ b/home.nix @@ -1,6 +1,9 @@ { configs, pkgs, ... }: { + imports = [ + ./redis/.nix + ]; home.username = "vic"; @@ -19,49 +22,11 @@ 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/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" ]; - }; - - }; - - }; programs.home-manager.enable = true; diff --git a/redis/redis.nix b/redis/redis.nix new file mode 100644 index 0000000..2164b84 --- /dev/null +++ b/redis/redis.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: + +{ + home.file = { + ".config/redis/redis.conf" = { + source = ./redis/redis.conf; + + }; + }; + + systemd.user.services = { + + Redis = { + Unit = { + Description = "Vic's redis"; + After = [ "network-online.target" ]; + }; + + Service = { + Type = "oneshot"; + ExecStart = "redis-server .config/redis/redis.conf"; + SyslogIdentifier = "hackey"; + Restart = "always"; + TimeoutSec = 0; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + + }; + + }; +} \ No newline at end of file From 5ea10df4f847b21d227ce484afcf75d1acacd82e Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:56:11 +0200 Subject: [PATCH 08/10] fix typos --- home.nix | 3 ++- redis/{redis.nix => Redis.nix} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename redis/{redis.nix => Redis.nix} (100%) diff --git a/home.nix b/home.nix index f12e269..3048d0c 100644 --- a/home.nix +++ b/home.nix @@ -2,7 +2,8 @@ { imports = [ - ./redis/.nix + ./redis/Redis.nix + ./Hackey/Hackey.nix ]; diff --git a/redis/redis.nix b/redis/Redis.nix similarity index 100% rename from redis/redis.nix rename to redis/Redis.nix From c65a6134b48438ed0be72b70d3dcd262067b6576 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:58:16 +0200 Subject: [PATCH 09/10] typo --- redis/Redis.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.nix b/redis/Redis.nix index 2164b84..6a950f4 100644 --- a/redis/Redis.nix +++ b/redis/Redis.nix @@ -3,7 +3,7 @@ { home.file = { ".config/redis/redis.conf" = { - source = ./redis/redis.conf; + source = ./redis.conf; }; }; From 5a217c9f80f7988630a126a3807fad2611ca8789 Mon Sep 17 00:00:00 2001 From: Vic <74506415+v1ctorio@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:59:52 +0200 Subject: [PATCH 10/10] make redis simple --- redis/Redis.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.nix b/redis/Redis.nix index 6a950f4..ff931d3 100644 --- a/redis/Redis.nix +++ b/redis/Redis.nix @@ -17,7 +17,7 @@ }; Service = { - Type = "oneshot"; + Type = "simple"; ExecStart = "redis-server .config/redis/redis.conf"; SyslogIdentifier = "hackey"; Restart = "always";