Compare commits
No commits in common. "b655dafce9a28a3e087ddb7095b11ebe3fa95356" and "4b519ab7e17554f395a4f236757262bb7de0db14" have entirely different histories.
b655dafce9
...
4b519ab7e1
@ -10,8 +10,7 @@
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
# sway as window manager
|
||||
../../modules/nixos/sway.nix
|
||||
./suspend-and-hibernate.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
@ -50,6 +49,18 @@
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
desktopManager.gnome.enable = true;
|
||||
layout = "de";
|
||||
xkbVariant = "";
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "de";
|
||||
|
||||
@ -66,7 +77,7 @@
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
jack.enable = true;
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
@ -116,10 +127,6 @@
|
||||
ffmpeg
|
||||
];
|
||||
|
||||
fonts.fonts = with pkgs; [
|
||||
nerdfonts
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
@ -127,50 +134,17 @@
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
programs.ssh.startAgent = true;
|
||||
programs.nix-ld.enable = true;
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
glfw
|
||||
wayland-protocols
|
||||
libxkbcommon
|
||||
xorg.libX11
|
||||
xorg.libXinerama
|
||||
xorg.libXcursor
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
xorg.libXext
|
||||
libGL
|
||||
libGLU
|
||||
];
|
||||
programs.nix-ld.libraries = with pkgs; [];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.steam.enable = true;
|
||||
|
||||
security.polkit.enable = true;
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# fingerprint unlock
|
||||
services.fprintd.enable = true;
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = rec {
|
||||
default_session = {
|
||||
command = "${pkgs.sway}/bin/sway";
|
||||
user = "max";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
# services.openssh.enable = true;
|
||||
|
@ -21,7 +21,7 @@
|
||||
nixosConfigurations."MaxNixosLaptop" = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = [
|
||||
./hosts/MaxNixosLaptop/configuration.nix
|
||||
./configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
@ -1,14 +1,8 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# sway as windowmanager
|
||||
../../modules/home-manager/sway.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "max";
|
||||
@ -31,12 +25,14 @@
|
||||
zsh
|
||||
starship
|
||||
zoxide
|
||||
nerdfonts
|
||||
lazygit
|
||||
btop
|
||||
bat
|
||||
eza
|
||||
unzip
|
||||
rustup
|
||||
keepassxc
|
||||
nextcloud-client
|
||||
firefox
|
||||
thunderbird
|
||||
@ -55,8 +51,6 @@
|
||||
betaflight-configurator
|
||||
loudgain
|
||||
youtube-dl
|
||||
dconf
|
||||
distrobox
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
@ -1,211 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
sway
|
||||
waybar # status bar
|
||||
swaylock # screen locking
|
||||
swayidle # automatic screen locking after system idle time
|
||||
kanshi # hotswap displays
|
||||
foot # terminal
|
||||
keepassxc # used for secrets instead of gnome-keyring
|
||||
];
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
xdgAutostart = true;
|
||||
};
|
||||
|
||||
wrapperFeatures = {
|
||||
gtk = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "de";
|
||||
xkb_options = "caps:ctrl_modifier";
|
||||
xkb_numlock = "enable";
|
||||
};
|
||||
"type:touchpad" = {
|
||||
tap = "enable";
|
||||
natural_scroll = "enable";
|
||||
};
|
||||
};
|
||||
modifier = "Mod4";
|
||||
keybindings = let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in
|
||||
lib.mkOptionDefault {
|
||||
# brightness
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
||||
# volume
|
||||
"XF86AudioRaiseVolume" = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +1%'";
|
||||
"XF86AudioLowerVolume" = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -1%'";
|
||||
"XF86AudioMute" = "exec '${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle'";
|
||||
|
||||
# custom pause mode similar to typical system shutdown menus
|
||||
"${modifier}+F12" = "mode pause-break";
|
||||
};
|
||||
# use foot as default terminal
|
||||
terminal = "foot";
|
||||
assigns = {
|
||||
"1" = [{app_id = "firefox";}];
|
||||
"2" = [{app_id = "foot";}];
|
||||
};
|
||||
bars = [];
|
||||
menu = "${pkgs.tofi}/bin/tofi-drun | ${pkgs.findutils}/bin/xargs swaymsg exec --";
|
||||
fonts = {
|
||||
names = ["FiraCode Nerd Font"];
|
||||
size = 11.0;
|
||||
};
|
||||
modes = {
|
||||
pause-break = {
|
||||
e = "exec --no-startup-id swaymsg exit, mode default";
|
||||
s = "exec --no-startup-id ${pkgs.dash}/bin/dash -c '${pkgs.swaylock}/bin/swaylock & systemctl suspend-then-hibernate', mode default";
|
||||
r = "exec --no-startup-id systemctl reboot";
|
||||
End = "exec --no-startup-id systemctl poweroff";
|
||||
Return = "mode default";
|
||||
Escape = "mode default";
|
||||
};
|
||||
};
|
||||
startup = [
|
||||
{command = "${pkgs.keepassxc}/bin/keepassxc";}
|
||||
{command = "${pkgs.waybar}/bin/waybar";}
|
||||
{command = "${pkgs.foot}/bin/foot";}
|
||||
{command = "${pkgs.firefox}/bin/firefox";}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 26;
|
||||
modules-left = ["sway/workspaces" "sway/mode"];
|
||||
modules-right = ["sway/language" "clock" "battery"];
|
||||
|
||||
"sway/language" = {
|
||||
format = "{shortDescription}";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"clock" = {
|
||||
interval = 60;
|
||||
format = "{:%a %d.%m %I:%M}";
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: #292828;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
margin-right: 10px;
|
||||
color: #ffffff;
|
||||
}
|
||||
#workspaces button:hover, #workspaces button:active {
|
||||
background-color: #292828;
|
||||
color: #ffffff;
|
||||
}
|
||||
#workspaces button.focused {
|
||||
background-color: #383737;
|
||||
}
|
||||
|
||||
#language {
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
#battery {
|
||||
margin-left: 7px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
laptop.outputs = [
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
position = "0,0";
|
||||
}
|
||||
];
|
||||
dock_luhbots.outputs = [
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
position = "0,1080";
|
||||
}
|
||||
{
|
||||
criteria = "Dell Inc. DELL U2422HE GRCPH83";
|
||||
position = "0,0";
|
||||
}
|
||||
{
|
||||
criteria = "NEC Corporation E243WMi 7X313185NB";
|
||||
transform = "90";
|
||||
position = "1920,0";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Theming
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
package = pkgs.capitaine-cursors;
|
||||
name = "capitaine-cursors-white";
|
||||
size = 24;
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.whitesur-icon-theme;
|
||||
name = "WhiteSur-dark";
|
||||
};
|
||||
theme = {
|
||||
package = pkgs.whitesur-gtk-theme;
|
||||
name = "WhiteSur-Dark";
|
||||
};
|
||||
gtk3.extraConfig = {
|
||||
gtk-dialogs-use-header = false;
|
||||
gtk-cursor-theme-size = 0;
|
||||
gtk-toolbar-style = "GTK_TOOLBAR_BOTH_HORIZ";
|
||||
gtk-toolbar-icon-style = "GTK_ICON_SIZE_LARGE_TOOLBAR";
|
||||
gtk-button-images = 0;
|
||||
gtk-menu-images = 0;
|
||||
gtk-enable-event-sounds = 0;
|
||||
gtk-enable-input-feedback-sounds = 1;
|
||||
gtk-xft-antialias = 1;
|
||||
gtk-xft-hinting = 1;
|
||||
gtk-xft-hintstyle = "hintslight";
|
||||
gtk-xft-rgba = "none";
|
||||
};
|
||||
};
|
||||
home.pointerCursor = {
|
||||
package = pkgs.capitaine-cursors;
|
||||
name = "capitaine-cursors-white";
|
||||
size = 24;
|
||||
x11.enable = true;
|
||||
x11.defaultCursor = "capitaine-cursors-white";
|
||||
};
|
||||
xsession.enable = true;
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
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; [
|
||||
dbus # make dbus-update-activation-environment available in the path
|
||||
dbus-sway-environment
|
||||
configure-gtk
|
||||
wayland
|
||||
xdg-utils # for opening default programs when clicking links
|
||||
glib # gsettings
|
||||
dracula-theme # gtk theme
|
||||
gnome3.adwaita-icon-theme # default gnome cursors
|
||||
swaylock
|
||||
swayidle
|
||||
grim # screenshot functionality
|
||||
slurp # screenshot functionality
|
||||
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin/stdout
|
||||
mako # notification system developed by swaywm maintainer
|
||||
wdisplays # tool to configure displays
|
||||
];
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
# xdg-desktop-portal works by exposing a series of D-Bus interfaces
|
||||
# known as portals under a well-known name
|
||||
# (org.freedesktop.portal.Desktop) and object path
|
||||
# (/org/freedesktop/portal/desktop).
|
||||
# The portal interfaces include APIs for file access, opening URIs,
|
||||
# printing and others.
|
||||
services.dbus.enable = true;
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
# gtk portal needed to make gtk apps happy
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
# make brightness keys work
|
||||
users.users.max.extraGroups = ["video"];
|
||||
programs.light.enable = true;
|
||||
|
||||
# make swaylock work
|
||||
security.pam.services.swaylock = {};
|
||||
}
|
@ -7,7 +7,7 @@ set -e
|
||||
pushd ~/dotfiles/nixos/
|
||||
|
||||
# Edit your config
|
||||
$EDITOR
|
||||
$EDITOR configuration.nix
|
||||
|
||||
# Autoformat your nix files
|
||||
alejandra . #&>/dev/null
|
||||
|
41
suspend-and-hibernate.nix
Normal file
41
suspend-and-hibernate.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
hibernateEnvironment = {
|
||||
HIBERNATE_SECONDS = "300";
|
||||
HIBERNATE_LOCK = "/var/run/autohibernate.lock";
|
||||
};
|
||||
in {
|
||||
systemd.services."awake-after-suspend-for-a-time" = {
|
||||
description = "Sets up the suspend so that it'll wake for hibernation";
|
||||
wantedBy = ["suspend.target"];
|
||||
before = ["systemd-suspend.service"];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
echo "$curtime $1" >> /tmp/autohibernate.log
|
||||
echo "$curtime" > $HIBERNATE_LOCK
|
||||
${pkgs.utillinux}/bin/rtcwake -m no -s $HIBERNATE_SECONDS
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
systemd.services."hibernate-after-recovery" = {
|
||||
description = "Hibernates after a suspend recovery due to timeout";
|
||||
wantedBy = ["suspend.target"];
|
||||
after = ["systemd-suspend.service"];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
sustime=$(cat $HIBERNATE_LOCK)
|
||||
rm $HIBERNATE_LOCK
|
||||
if [ $(($curtime - $sustime)) -ge $HIBERNATE_SECONDS ] ; then
|
||||
systemctl hibernate
|
||||
else
|
||||
${pkgs.utillinux}/bin/rtcwake -m no -s 1
|
||||
fi
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user