-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathflake.nix
More file actions
169 lines (152 loc) · 5.39 KB
/
Copy pathflake.nix
File metadata and controls
169 lines (152 loc) · 5.39 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
description = "elianiva nix config";
inputs = {
nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "nixpkgs-unstable";
# nix darwin stuff
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# manage homebrew through nix
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
homebrew-core.url = "github:homebrew/homebrew-core";
homebrew-core.flake = false;
homebrew-cask.url = "github:homebrew/homebrew-cask";
homebrew-cask.flake = false;
homebrew-bundle.url = "github:homebrew/homebrew-bundle";
homebrew-bundle.flake = false;
homebrew-barutsrb.url = "github:BarutSRB/homebrew-tap";
homebrew-barutsrb.flake = false;
# fenix for rust
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
# only needed for linux
nixGL.url = "github:nix-community/nixGL/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a";
nixGL.inputs.nixpkgs.follows = "nixpkgs";
jj-starship.url = "github:dmmulroy/jj-starship";
ioshelfka.url = "github:NotAShelf/Ioshelfka";
bash-env-json = {
url = "github:tesujimath/bash-env-json/main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
nixpkgs,
home-manager,
nix-darwin,
nix-homebrew,
fenix,
jj-starship,
...
}:
let
raw-identity = import ./modules/identity.nix;
flakePkgs = system: {
bash-env-json = inputs.bash-env-json.packages.${system}.default;
};
# Resolve platform-specific identity fields
mkIdentity = platform: raw-identity // {
inherit (raw-identity.platforms.${platform}) homeDir;
dotfiles = "${raw-identity.platforms.${platform}.homeDir}/.dotfiles";
workspacePath = "${raw-identity.platforms.${platform}.homeDir}/Development";
repositoriesPath = "${raw-identity.platforms.${platform}.homeDir}/Repositories";
};
identity = mkIdentity "darwin";
in
{
darwinConfigurations = {
melon = nix-darwin.lib.darwinSystem {
inherit inputs;
system = "aarch64-darwin";
# pkgs = nixpkgs.legacyPackages."aarch64-darwin";
pkgs = import nixpkgs {
system = "aarch64-darwin";
overlays = [
fenix.overlays.default
jj-starship.overlays.default
];
};
specialArgs = {
inherit (inputs) fenix ioshelfka;
flakePkgs = flakePkgs "aarch64-darwin";
inherit identity;
};
modules = [
nix-homebrew.darwinModules.nix-homebrew
home-manager.darwinModules.home-manager
{
nix-homebrew = {
enable = true;
enableRosetta = true;
user = identity.username;
taps = {
"homebrew/homebrew-core" = inputs.homebrew-core;
"homebrew/homebrew-cask" = inputs.homebrew-cask;
"homebrew/homebrew-bundle" = inputs.homebrew-bundle;
"BarutSRB/homebrew-tap" = inputs.homebrew-barutsrb;
};
mutableTaps = false;
autoMigrate = true;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit identity; };
home-manager.users.${identity.username} = {
imports = [
./modules/darwin-home.nix
./modules/git.nix
./modules/gpg.nix
];
};
}
# Align homebrew taps config with nix-homebrew
({config, lib, ...}: {
homebrew.taps = lib.mapAttrsToList (name: _:
let parts = lib.splitString "/" name;
org = lib.head parts;
repo = lib.last parts;
in if org == "homebrew" then "homebrew/${lib.removePrefix "homebrew-" repo}" else name
) config.nix-homebrew.taps;
})
./modules/darwin-config.nix
./modules/iosevka-output.nix
];
};
};
homeConfigurations = {
${identity.username} = home-manager.lib.homeManagerConfiguration {
system = "x86_64-linux";
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
extraSpecialArgs = {
inherit inputs;
inherit (inputs) ioshelfka;
identity = mkIdentity "linux";
flakePkgs = flakePkgs "x86_64-linux";
inherit (inputs) fenix;
};
modules = [
./modules/linux-home.nix
./modules/gpg.nix
./modules/git.nix
./modules/linux-terminals.nix
];
};
};
};
nixConfig = {
trusted-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}