-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
144 lines (118 loc) · 3.55 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# flake.nix --- the heart of my dotfiles #
# Author: Henrik Lissner <henrik@lissner.net> ++ Jake Chvatal <jakechvatal@gmail.com>
# URL: https://github.com/jakeisnt/nixcfg
# License: MIT
{
description = "jakeisnt's nix configuration";
inputs = {
# Two inputs so I can track them separately at different rates.
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR/master";
# inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = {
url = "github:nixos/nixos-hardware";
# inputs.nixpkgs.follows = "nixpkgs";
};
simple-nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix = {
url = "github:jakeisnt/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-remarkable = {
url = "github:siraben/nix-remarkable";
inputs.nixpkgs.follows = "nixpkgs";
};
# Pin Doom Emacs version
doom-emacs = {
url = "github:doomemacs/doomemacs/master";
flake = false;
# inputs.nixpkgs.follows = "nixpkgs";
};
# Used for compatible `nix build` commands if the system doesn't yet have flakes enabled`
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
# inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, spicetify-nix, doom-emacs, ... }:
let
inherit (lib) attrValues;
inherit (lib.my) mapModules mapModulesRec mapHosts;
system = "x86_64-linux";
mkPkgs = pkgs: extraOverlays:
import pkgs {
inherit system;
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
overlays = extraOverlays ++ (attrValues self.overlays);
};
uPkgs = mkPkgs nixpkgs-unstable [
self.overlay
(self: super: { doomEmacsRevision = doom-emacs.rev; })
];
pkgs = mkPkgs nixpkgs [
self.overlay
(self: super: {
doomEmacsRevision = doom-emacs.rev;
unstable = uPkgs;
})
];
lib = nixpkgs.lib.extend (
self: super: {
my =
import ./lib {
inherit pkgs inputs;
lib = self;
};
}
);
in
{
overlay = final: prev: {
unstable = uPkgs;
my = self.packages."${system}";
extras = { inherit spicetify-nix; };
};
overlays = mapModules ./overlays import;
packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
nixosModules = {
dotfiles = import ./.;
} // mapModulesRec ./modules import;
nixosConfigurations = mapHosts ./hosts { inherit system; };
devShell."${system}" = pkgs.mkShell {
name = "nixos-config";
};
templates = {
full = {
path = ./.;
description = "A grossly incandescent nixos config";
};
flake = {
path = ./templates/flake;
description = "A simple Nix flake starter project.";
};
};
defaultTemplate = self.templates.flake;
defaultApp."${system}" = {
type = "app";
program = ./bin/hey;
};
};
}