From a7fbed952a5e49e8f3179dedb0c1ce3ed9987feb Mon Sep 17 00:00:00 2001 From: Nimmo Date: Sun, 25 Jan 2026 09:19:09 +0000 Subject: [PATCH] feat: Integrate Home Manager into the NixOS flake and define initial user configuration for nimmo. --- common/home.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 20 +++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 common/home.nix diff --git a/common/home.nix b/common/home.nix new file mode 100644 index 0000000..38acf74 --- /dev/null +++ b/common/home.nix @@ -0,0 +1,44 @@ +{ config, pkgs, ... }: + +{ + home.username = "nimmo"; + home.homeDirectory = "/home/nimmo"; + home.stateVersion = "24.11"; + + programs.bash = { + enable = true; + enableCompletion = true; + + # History Search (Prefix sensitive) + # Using bashrcExtra ensures it's available in interactive shells + bashrcExtra = '' + bind '"\e[A": history-search-backward' + bind '"\e[B": history-search-forward' + ''; + + # Bash-it configuration + initExtra = '' + # Path to the bash-it installation provided by Nix + export BASH_IT="${pkgs.bash-it}/share/bash-it" + + # Set the theme + export BASH_IT_THEME="rjorgenson" + + # Disable auto-update as Nix manages the package version + export BASH_IT_AUTOMATIC_UPDATE_CHECK=false + + # Load Bash-it + if [ -f "$BASH_IT/bash_it.sh" ]; then + source "$BASH_IT/bash_it.sh" + fi + ''; + }; + + # Add bash-it to user packages + home.packages = with pkgs; [ + bash-it + ]; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/flake.nix b/flake.nix index acbe62b..0f68d7e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,11 @@ # 2. Antigravity (Google) - Custom Flake antigravity.url = "github:jacopone/antigravity-nix"; - antigravity.inputs.nixpkgs.follows = "nixpkgs"; + antigravity.inputs.nixpkgs.follows = "nixpkgs"; + + # 3. Home Manager + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, ... }@inputs: { @@ -21,6 +25,13 @@ specialArgs = { inherit inputs; }; modules = [ ./hosts/electra/default.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.nimmo = import ./common/home.nix; + } ]; }; @@ -32,6 +43,13 @@ specialArgs = { inherit inputs; }; modules = [ ./hosts/lena/default.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.nimmo = import ./common/home.nix; + } ]; };