darwin modules

This commit is contained in:
mjallen18
2025-11-19 21:54:01 -06:00
parent c0dbceefb9
commit 5e4d16297e
9 changed files with 434 additions and 292 deletions

View File

@@ -0,0 +1,61 @@
{
config,
lib,
options,
namespace,
inputs,
system,
...
}:
{
options.${namespace}.home = with lib.types; {
configFile = lib.mkOption {
type = attrs;
default = { };
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
};
extraOptions = lib.mkOption {
type = attrs;
default = { };
description = "Options to pass directly to home-manager.";
};
file = lib.mkOption {
type = attrs;
default = { };
description = "A set of files to be managed by home-manager's <option>home.file</option>.";
};
};
config = {
home-manager = {
# enables backing up existing files instead of erroring if conflicts exist
backupFileExtension = "backup";
useGlobalPkgs = true;
useUserPackages = true;
# Pass inputs so external modules can access them
extraSpecialArgs = {
inherit inputs namespace;
overlays = with inputs; [
nix-vscode-extensions.overlays.default
];
};
# Make ALL external HM modules available globally
sharedModules =
with inputs;
[
sops-nix.homeManagerModules.sops
nix-plist-manager.homeManagerModules.default
# Add any other external HM modules here
];
users."mattjallen" =
lib.mkAliasDefinitions
options.${namespace}.home.extraOptions;
verbose = true;
};
};
}

View File

@@ -0,0 +1,13 @@
{ config, ... }:
{
config = {
programs.ssh.knownHosts = {
desktop = {
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTBMydhOc6SnOdB5WrEd7X07DrboAtagCUgXiOJjLov matt@matt-nixos";
};
nas = {
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIwoHWOLSTGVif9hAhaMLl0qDA4roIzCNuyR6kyIXDOj admin@jallen-nas";
};
};
};
}

View File

@@ -9,6 +9,7 @@
}:
let
isArm = ("aarch64-linux" == system) || ("aarch64-darwin" == system);
isDarwin = ("aarch64-darwin" == system);
hasDestopEnvironment =
config.${namespace}.desktop.cosmic.enable
|| config.${namespace}.desktop.gnome.enable
@@ -62,9 +63,11 @@ in
with inputs;
[
sops-nix.homeManagerModules.sops
nix-plist-manager.homeManagerModules.default
# Add any other external HM modules here
]
++ (if (!isArm) then with inputs; [ steam-rom-manager.homeManagerModules.default ] else [ ]);
++ (if (!isArm) then with inputs; [ steam-rom-manager.homeManagerModules.default ] else [ ])
++ (if (isDarwin) then with inputs; [ ] else [ ]);
users.${config.${namespace}.user.name} =
lib.mkAliasDefinitions