-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathflake.nix
120 lines (100 loc) · 3.73 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
description = "cmacrae's systems configuration";
nixConfig = {
extra-substituters = [
"https://cmacrae.cachix.org"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"cmacrae.cachix.org-1:5Mp1lhT/6baI3eAqnEvruhLrrXE9CKe27SbnXqjwXfg="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
ez-configs.url = "github:ehllie/ez-configs";
ez-configs.inputs.nixpkgs.follows = "nixpkgs";
ez-configs.inputs.flake-parts.follows = "flake-parts";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
# FIXME: tracking a fork until issues discussed here are addressed
# https://github.com/nix-community/home-manager/issues/3864
home-manager.url = "github:nix-community/home-manager";
home-manager-darwin.url = "github:cmacrae/home-manager/fix/gpg-agent_launchd";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager-darwin.inputs.nixpkgs.follows = "nixpkgs";
# NOTE: currently private, working on releasing soon :)
limani.url = "github:cmacrae/limani";
limani.inputs.nixpkgs.follows = "nixpkgs";
firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
firefox-addons.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
# Emacs
twist.url = "github:emacs-twist/twist.nix";
org-babel.url = "github:emacs-twist/org-babel";
emacs.url = "github:emacs-mirror/emacs";
emacs.flake = false;
melpa.url = "github:melpa/melpa";
melpa.flake = false;
gnu-elpa.url = "github:elpa-mirrors/elpa";
gnu-elpa.flake = false;
nongnu-elpa.url = "github:elpa-mirrors/nongnu";
nongnu-elpa.flake = false;
emacs-overlay.url = "github:nix-community/emacs-overlay";
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.ez-configs.flakeModule ];
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-linux"
];
perSystem = { config, pkgs, system, emacs-env, emacs-early-init, ... }: {
_module.args = {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.emacs-overlay.overlays.emacs
inputs.org-babel.overlays.default
];
};
emacs-env = import ./configurations/emacs {
inherit inputs pkgs;
};
emacs-early-init =
let
org = inputs.org-babel.lib;
in
(pkgs.tangleOrgBabelFile "early-init.el" ./configurations/emacs/README.org {
processLines = org.selectHeadlines (org.tag "early");
});
config.extraSpecialArgs = {
inherit emacs-env emacs-early-init;
};
};
packages = {
inherit emacs-env emacs-early-init;
};
apps = emacs-env.makeApps {
lockDirName = "configurations/emacs/.lock";
};
};
ezConfigs = {
globalArgs = { inherit inputs; };
} // builtins.listToAttrs (map
(name: {
inherit name;
value = {
modulesDirectory = ./. + "/modules/${name}";
configurationsDirectory = ./. + "/configurations/${name}";
};
}) [ "home" "darwin" "nixos" ]);
};
}