-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
84 lines (84 loc) · 2.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
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
home-manager,
emacs-overlay,
flake-utils,
nix-index-database,
}@flakes:
let
overlay = import ./modules/overlay;
flakeSpecialConfig =
{ pkgs, ... }:
{
nixpkgs.overlays = [
overlay
emacs-overlay.overlay
];
nix = {
package = pkgs.nixVersions.stable;
channel.enable = false;
nixPath = [
"nixos-config=${./.}"
"nixpkgs=${nixpkgs}"
];
extraOptions = ''
flake-registry = /etc/nix/registry.json
experimental-features = nix-command flakes
'';
};
_module.args = {
inherit flakes;
};
};
flakeOutputs = flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
ghcWith = pkgs.ghc.withPackages (p: [ p.nvfetcher ]);
in
{
formatter = pkgs.nixfmt-rfc-style;
devShell = pkgs.mkShell {
packages = [
ghcWith
pkgs.nvchecker
];
};
}
);
hmSharedModules = _: {
home-manager.sharedModules = [ nix-index-database.hmModules.nix-index ];
};
nixosOutputs = {
nixosConfigurations.vonfry = nixpkgs.lib.nixosSystem {
modules = [
flakeSpecialConfig
home-manager.nixosModules.home-manager
hmSharedModules
./configuration.nix
];
};
};
in
flakeOutputs // nixosOutputs // { inherit overlay; };
}