Skip to content

Commit

Permalink
emacs: import configs
Browse files Browse the repository at this point in the history
  • Loading branch information
bqv committed May 27, 2020
1 parent 9b2ddc3 commit b4cf130
Show file tree
Hide file tree
Showing 167 changed files with 2,468 additions and 103 deletions.
2 changes: 1 addition & 1 deletion configuration.nix
Expand Up @@ -12,7 +12,7 @@ let
else
[ /etc/nixos/hosts/NixOS.nix ];
in {
imports = (import ./modules/list.nix) ++ [
imports = (import ./modules/nixos.nix) ++ [
(import "${builtins.fetchTarball "https://github.com/rycee/home-manager/archive/bqv-flakes.tar.gz"}/nixos" pkgs.path)
./profiles/core.nix
] ++ config;
Expand Down
15 changes: 15 additions & 0 deletions emacs/ace-window.nix
@@ -0,0 +1,15 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.ace-window = {
enable = false;
demand = true;
bind = {
"M-m" = "ace-window";
};
config = ''
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
aw-dispatch-always t)
'';
};
}
7 changes: 7 additions & 0 deletions emacs/all-the-icons.nix
@@ -0,0 +1,7 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.all-the-icons = {
demand = true;
};
}
7 changes: 7 additions & 0 deletions emacs/android-env.nix
@@ -0,0 +1,7 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.android-env = {
demand = true;
};
}
22 changes: 22 additions & 0 deletions emacs/android-mode.nix
@@ -0,0 +1,22 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.android-mode = {
demand = true;
config = ''
(setq-default adb-host "192.168.0.3")
(defun adb-connect (host)
"Connect ADB Daemon to HOST."
(interactive (list (read-string (format "Android Device Host [%s]: " adb-host) nil nil adb-host)))
(let ((adb (android-tool-path "adb")))
(with-temp-buffer
(let ((exit-code (call-process adb nil (current-buffer) nil "connect" host)))
(progn
(goto-char (point-max))
(delete-backward-char 1)
(message "%s: %s" adb (buffer-string)))
(when (= exit-code 0)
(setq adb-host host))))))
'';
};
}
8 changes: 8 additions & 0 deletions emacs/auctex-latexmk.nix
@@ -0,0 +1,8 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.auctex-latexmk = {
demand = true;
after = [ "auctex" ];
};
}
8 changes: 8 additions & 0 deletions emacs/auctex-lua.nix
@@ -0,0 +1,8 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.auctex-lua = {
demand = true;
after = [ "auctex" ];
};
}
12 changes: 12 additions & 0 deletions emacs/auctex.nix
@@ -0,0 +1,12 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.auctex = {
demand = true;
defer = true;
after = [ "tex" "latex" ];
config = ''
(TeX-global-PDF-mode t)
'';
};
}
18 changes: 18 additions & 0 deletions emacs/auth-source.nix
@@ -0,0 +1,18 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.auth-source = {
demand = true;
name = "pass";
config = ''
(require 'auth-source-pass)
(setq auth-sources '(;default
;"secrets:session"
;"secrets:Login"
password-store
"~/.authinfo"
"~/.authinfo.gpg"))
'';
systemDeps = with pkgs; [ pass ];
};
}
13 changes: 13 additions & 0 deletions emacs/avy.nix
@@ -0,0 +1,13 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.avy = {
demand = true;
bind = {
"C-=" = "avy-goto-char";
};
config = ''
(setq avy-background t)
'';
};
}
15 changes: 15 additions & 0 deletions emacs/bitwarden.nix
@@ -0,0 +1,15 @@
{ config, lib, usr, pkgs, domains, ... }:

{
emacs-loader.bitwarden = {
config = ''
(setenv "BW_SESSION"
(let ((secret (plist-get
(nth 0 (auth-source-search :host "bitwarden-session"))
:secret)))
(if (functionp secret) (funcall secret) secret)))
(setq bitwarden-user "me@${domains.home}")
(setq bitwarden-automatic-unlock (lambda () (read-passwd "Bitwarden Password: ")))
'';
};
}
15 changes: 15 additions & 0 deletions emacs/buffer-move.nix
@@ -0,0 +1,15 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.buffer-move = {
demand = true;
after = [ "exwm-input" ];
config = ''
(progn
(exwm-input-set-key (kbd "<s-up>") #'buf-move-up)
(exwm-input-set-key (kbd "<s-down>") #'buf-move-down)
(exwm-input-set-key (kbd "<s-left>") #'buf-move-left)
(exwm-input-set-key (kbd "<s-right>") #'buf-move-right))
'';
};
}
11 changes: 11 additions & 0 deletions emacs/calfw-org.nix
@@ -0,0 +1,11 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.calfw-org = {
demand = true;
after = [ "org" "calfw" ];
config = ''
(setq calendar-week-start-day 1)
'';
};
}
7 changes: 7 additions & 0 deletions emacs/calfw.nix
@@ -0,0 +1,7 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.calfw = {
demand = true;
};
}
11 changes: 11 additions & 0 deletions emacs/cargo.nix
@@ -0,0 +1,11 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.cargo = {
demand = true;
after = [ "rust-mode" ];
hook = [
{ rust-mode = "cargo-minor-mode"; }
];
};
}
7 changes: 7 additions & 0 deletions emacs/cl.nix
@@ -0,0 +1,7 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.cl = {
package = lib.const null;
};
}
11 changes: 11 additions & 0 deletions emacs/company-box.nix
@@ -0,0 +1,11 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.company-box = {
demand = true;
after = [ "company" ];
hook = [
{ company-mode = "company-box-mode"; }
];
};
}
7 changes: 7 additions & 0 deletions emacs/company-cabal.nix
@@ -0,0 +1,7 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.company-cabal = {
demand = true;
};
}
11 changes: 11 additions & 0 deletions emacs/company-lsp.nix
@@ -0,0 +1,11 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.company-lsp = {
demand = true;
after = [ "company" "lsp" ];
config = ''
(push 'company-lsp company-backends)
'';
};
}
15 changes: 15 additions & 0 deletions emacs/company.nix
@@ -0,0 +1,15 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.company = {
demand = true;
diminish = [ "company-mode" ];
hook = [
{ prog-mode = "company-mode"; }
];
config = ''
(setq company-tooltip-align-annotations t
company-minimum-prefix-length 1)
'';
};
}
12 changes: 12 additions & 0 deletions emacs/counsel-projectile.nix
@@ -0,0 +1,12 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.counsel-projectile = {
demand = true;
after = [ "projectile" "counsel" ];
config = ''
(counsel-projectile-mode t)
(setq ivy-initial-inputs-alist nil)
'';
};
}
16 changes: 16 additions & 0 deletions emacs/counsel.nix
@@ -0,0 +1,16 @@
{ config, lib, usr, pkgs, ... }:

{
emacs-loader.counsel = {
demand = true;
after = [ "ivy" ];
bind = {
"M-x" = "counsel-M-x";
"C-x M-f" = "counsel-recentf";
#"C-y" = "counsel-yank-pop";
};
config = ''
(setq ivy-initial-inputs-alist nil)
'';
};
}

0 comments on commit b4cf130

Please sign in to comment.