-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
140 lines (123 loc) · 3.65 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
{
description = "NixOS hyprland setup";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# TODO: Apply fixes to nixos-xps
hardware.url = "github:nixos/nixos-hardware";
nix-colors.url = "github:misterio77/nix-colors";
# home-manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix-darwin
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# secrets
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
# neovim
neovim = {
url = "github:dileep-kishore/neovim";
inputs.nixpkgs.follows = "nixpkgs";
};
# hyprland
hyprland = {
url = "github:hyprwm/hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
};
outputs = {
self,
nixpkgs,
home-manager,
nix-darwin,
...
} @ inputs: let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib // nix-darwin.lib;
systems = ["x86_64-linux" "x86_64-darwin"];
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
});
in {
inherit lib;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
# Custom modifications/overrides to upstream packages.
overlays = import ./overlays {inherit inputs outputs;};
# Custom packages to be shared or upstreamed.
packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.alejandra);
devShells = forEachSystem (pkgs: import ./shell.nix {inherit pkgs;});
# NOTE: home-manager is also imported as a module within nixosConfigurations
nixosConfigurations = {
# Main desktop
tsuki = lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/tsuki
home-manager.nixosModules.home-manager
({config, ...}: {
home-manager.extraSpecialArgs = {
inherit inputs outputs;
inherit (config.networking) hostName;
};
})
];
};
# Home Laptop
nixos-xps = lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/nixos-xps
home-manager.nixosModules.home-manager
({config, ...}: {
home-manager.extraSpecialArgs = {
inherit inputs outputs;
inherit (config.networking) hostName;
};
})
];
};
};
darwinConfigurations = {
# Work Laptop
Mac124929 = lib.darwinSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/Mac124929
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {inherit inputs outputs;};
}
];
};
};
homeConfigurations = {
# Work
"g8k@Mac124929" = lib.homeManagerConfiguration {
modules = [./home/Mac124929.nix];
pkgs = pkgsFor.x86_64-darwin;
extraSpecialArgs = {inherit inputs outputs;};
};
"g8k@lap135849" = lib.homeManagerConfiguration {
modules = [./home/lap135849.nix];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
};
};
};
}