-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (45 loc) · 1.2 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 = "My journey with Nix";
inputs = {
# Core dependencies.
nixpkgs.url = "nixpkgs/nixos-unstable"; # primary nixpkgs
# nixpkgs-unstable.url =
# "nixpkgs/nixpkgs-unstable"; # for packages on the edge
home-manager.url = "github:rycee/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Secrets manager
agenix.url = "github:ryantm/agenix";
secrets = {
url = "git+ssh://[email protected]/nhamlh/nix-secrets.git";
flake = false;
};
};
outputs =
inputs@{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
hosts = pkgs.lib.mapAttrsToList (n: v: n) (
pkgs.lib.filterAttrs (n: v: v == "directory") (builtins.readDir ./hosts)
);
in
{
nixosConfigurations = pkgs.lib.genAttrs hosts (
h:
nixpkgs.lib.nixosSystem {
inherit system pkgs;
specialArgs = inputs;
modules = [
./modules
(./. + "/hosts/${h}")
];
}
);
devShells = import ./shell.nix { inherit system pkgs; };
};
}