-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
165 lines (162 loc) · 4.57 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
{
description = "My NixOS config";
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
nixpkgs-stable = {
url = "github:nixos/nixpkgs/release-24.11";
};
nixpkgs-master = {
url = "github:nixos/nixpkgs/master";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors = {
url = "github:misterio77/nix-colors";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim-conf = {
url = "github:f0rdprefect/nixvim-config";
#url = "git+file:///home/matt/src/nixvim-config";
inputs.nixpkgs.follows = "nixpkgs";
};
# disko = {
# url = "github:nix-community/disko";
# inputs.nixpkgs.follows = "nixpkgs";
# };
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
stylix = {
url = "github:danth/stylix";
};
espanso-fix = {
url = "github:pitkling/nixpkgs/espanso-fix-capabilities-export";
};
};
#inputs@ or {} @ inputs gives a name to the set; only way to access parameters inside the function
# https://mhwombat.codeberg.page/nix-book/#at-patterns
outputs =
{
nixpkgs,
nixpkgs-master,
nixpkgs-stable,
home-manager,
impermanence,
nixos-hardware,
stylix,
espanso-fix,
nixvim-conf,
nix-colors,
...
}@inputs:
let
system = "x86_64-linux";
host = "xin";
inherit (import ./hosts/${host}/options.nix) username hostname;
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
pkgs-stable = import nixpkgs-stable {
inherit system;
config = {
allowUnfree = true;
};
};
pkgs-master = import nixpkgs-master {
inherit system;
config = {
allowUnfree = true;
};
};
# Make stable packages available in the unstable configuration
overlay-stable = final: prev: {
stable = pkgs-stable;
};
# Make master packages available in the unstable configuration
overlay-master = final: prev: {
master = pkgs-master;
};
in
{
nixosConfigurations = {
xin = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit system;
inherit inputs;
inherit username;
inherit hostname;
inherit host;
inherit nix-colors;
};
modules = [
./system.nix
espanso-fix.nixosModules.espanso-capdacoverride
# add your model from this list: https://github.com/NixOS/nixos-hardware/blob/master/flake.nix
nixos-hardware.nixosModules.lenovo-thinkpad-x1-yoga
stylix.nixosModules.stylix
impermanence.nixosModules.impermanence
home-manager.nixosModules.home-manager
# Apply the overlays
{
nixpkgs.overlays = [
overlay-master
overlay-stable
];
}
{
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
inherit host;
inherit nixvim-conf;
inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = import ./users/default/home.nix;
}
];
};
yakari = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit system;
inherit inputs;
inherit username;
inherit hostname;
inherit host;
inherit nix-colors;
};
modules = [
./hosts/yakari/configuration.nix
# add your model from this list: https://github.com/NixOS/nixos-hardware/blob/master/flake.nix
stylix.nixosModules.stylix
# Apply the overlays
{
nixpkgs.overlays = [
overlay-master
overlay-stable
];
}
];
};
};
};
}