diff --git a/configuration.nix b/configuration.nix index 50f4a4e..6385841 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,7 +12,7 @@ # Bootloader. boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.device = "/dev/vda"; boot.loader.grub.useOSProber = true; networking.hostName = "nixos"; # Define your hostname. @@ -102,11 +102,9 @@ environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget - alacritty + # alacritty, neovim and gh come from Home Manager (home.nix) for user leo curl - gh git - neovim gnome-extension-manager gnomeExtensions.dash-to-dock ]; diff --git a/dotfiles/init.vim b/dotfiles/init.vim new file mode 100644 index 0000000..4c07802 --- /dev/null +++ b/dotfiles/init.vim @@ -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 diff --git a/home.nix b/home.nix index 1c28ed9..b5d2790 100644 --- a/home.nix +++ b/home.nix @@ -13,92 +13,67 @@ # release notes. home.stateVersion = "26.05"; # Please read the comment before changing. - # The home.packages option allows you to install Nix packages into your - # environment. + # Packages that have no Home Manager module (or that need no config). + # Programs configured via `programs..enable` below are installed + # automatically, so they do not belong here. home.packages = [ - pkgs.tmux 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'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - "./.config/alacritty/alacritty.toml".text = '' - [window] - opacity = 0.75 - padding = { x = 5, y = 5} - decorations = "None" - - [colors.primary] - background = "#000000" - - [font] - size = 11 - ''; - - "./.config/nvim/init.vim".text = '' - set number - - 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 - - # 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 - # ''; + ############################################################################# + # Terminal + ############################################################################# + programs.alacritty = { + enable = true; + # This attribute set is translated into ~/.config/alacritty/alacritty.toml + settings = { + window = { + padding = { x = 5; y = 5; }; + decorations = "None"; + }; + colors.primary.background = "#000000"; + font.size = 11; + }; }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # 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' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/leo/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - # EDITOR = "emacs"; + ############################################################################# + # tmux + ############################################################################# + programs.tmux = { + enable = true; + prefix = "C-a"; # replaces the unbind C-b / set prefix dance + mouse = true; + extraConfig = '' + # Home Manager writes the config to ~/.config/tmux/tmux.conf + bind r source-file ~/.config/tmux/tmux.conf \; display-message "RELOADING CONFIGURATION FILE…" + + set -g status-style bg=white,fg=black + ''; }; + ############################################################################# + # Neovim + ############################################################################# + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + # The actual vimscript lives in dotfiles/init.vim so your editor can + # highlight it and no Nix string escaping is needed. + extraConfig = builtins.readFile ./dotfiles/init.vim; + plugins = with pkgs.vimPlugins; [ + # vim-sensible + # telescope-nvim + ]; + }; + + ############################################################################# + # Shell + ############################################################################# programs.bash = { enable = true; shellAliases = { @@ -107,4 +82,21 @@ 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 + }; }