❄️ My personnal NixOS configuration
nix-flake nixos-configuration linux dotfiles flake nix nix-config nixos nixos-flake linux-desktop

「✨」 feat: added proper autostart and few thing

+194 -153
+1
.envrc
··· 1 + use flake
+7 -1
flake.nix
··· 35 35 nixosConfigurations = { 36 36 DEV-BOYY = nixpkgs.lib.nixosSystem { 37 37 system = "x86_64-linux"; 38 - specialArgs = { inherit inputs outputs; }; 38 + specialArgs = { inherit inputs outputs self; }; 39 39 modules = [ 40 40 ./hosts/DEV-BOYY/default.nix 41 41 ··· 99 99 nixfmt-rfc-style 100 100 ]; 101 101 }; 102 + } 103 + ); 104 + packages = forEachSupportedSystem ( 105 + { pkgs }: 106 + { 107 + adjust-brightness = import ./pkgs/adjust-brightness { inherit pkgs; }; 102 108 } 103 109 ); 104 110 };
+31 -5
home/adjoly/home-desktop.nix
··· 1 - { inputs, pkgs, ... }: 1 + { 2 + inputs, 3 + pkgs, 4 + self, 5 + ... 6 + }: 2 7 { 3 8 imports = [ 4 - ../../pkgs/adjust-brightness 5 9 ../../modules/home-manager 6 10 7 11 ./cli-app.nix ··· 19 23 ./programs/direnv.nix 20 24 ./programs/fastfetch.nix 21 25 ./programs/shell/zsh.nix 22 - 23 - inputs.catppuccin.homeModules.catppuccin 24 26 ]; 25 27 26 28 gui.enable = true; ··· 37 39 hyprpaper # should be in the hyprland category 38 40 strawberry # for itunes lib and need to test if upload to ipod works 39 41 libreoffice 42 + nextcloud-client 40 43 bitwarden-desktop # nessacary for my ssh keys (can't use git otherwise) 41 - nextcloud-talk-desktop 44 + self.packages.${pkgs.system}.adjust-brightness # for adjusting brightness on ddc/ci screen 42 45 ]; 43 46 stateVersion = "24.05"; 44 47 }; ··· 71 74 ]; 72 75 }; 73 76 77 + wayland.windowManager.hyprland = { 78 + settings = { 79 + windowrule = [ 80 + "workspace 1, class:kitty" 81 + "workspace 2, class:zen-beta" 82 + "workspace 3, class:obsidian" 83 + "workspace 5, class:Bitwarden" 84 + "workspace 8, class:Slack" 85 + "workspace 9, class:discord" 86 + "workspace 10, class:Beeper" 87 + ]; 88 + exec-once = [ 89 + "kitty" 90 + "zen-beta" 91 + "/home/adjoly/AppImages/beeper.appimage" 92 + "discord" 93 + "bitwarden" 94 + "localsend_app --hidden" 95 + "solaar -w hide --restart-on-wake-up" 96 + ]; 97 + 98 + }; 99 + }; 74 100 }
+114 -106
home/adjoly/wm/hyprland.nix
··· 1 - { config, pkgs, ... }: 1 + { 2 + config, 3 + pkgs, 4 + lib, 5 + ... 6 + }: 2 7 3 8 { 4 - imports = [ 5 - ./tofi.nix 6 - ./dunst.nix 7 - ./waybar.nix 8 - #./swaylock.nix 9 - ./hyprlock.nix 10 - ./hyprpaper.nix 11 - ./wl-sunset.nix 12 - ]; 13 - wayland.windowManager.hyprland = { 14 - enable = true; 15 - xwayland.enable = true; 16 - settings = { 17 - general = { 18 - border_size = "0"; 19 - gaps_in = "4"; 20 - gaps_out = "8,8,8,8"; 21 - "col.active_border" = "rgba(ffbabbf1)"; 22 - "col.inactive_border" = "rgba(ff303446)"; 23 - }; 24 - decoration = { 25 - rounding = 8; 26 - }; 27 - gestures.workspace_swipe = "on"; 28 - exec-once = [ 29 - "hyprpaper" 30 - "waybar" 31 - ]; 32 - "$mod" = "ALT"; 33 - "$win" = "SUPER"; 34 - bind = [ 35 - "$mod, P, exec, tofi-drun --drun=true" 36 - "$mod, space, exec, tofi-drun --drun=true" 37 - "CONTROLALT, delete, exec, hyprctl dispatch exit" 38 - "$mod, return, exec, kitty" 39 - "$mod, Q, killactive" 40 - "$win, L, exec, hyprlock" 41 - "$win + SHIFT, S, exec, grimblast --notify copysave area \"$HOME/Nextcloud/Images/Captures d’écran/Capture d’écran $(date +%F-%H%M%S).png\"" 42 - "CTRL_SHIFT, K, sendshortcut, CTRL, K, ^(Beeper)$" 43 - "CTRL ALT, HOME, exec, adjust-brightness 1 +10" 44 - "CTRL ALT, END, exec, adjust-brightness 1 -10" 45 - "CTRL ALT, Next, exec, adjust-brightness 2 -10" 46 - "CTRL ALT, Prior, exec, adjust-brightness 2 +10" 47 - ] 48 - ++ ( 49 - builtins.concatLists (builtins.genList ( 50 - x: let 51 - ws = let 52 - c = (x + 1) / 10; 53 - in 54 - builtins.toString (x + 1 - (c * 10)); 55 - in [ 56 - "$mod, ${ws}, workspace, ${toString (x + 1)}" 57 - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" 58 - ] 59 - ) 60 - 10) 61 - ); 62 - env = [ 63 - "XCURSOR_SIZE,30" 64 - "XDG_CURRENT_DESKTOP,Hyprland" 65 - ]; 66 - cursor = { 67 - no_hardware_cursors = true; 68 - }; 69 - bindl = [ 70 - # media controls 71 - ", XF86AudioPlay, exec, playerctl play-pause" 72 - ", XF86AudioPause, exec, playerctl pause" 73 - ", XF86AudioPrev, exec, playerctl previous" 74 - ", XF86AudioNext, exec, playerctl next" 9 + imports = [ 10 + ./tofi.nix 11 + ./dunst.nix 12 + ./waybar.nix 13 + #./swaylock.nix 14 + ./hyprlock.nix 15 + ./hyprpaper.nix 16 + ./wl-sunset.nix 17 + ]; 18 + wayland.windowManager.hyprland = { 19 + enable = true; 20 + xwayland.enable = true; 21 + settings = { 22 + general = { 23 + border_size = "0"; 24 + gaps_in = "4"; 25 + gaps_out = "8,8,8,8"; 26 + "col.active_border" = "rgba(ffbabbf1)"; 27 + "col.inactive_border" = "rgba(ff303446)"; 28 + }; 29 + decoration = { 30 + rounding = 8; 31 + }; 32 + gestures.workspace_swipe = "on"; 33 + exec-once = lib.mkBefore [ 34 + "hyprpaper" 35 + "waybar" 36 + ]; 37 + "$mod" = "ALT"; 38 + "$win" = "SUPER"; 39 + bind = 40 + [ 41 + "$mod, P, exec, tofi-drun --drun=true" 42 + "$mod, space, exec, tofi-drun --drun=true" 43 + "CONTROLALT, delete, exec, hyprctl dispatch exit" 44 + "$mod, return, exec, kitty" 45 + "$mod, Q, killactive" 46 + "$win, L, exec, hyprlock" 47 + "$win + SHIFT, S, exec, grimblast --notify copysave area \"$HOME/Nextcloud/Images/Captures d’écran/Capture d’écran $(date +%F-%H%M%S).png\"" 48 + "CTRL_SHIFT, K, sendshortcut, CTRL, K, ^(Beeper)$" 49 + "CTRL ALT, HOME, exec, adjust-brightness 1 +10" 50 + "CTRL ALT, END, exec, adjust-brightness 1 -10" 51 + "CTRL ALT, Next, exec, adjust-brightness 2 -10" 52 + "CTRL ALT, Prior, exec, adjust-brightness 2 +10" 53 + ] 54 + ++ (builtins.concatLists ( 55 + builtins.genList ( 56 + x: 57 + let 58 + ws = 59 + let 60 + c = (x + 1) / 10; 61 + in 62 + builtins.toString (x + 1 - (c * 10)); 63 + in 64 + [ 65 + "$mod, ${ws}, workspace, ${toString (x + 1)}" 66 + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" 67 + ] 68 + ) 10 69 + )); 70 + env = [ 71 + "XCURSOR_SIZE,30" 72 + "XDG_CURRENT_DESKTOP,Hyprland" 73 + ]; 74 + cursor = { 75 + no_hardware_cursors = true; 76 + }; 77 + bindl = [ 78 + # media controls 79 + ", XF86AudioPlay, exec, playerctl play-pause" 80 + ", XF86AudioPause, exec, playerctl pause" 81 + ", XF86AudioPrev, exec, playerctl previous" 82 + ", XF86AudioNext, exec, playerctl next" 75 83 76 - # volume 77 - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" 78 - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" 79 - ]; 84 + # volume 85 + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" 86 + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" 87 + ]; 80 88 81 - bindle = [ 82 - # volume 83 - ", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%+" 84 - ", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%-" 89 + bindle = [ 90 + # volume 91 + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%+" 92 + ", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 5%-" 85 93 86 - # backlight 87 - ", XF86MonBrightnessUp, exec, brightnessctl s 5%+" 88 - ", XF86MonBrightnessDown, exec, brightnessctl s 5%-" 89 - ]; 90 - misc = { 91 - focus_on_activate = true; 92 - }; 93 - animation = [ 94 - "global, 1, 0.8, default" 95 - ]; 96 - input = { 97 - kb_layout = "us"; 98 - kb_variant = "intl"; 99 - follow_mouse = "1"; 100 - scroll_factor = "0.7"; 101 - force_no_accel = true; 102 - touchpad = { 103 - natural_scroll = "yes"; 104 - tap-and-drag = true; 105 - scroll_factor = "0.5"; 106 - }; 107 - sensitivity = "0.6"; 108 - accel_profile = "flat"; 109 - }; 110 - }; 111 - }; 94 + # backlight 95 + ", XF86MonBrightnessUp, exec, brightnessctl s 5%+" 96 + ", XF86MonBrightnessDown, exec, brightnessctl s 5%-" 97 + ]; 98 + misc = { 99 + focus_on_activate = true; 100 + }; 101 + animation = [ 102 + "global, 1, 0.8, default" 103 + ]; 104 + input = { 105 + kb_layout = "us"; 106 + kb_variant = "intl"; 107 + follow_mouse = "1"; 108 + scroll_factor = "0.7"; 109 + force_no_accel = true; 110 + touchpad = { 111 + natural_scroll = "yes"; 112 + tap-and-drag = true; 113 + scroll_factor = "0.5"; 114 + }; 115 + sensitivity = "0.6"; 116 + accel_profile = "flat"; 117 + }; 118 + }; 119 + }; 112 120 }
+1 -1
home/adjoly/wm/waybar.nix
··· 12 12 layer = "top"; 13 13 modules-left = [ "hyprland/workspaces" "hyprland/window" ]; 14 14 modules-center = [ "clock" ]; 15 - modules-right = [ /*"tray"*/ "mpris" "pulseaudio" "custom/prev" "custom/playpause" "custom/next" "network" "battery" ]; 15 + modules-right = [ "mpris" "tray" "pulseaudio" "custom/prev" "custom/playpause" "custom/next" "network" "battery" ]; 16 16 #output = [ "eDP-1" ]; 17 17 18 18 # ---------------------------------------------------------
+3 -2
hosts/DEV-BOYY/default.nix
··· 2 2 pkgs, 3 3 inputs, 4 4 outputs, 5 + self, 5 6 ... 6 7 }: 7 8 ··· 114 115 ddcutil 115 116 ]; 116 117 117 - programs.ssh.startAgent = true; 118 + # programs.ssh.startAgent = false; 118 119 programs.seahorse.enable = true; 119 120 services.gnome.gnome-keyring.enable = true; 120 121 ··· 151 152 152 153 home-manager = { 153 154 useUserPackages = true; 154 - extraSpecialArgs = { inherit inputs outputs; }; 155 + extraSpecialArgs = { inherit inputs outputs self; }; 155 156 users.adjoly = import ../../home/adjoly/home-desktop.nix; 156 157 }; 157 158
+2 -2
hosts/DEV-BOYY/hardware/hardware-configuration.nix
··· 30 30 boot.extraModulePackages = [ ]; 31 31 32 32 fileSystems."/" = { 33 - device = "/dev/nvme0n1p6"; 33 + device = "/dev/disk/by-label/NIX_ROOT"; 34 34 fsType = "btrfs"; 35 35 options = [ "compress=zstd" ]; 36 36 }; 37 37 38 38 fileSystems."/boot" = { 39 - device = "/dev/nvme0n1p5"; 39 + device = "/dev/disk/by-label/NIX_BOOT"; 40 40 fsType = "vfat"; 41 41 options = [ 42 42 "fmask=0022"
modules/home-manager/cli/pogit.nix

This is a binary file and will not be displayed.

+3 -2
modules/home-manager/default.nix
··· 1 - { config, lib, ... }: 1 + { inputs, config, lib, ... }: 2 2 let 3 3 cli-conf = lib.mkIf config.cli.enable { 4 4 tmux.enable = lib.mkDefault true; ··· 6 6 }; 7 7 gui-conf = lib.mkIf config.gui.enable { 8 8 cli.enable = true; 9 - kitty.enable = true; 9 + kitty.enable = true; 10 10 }; 11 11 in 12 12 { 13 13 imports = [ 14 14 ./cli 15 15 ./gui 16 + inputs.catppuccin.homeModules.catppuccin 16 17 ]; 17 18 18 19 options = {
+32 -34
pkgs/adjust-brightness/default.nix
··· 1 - { pkgs, ... }: 2 - 3 1 { 4 - home.packages = [ 5 - (pkgs.writeShellScriptBin "adjust-brightness" '' 6 - #!/bin/sh 2 + pkgs ? import <nixpkgs> { }, 3 + }: 7 4 8 - # Check if the correct number of arguments is provided 9 - if [ "$#" -ne 2 ]; then 10 - echo "Usage: $0 <display_number> <brightness_value_or_adjustment>" 11 - exit 1 12 - fi 5 + pkgs.writeShellScriptBin "adjust-brightness" '' 6 + #!/bin/sh 13 7 14 - DISPLAY=$1 15 - VALUE_OR_ADJUSTMENT=$2 8 + # Check if the correct number of arguments is provided 9 + if [ "$#" -ne 2 ]; then 10 + echo "Usage: $0 <display_number> <brightness_value_or_adjustment>" 11 + exit 1 12 + fi 16 13 17 - # Get the current brightness value 18 - CURRENT=$(ddcutil getvcp 10 --display=$DISPLAY | grep -oP 'current value =\s*\K\d+') 14 + DISPLAY=$1 15 + VALUE_OR_ADJUSTMENT=$2 19 16 20 - # Check if the adjustment is relative (+ or -) 21 - if [[ "$VALUE_OR_ADJUSTMENT" =~ ^[+-] ]]; then 22 - # Calculate the new brightness value 23 - NEW_BRIGHTNESS=$((CURRENT + VALUE_OR_ADJUSTMENT)) 24 - else 25 - # Set the brightness to the specified value 26 - NEW_BRIGHTNESS=$VALUE_OR_ADJUSTMENT 27 - fi 17 + # Get the current brightness value 18 + CURRENT=$(ddcutil getvcp 10 --display=$DISPLAY | grep -oP 'current value =\s*\K\d+') 28 19 29 - # Ensure the new brightness is within the valid range (0-100) 30 - if [ "$NEW_BRIGHTNESS" -lt 0 ]; then 31 - NEW_BRIGHTNESS=0 32 - elif [ "$NEW_BRIGHTNESS" -gt 100 ]; then 33 - NEW_BRIGHTNESS=100 34 - fi 20 + # Check if the adjustment is relative (+ or -) 21 + if [[ "$VALUE_OR_ADJUSTMENT" =~ ^[+-] ]]; then 22 + # Calculate the new brightness value 23 + NEW_BRIGHTNESS=$((CURRENT + VALUE_OR_ADJUSTMENT)) 24 + else 25 + # Set the brightness to the specified value 26 + NEW_BRIGHTNESS=$VALUE_OR_ADJUSTMENT 27 + fi 28 + 29 + # Ensure the new brightness is within the valid range (0-100) 30 + if [ "$NEW_BRIGHTNESS" -lt 0 ]; then 31 + NEW_BRIGHTNESS=0 32 + elif [ "$NEW_BRIGHTNESS" -gt 100 ]; then 33 + NEW_BRIGHTNESS=100 34 + fi 35 35 36 - # Set the new brightness value 37 - ddcutil setvcp 10 $NEW_BRIGHTNESS --display=$DISPLAY 36 + # Set the new brightness value 37 + ddcutil setvcp 10 $NEW_BRIGHTNESS --display=$DISPLAY 38 38 39 - echo "Brightness for display $DISPLAY changed to $NEW_BRIGHTNESS" 40 - '') 41 - ]; 42 - } 39 + echo "Brightness for display $DISPLAY changed to $NEW_BRIGHTNESS" 40 + ''