nixos module
This commit is contained in:
@@ -8,7 +8,14 @@
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
package = nixpkgs.legacyPackages.${system}.callPackage ./. { };
|
||||
in {
|
||||
packages.${system}.default = nixpkgs.legacyPackages.${system}.callPackage ./. { };
|
||||
packages.${system}.default = package;
|
||||
|
||||
nixosModules.default = {
|
||||
imports = [ ./module.nix ];
|
||||
|
||||
_module.args.package = package;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
{ config, lib, pkgs, package, ... }:
|
||||
|
||||
let
|
||||
cfg = config.custom.minimal-youtube;
|
||||
in
|
||||
{
|
||||
options.custom.minimal-youtube = {
|
||||
enable = lib.mkEnableOption "minimal-youtube web app";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8080;
|
||||
};
|
||||
};
|
||||
|
||||
config.systemd.services.minimal-youtube = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart =
|
||||
"${package}/bin/minimal-youtube --port ${toString cfg.port}";
|
||||
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user