nixos module

This commit is contained in:
Aaron Manning
2026-09-15 18:31:49 +10:00
parent d3f3403523
commit 5c548b909e
2 changed files with 37 additions and 4 deletions
+11 -4
View File
@@ -6,9 +6,16 @@
}; };
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
in { package = nixpkgs.legacyPackages.${system}.callPackage ./. { };
packages.${system}.default = nixpkgs.legacyPackages.${system}.callPackage ./. { }; in {
packages.${system}.default = package;
nixosModules.default = {
imports = [ ./module.nix ];
_module.args.package = package;
}; };
};
} }
+26
View File
@@ -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";
};
};
}