-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
52 lines (44 loc) · 1.39 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
{
description = "NixOS configuration flake";
inputs = # Define dependencies
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable nix packages
home-manager = { # User package management + configs
url = "github:nix-community/home-manager/";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs = {
home-manager.follows = "home-manager";
nixpkgs.follows = "nixpkgs";
};
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, home-manager, agenix, devshell}:
let
user = "castersj";
# utility function that overlays the lib module
mkLib = nixpkgs:
nixpkgs.lib.extend(
final: prev: (import ./lib {inherit (final) lib;}) // home-manager.lib
);
lib = mkLib nixpkgs;
inherit (lib) mapModule;
in
{
nixpkgs.overlays = mapModule ./overlays import ++ [
devshell.overlay
];
nixosConfigurations = (
import ./hosts { # Imports ./hosts/default.nix
inherit lib;
inherit inputs user nixpkgs home-manager agenix;
}
);
};
}