Add nix native configs. Add dotfiles dir

This commit is contained in:
Leo Alho 2026-07-28 11:35:25 +03:00
parent 7c37492c69
commit 9e58368444
3 changed files with 83 additions and 82 deletions

View file

@ -12,7 +12,7 @@
# Bootloader. # Bootloader.
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/vda";
boot.loader.grub.useOSProber = true; boot.loader.grub.useOSProber = true;
networking.hostName = "nixos"; # Define your hostname. networking.hostName = "nixos"; # Define your hostname.
@ -102,11 +102,9 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget # wget
alacritty # alacritty, neovim and gh come from Home Manager (home.nix) for user leo
curl curl
gh
git git
neovim
gnome-extension-manager gnome-extension-manager
gnomeExtensions.dash-to-dock gnomeExtensions.dash-to-dock
]; ];

11
dotfiles/init.vim Normal file
View file

@ -0,0 +1,11 @@
" Neovim configuration, loaded by Home Manager
" (programs.neovim.extraConfig in ../home.nix)
set number
set noswapfile
" Indentation
set autoindent
set shiftwidth=4
set expandtab

140
home.nix
View file

@ -13,92 +13,67 @@
# release notes. # release notes.
home.stateVersion = "26.05"; # Please read the comment before changing. home.stateVersion = "26.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your # Packages that have no Home Manager module (or that need no config).
# environment. # Programs configured via `programs.<name>.enable` below are installed
# automatically, so they do not belong here.
home.packages = [ home.packages = [
pkgs.tmux
pkgs.gh pkgs.gh
pkgs.pi-coding-agent
pkgs.proton-vpn
pkgs.vscodium
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage #############################################################################
# plain files is through 'home.file'. # Terminal
home.file = { #############################################################################
# # Building this configuration will create a copy of 'dotfiles/screenrc' in programs.alacritty = {
# # the Nix store. Activating the configuration will then make '~/.screenrc' a enable = true;
# # symlink to the Nix store copy. # This attribute set is translated into ~/.config/alacritty/alacritty.toml
# ".screenrc".source = dotfiles/screenrc; settings = {
"./.config/alacritty/alacritty.toml".text = '' window = {
[window] padding = { x = 5; y = 5; };
opacity = 0.75 decorations = "None";
padding = { x = 5, y = 5} };
decorations = "None" colors.primary.background = "#000000";
font.size = 11;
};
};
[colors.primary] #############################################################################
background = "#000000" # tmux
#############################################################################
[font] programs.tmux = {
size = 11 enable = true;
''; prefix = "C-a"; # replaces the unbind C-b / set prefix dance
mouse = true;
"./.config/nvim/init.vim".text = '' extraConfig = ''
set number # Home Manager writes the config to ~/.config/tmux/tmux.conf
bind r source-file ~/.config/tmux/tmux.conf \; display-message "RELOADING CONFIGURATION FILE"
set noswapfile
" Indentation
set autoindent
set shiftwidth=4
'';
".tmux.conf".text = ''
#Add a mapping for reloading the conf file
bind r source-file ~/.tmux.conf \; display-message "RELOADING CONFIGURATION FILE"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
set -g status-style bg=white,fg=black set -g status-style bg=white,fg=black
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
''; '';
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
}; };
# Home Manager can also manage your environment variables through #############################################################################
# 'home.sessionVariables'. These will be explicitly sourced when using a # Neovim
# shell provided by Home Manager. If you don't want to manage your shell #############################################################################
# through Home Manager then you have to manually source 'hm-session-vars.sh' programs.neovim = {
# located at either enable = true;
# viAlias = true;
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh vimAlias = true;
# defaultEditor = true;
# or # The actual vimscript lives in dotfiles/init.vim so your editor can
# # highlight it and no Nix string escaping is needed.
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh extraConfig = builtins.readFile ./dotfiles/init.vim;
# plugins = with pkgs.vimPlugins; [
# or # vim-sensible
# # telescope-nvim
# /etc/profiles/per-user/leo/etc/profile.d/hm-session-vars.sh ];
#
home.sessionVariables = {
# EDITOR = "emacs";
}; };
#############################################################################
# Shell
#############################################################################
programs.bash = { programs.bash = {
enable = true; enable = true;
shellAliases = { shellAliases = {
@ -107,4 +82,21 @@
count = "ls -1 | wc -l"; count = "ls -1 | wc -l";
}; };
}; };
# Plain files that have no dedicated module can still be managed here, either
# inline with `.text` or - preferably - from a file in dotfiles/:
#
# home.file.".screenrc".source = ./dotfiles/screenrc;
# xdg.configFile."foo".source = ./dotfiles/foo; # whole directory
#
# For a config you tweak constantly, symlink to the working tree instead so
# edits apply without a rebuild:
#
# home.file.".config/nvim".source =
# config.lib.file.mkOutOfStoreSymlink "/home/leo/NixOS/dotfiles/nvim";
home.file = { };
home.sessionVariables = {
# EDITOR is set by programs.neovim.defaultEditor
};
} }