-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
96 lines (77 loc) · 2.5 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
{
description = "Darwin system flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
helix-master = {
url = "github:helix-editor/helix/master";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
scls-main = {
url = "github:estin/simple-completion-language-server/main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nix-darwin, nixpkgs-master, home-manager, helix-master, scls-main, sops-nix, ... }:
let
system = "aarch64-darwin";
username = "jaakkopaju";
userhome = "/Users/${username}";
pkgs-master = import nixpkgs-master { inherit system; };
fishUtils = import "${self}/util/fish.nix";
specialArgs = {
inherit system;
inherit username;
inherit userhome;
inherit nix-darwin;
inherit home-manager;
inherit sops-nix;
inherit helix-master;
inherit scls-main;
inherit pkgs-master;
inherit fishUtils;
};
homeManagerOptions = homeModules: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username}.imports = homeModules;
extraSpecialArgs = specialArgs;
backupFileExtension = "bak";
};
};
in {
# Expose the package set, including overlays, for convenience.
# darwinPackages = self.darwinConfigurations.${hostname}.pkgs;
darwinConfigurations = {
"Jaakkos-MacBook-Pro" = nix-darwin.lib.darwinSystem {
inherit system;
inherit specialArgs;
modules = let
hmModules = [ ./home/personal.nix ];
hmOpts = homeManagerOptions hmModules;
in [ ./system/personal.nix home-manager.darwinModules.home-manager hmOpts ];
};
"Wolt-MacBook-Pro" = nix-darwin.lib.darwinSystem {
inherit system;
inherit specialArgs;
modules = let
hmModules = [ ./home/work.nix ];
hmOpts = homeManagerOptions hmModules;
in [ ./system/work.nix home-manager.darwinModules.home-manager hmOpts ];
};
};
};
}