-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
92 lines (80 loc) · 2.25 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
{
description = "A flake for timraymond's dotfiles";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
helm-complete = {
url = "github:timraymond/helm-complete";
};
};
outputs = { self, nixpkgs, home-manager, nixos-wsl, darwin, helm-complete}:
let
overlays = [
(import ./overlays)
helm-complete.overlays.default
];
mkSystem = import ./lib/mk-system.nix;
# Supported system types
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
# Helper to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
});
in
{
nixosConfigurations = {
wsl = mkSystem {
inherit nixpkgs home-manager;
system = "x86_64-linux";
extraModules = [
nixos-wsl.nixosModules.default
./modules/wsl.nix
{ nixpkgs.overlays = overlays; }
];
};
};
darwinConfigurations = {
ceres = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./modules/darwin.nix
home-manager.darwinModules.home-manager
{
nixpkgs.overlays = overlays;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users."tim" = { pkgs, ... }: {
imports = [ ./home ];
home = {
username = "tim";
homeDirectory = "/Users/tim";
};
};
};
}
];
};
};
homeConfigurations = {
nixos = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgsFor.x86_64-linux;
modules = [ ./home ];
};
};
};
}