Compare commits

..

63 Commits

Author SHA1 Message Date
3b4f67c04f 242 current 1970-01-01 01:00:00 24.05.20240316.c75037b 6.6.22 * 2024-03-18 10:34:42 +01:00
267616cc4e 241 current 1970-01-01 01:00:00 24.05.20240316.c75037b 6.6.22 * 2024-03-18 10:22:56 +01:00
d9bf9363bb 239 current 1970-01-01 01:00:00 24.05.20240314.d691274 6.6.21 * 2024-03-18 10:05:49 +01:00
867fe1d499 237 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 15:42:14 +01:00
971d01eb39 236 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 15:35:54 +01:00
15f0020ccf 235 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 15:31:32 +01:00
44e5d0819f 234 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 14:55:18 +01:00
597391a802 233 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 14:20:08 +01:00
ef30450892 232 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 14:00:06 +01:00
a91af9bae7 231 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 13:35:32 +01:00
0b80531ad0 230 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-15 13:33:25 +01:00
37c3b67dea 229 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-14 10:22:03 +01:00
6d0d71630b 228 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-14 10:07:34 +01:00
9b224b96a5 227 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-14 10:04:36 +01:00
111d3d9777 226 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 * 2024-03-14 09:53:30 +01:00
9e4597fdd3 224 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 23:31:27 +01:00
2bbf3bade0 223 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 23:15:29 +01:00
9def7cb0f6 222 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 23:03:54 +01:00
f7d8f58aaa 221 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:59:03 +01:00
dcfb553990 220 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:44:33 +01:00
b9b3aaa060 219 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:39:10 +01:00
d3871dd3a5 218 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:34:18 +01:00
3b22026126 217 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:18:07 +01:00
86a6ad5767 216 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 22:12:57 +01:00
cd15722fa9 215 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 21:58:53 +01:00
871acbd8e6 214 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 21:51:32 +01:00
ebdc037b07 213 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 21:23:41 +01:00
86bc85392e 212 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 21:21:10 +01:00
44dcc01e7f 211 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 21:16:46 +01:00
684a48804d 210 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 20:45:40 +01:00
68c53b010d 209 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 19:37:23 +01:00
290d4466ad 208 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 18:20:23 +01:00
302922eee6 207 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:33:43 +01:00
58da3a96ae 206 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:32:44 +01:00
b2c59b3419 205 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:31:41 +01:00
62b2834fb2 204 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:30:01 +01:00
75a8652776 203 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:27:15 +01:00
be35a2cdce 202 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:25:48 +01:00
a33e4b8366 201 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:20:00 +01:00
462ab61d81 200 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:15:54 +01:00
3ac19ad849 199 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:14:05 +01:00
6ea0b486b6 198 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:04:12 +01:00
cca87f0771 197 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 11:01:27 +01:00
c2e17a4481 196 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 10:59:13 +01:00
70a6016243 195 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 10:47:09 +01:00
0f8b328b90 194 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 10:23:22 +01:00
c2781c50a7 193 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-13 10:18:35 +01:00
3481bcd675 190 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-12 13:11:14 +01:00
e4b574a7ca 189 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-12 13:01:02 +01:00
acccdbc938 188 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-12 12:54:23 +01:00
63a586642a 187 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 21:56:13 +01:00
8dccfbd32a 186 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 18:54:30 +01:00
ceb04ea2e2 185 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 18:51:22 +01:00
5f75b4ebad 184 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 18:48:35 +01:00
210cbdbfd7 183 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 18:42:45 +01:00
dd5c2e41d2 182 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 18:38:28 +01:00
1883e9c09f 181 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 14:57:19 +01:00
c9c6944844 180 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 14:49:43 +01:00
1fcafb2be7 179 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 14:42:11 +01:00
cd0c000204 178 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 14:37:04 +01:00
a9bfae3d4c 177 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 14:33:12 +01:00
7a26f45b00 176 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 13:52:19 +01:00
098d5bc99d 175 current 1970-01-01 01:00:00 24.05.20240303.b8697e5 6.6.19 * 2024-03-11 12:56:41 +01:00
13 changed files with 347 additions and 138 deletions

View File

@ -30,12 +30,12 @@
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./hosts/MaxNixosLaptop/configuration.nix ./hosts/MaxNixosLaptop/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.default home-manager.nixosModules.default
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
} }
sops-nix.nixosModules.sops
]; ];
}; };
}; };

View File

@ -12,6 +12,8 @@
./hardware-configuration.nix ./hardware-configuration.nix
# script for rebuilding nixos # script for rebuilding nixos
../../modules/nixos/rebuild.nix ../../modules/nixos/rebuild.nix
../../modules/nixos/wifi.nix
../../modules/nixos/sops.nix
# greetd login manager # greetd login manager
../../modules/nixos/greetd.nix ../../modules/nixos/greetd.nix
# sway as window manager # sway as window manager
@ -31,7 +33,7 @@
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking # Enable networking
networking.networkmanager.enable = true; # networking.networkmanager.enable = true;
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -84,6 +86,7 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim
wget wget
fprintd fprintd
home-manager home-manager
@ -123,6 +126,12 @@
# fingerprint unlock # fingerprint unlock
services.fprintd.enable = true; services.fprintd.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
# services.openssh.enable = true; # services.openssh.enable = true;
@ -144,6 +153,14 @@
randomizedDelaySec = "45min"; randomizedDelaySec = "45min";
}; };
nix.gc = {
automatic = true;
dates = "10:00";
randomizedDelaySec = "45min";
options = "--delete-older-than 14d";
};
nix.settings.auto-optimise-store = true;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave

View File

@ -42,7 +42,6 @@
# environment. # environment.
home.packages = with pkgs; [ home.packages = with pkgs; [
unzip unzip
rustup
nextcloud-client nextcloud-client
firefox firefox
thunderbird thunderbird
@ -51,9 +50,6 @@
prismlauncher prismlauncher
steam steam
blender blender
flip-link
bacon
probe-rs
betaflight-configurator betaflight-configurator
loudgain loudgain
youtube-dl youtube-dl
@ -64,6 +60,11 @@
sops sops
pwvucontrol pwvucontrol
qpwgraph qpwgraph
(pkgs.discord.override {
withOpenASAR = true;
withVencord = true;
})
vesktop
]; ];
home.sessionVariables = { home.sessionVariables = {
@ -76,4 +77,10 @@
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
} }

View File

@ -3,7 +3,69 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }: let
schema = "org.gnome.desktop.a11y.applications";
key = "screen-keyboard-enabled";
squeekboard_toggle = pkgs.writeShellScriptBin "squeekboard_toggle" ''
if [ "$(gsettings get ${schema} ${key})" == "true" ]; then
gsettings set ${schema} ${key} false
else
gsettings set ${schema} ${key} true
fi
'';
squeekboard_format = pkgs.writeShellScriptBin "squeekboard_format" ''
if [ "$(gsettings get ${schema} ${key})" == "true" ]; then
echo '{ "text": "󰌌", "tooltip": "enabled", "percentage": 100 }'
else
echo '{ "text": "󰌐", "tooltip": "disabled", "percentage": 0 }'
fi
'';
rotate_lisgd = pkgs.writeShellScriptBin "rotate_lisgd" ''
# PREV_ORIENTATION and ORIENTATION are given by rot8
LISGD_INPUT=/dev/input/by-path/platform-AMDI0010:02-event
# open nwggrid (Meta+D) by swiping up from the bottom edge
LISGD_ACTIONS=("1,DU,B,*,R,${pkgs.ydotool}/bin/ydotool key 125:1 32:1 32:0 125:0")
# close window (Meta+Shift+Q) by swiping down with 3 fingers
LISGD_ACTIONS+=("3,UD,*,L,R,${pkgs.ydotool}/bin/ydotool key 125:1 42:1 16:1 16:0 42:0 125:0")
# move window left (Meta+Shift+H) by swiping left with 2 fingers
LISGD_ACTIONS+=("2,UD,*,*,R,${pkgs.ydotool}/bin/ydotool key 125:1 42:1 35:1 35:0 42:0 125:0")
# move window down (Meta+Shift+J) by swiping down with 2 fingers
LISGD_ACTIONS+=("2,UD,*,*,R,${pkgs.ydotool}/bin/ydotool key 125:1 42:1 36:1 36:0 42:0 125:0")
# move window up (Meta+Shift+K) by swiping up with 2 fingers
LISGD_ACTIONS+=("2,UD,*,*,R,${pkgs.ydotool}/bin/ydotool key 125:1 42:1 37:1 37:0 42:0 125:0")
# move window right (Meta+Shift+L) by swiping right with 2 fingers
LISGD_ACTIONS+=("2,UD,*,*,R,${pkgs.ydotool}/bin/ydotool key 125:1 42:1 38:1 38:0 42:0 125:0")
LISGD_ACTION_OPTIONS=()
for str in "''${LISGD_ACTIONS[@]}"; do
LISGD_ACTION_OPTIONS+=("-g" "$str")
done
${pkgs.killall}/bin/killall lisgd
${pkgs.lisgd}/bin/lisgd -v -d "$LISGD_INPUT" "''${LISGD_ACTION_OPTIONS[@]}" &
'';
# bash script to let dbus know about impotant env variables and
# propagate them to relevent services run at the end of sway config
dbus-sway-environment = pkgs.writeShellScriptBin "dbus-sway-environment" ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
'';
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
configure-gtk = pkgs.writeShellScriptBin "configure-gtk" ''
gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Dracula'
'';
in {
home.packages = with pkgs; [ home.packages = with pkgs; [
waybar # status bar waybar # status bar
swaylock # screen locking swaylock # screen locking
@ -95,7 +157,7 @@
# custom pause mode similar to typical system shutdown menus # custom pause mode similar to typical system shutdown menus
"${modifier}+F12" = "mode pause-break"; "${modifier}+F12" = "mode pause-break";
}; };
menu = "${pkgs.tofi}/bin/tofi-drun | ${pkgs.findutils}/bin/xargs swaymsg exec --"; menu = "${pkgs.nwg-launchers}/bin/nwggrid -client";
# use foot as default terminal # use foot as default terminal
terminal = "foot"; terminal = "foot";
@ -123,11 +185,16 @@
}; };
startup = [ startup = [
{command = "dbus-sway-environment";} {command = "${dbus-sway-environment}/bin/dbus-sway-environment";}
{command = "configure-gtk";} {command = "${configure-gtk}/bin/configure-gtk";}
{command = "${pkgs.squeekboard}/bin/squeekboard";}
{command = "${pkgs.rot8}/bin/rot8 -n 10 -h ${rotate_lisgd}/bin/rotate_lisgd";}
{command = "${rotate_lisgd}/bin/rotate_lisgd";}
{command = "${pkgs.nwg-launchers}/bin/nwggrid-server -fp";}
{command = "${pkgs.keepassxc}/bin/keepassxc";} {command = "${pkgs.keepassxc}/bin/keepassxc";}
{command = "${pkgs.waybar}/bin/waybar";} {command = "${pkgs.waybar}/bin/waybar";}
{command = "${pkgs.foot}/bin/foot -a foot-startup";} {command = "${pkgs.foot}/bin/foot -a foot-startup";}
{command = "${pkgs.networkmanagerapplet}/bin/nm-applet";}
]; ];
defaultWorkspace = "main"; defaultWorkspace = "main";
@ -203,6 +270,11 @@
}; };
window.titlebar = false; window.titlebar = false;
}; };
extraConfig = ''
bindswitch --reload --locked lid:on exec "[ $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jq}/bin/jq '. | length') -gt 1 ] && ${pkgs.sway}/bin/swaymsg output eDP-1 disable"
bindswitch --reload --locked lid:off output eDP-1 enable
'';
}; };
programs.waybar = { programs.waybar = {
@ -214,7 +286,7 @@
height = 26; height = 26;
modules-left = ["sway/workspaces" "sway/mode"]; modules-left = ["sway/workspaces" "sway/mode"];
modules-center = ["sway/window"]; modules-center = ["sway/window"];
modules-right = ["mpd" "tray" "sway/language" "clock" "backlight" "battery" "network"]; modules-right = ["mpd" "tray" "custom/squeekboard" "sway/language" "clock" "backlight" "battery" "network"];
"sway/workspaces" = { "sway/workspaces" = {
disable-scroll = true; disable-scroll = true;
@ -232,7 +304,7 @@
}; };
"mpd" = { "mpd" = {
format = "{stateIcon}{consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {title} ({elapsedTime:%M:%S}/{totalTime:%M%S}) {volume}"; format = "{stateIcon}{consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) {volume}";
format-stopped = "{stateIcon}{randomIcon}{repeatIcon}{singleIcon} Stopped {volume}"; format-stopped = "{stateIcon}{randomIcon}{repeatIcon}{singleIcon} Stopped {volume}";
format-disconnected = ""; format-disconnected = "";
unkown-tag = "N/A"; unkown-tag = "N/A";
@ -264,6 +336,15 @@
spacing = 10; spacing = 10;
}; };
"custom/squeekboard" = {
format = "{}";
exec = "${squeekboard_format}/bin/squeekboard_format";
return-type = "json";
exec-on-event = true;
interval = 2;
on-click = "${squeekboard_toggle}/bin/squeekboard_toggle";
};
"sway/language" = { "sway/language" = {
format = "{shortDescription}"; format = "{shortDescription}";
tooltip = false; tooltip = false;
@ -328,6 +409,30 @@
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
]; ];
}; };
dock_luhbots2 = {
outputs = [
{
criteria = "eDP-1";
position = "1080,1080";
}
{
criteria = "Dell Inc. DELL U2422HE 8YCPH83";
position = "1080,0";
}
{
criteria = "NEC Corporation E243WMi 59118576NB";
transform = "90";
position = "0,0";
}
];
exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
];
};
laptop_hannspree = { laptop_hannspree = {
outputs = [ outputs = [
{ {

View File

@ -40,6 +40,14 @@ window#waybar {
padding-right: 3px; padding-right: 3px;
} }
#custom-squeekboard {
border-width: 1px;
border-style: none none none solid;
border-color: #444444;
padding-left: 10px;
padding-right: 10px;
}
#language { #language {
border-width: 1px; border-width: 1px;
border-style: none none none solid; border-style: none none none solid;

View File

@ -74,4 +74,6 @@
enableZshIntegration = true; enableZshIntegration = true;
options = ["--cmd cd"]; options = ["--cmd cd"];
}; };
home.packages = with pkgs; [neovim];
} }

Binary file not shown.

View File

@ -4,39 +4,24 @@
pkgs, pkgs,
... ...
}: let }: let
swayConfig = pkgs.writeText "greetd-sway-config" '' themeEnv = ''
input * { export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
xkb_layout "de" export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
xkb_options "caps:ctrl_modifier" export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
xkb_numlock "enable"
}
input "type:touchpad" {
tap "enable"
natural_scroll "enable"
}
exec dbus-sway-environment
exec configure-gtk
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
''; '';
in { in {
environment.extraInit = themeEnv;
programs.regreet = { programs.regreet = {
enable = true; enable = true;
settings = { settings = {
background = { background = {
fit = "Containe"; fit = "Contain";
path = "~/Documents/Blender/desktop background Informatiker/render 4K new color.png"; path = "/home/max/Documents/Blender/desktop background Informatiker/render 4K new color.png";
}; };
gtk = { gtk = {
application_prefer_dark_theme = true; application_prefer_dark_theme = true;
cursor_theme_name = "capitaine-cursors-white"; cursor_theme_name = "capitaine-cursors-white";
font_name = "FiraCode Nerd Font"; font_name = "FiraCode Nerd Font 20";
icon_theme_name = "WhiteSur-dark"; icon_theme_name = "WhiteSur-dark";
theme_name = "WhiteSur-Dark"; theme_name = "WhiteSur-Dark";
}; };
@ -53,17 +38,15 @@ in {
extraGroups = []; extraGroups = [];
}; };
services.greetd = { services.greetd.enable = true;
enable = true;
settings = {
initial_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
user = "greeter";
};
};
};
environment.etc."greetd/environments".text = '' environment.etc."greetd/environments".text = ''
sway sway
''; '';
environment.systemPackages = with pkgs; [
whitesur-gtk-theme
whitesur-icon-theme
whitesur-cursors
];
} }

View File

@ -1,12 +1,6 @@
{pkgs, ...}: let {pkgs, ...}: let
# script for rebuilding nixos # script for rebuilding nixos
rebuild = pkgs.writeTextFile { rebuild = pkgs.writeShellScriptBin "rebuild" ''
name = "rebuild";
destination = "/bin/rebuild";
executable = true;
text = ''
#!${pkgs.bash}/bin/bash
# A rebuild script that commits on a successful build # A rebuild script that commits on a successful build
set -e set -e
@ -24,6 +18,8 @@
echo "NixOS Rebuilding..." echo "NixOS Rebuilding..."
# echo using sudo so we get feedback after unlocking
sudo echo "Beginning rebuild"
# Rebuild, output simplified errors, log trackebacks # Rebuild, output simplified errors, log trackebacks
sudo nixos-rebuild switch &>nixos-switch.log || (${pkgs.coreutils}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false) sudo nixos-rebuild switch &>nixos-switch.log || (${pkgs.coreutils}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false)
@ -39,7 +35,6 @@
# Notify all OK! # Notify all OK!
${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available ${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
''; '';
};
in { in {
environment.systemPackages = [rebuild]; environment.systemPackages = [rebuild];
} }

34
modules/nixos/sops.nix Normal file
View File

@ -0,0 +1,34 @@
{sops, ...}: {
sops = {
age.keyFile = /home/max/.config/sops/age/keys.txt;
secrets = {
"home/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"home/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/ident" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid5" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
};
};
}

View File

@ -3,39 +3,9 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }: {
# bash script to let dbus know about impotant env variables and
# propagate them to relevent services run at the end of sway config
dbus-sway-environment = pkgs.writeTextFile {
name = "dubs-sway-environment";
destination = "/bin/dbus-sway-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
'';
};
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in ''
gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Dracula'
'';
};
in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
dbus # make dbus-update-activation-environment available in the path dbus # make dbus-update-activation-environment available in the path
dbus-sway-environment
configure-gtk
wayland wayland
xdg-utils # for opening default programs when clicking links xdg-utils # for opening default programs when clicking links
glib # gsettings glib # gsettings
@ -88,4 +58,6 @@ in {
# make swaylock work # make swaylock work
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
users.extraUsers.max.extraGroups = ["input"];
} }

View File

@ -1,32 +1,106 @@
{config, ...}: { {
sops.secrets."wireless.env" = {}; config,
networking.wireless = { pkgs,
enable = true; ...
userControlled.enable = true; }: {
environmentFile = config.sops.secrets."wireless.env".path; sops.templates = let
networks = { placeholder = config.sops.placeholder;
"@home_uuid@" = { in {
psk = "@home_psk@"; "home.nmconnection".content = ''
priority = 10; [connection]
}; id=${placeholder."home/ssid"}
"@par_uuid@" = { type=wifi
psk = "@par_psk@"; autoconnect-priority=10
priority = 10;
}; [wifi]
"@luhbots_uuid@" = { mode=infrastructure
psk = "@luhbots_psk@"; ssid=${placeholder."home/ssid"}
priority = 5;
}; [wifi-security]
eduroam = { key-mgmt=wpa-psk
auth = '' psk=${placeholder."home/psk"}
key_mgmt=WPA-EAP '';
eap=PWD "parents.nmconnection".content = ''
identity="@eduroam_ident@" [connection]
password="@eduroam_psk@" id=${placeholder."parents/ssid"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."parents/ssid"}
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."parents/psk"}
'';
"eduroam.nmconnection".content = ''
[connection]
id=eduroam
type=wifi
autoconnect-priority=0
[wifi]
mode=infrastructure
ssid=eduroam
[wifi-security]
auth-alg=open
key-mgmt=wpa-eap
[802-1x]
anonymous-identity=anonymous@uni-hannover.de
ca-cert=${./T-TeleSec_GlobalRoot_Class_2.crt}
domain-suffix-match=radius-dfn.luis.uni-hannover.de
eap=ttls;
identity=${placeholder."eduroam/ident"}
password=${placeholder."eduroam/psk"}
phase2-auth=mschapv2
'';
"luhbots.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid"}
type=wifi
autoconnect-priority=5
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
'';
"luhbots5.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid5"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid5"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
''; '';
priority = 0;
}; };
environment.etc = let
template = config.sops.templates;
base = "NetworkManager/system-connections";
in {
"${base}/home.nmconnection".source = template."home.nmconnection".path;
"${base}/parents.nmconnection".source = template."parents.nmconnection".path;
"${base}/eduroam.nmconnection".source = template."eduroam.nmconnection".path;
"${base}/luhbots.nmconnection".source = template."luhbots.nmconnection".path;
"${base}/luhbots5.nmconnection".source = template."luhbots5.nmconnection".path;
}; };
}; networking.networkmanager.enable = true;
users.extraUsers.max.extraGroups = ["wheel"];
environment.systemPackages = with pkgs; [
nm-tray
];
} }

View File

@ -1,4 +1,16 @@
wireless.env: ENC[AES256_GCM,data:JSJjKuLsEz7niHs1tOJP0a11Hn2rWw8b671v6Fmq/8Gx+z4Pbz4ndwnsuJOK1fWN0LILCUmKr0pKOIoF+iDWPHJLN0j7iRGQui1AMC10a6uOhCqe0ILPdcGLqIbbo3jEn3/64L4qCVkC7nfHWoOH5v9ccTpPSi90tfLFc/SCqUpeoF0o26v+edxqyEkN+eI01S4vBy7TWijL30BYOiCAI3Q8PDQ7YKwHQukRyApLI2F1DYl0YW/BXOwqvuAvcejXYsM2/Abl0zLnRClTj7War0PS7svVGIzE,iv:ZTI9d/usa4oEWWJ3n3VBmeX3uMuJbuHBxL7ds/dkxZM=,tag:h0c0jvddS0RA2NkQBl3/AQ==,type:str] home:
ssid: ENC[AES256_GCM,data:i76d33GIysjSY2k=,iv:34g02nNL5xYXx0PpN49u4xVHzfraTMtAqC4w4oxLBao=,tag:Y3g8kzhPF5LJuaxFq7jd3w==,type:str]
psk: ENC[AES256_GCM,data:bb25mbWgCBvwEvKr4sRRXg==,iv:+oNkqdk0bEP1l1e+HpSveRrxJI8OfQtBVcQ5476kMLU=,tag:vdWSVd5pIRGab+lzP4oFHg==,type:str]
parents:
ssid: ENC[AES256_GCM,data:NZEKQ2N1sC0=,iv:vvsnsH3lYbtXwSnQuInhceiE19Z+ZNszB20TL9BF40g=,tag:5YOljSW9Hht+MCNKhss/Sw==,type:str]
psk: ENC[AES256_GCM,data:gjpdj21uLDiY,iv:k1RH2ybRkJccEqjkdv1Tz+qLS2EdGWdn+jRkUcTDLtY=,tag:IuwgoHt//GvyWVvDI2C/2g==,type:str]
luhbots:
ssid5: ENC[AES256_GCM,data:Bo0aJge7ZkrUhhA=,iv:1EmjRy1xK73xwhE+orUi2HLM9fM2zKxpxDHQnQgEdP0=,tag:P6PSTd34VByQEAhVGbXdNg==,type:str]
ssid: ENC[AES256_GCM,data:MH0T/q45UCZL7w==,iv:SFwjqsojxvsu4k83mi69CypaAdzVhFXbebi9/wTsgaY=,tag:JxY5ftwiZp6jGM4ZxvpO/g==,type:str]
psk: ENC[AES256_GCM,data:Fg8aRzPc6F0=,iv:5Se6YLTRRAP0Gc4WKPQ4vQHlZcG5mqLLqVLzeEaW/sI=,tag:1Ppw5ZyDSCb0atF8/tnSxg==,type:str]
eduroam:
ident: ENC[AES256_GCM,data:PXY5jOJ36+ko+a0PmtxViPHv5GvBwfBD32A=,iv:i6uFlawX0nQ7T25MF2OgwgeW43jaB2Y8pNYx9NMAVTc=,tag:veYmEFGz30AbYuHuQdA01w==,type:str]
psk: ENC[AES256_GCM,data:AcC96tlKw9mKKdR3nW+5FA==,iv:c6Oly2tmIpLjzTZ1iMl6e9bxAz9r7l5zKpwf3UVBpJg=,tag:yZnNpf2d40eZ6L9OgOzYHQ==,type:str]
sops: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -14,8 +26,8 @@ sops:
d0FZc0x5UVhPQ09xUE5Qa1A0QkExVmcKkcy1i+nME0uHlLy8vCu8vgqSuR+0NqaD d0FZc0x5UVhPQ09xUE5Qa1A0QkExVmcKkcy1i+nME0uHlLy8vCu8vgqSuR+0NqaD
D+zKRKNdfJn1TLsoyDb4iDSeqp8nB9fZzQqIJshGRhlnqxuzIiYqqA== D+zKRKNdfJn1TLsoyDb4iDSeqp8nB9fZzQqIJshGRhlnqxuzIiYqqA==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-03-08T22:34:29Z" lastmodified: "2024-03-15T13:39:03Z"
mac: ENC[AES256_GCM,data:MPUKmmbm8aB0BV3yWTeEIAfDudRGo4GSW6LVNBMCVUp/GXNYw45C/w09/u2d6o1oBSIBOZP03mR18sSNpaz7t98iw+F5bArMqefP+nULdhz3D58Zqm8lcaSMVjqCOc8q1O2o/bbhiE3qXZoC2It85Xym1BiVO5fdbwFZVRPa3aY=,iv:Z7Cg8qQg1e3gMHITgU4TfQbBIEx8/9lyhiQVNuQ+/yA=,tag:n/1uaNgHmw7MheLz/+41nA==,type:str] mac: ENC[AES256_GCM,data:fY0F6U2Vro76AunBcwA4RtCdH6ovtjWFmI5aaqePcLgWuyPFAcDESAtLFNL/83KARRIwHeO2a+Q2gkVHkI3TROyCoPx/LGpIFGWpm5OpSImtT5LPrvFsG0I8cSiXZ7sIIjGaBMNfRNN1YqnYGCwqA2zXyE3mbtpJoVqd0/hVpx8=,iv:T7SrzmPrb3zVT+xkGPaiGj7uL8y3arlfyEbnXmqZYkY=,tag:k228lcSejQGFQAvd7/6Bkg==,type:str]
pgp: [] pgp: []
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.8.1 version: 3.8.1