-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
134 lines (110 loc) · 3.45 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
# flake.nix --- the heart of my dotfiles
#
# Author: Henrik Lissner <[email protected]> ++ Jake Chvatal <[email protected]>
# 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/master";
nixpkgs-unstable.url = "nixpkgs/master";
home-manager = {
url = "github:rycee/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/NUR/master";
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
# inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware";
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;
};
# Used for compatible `nix build` comamnds if the system doesn't yet have flakes enabled`
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};
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);
};
pkgs = mkPkgs nixpkgs [
self.overlay
(self: super: { doomEmacsRevision = doom-emacs.rev; })
];
uPkgs = mkPkgs nixpkgs-unstable [];
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";
};
# TODO: I don't use this. Consider retiring!
minimal = {
path = ./templates/minimal;
description = "A grossly incandescent and minimal nixos config";
};
flake = {
path = ./templates/flake;
description = "A simple Nix flake starter project.";
};
};
defaultTemplate = self.templates.flake;
defaultApp."${system}" = {
type = "app";
program = ./bin/hey;
};
};
}