-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
163 lines (143 loc) · 4.45 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
{
description = "suasuasuasuasua's nixos and nix-darwin config";
inputs = {
# nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO:use disko eventually
# disko = {
# url = "github:nix-community/disko";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# Theming
catppuccin.url = "github:catppuccin/nix";
# Spotify customization
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nvim through Nix
nixvim = {
url = "github:nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of nixvim.
# url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Firefox
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
# TODO: uncomment when I get around to using
# disko,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
nixosSystems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
darwinSystems = [
"aarch64-darwin"
"x86_64-darwin"
];
systems = nixosSystems ++ darwinSystems;
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
# Define the user
name = "justin";
user = {
name = "${name}";
fullName = "Justin Hoang";
home = "/home/${name}";
email = "j124.dev@proton.me";
browser = "firefox";
editor = "nvim";
terminal = "alacritty";
};
in {
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# NixOS configuration entrypoint
# Available through 'nixos-rebuild switch --flake .#your-hostname'
nixosConfigurations = {
# Define the different NixOS systems
# HP Optiplex 5060 Micro PC
"dell" = nixpkgs.lib.nixosSystem {
specialArgs = {
hostname = "dell";
system = "x86_64-linux";
inherit inputs outputs user;
};
modules = [
# > Our main nixos configuration file <
./hosts/dell/configuration.nix
];
};
# Acer Spin 713-3w Chromebook
"penguin" = nixpkgs.lib.nixosSystem {
specialArgs = {
hostname = "penguin";
system = "x86_64-linux";
inherit inputs outputs user;
};
modules = [
# > Our main nixos configuration file <
./hosts/penguin/configuration.nix
];
};
# ...
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager switch --flake .#your-username@your-hostname'
homeConfigurations = {
# Define the users
"nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {
system = "x86_64-linux";
inherit inputs outputs user;
};
# > Our main home-manager configuration file <
modules = [
./home-manager/home-nixos.nix
];
};
"wsl" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {
system = "x86_64-linux";
inherit inputs outputs user;
};
# > Our main home-manager configuration file <
modules = [
./home-manager/home-wsl.nix
];
};
"darwin" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {
system = "aarch64-darwin";
inherit inputs outputs user;
};
# > Our main home-manager configuration file <
modules = [
./home-manager/home-darwin.nix
];
};
# ...
};
};
}