dotfiles.pub/flake.nix
2025-09-06 20:35:17 +02:00

62 lines
1.7 KiB
Nix

{
description = "OSHs dotfiles";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
username = builtins.getEnv "USER";
homeDir = builtins.getEnv "HOME";
pkgs = import nixpkgs { inherit system; };
in {
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
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";
};
# Put extra packages in the *user* profile (not system)
home.packages = with pkgs; [
ripgrep
fd
tmux
neovim
];
# Example: link dotfiles without forcing overwrite
# (fails safely if a file already exists)
home.file.".tmux.conf".source = ./_tmux.conf;
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";
}
];
};
};
}