-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
151 lines (142 loc) · 4.88 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
145
146
147
148
149
150
151
{
description = ''
Home and NixOS configuration.
The home configuration can be built (à la 'home-manager build') using
nix build '.#<host>'
and to the configuration can be switched (à la 'home-manager switch') using
nix run '.#<host>'
where '<host>' is the name of the host (e.g. 'thinkpad').
The system configuration can be built using
sudo nixos-rebuild build --flake '.#<host>'
and to the configuration can be switched using
sudo nixos-rebuild switch --flake '.#<host>'.
'';
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/nur";
emacs-overlay.url = "github:nix-community/emacs-overlay";
nixos-hardware.url = "github:nixos/nixos-hardware";
base16-tomorrow-scheme = {
url = "github:chriskempson/base16-tomorrow-scheme";
flake = false;
};
nixpkgs-iosevka.url =
"github:nixos/nixpkgs?rev=838eefb4f93f2306d4614aafb9b2375f315d917f";
kmonad = {
url = "github:kmonad/kmonad?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
"ligature.el" = {
url = "github:mickeynp/ligature.el";
flake = false;
};
lin = {
url = "gitlab:protesilaos/lin";
flake = false;
};
math-delimiters = {
url = "github:oantolin/math-delimiters";
flake = false;
};
mopidy-mpd = {
url = "github:mopidy/mopidy-mpd";
flake = false;
};
xmonad-splintah = {
url = "github:splintah/xmonad-splintah";
inputs.nixpkgs.follows = "nixpkgs";
};
private = {
url = "path:/home/splinter/configuration/private";
flake = false;
};
};
outputs = { self, ... }@inputs:
let
overlays = [
inputs.nur.overlay
inputs.emacs-overlay.overlay
inputs.kmonad.overlays.default
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
};
# Pin Iosevka independently from Nixpkgs, since building the
# modified version requires a lot of resources.
iosevka = (import inputs.nixpkgs-iosevka {
system = "x86_64-linux";
config.allowUnfree = true;
}).iosevka;
xmonad-splintah = inputs.xmonad-splintah.defaultPackage.x86_64-linux;
})
];
in {
homeConfigurations = {
thinkpad = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [{
imports = let
nurNoPkgs = import inputs.nur {
nurpkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
};
in [
./hosts/thinkpad/home.nix
# NOTE: these modules must be imported here to prevent infinite
# recursion. See
# <https://github.com/nix-community/home-manager/issues/1642#issuecomment-739012921>.
nurNoPkgs.repos.rycee.hmModules.theme-base16
nurNoPkgs.repos.splintah.hmModules.onedrive
nurNoPkgs.repos.splintah.hmModules.mpdscribble
"${inputs.private}/configuration/home/mail/accounts.nix"
"${inputs.private}/configuration/home/mopidy.nix"
"${inputs.private}/configuration/home/mpdscribble.nix"
];
nixpkgs = {
config.allowUnfree = true;
inherit overlays;
};
_module.args.inputs = inputs;
}];
};
};
nixosConfigurations = {
thinkpad = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/thinkpad/system.nix
{
nix = {
registry = {
nixpkgs.flake = inputs.nixpkgs;
unstable.flake = inputs.nixpkgs-unstable;
home-manager.flake = inputs.home-manager;
nur.flake = inputs.nur;
emacs-overlay.flake = inputs.emacs-overlay;
nixos-hardware.flake = inputs.nixos-hardware;
};
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
nixpkgs.overlays = overlays;
}
];
specialArgs = { inherit inputs; };
};
};
packages.x86_64-linux =
builtins.mapAttrs (_name: config: config.activationPackage)
self.homeConfigurations;
apps.x86_64-linux = builtins.mapAttrs (name: activationPackage: {
type = "app";
program = "${activationPackage}/activate";
}) self.packages.x86_64-linux;
};
}