feat: direnv and lorri support

This commit is contained in:
Jeremy Wall 2024-10-08 10:09:49 -04:00
parent ecef58f465
commit 9a845636d0
5 changed files with 38 additions and 3 deletions

View File

@ -44,6 +44,7 @@ in
# }; # };
#}; #};
services.my-lorri.enable = true;
services.durnitisp.enable = true; services.durnitisp.enable = true;
services.node-exporter.enable = true; services.node-exporter.enable = true;
services.prometheus.enable = true; services.prometheus.enable = true;

View File

@ -1116,11 +1116,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1720058333, "lastModified": 1728279793,
"narHash": "sha256-gM2RCi5XkxmcsZ44pUkKIYBiBMfZ6u7MdcZcykmccrs=", "narHash": "sha256-W3D5YpNrUVTFPVU4jiEiboaaUDShaiH5fRl9aJLqUnU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6842b061970bf96965d66fcc86a28e1f719aae95", "rev": "f85a2d005e83542784a755ca8da112f4f65c4aa4",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -86,6 +86,7 @@
nil-pkg = nil-flake.packages."${system}".default; nil-pkg = nil-flake.packages."${system}".default;
in in
{ config, pkgs, ...}: let { config, pkgs, ...}: let
unstablePkgs = import unstable { inherit system; };
possession-nvim = pkgs.callPackage ./possession-nvim.nix { possession-nvim = pkgs.callPackage ./possession-nvim.nix {
inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs.vimUtils) buildVimPlugin;
inherit (pkgs) fetchFromGitHub; inherit (pkgs) fetchFromGitHub;
@ -133,6 +134,7 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
custom-neovim = nvim; custom-neovim = nvim;
lorri = unstablePkgs.lorri;
}) })
]; ];
programs = with pkgs; { programs = with pkgs; {
@ -223,6 +225,9 @@ EOF";
lua-language-server lua-language-server
rust-analyzer rust-analyzer
dasht dasht
direnv
lorri
devenv
]); ]);
}; };
}; };
@ -374,6 +379,7 @@ EOF";
./modules/darwin-monitor.nix ./modules/darwin-monitor.nix
./modules/victoria-logs.nix ./modules/victoria-logs.nix
./modules/vector.nix ./modules/vector.nix
./modules/lorri.nix
./darwin-configuration.nix ./darwin-configuration.nix
]; ];
}; };

View File

@ -0,0 +1,26 @@
{pkgs, lib, config, ...}:
with lib;
let
mkLauncher = import ../../packages/darwin-launcher.nix { inherit pkgs; };
lorriLauncher = mkLauncher ''
source ${config.system.build.setEnvironment}
exec ${pkgs.lorri}/bin/lorri daemon
'';
in
{
options.services.my-lorri = {
enable = mkEnableOption "Enable the lorri agent";
};
config = {
launchd.user.agents.lorri = mkIf config.services.my-lorri.enable {
serviceConfig = {
ProgramArguments = [
"${lorriLauncher}"
];
RunAtLoad = true;
KeepAlive = true;
};
};
};
}

View File

@ -41,3 +41,5 @@ function disk_usage() {
local path=${1:-.} local path=${1:-.}
/run/current-system/sw/bin/du --max-depth=1 -h "${path}" 2>/dev/null /run/current-system/sw/bin/du --max-depth=1 -h "${path}" 2>/dev/null
} }
eval "$(direnv hook zsh)"