-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
101 lines (94 loc) · 2.98 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
{
description = "Personal Nix configuration";
inputs = {
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nix-darwin,
home-manager,
nixpkgs,
...
}@inputs:
let
inherit (self) outputs;
systems = [
"x86_64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
evaledConfig = nixpkgs.lib.evalModules {
modules = [ ./conf.nix ];
};
userConf = evaledConfig.config;
system = builtins.currentSystem;
in
{
overlays = import ./overlays { inherit inputs; };
formatter."${system}" = nixpkgs.legacyPackages."${system}".nixfmt-rfc-style;
nixosConfigurations = {
default = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit userConf inputs outputs; };
modules = [
./modules
./modules/linux
./hosts/default
home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
users."${userConf.username}" = import ./home/default/default.nix;
};
}
];
};
};
darwinConfigurations = {
"${userConf.osx_hostname}" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit userConf inputs outputs; };
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
modules = [
./modules
./modules/osx
./hosts/osx
home-manager.darwinModules.home-manager
{
home-manager = {
useUserPackages = true;
extraSpecialArgs = { inherit inputs outputs; };
users."${userConf.osx_username}" = import ./home/osx/default.nix;
};
}
];
};
};
# homeConfigurations = forAllSystems (system: let
# pkgs = nixpkgs.legacyPackages.${system};
# in {
# "${userConf.username}@${userConf.hostname}" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages."${system}";
# extraSpecialArgs = {
# inherit userConf inputs outputs;
# };
# modules = [ ./home/default/default.nix ];
# };
# "${userConf.osx_username}@${userConf.osx_hostname}" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages."${system}";
# extraSpecialArgs = {
# inherit userConf inputs outputs;
# };
# modules = [ ./home/osx/default.nix ];
# };
# });
};
}