46 current 1970-01-01 01:00:00 23.11.20240229.068d4db 6.1.79 *
This commit is contained in:
		| @@ -21,7 +21,7 @@ | |||||||
|     nixosConfigurations."MaxNixosLaptop" = nixpkgs.lib.nixosSystem { |     nixosConfigurations."MaxNixosLaptop" = nixpkgs.lib.nixosSystem { | ||||||
|       specialArgs = {inherit inputs;}; |       specialArgs = {inherit inputs;}; | ||||||
|       modules = [ |       modules = [ | ||||||
|         ./configuration.nix |         ./hosts/MaxNixosLaptop/configuration.nix | ||||||
|         inputs.home-manager.nixosModules.default |         inputs.home-manager.nixosModules.default | ||||||
|       ]; |       ]; | ||||||
|     }; |     }; | ||||||
|   | |||||||
| @@ -10,7 +10,6 @@ | |||||||
|   imports = [ |   imports = [ | ||||||
|     # Include the results of the hardware scan. |     # Include the results of the hardware scan. | ||||||
|     ./hardware-configuration.nix |     ./hardware-configuration.nix | ||||||
|     ./suspend-and-hibernate.nix |  | ||||||
|     inputs.home-manager.nixosModules.default |     inputs.home-manager.nixosModules.default | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
| @@ -49,18 +48,6 @@ | |||||||
|     LC_TIME = "de_DE.UTF-8"; |     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 |   # Configure console keymap | ||||||
|   console.keyMap = "de"; |   console.keyMap = "de"; | ||||||
| 
 | 
 | ||||||
| @@ -77,7 +64,7 @@ | |||||||
|     alsa.support32Bit = true; |     alsa.support32Bit = true; | ||||||
|     pulse.enable = true; |     pulse.enable = true; | ||||||
|     # If you want to use JACK applications, uncomment this |     # 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, |     # 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) |     # no need to redefine it in your config for now) | ||||||
| @@ -140,6 +127,9 @@ | |||||||
|   programs.zsh.enable = true; |   programs.zsh.enable = true; | ||||||
|   programs.steam.enable = true; |   programs.steam.enable = true; | ||||||
| 
 | 
 | ||||||
|  |   security.polkit.enable = true; | ||||||
|  |   environment.sessionVariables.NIXOS_OZONE_WL = "1"; | ||||||
|  | 
 | ||||||
|   # List services that you want to enable: |   # List services that you want to enable: | ||||||
| 
 | 
 | ||||||
|   # fingerprint unlock |   # fingerprint unlock | ||||||
| @@ -51,6 +51,9 @@ | |||||||
|     betaflight-configurator |     betaflight-configurator | ||||||
|     loudgain |     loudgain | ||||||
|     youtube-dl |     youtube-dl | ||||||
|  |     foot | ||||||
|  |     grimblast | ||||||
|  |     dconf | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|   # Home Manager is pretty good at managing dotfiles. The primary way to manage |   # Home Manager is pretty good at managing dotfiles. The primary way to manage | ||||||
| @@ -87,6 +90,80 @@ | |||||||
|     EDITOR = "nvim"; |     EDITOR = "nvim"; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  |   wayland.windowManager.sway = { | ||||||
|  |     enable = true; | ||||||
|  |     config = rec { | ||||||
|  |       modifier = "Mod4"; | ||||||
|  |       # use foot as default terminal | ||||||
|  |       terminal = "foot"; | ||||||
|  |       assigns = { | ||||||
|  |         "main" = [{class = "^Firefox$";}]; | ||||||
|  |         "term" = [{class = "^foot$";}]; | ||||||
|  |       }; | ||||||
|  |       startup = [ | ||||||
|  |         {command = "keepassxc";} | ||||||
|  |       ]; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   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; | ||||||
|  |       } | ||||||
|  |     ''; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|   programs.zsh = { |   programs.zsh = { | ||||||
|     enable = true; |     enable = true; | ||||||
|     enableAutosuggestions = true; |     enableAutosuggestions = true; | ||||||
| @@ -148,6 +225,46 @@ | |||||||
|     options = ["--cmd cd"]; |     options = ["--cmd cd"]; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  |   # 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; | ||||||
|  | 
 | ||||||
|   services.nextcloud-client.enable = true; |   services.nextcloud-client.enable = true; | ||||||
| 
 | 
 | ||||||
|   services.mpd = { |   services.mpd = { | ||||||
| @@ -7,7 +7,7 @@ set -e | |||||||
| pushd ~/dotfiles/nixos/ | pushd ~/dotfiles/nixos/ | ||||||
|  |  | ||||||
| # Edit your config | # Edit your config | ||||||
| $EDITOR configuration.nix | $EDITOR | ||||||
|  |  | ||||||
| # Autoformat your nix files | # Autoformat your nix files | ||||||
| alejandra . #&>/dev/null | alejandra . #&>/dev/null | ||||||
|   | |||||||
| @@ -1,41 +0,0 @@ | |||||||
| { |  | ||||||
|   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"; |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user