flake
This commit is contained in:
parent
d5f92f0fb9
commit
f07af1a6dc
1 changed files with 62 additions and 0 deletions
62
flake.nix
Normal file
62
flake.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
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 = 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 = [
|
||||
{
|
||||
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
|
||||
nvim
|
||||
];
|
||||
|
||||
# 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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue