From 1f9a3f6869940170d2ccbbb26eecce1f66289f01 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sun, 28 Dec 2025 00:42:03 +0100 Subject: [PATCH] Changed the way of importing HM --- hosts/common/home.nix | 8 +------- hosts/macos/home.nix | 11 ++--------- hosts/nixos/configuration.nix | 3 +++ hosts/nixos/home.nix | 14 ++++---------- hosts/nixos/modules.nix | 1 + modules/common/zed.nix | 6 +++--- 6 files changed, 14 insertions(+), 29 deletions(-) diff --git a/hosts/common/home.nix b/hosts/common/home.nix index 24333c1..960292c 100644 --- a/hosts/common/home.nix +++ b/hosts/common/home.nix @@ -1,10 +1,6 @@ -{ config, pkgs, inputs, username, homeDir, ... }: +{ config, pkgs, inputs, ... }: { - home = { - username = username; - homeDirectory = homeDir; - }; imports = [ inputs.spicetify-nix.homeManagerModules.spicetify @@ -74,6 +70,4 @@ python312 # The main interpreter #pip # The package manager ]; - - } diff --git a/hosts/macos/home.nix b/hosts/macos/home.nix index e454ad0..faa7386 100644 --- a/hosts/macos/home.nix +++ b/hosts/macos/home.nix @@ -1,12 +1,5 @@ { config, pkgs, inputs, ... }: -let - commonHome = import ../common/home.nix { - inherit config pkgs inputs; - username = "alex"; - homeDir = "/Users/alex"; - }; -in commonHome // { # Refer to the nixOS host for info about home-manager # inherit commonHome; @@ -15,10 +8,10 @@ commonHome // { # Allow unfree packages nixpkgs.config.allowUnfree = true; - home.packages = commonHome.home.packages ++ (with pkgs; [ + home.packages = with pkgs; [ # Window management (maybe configure it with home-manager) yabai skhd #borders - ]); + ]; } diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 255cfe9..06831b0 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -66,6 +66,9 @@ useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "backup"; + sharedModules = [ + inputs.sops-nix.homeManagerModules.sops + ]; users = { "alex" = import ./home.nix; }; diff --git a/hosts/nixos/home.nix b/hosts/nixos/home.nix index ce1f781..c6c8ab8 100644 --- a/hosts/nixos/home.nix +++ b/hosts/nixos/home.nix @@ -1,16 +1,10 @@ { config, pkgs, inputs, ... }: -let - commonHome = import ../common/home.nix { - inherit config pkgs inputs; - username = "alex"; - homeDir = "/home/alex"; - }; -in -commonHome // { +{ # Home Manager needs a bit of information about you and the paths it should # manage. imports = [ + ../common/home.nix ../../modules/home-manager/hyprland.nix ]; # This value determines the Home Manager release that your configuration is @@ -24,7 +18,7 @@ commonHome // { # The home.packages option allows you to install Nix packages into your # environment. - home.packages = commonHome.home.packages ++ ( with pkgs;[ + home.packages = with pkgs; [ # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. @@ -51,7 +45,7 @@ commonHome // { # (pkgs.writeShellScriptBin "my-hello" '' # echo "Hello, ${config.home.username}!" # '') - ]); + ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage # plain files is through 'home.file'. diff --git a/hosts/nixos/modules.nix b/hosts/nixos/modules.nix index 83cf4b8..734ade6 100644 --- a/hosts/nixos/modules.nix +++ b/hosts/nixos/modules.nix @@ -5,6 +5,7 @@ imports = [ inputs.sops-nix.nixosModules.sops + inputs.sops-nix.homeManagerModules.sops ../../modules/nixos/secrets.nix # Sops ../../modules/nixos/wireless.nix # For the wifi ../../modules/nixos/locale.nix # For localisation options diff --git a/modules/common/zed.nix b/modules/common/zed.nix index 8c280ac..4bee2e4 100644 --- a/modules/common/zed.nix +++ b/modules/common/zed.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - cfg = config.programs.zed-ai; + cfg = config.programs.zed-custom; # Zed configuration zedSettings = { @@ -390,7 +390,7 @@ in }; # Configure default MCP servers - programs.zed-ai.mcpServers = lib.mkDefault { + programs.zed-custom.mcpServers = lib.mkDefault { filesystem = { command = "npx"; args = [ @@ -447,7 +447,7 @@ in # Helper Scripts home.packages = [ # Main test script - (pkgs.writeShellScriptBin "zed-ai-test" '' + (pkgs.writeShellScriptBin "zed-custom-test" '' echo "🔍 Testing Zed AI Configuration with Chain of Thought..." echo ""