-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
132 lines (123 loc) · 3.64 KB
/
flake.nix
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
description = "Nix-darwin + nixos configuration";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs?rev=d2faa1bbca1b1e4962ce7373c5b0879e5b12cef2";
# pinned until nix-darwin issue resolved https://github.com/LnL7/nix-darwin/issues/1317
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Add neovim-nightly-overlay
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
# Needed for nix darwin for now as not all pkgs are within nixpkgs
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
hyprland = {
url = "github:hyprwm/Hyprland/b1e5cc66bdb20b002c93479490c3a317552210b3";
#url = "github:hyprwm/Hyprland/b74a56e2acce8fe88a575287a20ac196d8d01938";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nix-darwin,
nixpkgs,
home-manager,
nix-homebrew,
homebrew-core,
homebrew-cask,
homebrew-bundle,
neovim-nightly-overlay,
hyprland,
...
}: let
overlays = [
neovim-nightly-overlay.overlays.default
(final: prev: {
hyprland = prev.hyprland.override {
libgbm = prev.mesa;
};
})
];
systemDarwin = "aarch64-darwin";
systemLinux = "aarch64-linux";
# A helper function for the home manager configuration.
mkHomeConfig = system:
home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
inherit overlays;
};
modules = [
./home-manager/home.nix
{nixpkgs.overlays = overlays;}
];
extraSpecialArgs = {
inherit hyprland;
};
};
in {
##########################################
# Nix Darwin
##########################################
darwinConfigurations.darwin = nix-darwin.lib.darwinSystem {
system = systemDarwin; #
specialArgs = {inherit self;};
modules = [
./darwin/configuration.nix
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
enable = true;
user = "aloys";
# Optional: Declarative tap management
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
"homebrew/homebrew-bundle" = homebrew-bundle;
};
# Optional: Enable fully-declarative tap management
#
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
mutableTaps = false;
};
}
];
};
##########################################
# NixOS configuration
##########################################
nixosConfigurations.myNixOS = nixpkgs.lib.nixosSystem {
system = systemLinux;
modules = [
./nixos/configuration.nix
];
};
##########################################
# Home manager configuration
##########################################
homeConfigurations = {
# For Linux systems
linux = mkHomeConfig systemLinux;
# For macOS systems (if you want a separate Home Manager config)
darwin = mkHomeConfig systemDarwin;
};
};
}