beh
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
inputs = {
|
||||
#dev stuff
|
||||
pydev.url ="./system/extras/pydev/";
|
||||
currents.url = "./system/extras/currents/";
|
||||
currents.url = "github:autumnalmusing/currents/handler";
|
||||
#regular flakes
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
lix.url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||
|
||||
2774
system/extras/currents/Cargo.lock
generated
2774
system/extras/currents/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,88 +0,0 @@
|
||||
{
|
||||
description = "Currents, a weather alert daemon";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
currents-src.url = "path:/home/autumn/projects/currents";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, currents-src }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "currents";
|
||||
version = "0.1.0";
|
||||
src = currents-src;
|
||||
cargoLock.lockFile = "${currents-src}/Cargo.lock";
|
||||
|
||||
# Build inputs
|
||||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||
buildInputs = with pkgs; [ openssl ];
|
||||
|
||||
# Environment variables for build
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
};
|
||||
|
||||
# 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";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = self.packages.${system}.default;
|
||||
description = "The currents package to use";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
systemd.user.services.currents = {
|
||||
Unit = {
|
||||
Description = "Currents, a weather alert daemon";
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${cfg.package}/bin/currents";
|
||||
Restart = "always";
|
||||
RestartSec = 10;
|
||||
Environment = "RUST_LOG=info";
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges = true;
|
||||
PrivateTmp = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = "read-only";
|
||||
ReadWritePaths = [ "%h/.config/currents" ];
|
||||
|
||||
# Resource limits
|
||||
MemoryMax = "64M";
|
||||
CPUQuota = "10%";
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user