Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
153 lines (150 loc) · 4.48 KB
/
Copy pathflake.nix
File metadata and controls
153 lines (150 loc) · 4.48 KB
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
{
description = "A basic flake with a shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
# Add the emacs-lsp-booster input
emacs-lsp-booster = {
url = "github:slotThe/emacs-lsp-booster-flake";
# Ensure it uses the same nixpkgs as the rest of your flake
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
doom-emacs.url = "github:doomemacs/doomemacs/master";
doom-emacs.flake = false;
};
outputs = {
self,
nixpkgs,
flake-utils,
doom-emacs,
home-manager,
emacs-lsp-booster, # Pass the new input to outputs
devshell,
}: let
inherit (home-manager.lib) homeManagerConfiguration;
isDarwin = system: (builtins.elem system nixpkgs.lib.platforms.darwin);
homePrefix = system:
if isDarwin system
then "/Users"
else "/home";
mkOverlays = system: [
emacs-lsp-booster.overlays.default # Add the booster overlay
(final: prev: {doomEmacsRevision = doom-emacs.rev;})
(final: prev: {home-manager = home-manager.packages.${system}.home-manager;})
(import ./nixpkgs/overlays/bins.nix)
];
# Single source of truth for unfree packages: a host opts in by listing
# package names. Empty (the default) keeps a host fully free.
mkUnfreeConfig = unfree: {
allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) unfree;
};
mkHomeConfig = {
username,
system ? "x86_64-linux",
baseModules ? [],
extraModules ? [],
unfree ? [],
}:
homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = mkOverlays system;
config = mkUnfreeConfig unfree;
};
modules =
[
{
home = {
inherit username;
homeDirectory = "${homePrefix system}/${username}";
stateVersion = "22.05";
};
}
]
++ baseModules
++ extraModules
++ (
if isDarwin system
then [./nixpkgs/mac.nix]
else [./nixpkgs/linux.nix]
);
};
in
{
checks = builtins.listToAttrs (
(map
(system: {
name = system;
value = {
linux = self.homeConfigurations.chris-3900x.activationPackage;
};
})
["x86_64-linux"])
++ (map
(system: {
name = system;
value = {
mac = self.homeConfigurations.Yuris-MacBook-Airlocal.activationPackage;
};
})
nixpkgs.lib.platforms.darwin)
);
homeConfigurations = {
chris-3900x = mkHomeConfig {
username = "chris";
baseModules = [
./nixpkgs/emacs.nix
./nixpkgs/profiles/personal.nix
./nixpkgs/modules/dev.nix
./nixpkgs/modules/lang-clojure.nix
./nixpkgs/modules/lang-python.nix
./nixpkgs/modules/lang-js.nix
];
};
FVFG608QQ05Qlocal = mkHomeConfig {
# workm1
system = "aarch64-darwin";
username = "chris.mcdevitt";
unfree = [];
baseModules = [
./nixpkgs/emacs.nix
./nixpkgs/fonts.nix
./nixpkgs/profiles/work.nix
./nixpkgs/modules/dev.nix
./nixpkgs/modules/lang-clojure.nix
./nixpkgs/modules/lang-python.nix
./nixpkgs/modules/lang-js.nix
./nixpkgs/modules/cloud.nix
./nixpkgs/modules/work.nix
];
};
Yuris-MacBook-Airlocal = mkHomeConfig {
system = "aarch64-darwin";
username = "chris";
baseModules = [
# ./nixpkgs/fonts.nix
./nixpkgs/profiles/personal.nix
];
};
};
}
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = mkOverlays system ++ [devshell.overlays.default];
};
in {
# Use devshell's own mkShell function, accessed directly from the input
devShells.default = pkgs.devshell.mkShell {
packages = [pkgs.home-manager]; # Add packages directly here
};
});
}