-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
167 lines (154 loc) · 4.56 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
description = "Home manager flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
};
# Applying the configuration happens from the .dotfiles directory so the
# relative path is defined accordingly. This has potential of causing issues.
vim-plugins = {
url = "path:/Users/nixypanda/.dotfiles/modules/nvim/plugins";
};
zjstatus = {
url = "github:dj95/zjstatus";
inputs.nixpkgs.follows = "nixpkgs";
};
# MacOS specific inputs
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-firefox-darwin = {
url = "github:bandithedoge/nixpkgs-firefox-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util = {
url = "github:hraban/mac-app-util";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nur,
vim-plugins,
nixpkgs,
home-manager,
zjstatus,
darwin,
nixpkgs-firefox-darwin,
mac-app-util,
}:
let
home-common =
{ lib, ... }:
{
# NOTE: Injecting colorscheme so that it is passed down all the imports
_module.args = {
colorscheme = import ./colorschemes/tokyonight.nix;
};
nixpkgs.config = {
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"zoom"
"unrar"
"codeium"
"terraform"
# browser extensions
"onepassword-password-manager"
"okta-browser-plugin"
];
};
nixpkgs.overlays = [
nur.overlay
vim-plugins.overlay
(final: prev: { zjstatus = zjstatus.packages.${prev.system}.default; })
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.stateVersion = "22.05";
imports = [
./modules/aws
./modules/bat
./modules/cli.nix
./modules/direnv
./modules/firefox
./modules/fonts.nix
./modules/git
./modules/kitty
./modules/nu
./modules/nvim
./modules/programming.nix
./modules/system-management
./modules/zellij
./modules/zsh
];
};
home-macbook = {
# Hack: Firefox does not work on mac so we have to depend on an overlay.
nixpkgs.overlays = [ nixpkgs-firefox-darwin.overlay ];
home.homeDirectory = "/Users/nixypanda";
home.username = "nixypanda";
imports = [ mac-app-util.homeManagerModules.default ];
xdg.configFile."nix/nix.conf".text = ''
experimental-features = nix-command flakes
'';
};
home-linux = {
home.homeDirectory = "/home/sherub";
home.username = "sherub";
imports = [
# Desktop Environment
./modules/linux/desktop-environment.nix
./modules/linux/betterlockscreen
./modules/linux/colorscheme-based-background
./modules/linux/deadd
./modules/linux/eww
./modules/linux/gtk
./modules/linux/picom
./modules/linux/plasma-browser-integration
./modules/linux/rofi
./modules/linux/taffybar
./modules/linux/xidlehook
./modules/linux/xmonad
];
};
in
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./system/nixos/configuration.nix ];
};
homeConfigurations = {
nixos = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
modules = [
home-common
home-linux
];
};
srt-l02-sekhmet = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-darwin";
modules = [
home-common
home-macbook
];
};
};
darwinConfigurations."srt-l02-sekhmet" = darwin.lib.darwinSystem {
pkgs = nixpkgs.legacyPackages."x86_64-darwin";
modules = [
./modules/mac/configuration.nix
./modules/mac/yabai.nix
./modules/mac/skhd.nix
./modules/mac/homebrew.nix
];
};
};
}