-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
67 lines (57 loc) · 1.88 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
wallpapers = {
url = "github:mislavzanic/wallpapers";
flake = false;
};
home-manager = {
url = "github:rycee/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-utils = {
url = "github:mislavzanic/nix-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-config = {
url = "github:mislavzanic/emacs-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-utils.follows = "nix-utils";
inputs.emacs-overlay.follows = "emacs-overlay";
};
};
outputs = inputs @ {
nixpkgs,
nix-utils,
wallpapers,
emacs-config,
home-manager,
...
}: let
inherit (lib.my) mapModulesRec mapModulesRec' mapShell;
inherit (nix-utils) mkPkgs mkLib;
system = "x86_64-linux";
pkgs = mkPkgs {inherit system; pkgs = nixpkgs;};
lib = nixpkgs.lib.extend (mkLib {inherit pkgs inputs;});
utilModules = nix-utils.modules;
mkModuleArr = path: mapModulesRec' path import;
allModules = (mapModulesRec ./modules import);
hmModules = [utilModules.common utilModules.home]
++ (mkModuleArr (toString ./modules/common))
++ (mkModuleArr (toString ./modules/systems/home));
nixosModules = [utilModules.common utilModules.nixos]
++ (mkModuleArr (toString ./modules/common))
++ (mkModuleArr (toString ./modules/systems/nixos));
in {
inherit hmModules nixosModules allModules;
mkHomeCfg = mods: attrs: home-manager.lib.homeManagerConfiguration ({
modules = hmModules ++ mods;
} // attrs);
devShells."${system}" = mapShell ./shells {inherit pkgs lib;};
};
}