Make home manager config work cross-platform

This commit is contained in:
Gene Liverman 2025-08-09 22:58:18 -04:00
parent 77ebe6ddd5
commit 516036541b
No known key found for this signature in database
3 changed files with 13 additions and 6 deletions

View file

@ -174,9 +174,16 @@
# Home Manager (only) users
homeConfigurations = {
gene = localLib.mkHomeConfig {
gene-x86_64-linux = localLib.mkHomeConfig {
homeDirectory = "/home/gene";
username = "gene";
system = "x86_64-linux";
};
gene-aarch64-linux = localLib.mkHomeConfig {
homeDirectory = "/home/gene";
username = "gene";
system = "aarch64-linux";
};
}; # end homeConfigurations

View file

@ -1,10 +1,10 @@
{ inputs, ... }: {
mkHomeConfig = {
system ? "x86_64-linux",
homeDirectory,
system,
username,
}: inputs.home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = { inherit inputs homeDirectory username; };
extraSpecialArgs = { inherit inputs homeDirectory system username; };
pkgs = inputs.nixpkgs.legacyPackages.${system};

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: {
{ config, pkgs, system, username, ... }: {
home.stateVersion = "25.05";
home.packages = with pkgs; [
age
@ -9,8 +9,8 @@
# home-manager switch --flake ~/repos/dots
programs.zsh.shellAliases = {
nixdiff = "cd ~/repos/dots && home-manager build --flake . && nvd diff /run/current-system result";
nixup = "home-manager switch --flake ~/repos/dots";
nixdiff = "cd ~/repos/dots && home-manager build --flake .#${username}-${system} && nvd diff /run/current-system result";
nixup = "home-manager switch --flake ~/repos/dots#${username}-${system}";
};
sops = {