Compare commits

...

4 Commits

7 changed files with 73 additions and 8 deletions

21
flake.lock generated
View File

@ -204,6 +204,26 @@
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1746934494,
"narHash": "sha256-3n6i+F0sDASjkhbvgFDpPDZGp7z19IrRtjfF9TwJpCA=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "e9b21b01e4307176b9718a29ac514838e7f6f4ff",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-index-database",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733212471,
@ -272,6 +292,7 @@
"inputs": {
"devenv": "devenv",
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_4",
"sops-nix": "sops-nix",
"zen-browser": "zen-browser"

View File

@ -8,11 +8,18 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
devenv.url = "github:cachix/devenv";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";

View File

@ -7,6 +7,7 @@
./eza.nix
./mopidy.nix
./nh.nix
./nix-index.nix
./shell
./ssh.nix
./tealdeer.nix

View File

@ -1,7 +1,10 @@
{
programs.direnv = {
enable = true;
config.global.load_dotenv = true;
config.global = {
load_dotenv = true;
hide_env_diff = true;
};
nix-direnv.enable = true;
};
}

View File

@ -3,7 +3,7 @@
config,
lib,
...
}: let
}: with lib; let
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (
epkgs: [
epkgs.vterm
@ -14,23 +14,45 @@
cfg = config.modules.emacs;
in {
options.modules.emacs = {
enable = lib.mkEnableOption "enables Emacs";
package = lib.mkOption {
type = lib.types.package;
enable = mkEnableOption "enables Emacs";
package = mkOption {
type = types.package;
default = emacsDefaultPackage;
};
service = lib.mkEnableOption "enables Emacs service";
service = mkEnableOption "enables Emacs service";
mu4eMime = mkEnableOption "Enables mu4e to handle mailto scheme";
org-protocol = mkEnableOption "Enables org-protocol";
};
config = {
programs.emacs = lib.mkIf cfg.enable {
programs.emacs = mkIf cfg.enable {
enable = true;
inherit (cfg) package;
};
services.emacs = lib.mkIf cfg.service {
services.emacs = mkIf cfg.service {
enable = true;
inherit (cfg) package;
startWithUserSession = "graphical";
};
xdg.desktopEntries.mu4e = mkIf cfg.mu4eMime {
name = "mu4e";
genericName = "mu4e";
comment = "Maildir Utils for Emacs";
mimeType = ["x-scheme-handler/mailto"];
noDisplay = true;
exec = "${cfg.package}/bin/emacsclient -c -n -a ${cfg.package}/bin/emacs -e \"(browse-url-mail \\\"\\$*\\\")\"";
terminal = false;
categories = ["Network" "Email" "TextEditor" "Utility"];
};
xdg.desktopEntries.org-protocol = mkIf cfg.org-protocol {
name = "org-protocol";
exec = "${cfg.package}/bin/emacsclient -c -n -a ${cfg.package}/bin/emacs %u";
terminal = false;
noDisplay = true;
categories = ["System"];
mimeType = ["x-scheme-handler/org-protocol"];
};
};
}

View File

@ -0,0 +1,9 @@
{ inputs, ... }:
{
imports = [
inputs.nix-index-database.hmModules.nix-index
];
programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true;
}

View File

@ -58,6 +58,8 @@
enable = true;
service = true;
package = emacsPkg;
mu4eMime = true;
org-protocol = true;
};
hyprland = {
inherit emacsPkg;