Skip to content

Commit

Permalink
homes: emacs can be enabled/disabled + fix wsl
Browse files Browse the repository at this point in the history
  • Loading branch information
adfaure committed Dec 18, 2023
1 parent d839938 commit fbb7804
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 27 deletions.
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
flake = false;
};
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/NUR";
Expand Down
2 changes: 1 addition & 1 deletion homes/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
./modules/vim
./modules/zsh
./modules/ranger
./modules/emacs
./modules/tmux
./modules/emacs
# ./modules/nushell
];

Expand Down
29 changes: 22 additions & 7 deletions homes/modules/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@
my-dotfiles,
wrapCmd,
...
}: {
home.packages = [
pkgs.myEmacs
(pkgs.aspellWithDicts (d: [d.fr d.en]))
];
home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell";
home.file.".emacs".text = builtins.readFile "${my-dotfiles}/files/emacs_conf";
}:
let
cfg = config.my-programs.emacs;
in {
options = {
my-programs.emacs = {
enable = lib.mkOption {
default = false;
description = ''
Whether to enable emacs module.
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.myEmacs
(pkgs.aspellWithDicts (d: [d.fr d.en]))
];
home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell";
home.file.".emacs".text = builtins.readFile "${my-dotfiles}/files/emacs_conf";
};
}
21 changes: 10 additions & 11 deletions homes/wsl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
}: {
imports = [
./base.nix

# GUI (disabled for experiment)
# ./modules/emacs
./modules/vim
];

Expand All @@ -27,6 +25,14 @@
'';
};

my-programs.emacs.enable = false;

services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};

# First we activate home-manager
programs.home-manager.enable = true;
home.file.".config/sakura/sakura.conf".text =
Expand All @@ -36,21 +42,14 @@
bat # cat with colors for code
cloc
pass
taskwarrior
timewarrior
nitrokey-app
jq
cgvg
tree
manpages
gcc
pinentry
# manpages
wget
gdb
direnv
entr

# Nix file formating
nixfmt
];
};
}

0 comments on commit fbb7804

Please sign in to comment.