mrflos-nixos-config-fork/modules/home-config.nix
2024-01-11 21:19:05 +03:00

240 lines
5.7 KiB
Nix

# Inject the right home-manager config for the machine.
{ config, pkgs, lib, ... }:
let
treesitterWithGrammars = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
p.bash
p.comment
p.css
p.dockerfile
p.fish
p.gitattributes
p.gitignore
p.go
p.gomod
p.gowork
p.hcl
p.php
p.javascript
p.jq
p.json5
p.json
p.lua
p.make
p.markdown
p.nix
p.python
p.rust
p.toml
p.typescript
p.vue
p.yaml
]));
in {
# TODO can we automate the installation of home-manager ?
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
imports = [ <home-manager/nixos> ];
# Let Home Manager install and manage itself.
#programs.home-manager.enable = true;
home-manager.useGlobalPkgs = true;
users.users.mrflos = {
isNormalUser = true;
description = "mrflos";
createHome = true;
extraGroups = [ "docker" "libvirtd" "lxd" "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
nix.settings.trusted-users = [ "mrflos" ];
home-manager.users.mrflos = { pkgs, ... }: {
home.stateVersion = "23.05";
home.packages = with pkgs; [
gcc
cmake
ripgrep
fd
lua-language-server
rust-analyzer-unwrapped
php83Packages.composer
nodejs_20
yarn
];
home.file = {
"./.config/kitty/" = {
source = ../dotfiles/kitty;
recursive = true;
};
"./.config/nvim/" = {
source = ../dotfiles/nvim;
recursive = true;
};
"./.config/tmux/" = {
source = ../dotfiles/tmux;
recursive = true;
};
# Treesitter is configured as a locally developed module in lazy.nvim
# we hardcode a symlink here so that we can refer to it in our lazy config
"./.local/share/nvim/nix/nvim-treesitter/" = {
recursive = true;
source = treesitterWithGrammars;
};
};
accounts.email.accounts = {
"mrflos@chmok.net" = {
realName = "Florian Schmitt";
userName = "mrflos@chmok.net";
address = "mrflos@chmok.net";
primary = true;
thunderbird = { enable = true; };
imap = {
host = "mail.infomaniak.com";
port = 993;
};
smtp = {
host = "mail.infomaniak.com";
port = 465;
};
};
"mrflos@yeswiki.pro" = {
realName = "Florian Schmitt - Yeswiki.pro";
userName = "mrflos@yeswiki.pro";
address = "mrflos@yeswiki.pro";
thunderbird = { enable = true; };
imap = {
host = "mail.infomaniak.com";
port = 993;
};
smtp = {
host = "mail.infomaniak.com";
port = 465;
};
};
"mrflos@mrflos.pw" = {
realName = "Florian Schmitt";
userName = "mrflos";
address = "mrflos@mrflos.pw";
primary = false;
thunderbird = { enable = true; };
imap = {
host = "mrflos.pw";
port = 993;
tls.enable = true;
tls.useStartTls = true;
};
smtp = {
host = "mrflos.pw";
port = 587;
tls.useStartTls = true;
};
};
"contact@yeswiki.pro" = {
realName = "YesWiki.pro";
userName = "contact@yeswiki.pro";
address = "contact@yeswiki.pro";
primary = false;
thunderbird = { enable = true; };
imap = {
host = "mail.infomaniak.com";
port = 993;
};
smtp = {
host = "mail.infomaniak.com";
port = 465;
};
};
};
programs = {
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
git = {
enable = true;
userName = "Florian Schmitt";
userEmail = "mrflos@gmail.com";
extraConfig = {
pull.rebase = true;
init.defaultBranch = "main";
core.fileMode = false;
};
};
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
coc.enable = false;
plugins = [ treesitterWithGrammars ];
};
password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
settings = {
PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store";
PASSWORD_STORE_KEY = "How to Hide This ?";
PASSWORD_STORE_CLIP_TIME = "60";
};
};
thunderbird = {
enable = true;
profiles.default = { isDefault = true; };
};
starship = {
enable = true;
settings = with builtins; fromTOML (readFile ../dotfiles/starship/starship.toml);
};
zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
shellAliases = {
#tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new";
ls = "lsd --hyperlink=auto";
icat = "kitty +kitten icat";
nixedit = "vi /etc/nixos";
nixupdate = "sudo nix-channel --update && sudo nixos-rebuild switch";
nixclean = "sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch && sudo nix-store --gc";
};
initExtra = ''
plugins=(git ssh-agent)
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
'';
#shellInit = "cd ~/Developpements;";
#ohMyZsh = {
# enable = true;
# plugins = [ "git" "ssh-agent" ];
# theme = "robbyrussell";
#};
};
};
services.ssh-agent.enable = true;
};
}