mirror of
https://github.com/thiloho/nixos-config.git
synced 2025-11-22 11:31:36 +01:00
Add systemd service and ensure db for discord bot
This commit is contained in:
87
flake.lock
generated
87
flake.lock
generated
@@ -18,58 +18,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cachix": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1635350005,
|
|
||||||
"narHash": "sha256-tAMJnUwfaDEB2aa31jGcu7R7bzGELM9noc91L2PbVjg=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "1c1f5649bb9c1b0d98637c8c365228f57126f361",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-20.09",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"firefox": {
|
|
||||||
"inputs": {
|
|
||||||
"cachix": "cachix",
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"mozilla": "mozilla",
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1693917765,
|
|
||||||
"narHash": "sha256-LtNhYwnIrp9UuSxv3AnYdOwGqypTYkW+20bdzCfzMdI=",
|
|
||||||
"owner": "colemickens",
|
|
||||||
"repo": "flake-firefox-nightly",
|
|
||||||
"rev": "131d2f932ced539afdb2390d6245f5c62d31e26d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "colemickens",
|
|
||||||
"repo": "flake-firefox-nightly",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1688025799,
|
|
||||||
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -90,22 +38,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mozilla": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1690536331,
|
|
||||||
"narHash": "sha256-aRIf2FB2GTdfF7gl13WyETmiV/J7EhBGkSWXfZvlxcA=",
|
|
||||||
"owner": "mozilla",
|
|
||||||
"repo": "nixpkgs-mozilla",
|
|
||||||
"rev": "db89c8707edcffefcd8e738459d511543a339ff5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "mozilla",
|
|
||||||
"repo": "nixpkgs-mozilla",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1684787197,
|
"lastModified": 1684787197,
|
||||||
@@ -137,28 +69,11 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1693663421,
|
|
||||||
"narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e56990880811a451abd32515698c712788be5720",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"aurora-blog-template": "aurora-blog-template",
|
"aurora-blog-template": "aurora-blog-template",
|
||||||
"firefox": "firefox",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"website": "website"
|
"website": "website"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
aurora-blog-template.url = "github:thiloho/aurora";
|
aurora-blog-template.url = "github:thiloho/aurora";
|
||||||
firefox.url = "github:colemickens/flake-firefox-nightly";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
nix.settings.trusted-users = [ "thiloho" ];
|
nix.settings.trusted-users = [ "thiloho" ];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nodejs_20
|
||||||
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "server";
|
hostName = "server";
|
||||||
firewall = {
|
firewall = {
|
||||||
@@ -77,19 +81,6 @@
|
|||||||
};
|
};
|
||||||
autoUpdateApps.enable = true;
|
autoUpdateApps.enable = true;
|
||||||
};
|
};
|
||||||
# mysql.package = pkgs.mariadb;
|
|
||||||
# firefox-syncserver = {
|
|
||||||
# enable = true;
|
|
||||||
# database.createLocally = true;
|
|
||||||
# secrets = "/var/run/firefox-syncserver-secrets.txt";
|
|
||||||
# singleNode = {
|
|
||||||
# enable = true;
|
|
||||||
# enableNginx = true;
|
|
||||||
# enableTLS = true;
|
|
||||||
# hostname = "fsync.thilohohlt.com";
|
|
||||||
# url = "https://ffsync.thilohohlt.com";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
@@ -102,6 +93,28 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.postgresql_15;
|
||||||
|
ensureDatabases = [ "dcbot" ];
|
||||||
|
authentication = pkgs.lib.mkOverride 10 ''
|
||||||
|
#type database DBuser auth-method
|
||||||
|
local all all trust
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.denbot = {
|
||||||
|
description = "Thilo's Den discord bot";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
after = ["network-online.target"];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.nodejs_20}/bin/node index.js --token=$CREDENTIALS_DIRECTORY/bot.token";
|
||||||
|
LoadCredential = "bot.token:/var/run/bot-token.txt";
|
||||||
|
WorkingDirectory = inputs.denbot;
|
||||||
|
Restart = "always";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
users.users.thiloho.openssh.authorizedKeys.keys = [
|
users.users.thiloho.openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkvr+vT7Ik0fjquxb9xQBfVVWJPgrfC+vJZsyG2V+/G thiloho@pc"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkvr+vT7Ik0fjquxb9xQBfVVWJPgrfC+vJZsyG2V+/G thiloho@pc"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -31,10 +31,7 @@
|
|||||||
|
|
||||||
home-manager.users.thiloho = { pkgs, lib, config, ... }: {
|
home-manager.users.thiloho = { pkgs, lib, config, ... }: {
|
||||||
programs = {
|
programs = {
|
||||||
# firefox = {
|
firefox.enable = true;
|
||||||
# enable = true;
|
|
||||||
# package = pkgs.firefox-devedition;
|
|
||||||
# };
|
|
||||||
chromium = {
|
chromium = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extensions = [
|
extensions = [
|
||||||
@@ -85,7 +82,6 @@
|
|||||||
teamspeak5_client
|
teamspeak5_client
|
||||||
discord
|
discord
|
||||||
qbittorrent
|
qbittorrent
|
||||||
inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user