From 7d11aedd933a3619bd8e08243f5f12fb723c9d3e Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sat, 4 Feb 2023 11:12:13 +0100 Subject: [PATCH] Various improvments/brightness --- _ | 80 +++++++++++++++++++ machines/macintosh/default.nix | 23 +++--- machines/macintosh/home-julien.nix | 118 +++++++++++++++-------------- 3 files changed, 153 insertions(+), 68 deletions(-) create mode 100644 _ diff --git a/_ b/_ new file mode 100644 index 0000000..0c618f4 --- /dev/null +++ b/_ @@ -0,0 +1,80 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, lib, inputs, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware.nix + ./home-julien.nix + ../../users/julien.nix + ../../users/default.nix + inputs.nixos-apple-silicon.nixosModules.apple-silicon-support + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = false; + nixpkgs.config.allowUnsupportedSystem = false; + networking.hostName = "macintosh"; # Define your hostname. + # Pick only one of the below networking options. + networking.wireless.enable = false; + + hardware.asahi.addEdgeKernelConfig = true; + hardware.asahi.useExperimentalGPUDriver = true; + + hardware.video.hidpi.enable = true; + + services.tailscale.enable = true; + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + time.timeZone = "Europe/Paris"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + hardware.asahi.peripheralFirmwareDirectory = ./firmware; + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.displayManager.gdm.wayland = true; + services.xserver.layout = "fr"; + + services.xserver.libinput.enable = true; + + hardware.opengl.enable = true; + hardware.opengl.driSupport = true; + + programs.dconf.enable = true; + + programs.sway.enable = true; + + security.polkit.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.julien = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + thunderbird + ]; + }; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; [ + tailscale + ]; + + system.stateVersion = "23.05"; # Did you read the comment? + +} + + diff --git a/machines/macintosh/default.nix b/machines/macintosh/default.nix index 270c05e..a71c504 100644 --- a/machines/macintosh/default.nix +++ b/machines/macintosh/default.nix @@ -41,7 +41,11 @@ }; hardware.asahi.peripheralFirmwareDirectory = ./firmware; - services.xserver.libinput.enable = true; + + services.xserver.libinput = { + enable = true; + naturalScrolling = true; + }; hardware.opengl.enable = true; hardware.opengl.driSupport = true; @@ -49,25 +53,18 @@ programs.dconf.enable = true; - programs.sway.enable = true; + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; security.polkit.enable = true; services.tlp.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.julien = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - firefox - thunderbird - ]; - }; - - # List packages installed in system profile. To search, run: environment.systemPackages = with pkgs; [ tailscale + brightnessctl ]; system.stateVersion = "23.05"; # Did you read the comment? diff --git a/machines/macintosh/home-julien.nix b/machines/macintosh/home-julien.nix index 2a66bfa..7a6626e 100644 --- a/machines/macintosh/home-julien.nix +++ b/machines/macintosh/home-julien.nix @@ -29,64 +29,72 @@ in luj.programs.git.enable = true; luj.programs.gtk.enable = true; - wayland.windowManager.sway.enable = true; - wayland.windowManager.sway.config.terminal = terminal; - wayland.windowManager.sway.config.modifier = modifier; - wayland.windowManager.sway.config.input = { - "*" = { - xkb_layout = "fr"; - xkb_variant = "mac"; + wayland.windowManager.sway = { + enable = true; + config = { + terminal = terminal; + modifier = modifier; + input = { + "*" = { + xkb_layout = "fr"; + xkb_variant = "mac"; + }; + }; + + gaps = { + right = 2; + left = 2; + top = 2; + bottom = 2; + inner = 7; + }; + + keybindings = lib.mkOptionDefault { + "${modifier}+ampersand" = "workspace 1"; + "${modifier}+eacute" = "workspace 2"; + "${modifier}+quotedbl" = "workspace 3"; + "${modifier}+apostrophe" = "workspace 4"; + "${modifier}+parenleft" = "workspace 5"; + "${modifier}+egrave" = "workspace 6"; + "${modifier}+minus" = "workspace 7"; + "${modifier}+underscore" = "workspace 8"; + "${modifier}+ccedilla" = "workspace 9"; + "${modifier}+agrave" = "workspace 10"; + + "${modifier}+Shift+ampersand" = "move container to workspace 1"; + "${modifier}+Shift+eacute" = "move container to workspace 2"; + "${modifier}+Shift+quotedbl" = "move container to workspace 3"; + "${modifier}+Shift+apostrophe" = "move container to workspace 4"; + "${modifier}+Shift+parenleft" = "move container to workspace 5"; + "${modifier}+Shift+egrave" = "move container to workspace 6"; + "${modifier}+Shift+minus" = "move container to workspace 7"; + "${modifier}+Shift+underscore" = "move container to workspace 8"; + "${modifier}+Shift+ccedilla" = "move container to workspace 9"; + "${modifier}+Shift+agrave" = "move container to workspace 10"; + + "${modifier}+h" = "focus left"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+l" = "focus right"; + + "${modifier}+Shift+h" = "move left"; + "${modifier}+Shift+j" = "move down"; + "${modifier}+Shift+k" = "move up"; + "${modifier}+Shift+l" = "move right"; + + + "${modifier}+q" = "kill"; + "${modifier}+space" = "exec rofi -show run"; + "${modifier}+Return" = "exec ${terminal}"; + "${modifier}+f" = "fullscreen toggle"; + + "XF86MonBrightnessUp" = "exec brightnessctl s +10"; + "XF86MonBrightnessDown" = "exec brightnessctl s 10-"; + }; }; }; - wayland.windowManager.sway.config.gaps = { - right = 2; - left = 2; - top = 2; - bottom = 2; - inner = 7; - }; - wayland.windowManager.sway.config.keybindings = lib.mkOptionDefault { - - "${modifier}+ampersand" = "workspace 1"; - "${modifier}+eacute" = "workspace 2"; - "${modifier}+quotedbl" = "workspace 3"; - "${modifier}+apostrophe" = "workspace 4"; - "${modifier}+parenleft" = "workspace 5"; - "${modifier}+egrave" = "workspace 6"; - "${modifier}+minus" = "workspace 7"; - "${modifier}+underscore" = "workspace 8"; - "${modifier}+ccedilla" = "workspace 9"; - "${modifier}+agrave" = "workspace 10"; - - "${modifier}+Shift+ampersand" = "move container to workspace 1"; - "${modifier}+Shift+eacute" = "move container to workspace 2"; - "${modifier}+Shift+quotedbl" = "move container to workspace 3"; - "${modifier}+Shift+apostrophe" = "move container to workspace 4"; - "${modifier}+Shift+parenleft" = "move container to workspace 5"; - "${modifier}+Shift+egrave" = "move container to workspace 6"; - "${modifier}+Shift+minus" = "move container to workspace 7"; - "${modifier}+Shift+underscore" = "move container to workspace 8"; - "${modifier}+Shift+ccedilla" = "move container to workspace 9"; - "${modifier}+Shift+agrave" = "move container to workspace 10"; - - "${modifier}+h" = "focus left"; - "${modifier}+j" = "focus down"; - "${modifier}+k" = "focus up"; - "${modifier}+l" = "focus right"; - - "${modifier}+Shift+h" = "move left"; - "${modifier}+Shift+j" = "move down"; - "${modifier}+Shift+k" = "move up"; - "${modifier}+Shift+l" = "move right"; - - - "${modifier}+q" = "kill"; - "${modifier}+space" = "exec rofi -show run"; - "${modifier}+Return" = "exec ${terminal}"; - "${modifier}+f" = "fullscreen toggle"; - - }; + services.swayidle.enable = true; programs.alacritty = {