54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
let
|
|
service = "repo-clone";
|
|
cfg = config.repo-clone;
|
|
in
|
|
{
|
|
options.${service} = {
|
|
enable = lib.mkEnableOption "${service} service";
|
|
|
|
repos = lib.mkOption {
|
|
type = import ./repo.nix { inherit lib; };
|
|
description = ''
|
|
attrs of repos to clone
|
|
'';
|
|
default = { };
|
|
};
|
|
|
|
pkg = lib.mkOption {
|
|
type = lib.types.package;
|
|
};
|
|
};
|
|
|
|
|
|
# /nix/store/pxd7wc8icz577hpl6pmz02b74nhbrj6h-unit-home-manager-ravenshade.service/home-manager-ravenshade.service
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.user.services.${service} = {
|
|
Unit = {
|
|
Description = "${service} service";
|
|
};
|
|
Service = {
|
|
Type = "exec";
|
|
ExecStart =
|
|
let
|
|
execName = service;
|
|
script = pkgs.writeShellScriptBin execName ''
|
|
echo "hello!"
|
|
echo "${config.repo-clone.pkg}"
|
|
'';
|
|
in
|
|
"${script}/bin/${execName}";
|
|
RemainAfterExit = "yes";
|
|
};
|
|
Install = {
|
|
WantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
|
|
repo-clone.pkg = pkgs.writeText "${service}.conf" ''
|
|
uwu
|
|
'';
|
|
};
|
|
}
|