-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflake.nix
116 lines (102 loc) · 3.19 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
{
description = "NixOS and nix-darwin configs for my machines";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
# Home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixOS profiles to optimize settings for different hardware
hardware.url = "github:nixos/nixos-hardware";
# Global catppuccin theme
catppuccin.url = "github:catppuccin/nix";
# NixOS Spicetify
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix Darwin (for MacOS machines)
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Homebrew
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
};
outputs = {
self,
catppuccin,
darwin,
home-manager,
nix-homebrew,
nixpkgs,
...
} @ inputs: let
inherit (self) outputs;
# Define user configurations
users = {
nabokikh = {
avatar = ./files/avatar/face;
email = "alexander.nabokikh@olx.pl";
fullName = "Alexander Nabokikh";
gitKey = "C5810093";
name = "nabokikh";
};
};
# Function for NixOS system configuration
mkNixosConfiguration = hostname: username:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs hostname;
userConfig = users.${username};
nixosModules = "${self}/modules/nixos";
};
modules = [./hosts/${hostname}];
};
# Function for nix-darwin system configuration
mkDarwinConfiguration = hostname: username:
darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs hostname;
userConfig = users.${username};
};
modules = [
./hosts/${hostname}
home-manager.darwinModules.home-manager
nix-homebrew.darwinModules.nix-homebrew
];
};
# Function for Home Manager configuration
mkHomeConfiguration = system: username: hostname:
home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {inherit system;};
extraSpecialArgs = {
inherit inputs outputs;
userConfig = users.${username};
nhModules = "${self}/modules/home-manager";
};
modules = [
./home/${username}/${hostname}
catppuccin.homeManagerModules.catppuccin
];
};
in {
nixosConfigurations = {
energy = mkNixosConfiguration "energy" "nabokikh";
nabokikh-z13 = mkNixosConfiguration "nabokikh-z13" "nabokikh";
};
darwinConfigurations = {
"nabokikh-mac" = mkDarwinConfiguration "nabokikh-mac" "nabokikh";
};
homeConfigurations = {
"nabokikh@energy" = mkHomeConfiguration "x86_64-linux" "nabokikh" "energy";
"nabokikh@nabokikh-mac" = mkHomeConfiguration "aarch64-darwin" "nabokikh" "nabokikh-mac";
"nabokikh@nabokikh-z13" = mkHomeConfiguration "x86_64-linux" "nabokikh" "nabokikh-z13";
};
overlays = import ./overlays {inherit inputs;};
};
}