-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
39 lines (35 loc) · 1.01 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
{
outputs = { self }: {
nixosModules = {
hmModule = { config, lib, ... }:
with lib;
let cfg = config.programs.zsh.johnnydecimal;
in {
options = {
programs.zsh.johnnydecimal = {
enable = mkEnableOption "zsh-johnnydecimal";
basePath = mkOption {
type = types.path;
default = "~/johnny/";
description = "Path to the root of the J.D structure";
};
};
};
config = mkIf cfg.enable {
programs.zsh.plugins = [{
name = "zsh-johnnydecimal";
file = "johnnydecimal.zsh";
src = ./.;
}];
home.sessionVariables = {
"JOHNNYDECIMAL_BASE" = cfg.basePath;
};
};
};
globalModule = {config, ...}: {
home-manager.sharedModules = [ self.nixosModules.hmModule ];
};
default = self.nixosModules.globalModule;
};
};
}