Files
nixcfg/users/daniel/default.nix
2022-07-15 00:50:28 +01:00

178 lines
3.3 KiB
Nix

{
pkgs,
lib,
fetchurl,
hostname,
headless,
...
}: let
idea = with pkgs;
symlinkJoin {
name = "idea-ultimate";
paths = [
jetbrains.idea-ultimate
];
buildInputs = [makeWrapper];
postBuild = ''
wrapProgram $out/bin/idea-ultimate --prefix PATH : ${symlinkJoin {
name = "rust-toolchain";
paths = [rustc cargo rustfmt];
}}/bin
'';
};
cliPackages = with pkgs; [
direnv
entr
go_1_18
gopls
oh-my-zsh
(
let
my-python-packages = python-packages:
with python-packages; [
tkinter
requests
];
python-with-my-packages = python3.withPackages my-python-packages;
in
python-with-my-packages
)
restic
rust-analyzer
starship
];
guiPackages = with pkgs; [
_1password
_1password-gui
discord
feh
iosevka
idea
mpv
nerdfonts
obsidian
pamixer
pavucontrol
playerctl
spotify-qt
xclip
];
defaultUser = "daniel";
in {
imports =
[
./configs/system
]
++ lib.optionals (!headless) [
./configs/desktop
]
++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [
./host-specific/${hostname}
];
home = {
username = defaultUser;
homeDirectory = "/home/${defaultUser}";
sessionPath = [
"$HOME/go/bin"
];
file = {
".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors";
".rust".source = pkgs.rustPlatform.rustcSrc;
"bin/update" = {
source = ../../scripts/update;
executable = true;
};
"bin/supdate" = {
source = ../../scripts/supdate;
executable = true;
};
};
packages = cliPackages ++ lib.optionals (!headless) guiPackages;
keyboard = {
layout = "gb";
options = [
"caps:escape"
];
};
stateVersion = "21.05";
};
programs = {
# Let Home Manager install and manage itself.
home-manager.enable = true;
fzf = {
enable = true;
enableZshIntegration = true;
};
git = {
enable = true;
package = pkgs.gitFull;
userName = "Daniel Patterson";
userEmail = "me@danielpatterson.dev";
extraConfig = {
pull.rebase = true;
init.defaultBranch = "main";
format.signOff = "yes";
sendemail = {
smtpUser = "me@danielpatterson.dev";
smtpServer = "smtp.fastmail.com";
smtpEncryption = "tls";
smtpServerPort = 587;
};
};
};
lazygit = {
enable = true;
settings = {
gui = {
showFileTree = false;
};
};
};
starship.enable = true;
vscode.enable = true;
zsh = {
enable = true;
enableAutosuggestions = true;
initExtra = ''
if [ -n "$TMUX" ]; then
setopt ignoreeof
fi
eval "$(direnv hook zsh)"
'';
oh-my-zsh = {
enable = true;
plugins = ["git" "fzf"];
theme = "agnoster";
};
};
};
services = {
dunst.enable = true;
screen-locker = {
enable = true;
lockCmd = "${pkgs.i3lock}/bin/i3lock -i /home/daniel/wallpapers/lock.png";
inactiveInterval = 60;
};
};
}