-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
193 lines (177 loc) · 4.57 KB
/
configuration.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{
config,
lib,
pkgs,
inputs,
username,
hostname,
scripts,
...
}:
with lib;
with lib.my; {
# NixOS configuration
nix = {
settings = {
auto-optimise-store = true;
substituters = [
"https://cache.thalheim.io"
"https://ezkea.cachix.org"
];
trusted-public-keys = [
"cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="
"ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
];
};
extraOptions = ''
experimental-features = nix-command flakes
!include ${config.sops.templates."nix/access_tokens.conf".path}
'';
package = pkgs.nixVersions.latest;
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
};
nixpkgs.pkgs = pkgs;
# System time
time.timeZone = "Europe/Warsaw";
time.hardwareClockInLocalTime = true;
# System locale
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8";
LC_MEASUREMENT = "pl_PL.UTF-8";
LC_MONETARY = "pl_PL.UTF-8";
LC_NAME = "pl_PL.UTF-8";
LC_NUMERIC = "pl_PL.UTF-8";
LC_PAPER = "pl_PL.UTF-8";
LC_TELEPHONE = "pl_PL.UTF-8";
LC_TIME = "pl_PL.UTF-8";
};
};
console.keyMap = "pl";
services.xserver.xkb.layout = "pl";
# Fonts
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-extra
noto-fonts-color-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji-blob-bin
jetbrains-mono
icomoon-feather
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
];
fontconfig = {
enable = true;
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>JetBrains Mono</family>
<prefer>
<family>JetBrains Mono</family>
<family>icomoon-feather</family>
<family>Symbols Nerd Font Mono</family>
</prefer>
</alias>
</fontconfig>
'';
};
};
# Global packages
environment = {
systemPackages = with pkgs; [neovim git bash];
variables = {
EDITOR = "nvim";
};
shells = with pkgs; [bash];
};
# Linux Kernel settings
boot = {
supportedFilesystems = ["ntfs"];
initrd.availableKernelModules = ["ehci_pci" "ahci" "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
loader.efi.canTouchEfiVariables = true;
tmp.cleanOnBoot = true;
plymouth = {
enable = true;
themePackages = with pkgs; [nixos-blur-plymouth];
theme = "nixos-blur";
};
};
# SOPS
sops = let
base = "nix/access-tokens";
secretNames = utils.recursiveReadSecretNames {inherit config base;};
secrets = utils.readSecrets {inherit config base;};
in {
templates = {
"nix/access_tokens.conf" = {
mode = "0440";
group = config.users.groups.keys.name;
content = ''
access-tokens = ${
lib.concatStringsSep " "
(
builtins.map
(entry: "${entry}=${utils.mkSecretPlaceholder config [base entry]}")
(builtins.attrNames secrets)
)
}
'';
};
};
secrets =
{"users/${username}/password".neededForUsers = true;}
// lib.listToAttrs (builtins.map (v: lib.nameValuePair v {}) secretNames);
};
# User settings
users.users.${username} = {
isNormalUser = true;
hashedPasswordFile = config.sops.secrets."users/${username}/password".path;
description = "Krzysztof Saczuk";
extraGroups = ["wheel" config.users.groups.keys.name];
};
# Home-manager
home-manager = {
extraSpecialArgs = {inherit pkgs lib;};
sharedModules = [
inputs.nix-colors.homeManagerModule
inputs.sops-nix.homeManagerModule
inputs.catppuccin.homeManagerModule
inputs.vscode-server.homeManagerModule
];
useUserPackages = true;
useGlobalPkgs = true;
users.${username}.home = {
inherit username;
stateVersion = "24.05";
homeDirectory = "/home/${username}";
packages = scripts.mkShellExports config;
};
};
# Internal modules
modules = {
dev.git.enable = true;
services.xdg.enable = true;
hardware.grub.enable = true;
shell = {
fish = {
enable = true;
default = true;
};
};
};
# System
system = {
stateVersion = "24.05";
autoUpgrade = {
enable = true;
flake = "github:zakuciael/nixos-dotfiles#${hostname}";
dates = "daily";
};
};
}