diff --git a/nix/base-system/darwin-configuration.nix b/nix/base-system/darwin-configuration.nix index 17a5270..8efba2f 100644 --- a/nix/base-system/darwin-configuration.nix +++ b/nix/base-system/darwin-configuration.nix @@ -44,6 +44,7 @@ in # }; #}; + services.my-lorri.enable = true; services.durnitisp.enable = true; services.node-exporter.enable = true; services.prometheus.enable = true; diff --git a/nix/base-system/flake.lock b/nix/base-system/flake.lock index 3f5a755..c26a5fb 100644 --- a/nix/base-system/flake.lock +++ b/nix/base-system/flake.lock @@ -1116,11 +1116,11 @@ }, "unstable": { "locked": { - "lastModified": 1720058333, - "narHash": "sha256-gM2RCi5XkxmcsZ44pUkKIYBiBMfZ6u7MdcZcykmccrs=", + "lastModified": 1728279793, + "narHash": "sha256-W3D5YpNrUVTFPVU4jiEiboaaUDShaiH5fRl9aJLqUnU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6842b061970bf96965d66fcc86a28e1f719aae95", + "rev": "f85a2d005e83542784a755ca8da112f4f65c4aa4", "type": "github" }, "original": { diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index 0403716..efb690a 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -86,6 +86,7 @@ nil-pkg = nil-flake.packages."${system}".default; in { config, pkgs, ...}: let + unstablePkgs = import unstable { inherit system; }; possession-nvim = pkgs.callPackage ./possession-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs) fetchFromGitHub; @@ -133,6 +134,7 @@ nixpkgs.overlays = [ (final: prev: { custom-neovim = nvim; + lorri = unstablePkgs.lorri; }) ]; programs = with pkgs; { @@ -223,6 +225,9 @@ EOF"; lua-language-server rust-analyzer dasht + direnv + lorri + devenv ]); }; }; @@ -374,6 +379,7 @@ EOF"; ./modules/darwin-monitor.nix ./modules/victoria-logs.nix ./modules/vector.nix + ./modules/lorri.nix ./darwin-configuration.nix ]; }; diff --git a/nix/base-system/modules/lorri.nix b/nix/base-system/modules/lorri.nix new file mode 100644 index 0000000..0fcadde --- /dev/null +++ b/nix/base-system/modules/lorri.nix @@ -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; + }; + }; + }; +} diff --git a/nix/base-system/zshrc b/nix/base-system/zshrc index 04cb1d8..5d416d5 100644 --- a/nix/base-system/zshrc +++ b/nix/base-system/zshrc @@ -41,3 +41,5 @@ function disk_usage() { local path=${1:-.} /run/current-system/sw/bin/du --max-depth=1 -h "${path}" 2>/dev/null } + +eval "$(direnv hook zsh)"