1 files changed, 33 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index f5082fc..bbd4476 100644
--- a/flake.nix
+++ b/flake.nix
@@ -12,7 +12,7 @@
nixpkgs,
flake-utils,
}:
- flake-utils.lib.eachSystem flake-utils.lib.allSystems (
+ (flake-utils.lib.eachSystem flake-utils.lib.allSystems (
system:
let
pkgs = import nixpkgs {
@@ -25,8 +25,8 @@
{
packages = {
default = pkgs.buildNpmPackage {
- pname = "nodejs-ti-a-final-assignment-TheArcaneBrony";
- name = "nodejs-ti-a-final-assignment-TheArcaneBrony";
+ pname = "SafeNSound";
+ name = "SafeNSound";
meta = with lib; {
description = "Final assignment for NodeJS";
@@ -85,5 +85,34 @@
];
};
}
- );
+ )) // {
+ nixosModules.default = { config, lib, ...}: {
+ options.safensound = {
+ enable = lib.mkEnableOption "Enable SafeNSound service";
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = self.packages.${lib.system}.default;
+ description = "The SafeNSound service package to run.";
+ };
+ port = lib.mkOption {
+ type = lib.types.port;
+ default = 3000;
+ description = "The port on which the SafeNSound service will listen.";
+ };
+ logRequests = lib.mkEnableOption "Log requests";
+ dbCredentialsPath = lib.mkOption {
+ type = lib.types.path;
+ default = "mongodb-pass";
+ description = "Path to the database credentials file.";
+ };
+ JwtSecretPath = lib.mkOption {
+ type = lib.types.path;
+ default = ".";
+ description = "Path to the JWT secret directory.";
+ };
+ logQueries = lib.mkEnableOption "Log queries";
+ logAuth = lib.mkEnableOption "Log authentication";
+ };
+ };
+ };
}
\ No newline at end of file
|