dotfiles.pub/flake.nix
2025-09-07 00:17:28 +02:00

112 lines
3.3 KiB
Nix

{
description = "OSHs dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, neovim-nightly-overlay, ... }:
let
system = builtins.currentSystem;
username = builtins.getEnv "USER";
homeDir = builtins.getEnv "HOME";
pkgs = import nixpkgs { inherit system; };
in {
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
nixpkgs.overlays = [
neovim-nightly-overlay.overlays.default
];
home.username = username;
home.homeDirectory = homeDir;
# Only manage what you explicitly turn on below
# (this keeps you from overriding distro-level things)
programs.git = {
enable = true;
userName = "Oshgnacknak";
userEmail = "osh@oshgnacknak.de";
};
programs.neovim = {
enable = true;
package = neovim-nightly-overlay.packages.${pkgs.system}.default;
viAlias = true;
vimAlias = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = ''
autoload -Uz manydots-magic
manydots-magic
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
source ${pkgs.fzf}/share/fzf/completion.zsh
[ -f "$HOME/.config/zshrc" ] && emulate sh -c "source $HOME/.config/zshrc"
'';
zplug = {
enable = true;
plugins = [
{ name = "zsh-users/zsh-autosuggestions"; }
];
};
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
# Put extra packages in the *user* profile (not system)
home.packages = with pkgs; [
ripgrep
fd
tmux
xsel
fzf
thefuck
];
# Link dotfiles without forcing overwrite (fails safely if a file already exists)
home.file.".tmux.conf".source = ./_tmux.conf;
home.file.".config/zshrc".source = ./_zshrc;
home.file.".bashrc".source = ./_bashrc;
home.file.".local/share/nvim/site/autoload/plug.vim".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim";
sha256 = "c2d8998469a049a51225a71128a12917b379822d16b639493e29ea02d8787306";
};
xdg.configFile."nvim" = {
source = ./_config/nvim;
recursive = true;
force = true;
};
# Environment variables only for this user/session
home.sessionVariables = {
EDITOR = "nvim";
};
# Good HM hygiene
xdg.enable = true;
home.stateVersion = "24.05";
}
];
};
};
}