putz u in dhe washing machin and spins ur bsky pofile pictuer !!! :D

add home-manager module wit cool systemd service! #3

merged opened by koi.rip targeting main from koi.rip/washng0machine: push-mokxzqutskkv

hi u can use liek dis:

{
  services.washing-machien = {
    enable = true;
    image = ./supercoolimeag.png;
    environment = [
      "IDENTIFIER='did:sometdhiong'"
      "APP_PASSWORD='meow-meow-meow-meow'"
    ];
    interval = 60; # optional
  };
}
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:b26ewgkrnx3yvsp2cdao3ntu/sh.tangled.repo.pull/3melqj6s2vd22
+71 -4
Diff #0
+3 -3
flake.lock
··· 2 2 "nodes": { 3 3 "nixpkgs": { 4 4 "locked": { 5 - "lastModified": 1767364772, 6 - "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", 5 + "lastModified": 1770689213, 6 + "narHash": "sha256-N6JiSpfi0s8NjUTnjwo3c+YAmvYhCDzjCKCrTUC97xM=", 7 7 "owner": "nixos", 8 8 "repo": "nixpkgs", 9 - "rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa", 9 + "rev": "49d75834011c94a120a9cb874ac1c4d8b7bfc767", 10 10 "type": "github" 11 11 }, 12 12 "original": {
+3 -1
flake.nix
··· 1 1 { 2 - description = "Rust Project Template"; 2 + description = "putz u in dhe washing machin and spins ur bsky pofile pictuer !!! :D"; 3 3 4 4 inputs = { 5 5 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; ··· 24 24 default = pkgs.callPackage ./nix/shell.nix { }; 25 25 }); 26 26 27 + homeManagerModules.default = ./nix/hm-module.nix; 28 + 27 29 overlays.default = final: _: { washing-machien = final.callPackage ./nix/default.nix { }; }; 28 30 }; 29 31 }
+65
nix/hm-module.nix
··· 1 + { lib, pkgs, config, ... }: 2 + let 3 + inherit (lib) 4 + types 5 + mkIf 6 + mkOption 7 + mkEnableOption 8 + ; 9 + 10 + cfg = config.services.washing-machien; 11 + in { 12 + options.services.washing-machien = { 13 + enable = mkEnableOption "washing amchern WOW"; 14 + 15 + package = mkOption { 16 + type = types.package; 17 + default = pkgs.callPackage ./default.nix { }; 18 + description = "the washing-machien package"; 19 + }; 20 + 21 + image = mkOption { 22 + type = types.either types.str types.path; 23 + description = "path to your profile picture"; 24 + }; 25 + 26 + environment = mkOption { 27 + type = with types; coercedTo str lib.toList (listOf str); 28 + default = [ ]; 29 + example = [ 30 + "IDENTIFIER='your-handle-or-did'" 31 + "APP_PASSWORD='your-app-password'" 32 + "BACKGROUND='d0c1f5ff'" 33 + ]; 34 + description = "environment variables available to washnig machen"; 35 + }; 36 + 37 + interval = mkOption { 38 + type = types.ints.positive; 39 + default = 60; 40 + description = "update timer interval in seconds"; 41 + }; 42 + }; 43 + 44 + config = mkIf cfg.enable { 45 + home.packages = [ cfg.package ]; 46 + 47 + systemd.user = { 48 + services.washing-machien = { 49 + Unit.Description = "wachig,,,,....."; 50 + Service = { 51 + Type = "oneshot"; 52 + ExecStart = "${cfg.package}/bin/washing-machien ${cfg.image}"; 53 + Environment = cfg.environment; 54 + }; 55 + Install.WantedBy = [ "default.target" ]; 56 + }; 57 + 58 + timers.washing-machien = { 59 + Unit.Description = "wamchin tiemer!"; 60 + Timer.OnUnitActiveSec = "${toString cfg.interval}s"; 61 + Install.WantedBy = [ "timers.target" ]; 62 + }; 63 + }; 64 + }; 65 + }

History

1 round 1 comment
sign up or login to add to the discussion
koi.rip submitted #0
1 commit
expand
add home-manager module wit cool systemd service!
expand 1 comment
pull request successfully merged