forked from mitchellh/nixos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
183 lines (168 loc) · 5.77 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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
inputs = {
# Mirroring nixpkgs unstable
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
ghostty.url = "github:ghostty-org/ghostty";
# ghostty.inputs.nixpkgs-stable.follows = "nixpkgs";
# ghostty.inputs.nixpkgs-unstable.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# Updating nix itself
nix.url = "https://flakehub.com/f/DeterminateSystems/nix/2.0";
# For running GUI apps
# nixGL.url = "github:nix-community/nixGL";
# nixGL.inputs.nixpkgs.follows = "nixpkgs";
devenv.url = "github:cachix/devenv";
# Fix static linking issues
# flox.url = "github:flox/flox";
# ld-floxlib.url = "github:flox/ld-floxlib";
# Should follow nixpkgs for home-manager packages
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Do not follow nixpkgs so it can be built reliably
# neovim.url = "github:nix-community/neovim-nightly-overlay";
# For rust nightly
# fenix.url = "github:nix-community/fenix";
# fenix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
self,
flake-parts,
home-manager,
nixpkgs,
ghostty,
disko,
# neovim,
# devenv,
# flox,
# ld-floxlib,
# nixGL,
# fenix,
...
}:
let
linux-user = "sand";
mac-user = "san.nguyen";
modules =
{ user }:
[
{
nix.settings.extra-trusted-users = [ user ];
nix.settings.extra-trusted-public-keys = [
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
];
nix.settings.extra-trusted-substituters = [
"https://devenv.cachix.org"
"https://cache.flox.dev"
"https://ghostty.cachix.org"
];
}
./users/${user}/home.nix
inputs.nix.homeManagerModules.default
];
in
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
systems = [ "aarch64-linux" ];
debug = true;
imports = [ inputs.devenv.flakeModule ];
perSystem =
{ system, ... }:
{
devenv.shells.default = {
languages.nix.enable = true;
};
packages.default = ghostty.packages.${system}.ghostty;
};
flake.overlays.default = final: prev: {
# neovim-nightly = neovim.packages.${final.stdenv.system}.neovim;
# comic-code = prev.callPackage ./pkgs/comic-code { };
# nvchad = prev.callPackage ./pkgs/nvchad { };
# devenv = devenv.packages.${final.stdenv.system}.default;
# flox = flox.packages.${final.stdenv.system}.default;
# ghostty = ghostty.packages.${final.stdenv.system}.ghostty;
};
flake.overlays.linux = final: prev: {
# nixGL = nixGL.packages.${final.stdenv.system}.default;
# ld-floxlib = ld-floxlib.packages.${final.stdenv.system}.ld-floxlib;
};
flake.nixosConfigurations.parallels-desktop = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
./machines/parallels/configuration.nix
disko.nixosModules.disko
./machines/parallels/disko-config.nix
./machines/common.nix
{
disko.devices.disk.main.device = "/dev/sdc";
disko.devices.disk.work.device = "/dev/sdb";
environment.systemPackages = [
ghostty.packages.${system}.ghostty
# nixGL.packages.${system}.default
];
}
home-manager.nixosModules.home-manager
];
};
flake.nixosConfigurations.vmware-fusion = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
./machines/vmware-fusion/configuration.nix
disko.nixosModules.disko
./machines/vmware-fusion/disko-config.nix
./machines/common.nix
{
disko.devices.disk.main.device = "/dev/nvme0n3";
disko.devices.disk.work.device = "/dev/nvme0n4";
environment.systemPackages = [
ghostty.packages.${system}.ghostty
# nixGL.packages.${system}.default
];
}
home-manager.nixosModules.home-manager
];
};
flake.homeConfigurations.${linux-user} = withSystem "aarch64-linux" (
{ system, ... }:
home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.default
self.overlays.linux
# fenix.overlays.default
];
};
extraSpecialArgs = {
username = linux-user;
};
modules = modules { user = linux-user; };
}
);
flake.homeConfigurations.${mac-user} = withSystem "aarch64-darwin" (
{ system, ... }:
home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.default
# fenix.overlays.default
];
};
extraSpecialArgs = {
username = mac-user;
};
modules = modules { user = mac-user; };
}
);
}
);
}