updated
This commit is contained in:
175
flake.nix
175
flake.nix
@@ -28,88 +28,103 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nix-darwin,
|
||||
...
|
||||
} @ inputs: let
|
||||
# Default username - can be overridden per-host if needed
|
||||
username = "alice";
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nix-darwin,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
# Default username - can be overridden per-host if needed
|
||||
username = "alice";
|
||||
|
||||
# Common special args passed to all modules
|
||||
specialArgs = {inherit inputs username;};
|
||||
in {
|
||||
# Darwin (macOS) system configurations
|
||||
darwinConfigurations = {
|
||||
# Personal machine configuration
|
||||
"personal" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
# Host-specific darwin configuration
|
||||
./hosts/personal
|
||||
|
||||
# Home Manager as a darwin module
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
users.${username} = {...}: {
|
||||
imports = [
|
||||
./home
|
||||
./home/personal.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Work machine configuration
|
||||
"work" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
# Host-specific darwin configuration
|
||||
./hosts/work
|
||||
|
||||
# Home Manager as a darwin module
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
users.${username} = {...}: {
|
||||
imports = [
|
||||
./home
|
||||
./home/work.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Development shell for working on this repository
|
||||
devShells = let
|
||||
systems = ["aarch64-darwin" "x86_64-darwin"];
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
# Common special args passed to all modules
|
||||
specialArgs = { inherit inputs username; };
|
||||
in
|
||||
forAllSystems (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nil # Nix LSP
|
||||
{
|
||||
# Darwin (macOS) system configurations
|
||||
darwinConfigurations = {
|
||||
# Personal machine configuration
|
||||
"personal" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
# Host-specific darwin configuration
|
||||
./hosts/personal
|
||||
|
||||
# Home Manager as a darwin module
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
users.${username} =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./home
|
||||
./home/personal.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
# Work machine configuration
|
||||
"work" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
# Host-specific darwin configuration
|
||||
./hosts/work
|
||||
|
||||
# Home Manager as a darwin module
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
users.${username} =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./home
|
||||
./home/work.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Development shell for working on this repository
|
||||
devShells =
|
||||
let
|
||||
systems = [
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
in
|
||||
forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nil # Nix LSP
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user