-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
97 lines (82 loc) · 2.53 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
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
{
description = "bromanko's Nix system config";
inputs = {
# Package sets
nixpkgs.url = "github:nixos/nixpkgs/master";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-21.11";
# System management
darwin.url = "github:LnL7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Other sources
emacs-overlay.url = "github:nix-community/emacs-overlay";
homeage = {
# Waiting for https://github.com/jordanisaacs/homeage/pull/43 to land
url = "github:jordanisaacs/homeage/pull/43/head";
inputs.nixpkgs.follows = "nixpkgs";
};
age-plugin-op = {
url = "github:bromanko/age-plugin-op";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
self,
nixpkgs,
nixpkgs-stable,
home-manager,
emacs-overlay,
age-plugin-op,
...
}:
let
inherit (lib.my) mapModules;
supportedSystems = [
"aarch64-darwin"
"x86_64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
pkgs = forAllSystems (
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
config.input-fonts.acceptLicense = true;
overlays = [
self.overlay
emacs-overlay.overlay
] ++ (lib.attrValues self.overlays);
}
);
lib = nixpkgs.lib.extend (
self: super: {
my = import ./lib {
inherit pkgs inputs home-manager;
lib = self;
};
hm = home-manager.lib.hm;
}
);
in
{
# For debugging
passthru = {
inherit pkgs lib;
packages = self.packages;
};
packages = forAllSystems (system: mapModules ./packages (p: pkgs.${system}.callPackage p { }));
overlay = final: prev: {
stable = nixpkgs-stable.legacyPackages.${prev.system};
my = self.packages.${prev.system} // {
age-plugin-op = age-plugin-op.defaultPackage.${prev.system};
};
};
overlays = mapModules ./overlays import;
darwinConfigurations = (lib.my.mapDarwinHosts "aarch64-darwin" ./hosts/aarch64-darwin);
nixosConfigurations = lib.my.mapNixosHosts ./hosts/nixos;
homeManagerConfigurations = lib.my.mapHomeManagerHosts "x86_64-linux" ./hosts/x86_64-linux;
isoConfigurations = lib.my.mapNixosIsos ./hosts/iso;
};
}