-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
96 lines (89 loc) · 3.01 KB
/
flake.nix
File metadata and controls
96 lines (89 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
description = "srizzling's dotfiles (macOS + Linux)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
brew-nix = {
url = "github:BatteredBunny/brew-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin.url = "github:catppuccin/nix";
};
outputs = { self, nixpkgs, nix-darwin, home-manager, brew-nix, catppuccin, ... }:
let
system = "aarch64-darwin";
mkDarwinSystem = hostName: profile: username: nix-darwin.lib.darwinSystem {
inherit system;
specialArgs = { inherit profile system; };
modules = [
./darwin
# Add brew-nix module
brew-nix.darwinModules.default
({pkgs, ...}: {
# Enable brew-nix
brew-nix.enable = true;
# Add system-level packages (prefer nixpkgs, fallback to brew-nix)
environment.systemPackages = with pkgs; [
# Terminal emulator - using brew-nix due to build issues in nixpkgs
brewCasks.ghostty
# OrbStack for container management
brewCasks.orbstack
];
})
# Re-enable home-manager with explicit Darwin configuration
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup"; # Backup existing files
extraSpecialArgs = { inherit profile; };
users.${username} = { pkgs, lib, ... }: {
imports = [
./home-manager
catppuccin.homeModules.catppuccin
];
# Explicitly set homeDirectory for Darwin, forcing override
home.homeDirectory = lib.mkForce "/Users/${username}";
home.username = lib.mkForce username;
};
};
}
];
};
in
{
# Apple Silicon configurations
darwinConfigurations = {
"personal" = mkDarwinSystem "personal" "personal" "srizzling";
"work" = mkDarwinSystem "work" "work" "srizzling";
};
# Linux configurations (standalone home-manager for CachyOS)
homeConfigurations = {
"srizzling@BlueShell" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
./home-manager/linux.nix
catppuccin.homeModules.catppuccin
];
};
};
# Development shells
devShells.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.mkShell {
buildInputs = with nixpkgs.legacyPackages.aarch64-darwin; [ gnumake ];
};
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
buildInputs = with nixpkgs.legacyPackages.x86_64-linux; [ gnumake ];
};
};
}