diff --git a/default.nix b/default.nix index e1017f4..2d17faf 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,4 @@ -{ pkgs ? import { system = builtins.currentSystem; } -, lib ? pkgs.lib, rustPlatform ? pkgs.rustPlatform }: +{ pkgs, lib, rustPlatform }: rustPlatform.buildRustPackage rec { pname = "pxiv"; diff --git a/pxiv.service.nix b/pxiv.service.nix index cd43164..d86c2bc 100644 --- a/pxiv.service.nix +++ b/pxiv.service.nix @@ -1,26 +1,26 @@ -# rocket-service.nix -{ config, pkgs, ... }: +# pxiv.service.nix +{ config, pkgs, lib, ... }: let - # Import the Rocket application package - pxivApp = import ./default.nix { inherit pkgs; }; + inherit (lib) mkOption mkIf types; + pxivApp = import ./default.nix { inherit pkgs lib; rustPlatform = pkgs.rustPlatform; }; in { - options.services.rocket = { + options.services.pxiv = { enable = mkOption { type = types.bool; default = false; - description = "Enable the Rocket application service."; + description = "Enable the pxiv embed helper service."; }; port = mkOption { type = types.int; default = 8000; - description = "Port on which the Rocket application listens."; + description = "Port on which the pxiv embed helper listens."; }; }; - config = mkIf config.services.rocket.enable { + config = mkIf config.services.pxiv.enable { systemd.services.pxiv = { description = "pxiv embed helper service"; wantedBy = [ "multi-user.target" ]; @@ -29,7 +29,7 @@ in serviceConfig.ExecStart = "${pxivApp}/bin/pxiv"; # Set the port environment variable - serviceConfig.Environment = [ "ROCKET_PORT=${toString config.services.rocket.port}" ]; + serviceConfig.Environment = [ "ROCKET_PORT=${toString config.services.pxiv.port}" ]; # Restart on failure serviceConfig.Restart = "always";