custom weather notifier

This commit is contained in:
2025-09-30 09:50:05 -06:00
parent 3ed4ccca9e
commit 725c13a6b6
5 changed files with 84 additions and 8 deletions

View File

@@ -0,0 +1,61 @@
{
description = "Currents, a weather alert daemon";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
};
outputs = { self, nixpkgs, home-manager }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
pname = "currents";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
# NixOS module (existing)
nixosModules.currents = { config, lib, pkgs, ... }:
with lib;
let cfg = config.services.currents;
in {
options.services.currents = {
enable = mkEnableOption "Currents, a weather alert daemon";
};
config = mkIf cfg.enable {
systemd.services."currents@" = {
# ... existing service config
};
};
};
# Home Manager module (new)
homeManagerModules.currents = { config, lib, pkgs, ... }:
with lib;
let cfg = config.services.currents;
in {
options.services.currents = {
enable = mkEnableOption "Currents, a weather alert daemon";
};
config = mkIf cfg.enable {
home.packages = [ self.packages.${system}.default ];
systemd.user.services.currents = {
Unit.Description = "Currents, a weather alert daemon";
Service = {
Type = "simple";
ExecStart = "${self.packages.${system}.default}/bin/currents";
Restart = "always";
RestartSec = 10;
Environment = "RUST_LOG=info";
};
Install.WantedBy = [ "default.target" ];
};
};
};
};
}