❄️ going a little overboard with my nix config?

This commit is contained in:
James Walker 2020-12-21 19:41:29 -05:00
parent 468793b303
commit 45c10a5a32
Signed by: walkah
GPG Key ID: 3C127179D6086E93
6 changed files with 102 additions and 53 deletions

View File

@ -1,5 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }: {
{ imports = [
./modules/golang.nix
./modules/haskell.nix
./modules/nodejs.nix
./modules/python.nix
./modules/rust.nix
];
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -8,10 +15,7 @@
# home.username = builtins.getEnv "USER"; # home.username = builtins.getEnv "USER";
# home.homeDirectory = builtins.getEnv "HOME"; # home.homeDirectory = builtins.getEnv "HOME";
home.sessionPath = [ home.sessionPath = [ "$HOME/.local/bin" "$HOME/.emacs.d/bin" ];
"$HOME/.local/bin"
"$HOME/.emacs.d/bin"
];
home.packages = with pkgs; [ home.packages = with pkgs; [
aws aws
@ -27,12 +31,11 @@
jq jq
mr mr
niv niv
nodejs nixfmt
pinentry pinentry
ripgrep ripgrep
sqlite sqlite
wakatime wakatime
yarn
]; ];
programs = { programs = {
@ -56,18 +59,19 @@
"tmux" "tmux"
]; ];
}; };
sessionVariables = { sessionVariables = { EDITOR = "vim"; };
EDITOR = "vim"; };
}; dircolors = {
enable = true;
enableZshIntegration = true;
}; };
starship = { starship = {
enable = true; enable = true;
enableZshIntegration = false; enableZshIntegration = false;
settings = { settings = {
character = { character = {
success_symbol = "[»](bold green) "; success_symbol = "[»](bold green) ";
error_symbol = "[](bold red) "; error_symbol = "[](bold red) ";
}; };
directory = { directory = {
fish_style_pwd_dir_length = 1; fish_style_pwd_dir_length = 1;
@ -77,43 +81,39 @@
ssh_only = false; ssh_only = false;
format = "[$hostname]($style):"; format = "[$hostname]($style):";
}; };
gcloud = { gcloud = { disabled = true; };
disabled = true; kubernetes = { disabled = false; };
}; username = { format = "[$user]($style)@"; };
kubernetes = {
disabled = false;
};
username = {
format = "[$user]($style)@";
};
}; };
}; };
git = { git = {
enable = true; enable = true;
userName = "James Walker"; userName = "James Walker";
userEmail = "walkah@walkah.net"; userEmail = "walkah@walkah.net";
aliases = { aliases = {
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; lg =
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
st = "status -s"; st = "status -s";
undo = "reset HEAD~1 --mixed";
}; };
extraConfig = { extraConfig = {
github.user = "walkah";
pull.rebase = true; pull.rebase = true;
rebase.autoStash = true;
}; };
signing = { signing = {
key = "8896FEC44D47A81C"; key = "8896FEC44D47A81C";
signByDefault = true; signByDefault = true;
}; };
}; };
gpg = { gpg = {
enable = true; enable = true;
settings = { settings = { default-key = "8896FEC44D47A81C"; };
default-key = "8896FEC44D47A81C";
};
}; };
tmux = { tmux = {
@ -133,32 +133,25 @@
emacs = if (pkgs.stdenv.isLinux) then { emacs = if (pkgs.stdenv.isLinux) then {
enable = true; enable = true;
extraPackages = epkgs: [ epkgs.vterm ]; extraPackages = epkgs: [ epkgs.vterm ];
} } else
else { };
{};
vim = { enable = true; };
vim = {
enable = true;
};
}; };
services = services = if (pkgs.stdenv.isLinux) then {
if (pkgs.stdenv.isLinux) then lorri.enable = true;
{ syncthing.enable = true;
lorri.enable = true; gpg-agent = {
syncthing.enable = true; enable = true;
gpg-agent = { enableSshSupport = true;
enable = true; extraConfig = ''
enableSshSupport = true; allow-emacs-pinentry
extraConfig = '' allow-loopback-pinentry
allow-emacs-pinentry '';
allow-loopback-pinentry };
''; } else
}; { };
}
else
{};
# This value determines the Home Manager release that your # This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage # configuration is compatible with. This helps avoid breakage

22
modules/golang.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
home.sessionPath = [ "$HOME/.go/bin" ];
home.packages = with pkgs; [
go
gocode
golangci-lint
gomodifytags
gopls
gotests
gore
];
programs = {
zsh = {
oh-my-zsh = { plugins = [ "golang" ]; };
sessionVariables = { GOPATH = "$HOME/.go"; };
};
};
}

11
modules/haskell.nix Normal file
View File

@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [
ghc
stack
stylish-haskell
haskellPackages.ghcide
haskellPackages.hoogle
];
}

5
modules/nodejs.nix Normal file
View File

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [ nodejs nodePackages.js-beautify yarn ];
}

12
modules/python.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
pipenv
python3
python38Packages.black
python38Packages.isort
python38Packages.pyflakes
python38Packages.pytest
];
}

6
modules/rust.nix Normal file
View File

@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
home.sessionPath = [ "$HOME/.cargo/bin" ];
home.packages = with pkgs; [ cargo rustc rust-analyzer ];
}