-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
126 lines (100 loc) · 3.11 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
{
description = "My NixOS config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/master"; # for packages on the edge
flake-utils.url = "github:numtide/flake-utils";
git-ignore-nix.url = "github:hercules-ci/gitignore.nix/master";
xmonad = {
url = "github:xmonad/xmonad";
inputs.nixpkgs.follows = "nixpkgs";
};
xmonad-contrib = {
url = "github:xmonad/xmonad-contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
xmobar = {
url = "git+https://codeberg.org/xmobar/xmobar";
inputs.nixpkgs.follows = "nixpkgs";
inputs.git-ignore-nix.follows = "git-ignore-nix";
};
home-manager = {
url = "github:rycee/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-utils = {
url = "github:mislavzanic/nix-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-config = {
url = "github:mislavzanic/emacs-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-utils.follows = "nix-utils";
inputs.emacs-overlay.follows = "emacs-overlay";
};
xmonad-config = {
url = "github:mislavzanic/xmonad-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
wallpapers = {
url = "github:mislavzanic/wallpapers";
flake = false;
};
nix-modules = {
url = "github:mislavzanic/nix-modules";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-utils.follows = "nix-utils";
inputs.home-manager.follows = "home-manager";
inputs.emacs-overlay.follows = "emacs-overlay";
inputs.emacs-config.follows = "emacs-config";
inputs.xmonad-config.follows = "xmonad-config";
inputs.wallpapers.follows = "wallpapers";
};
nix-direnv.url = "github:nix-community/nix-direnv";
};
outputs = inputs @ {
self,
nixpkgs,
nixpkgs-unstable,
nix-direnv,
nix-utils,
nix-modules,
...
}: let
inherit (lib.my) mapModules mapModulesRec mapHosts mapShell;
inherit (nix-utils) mkPkgs;
system = "x86_64-linux";
pkgs = mkPkgs {
inherit system;
pkgs = nixpkgs;
overlays = [self.overlay] ++ nix-modules.overlays;
};
pkgs' = mkPkgs {
inherit system;
pkgs = nixpkgs-unstable;
overlays = (lib.attrValues self.overlays);
};
lib = nixpkgs.lib.extend (nix-utils.mkLib {inherit pkgs inputs;});
in {
lib = lib.my;
overlay = final: prev: {
unstable = pkgs';
my = self.packages."${system}";
};
packages."${system}" = mapModulesRec ./packages (p: pkgs.callPackage p {});
nixosModules = ({dotfiles = import ./.;} // mapModulesRec ./modules import);
nixosConfigurations = mapHosts ./hosts { defaults = ./.; };
devShell."${system}" =
import ./shell.nix {inherit pkgs;};
formatter."${system}" = pkgs.alejandra;
};
}