main
Zynh Ludwig 2024-07-31 16:12:48 -07:00
commit defd500a2b
3 changed files with 74 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722185531,
"narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

11
flake.nix Normal file
View File

@ -0,0 +1,11 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { ... }@inputs: {
homeManagerModule = import ./module.nix;
};
}

36
module.nix Normal file
View File

@ -0,0 +1,36 @@
{ lib, config, ... }:
let
cfg = config.repo-clone;
in
{
options.repo-clone = {
enable = lib.mkEnableOption "repo-clone service";
};
# /nix/store/pxd7wc8icz577hpl6pmz02b74nhbrj6h-unit-home-manager-ravenshade.service/home-manager-ravenshade.service
config = lib.mkIf cfg.enable {
system.user.services.repo-clone = {
Unit = {
Description = "repo-clone service";
Before = [ "systemd-user-sessions.service" ];
};
Service = {
Type = "exec";
ExecStart =
let
execName = "repo-clone";
script = lib.writeShellScriptBin execName ''
echo "hello!"
'';
in
"${script}/bin/${execName}";
RemainAfterExit = "yes";
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};
}