diff --git a/configuration.nix b/configuration.nix index 76cc397..76d01cd 100644 --- a/configuration.nix +++ b/configuration.nix @@ -42,8 +42,6 @@ # useXkbConfig = true; # use xkb.options in tty. }; - # Enable Wayland and Sway this way, for now (UPDATE: just using home manager lol) - # programs.sway.enable = true; # Enable screensharing xdg.portal = { enable = true; @@ -51,13 +49,27 @@ extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; config.common.default = "*"; }; + + # Set login and power management options + services.logind.lidSwitch = "suspend"; + services.logind.lidSwitchDocked = "ignore"; # when an external monitor is plugged in # Enable graphics. hardware.opengl.enable = true; + # Allow users in group "video" to modify backlight + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="backlight" KERNEL=="amdgpu_bl0", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/amdgpu_bl0/brightness" + + ACTION=="add", SUBSYSTEM=="backlight" KERNEL=="amdgpu_bl0", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/amdgpu_bl0/brightness" + ''; + # Enable CUPS to print documents. services.printing.enable = true; + # Enable udisks (handles storage devices, e.g. usb flash drives) + services.udisks2.enable = true; + # Enable sound. security.rtkit.enable = true; # needed for pipewire hardware.pulseaudio.enable = false; @@ -75,14 +87,14 @@ users.users.alice = { isNormalUser = true; home = "/home/alice"; - extraGroups = [ "wheel" "networkmanager" ]; # Enable 'sudo' for the user. + extraGroups = [ "wheel" "networkmanager" "video" ]; # Enable 'sudo' for the user. initialPassword = "manysuchcases"; }; home-manager.users.alice = import ./home.nix; # Make sure swaylock works (defined in home.nix) security.pam.services.swaylock = { }; - + # Make sure suspend actually happens services.logind.extraConfig = '' InhibitDelayMaxSec=5 diff --git a/home.nix b/home.nix index a969bab..9f8fcd4 100644 --- a/home.nix +++ b/home.nix @@ -4,6 +4,9 @@ home.username = "alice"; home.homeDirectory = "/home/alice"; + # stopgap, should be removed; sets nvim to default editor + home.sessionVariables.EDITOR = "nvim"; + home.stateVersion = "23.11"; home.packages = with pkgs; @@ -11,8 +14,8 @@ [ kitty ] ++ # Terminal emulator [ firefox vifm pavucontrol ] ++ # Basic graphical apps [ signal-desktop prismlauncher ] ++ # Personalized selection of graphical apps - [ bemenu j4-dmenu-desktop ] ++ - [ noto-fonts ]; + [ bemenu j4-dmenu-desktop ] ++ # Sway-related packages + [ noto-fonts overpass ]; # Fonts programs.home-manager.enable = true; @@ -83,6 +86,17 @@ icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; + "NixOS Options" = { + urls = [{ + template = "https://search.nixos.org/options"; + params = [ + { name = "type"; value = "options"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; "NixOS Wiki" = { urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; iconUpdateURL = "https://nixos.wiki/favicon.png"; diff --git a/todo b/todo new file mode 100644 index 0000000..113b84e --- /dev/null +++ b/todo @@ -0,0 +1,4 @@ +enable NUR and firefox extensions +split app configs off into separate files +fix editor issue!!! +switch to zsh diff --git a/wayland/sway.nix b/wayland/sway.nix index 117a8b1..714e7a7 100644 --- a/wayland/sway.nix +++ b/wayland/sway.nix @@ -2,15 +2,20 @@ { enable = true; - config = { + config = rec { terminal = "kitty"; modifier = "Mod4"; fonts = { - names = [ "Noto Sans" ]; + names = [ "Overpass" ]; style = "Regular"; size = 12.0; }; input = { "type:touchpad" = { natural_scroll = "enabled"; }; }; + bars = let config = config; in [{ + position = "top"; + inherit fonts; + statusCommand = "${pkgs.i3status}/bin/i3status"; + }]; window = { border = 2; titlebar = true; diff --git a/wayland/waybar.nix b/wayland/waybar.nix deleted file mode 100644 index d2515eb..0000000 --- a/wayland/waybar.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - enable = true; -}