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
|
# A base configuration for my workstations.
{ config, pkgs, lib, homeRepo, binify, philip, ... }:
{
imports = [
./base.nix
];
config = {
time.timeZone = "Europe/Berlin";
profpatsch.services.profpatsch.hardware.externalMonitorControl.enable = true;
networking = {
# it will be ready when it's ready,,
enableIPv6 = false;
# better for untrusted networks
firewall = {
enable = true;
# for manual/temporary stuff
allowedTCPPortRanges =
[
{ from = 5037; to = 5037; }
# test.profpatsch.de forwarding
{ from = 9999; to = 9999; }
];
allowedUDPPortRanges =
[
{ from = 5037; to = 5037; }
];
};
};
profpatsch.services.upower = {
enable = true;
settings = {
UPower = {
UsePercentageForPolicy = true;
CriticalPowerAction = "Suspend";
PercentageLow = 15;
PercentageCritical = 8;
PercentageAction = 5;
};
};
};
services.fwupd.enable = true;
###################
# Graphical System
profpatsch.user.profpatsch.xserver.windowManager.xmonad = {
enable = true;
package = homeRepo.my-xmonad;
updateSessionEnvironment = true;
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
configPackages = [
pkgs.xdg-desktop-portal-gtk
];
config.common = {
default = [
"gtk"
];
};
};
# TODO: libinput?
services.libinput.enable = false;
services.xserver = {
enable = true;
# otherwise xterm is enabled, creating an xterm that spawns the window manager.
desktopManager.xterm.enable = false;
xkb.layout = "de";
xkb.variant = "neo";
xkb.options = "altwin:swap_alt_win";
serverFlagsSection = ''
Option "StandbyTime" "10"
Option "SuspendTime" "20"
Option "OffTime" "30"
'';
displayManager = {
sessionCommands = ''
#TODO add as nixpkg
export PATH+=":$HOME/scripts" #add utility scripts
export PATH+=":$HOME/bin" #add user-specific binaries (filled by nix-home)
export EDITOR=micro
export TERMINAL=alacritty
${pkgs.xorg.xset}/bin/xset r rate 250 35
set-background &
# TODO xbindkeys user service file
${lib.getBin pkgs.xbindkeys}/bin/xbindkeys
# synchronize clipboards
${lib.getBin pkgs.autocutsel}/bin/autocutsel -s PRIMARY &
'';
};
synaptics = {
enable = true;
minSpeed = "0.6";
maxSpeed = "1.5";
accelFactor = "0.015";
twoFingerScroll = true;
vertEdgeScroll = false;
};
};
services.gnome.gnome-settings-daemon.enable = true;
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Source Code Pro" "DejaVu Sans Mono" ]; # TODO does not work
sansSerif = [ "Liberation Sans" ];
};
};
programs.ssh.startAgent = false;
###########
# Packages
environment.sessionVariables = {
EDITOR = "micro";
# TODO: required? old msg: This is important so that the xdg-desktop-portal-gtk will use the gtk.portal config arghhh
XDG_CURRENT_DESKTOP = "gnome";
};
environment.systemPackages = with pkgs; [
# of utmost necessity for me to function
smartmontools # check disk state
stow # dotfile management
wirelesstools # iwlist (wifi scan)
gitFull # git with send-email
# minimal set of gui applications
dmenu # minimal launcher
homeRepo.xdg-open.xdg-open # override the crap freedesktop xdg-open
];
# friendly user shell
programs.fish.enable = true;
profpatsch.programs.fish.fasd.enable = true;
########
# Users
users.users = { inherit philip; };
};
}
|