From a5b01438cf676841a5992b75c308cf0eb3635358 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 16:20:03 +0200 Subject: [PATCH 01/12] sorted programs --- hosts/vali/mars/awesome.nix | 2 +- hosts/vali/mars/programs.nix | 86 ++++++++++++++++++------------------ modules/cli/zsh.nix | 4 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/hosts/vali/mars/awesome.nix b/hosts/vali/mars/awesome.nix index fdf180c..cd9e68b 100644 --- a/hosts/vali/mars/awesome.nix +++ b/hosts/vali/mars/awesome.nix @@ -17,4 +17,4 @@ in { }; }; }; -} +; diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index f70e21f..7b0fa9b 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -7,39 +7,15 @@ in { fenix = inputs.fenix.packages.${pkgs.system}; in with pkgs; [ - pfetch - git - keepassxc - eza ripgrep - signal-desktop-beta - element-desktop - steam - tor-browser-bundle-bin - betterbird - telegram-desktop - libreoffice-fresh - qbittorrent - ventoy-full - lazygit - neofetch - zip - vlc - zathura alacritty - scc - texliveFull - st - unzip - gcc - trash-cli + alsa-utils + asciinema + betterbird bibata-cursors - networkmanagerapplet - xclip - pamixer dig - pcmanfm - ffmpeg_6-full - yt-dlp + element-desktop + eza ripgrep + fastfetch (fenix.complete.withComponents [ "cargo" "clippy" @@ -47,22 +23,46 @@ in { "rustc" "rustfmt" ]) - polkit - asciinema - fastfetch - alsa-utils - imagemagick - pavucontrol + ffmpeg_6-full + gcc gdb - tree - smartmontools - krita - python3 - rustdesk + git httpie - sherlock - strawberry + imagemagick + keepassxc + krita + lazygit + libreoffice-fresh + neofetch neovim + networkmanagerapplet + pamixer + pavucontrol + pcmanfm + pfetch + polkit + python3 + qbittorrent + rustdesk + scc + sherlock + signal-desktop-beta + smartmontools + st + steam + strawberry + telegram-desktop + texliveFull + tor-browser-bundle-bin + trash-cli + tree + unzip + ventoy-full + vlc + xclip + yt-dlp + zathura + zip ]; }; } diff --git a/modules/cli/zsh.nix b/modules/cli/zsh.nix index 40952c1..93f0910 100644 --- a/modules/cli/zsh.nix +++ b/modules/cli/zsh.nix @@ -86,8 +86,8 @@ in { ]; oh-my-zsh = mkIf cfg.ohmyzsh.enable { enable = true; - theme = cfg.ohmyzsh.theme; - plugins = cfg.ohmyzsh.plugins; + theme = cfg.ohmyzsh.theme; + plugins = cfg.ohmyzsh.plugins; }; }; }; From 685b38fd777b23f90055369c96aa0ae23d3e4349 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 19:22:28 +0200 Subject: [PATCH 02/12] added an overlay, the foot terminal and hypr stuff --- flake.nix | 21 +- hosts/vali/mars/awesome.nix | 2 +- hosts/vali/mars/configuration.nix | 13 +- hosts/vali/mars/default.nix | 1 + hosts/vali/mars/hypr/default.nix | 7 + hosts/vali/mars/hypr/idle.nix | 1 + hosts/vali/mars/hypr/land.nix | 426 ++++++++++++++++++++++++++++++ hosts/vali/mars/hypr/lock.nix | 81 ++++++ hosts/vali/mars/profile.nix | 1 + hosts/vali/mars/programs.nix | 3 + modules/gui/default.nix | 2 + modules/gui/foot.nix | 121 +++++++++ modules/gui/vivado.nix | 52 ++++ modules/other/default.nix | 1 + overlay.nix | 16 ++ 15 files changed, 744 insertions(+), 4 deletions(-) create mode 100644 hosts/vali/mars/hypr/default.nix create mode 100644 hosts/vali/mars/hypr/idle.nix create mode 100644 hosts/vali/mars/hypr/land.nix create mode 100644 hosts/vali/mars/hypr/lock.nix create mode 100644 modules/gui/foot.nix create mode 100644 modules/gui/vivado.nix create mode 100644 overlay.nix diff --git a/flake.nix b/flake.nix index cc50691..1995b4e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,21 @@ }; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; + anyrun = { + url = "github:Kirottu/anyrun"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - nur.url = "github:nix-community/NUR"; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; agenix.url = "github:ryantm/agenix"; @@ -27,11 +35,20 @@ fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; - }; + }; hyprland = { url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprlock = { + url = "github:hyprwm/hyprlock"; + inputs.nixpkgs.follows = "nixpkgs"; }; + + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; + }; }; } diff --git a/hosts/vali/mars/awesome.nix b/hosts/vali/mars/awesome.nix index cd9e68b..fdf180c 100644 --- a/hosts/vali/mars/awesome.nix +++ b/hosts/vali/mars/awesome.nix @@ -17,4 +17,4 @@ in { }; }; }; -; +} diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index ea03f21..2d9f20a 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -25,8 +25,10 @@ i3.enable = true; awesome.enable = true; schizofox.enable = true; - obs.enable = true; + #foot.enable = true; +# obs.enable = true; displaymanager.enable = true; +# vivado.enable = true; #neovim.enable = true; #git = { # enable = true; @@ -35,6 +37,15 @@ # defaultBranch = "main"; #}; starship.enable = true; + hypr = { + land = { + enable = false; + extraPlugins = [ + inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + }; + #lock.enable = true; + }; zsh = { enable = true; profiling = false; diff --git a/hosts/vali/mars/default.nix b/hosts/vali/mars/default.nix index 7705e41..1549554 100644 --- a/hosts/vali/mars/default.nix +++ b/hosts/vali/mars/default.nix @@ -6,5 +6,6 @@ _: { ./profile.nix ./i3.nix ./awesome.nix + ./hypr/default.nix ]; } diff --git a/hosts/vali/mars/hypr/default.nix b/hosts/vali/mars/hypr/default.nix new file mode 100644 index 0000000..2cf865e --- /dev/null +++ b/hosts/vali/mars/hypr/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./idle.nix + ./land.nix + ./lock.nix + ]; +} diff --git a/hosts/vali/mars/hypr/idle.nix b/hosts/vali/mars/hypr/idle.nix new file mode 100644 index 0000000..eed7124 --- /dev/null +++ b/hosts/vali/mars/hypr/idle.nix @@ -0,0 +1 @@ +_: {} diff --git a/hosts/vali/mars/hypr/land.nix b/hosts/vali/mars/hypr/land.nix new file mode 100644 index 0000000..cf566df --- /dev/null +++ b/hosts/vali/mars/hypr/land.nix @@ -0,0 +1,426 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.hypr.land; + username = config.myOptions.other.system.username; + hmCfg = config.home-manager.users.${username}; + + smwPresent = elem inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces cfg.extraPlugins; + + inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset; + inherit (inputs.anyrun.packages.${pkgs.system}) anyrun; + inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; + inherit (inputs.hyprlock.packages.${pkgs.system}) hyprlock; +in { + options.myOptions.programs.hypr.land = { + enable = mkEnableOption "huperland"; + startupSound = mkOption { + type = with types; nullOr path; + description = "sound to play on hyprland startup"; + default = null; + }; + tearing = mkOption { + type = types.bool; + description = "enable tearing"; + default = false; + }; + extraSettings = mkOption { + type = types.attrs; + description = "extra per host hyprland settings"; + default = {}; + }; + extraPlugins = mkOption { + type = with types; listOf package; + description = "extra per host hyprland plugins"; + default = []; + }; + }; + + disabledModules = [ "programs/hyprland.nix" ]; + + config = mkIf cfg.enable { + nix.settings = { + substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; + + environment.sessionVariables = { + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + XDG_SESSION_DESKTOP = "Hyprland"; + + SDL_VIDEODRIVER = "wayland"; + + _JAVA_AWT_WM_NONEREPARENTING = "1"; + + CLUTTER_BACKEND = "wayland"; + + GDK_BACKEND = "wayland"; + + QT_QPA_PLATFORM = "wayland"; + + LIBSEAT_BACKEND = "logind"; + }; + + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland + ]; + # TODO look into and make use of this + config.common.default = "*"; + }; + + home-manager.users.${username} = { + + xdg.dataFile = mkIf (cfg.startupSound != null) { "hypr/startup_sound".source = cfg.startupSound; }; + + wayland.windowManager.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + #portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + plugins = [] ++ cfg.extraPlugins; + # TODO make these work with the config below (infinite recursion) + # and make this file stop hanging my neovim every 2 seconds + # and figure out why it triggers E79 every single time I edit something + extraConfig = '' + bind=$mainMod, W, exec, schizofox + ${if (cfg.startupSound != null) then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${hmCfg.xdg.dataHome}/hypr/startup_sound" else ""} + ''; + settings = { + "$mainMod" = "SUPER"; + + monitor = [ + # second monitor + "HDMI-A-1, 1920@1080, 0x0, 1" + ]; + + workspace = [ + # second monitor + "1, monitor:HDMI-A-1, default:true" + "2, monitor:HDMI-A-1" + "3, monitor:HDMI-A-1" + "4, monitor:HDMI-A-1" + "5, monitor:HDMI-A-1" + "6, monitor:HDMI-A-1" + "7, monitor:HDMI-A-1" + "8, monitor:HDMI-A-1" + "9, monitor:HDMI-A-1" + "10, monitor:HDMI-A-1" + + # scratchpads + "special:btop, decorate:false" + "special:pipewire, decorate:false" + "special:nixos, decorate:false" + (mkIf config.services.asusd.enable + "special:rog, decorate:false") + "special:keepassxc, decorate:false" + ]; + + input = { + kb_layout = "de"; + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + + follow_mouse = true; + touchpad = { + disable_while_typing = false; + }; + + repeat_rate = 50; + repeat_delay = 250; + touchdevice = { + output = "eDP-1"; + }; + + tablet = { + output = "HDMI-A-1"; + }; + }; + + general = { + sensitivity = 1.0; + + gaps_in = 5; + gaps_out = 5; + border_size = 2; + + apply_sens_to_raw = 0; + + #no_border_on_floating = true; + allow_tearing = mkIf cfg.tearing true; + + "col.active_border" = "0xFFF5C2E7"; + "col.inactive_border" = "0xFF45475A"; + #col.group_border_active = "0xFFA6E3A1"; + #col.group_border = "0xFF45475A"; + }; + + env = optionals cfg.tearing [ "WLR_DRM_NO_ATOMIC,1" ]; + + decoration = { + rounding = 10; + blur = { + enabled = true; + size = 3; + passes = 2; + }; + + drop_shadow = 1; + shadow_range = 15; + shadow_render_power = 2; + shadow_ignore_window = 1; + shadow_offset = "2 4"; + shadow_scale = 1; + + "col.shadow" = "0xAF1E1E2E"; + }; + + bezier = [ + "dupa, 0.1, 0.9, 0.1, 1.05" + ]; + + animations = { + enabled = true; + animation = [ + "windows, 1, 4, dupa, popin" + "windowsOut, 1, 7, dupa, slide" + "border, 1, 15, default" + "fade, 1, 10, default" + "workspaces, 1, 5, dupa, slidevert" + ]; + }; + + dwindle = { + no_gaps_when_only = true; + }; + + misc = { + enable_swallow = false; + swallow_regex = "foot"; + focus_on_activate = true; + vrr = 1; + vfr = true; + animate_manual_resizes = false; + animate_mouse_windowdragging = false; + force_default_wallpaper = 0; + }; + + windowrulev2 = [ + "float, class:^(Tor Browser)$" + "float, class:^(foot)$" + "float, class:^(mpv)$" + "float, class:^(imv)$" + "float, class:^(Vieb)$" + "float, title:^(Picture-in-Picture)$" + "float, title:^(.*)(Choose User Profile)(.*)$" + "float, title:^(blob:null/)(.*)$" + + "float, class:^(xdg-desktop-portal-gtk)$" + "float, class:^(code), title: ^(Open*)" + "size 70% 70%, class:^(code), title: ^(Open*)" + "center, class: ^(code), title: ^(Open*)" + "float, class:^(org.keepassxc.KeePassXC)$" + (mkIf config.services.asusd.enable + "size 960 670, title:^(ROG Control Center)$") + ]; + + bind = [ + "$mainMod, RETURN, exec, ${foot}/bin/${foot}" + "$mainMod SHIFT, Q, killactive" + "$mainMod, F, fullscreen, 0" + "$mainMod, M, fullscreen, 1" + "$mainMod, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun" + "$mainMod, SPACE, togglefloating, active" + "$mainMod SHIFT, C, centerwindow" + "$mainMod CONTROL, R, bringactivetotop" + "$mainMod, P, pin" + # workspaces + "$mainMod, 1, ${if smwPresent then "split-" else ""}workspace, 1" + "$mainMod, 2, ${if smwPresent then "split-" else ""}workspace, 2" + "$mainMod, 3, ${if smwPresent then "split-" else ""}workspace, 3" + "$mainMod, 4, ${if smwPresent then "split-" else ""}workspace, 4" + "$mainMod, 5, ${if smwPresent then "split-" else ""}workspace, 5" + "$mainMod, 6, ${if smwPresent then "split-" else ""}workspace, 6" + "$mainMod, 7, ${if smwPresent then "split-" else ""}workspace, 7" + "$mainMod, 8, ${if smwPresent then "split-" else ""}workspace, 8" + "$mainMod, 9, ${if smwPresent then "split-" else ""}workspace, 9" + "$mainMod, 0, ${if smwPresent then "split-" else ""}workspace, 10" + "$mainMod SHIFT, 1, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 1" + "$mainMod SHIFT, 2, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 2" + "$mainMod SHIFT, 3, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 3" + "$mainMod SHIFT, 4, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 4" + "$mainMod SHIFT, 5, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 5" + "$mainMod SHIFT, 6, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 6" + "$mainMod SHIFT, 7, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 7" + "$mainMod SHIFT, 8, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 8" + "$mainMod SHIFT, 9, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 9" + "$mainMod SHIFT, 0, ${if smwPresent then "split-" else ""}movetoworkspacesilent, 10" + # screenshots + "$mainMod, S, exec, grimblast save area - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\"" + "$mainMod CONTROL, S, exec, grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${pkgs.coreutils-full}/bin/tee \"$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')\" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send \"Screenshot taken\"" + "$mainMod SHIFT, R, exec, ${hyprland}/bin/hyprctl reload" + + # TODO fix this maybe + "$mainMod, T, exec, grim -g \"$(slurp)\" -t ppm - | tesseract -l pol - - | wl-copy && notify-send \"Copied text: \" \"\\\"$(wl-paste)\\\"\"" + # TODO fix this + "$mainMod, SEMICOLON, exec, ~/.config/rofi/powermenu/type-2/powermenu.sh" + "$mainMod, G, togglegroup" + # this sometimes fixes the portal + "$mainMod CONTROL, X, exec, ${pkgs.systemd}/bin/systemctl --user restart xdg-desktop-portal-hyprland" + "$mainMod SHIFT, X, exec, ${hyprland}/bin/hyprctl kill" + # scratchpad binds + "$mainMod, B, togglespecialworkspace, btop" + "$mainMod, V, togglespecialworkspace, pipewire" + "$mainMod, N, togglespecialworkspace, nixos" + "$mainMod, X, togglespecialworkspace, keepassxc" + "$mainMod, C, exec, ${hyprlock}/bin/hyprlock" + # toggle waybar + "$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || waybar" + + #"$mainMod, mouse_up, exec, ${hyprland}/bin/hyprctl keyword misc:cursor_zoom_factor $(echo \"$(${hyprland}/bin/hyprctl getoption misc:cursor_zoom_factor -j | ${pkgs.jq}/bin/jq '.float') + 0.01\" | ${pkgs.bc}/bin/bc)" + #"$mainMod, mouse_down, exec, ${hyprland}/bin/hyprctl keyword misc:cursor_zoom_factor $(echo \"$(${hyprland}/bin/hyprctl getoption misc:cursor_zoom_factor -j | ${pkgs.jq}/bin/jq '.float') - 0.01\" | ${pkgs.bc}/bin/bc)" + + #"$mainMod, mouse_up, exec, ${pkgs.libnotify}/bin/notify-send 'mouse_up'" + #"$mainMod, mouse_down, exec, ${pkgs.libnotify}/bin/notify-send 'mouse_down'" + ]; + + # repeat + binde = [ + # window / monitor focus + "$mainMod, H, movefocus, l" + "$mainMod, J, movefocus, d" + "$mainMod, K, movefocus, u" + "$mainMod, L, movefocus, r" + "$mainMod CONTROL, J, focusmonitor, l" + "$mainMod CONTROL, K, focusmonitor, r" + + "$mainMod SHIFT, G, changegroupactive, f" + "$mainMod CONTROL, G, changegroupactive, b" + ]; + + # locked + bindl = [ + ", XF86AudioMedia, exec, ${pkgs.playerctl}/bin/playerctl play-pause" + ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" + ", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop" + ", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" + ", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" + ", XF86AudioMute, exec, ~/Scripts/notif_volume.sh --toggle-mute" + ]; + + # locked + repeat + bindle = [ + ", XF86MonBrightnessUp, exec, ~/Scripts/notif_brightness.sh set +5%" + ", XF86MonBrightnessDown, exec, ~/Scripts/notif_brightness.sh set 5%-" + ", XF86AudioRaiseVolume, exec, ~/Scripts/notif_volume.sh -ui 5" + ", XF86AudioLowerVolume, exec, ~/Scripts/notif_volume.sh -ud 5" + ]; + + # mouse + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + binds = { + pass_mouse_when_bound = false; + movefocus_cycles_fullscreen = false; + }; + + exec-once = let + # https://wiki.hyprland.org/IPC/#how-to-use-socket2-with-bash + handle_hyprland_events = pkgs.writeShellScriptBin "handle_hyprland_events" '' + #!/bin/sh + + handle() { + case $1 in + configreloaded*) + ${hyprland}/bin/hyprctl notify 1 2500 "" " Reloading Hyprland..." + ;; + esac + } + + ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | + while read -r line; do + handle "$line" + done + ''; + in [ + "waybar" + + # run persistent special workspace windows + "[workspace special:nixos silent;tile] cd ~/niksos; ${foot}/bin/foot" + (mkIf config.services.asusd.enable + "[workspace special:rog silent;tile] ${config.services.asusd.package}/bin/rog-control-center") + "[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc" + + (if config.myOptions.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";") + + "${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24" + + # TODO do something with this + #"${wl-clipboard}/bin/wl-paste --watch cliphist store" + + "${swww}/bin/swww init" + "${wlsunset}/bin/wlsunset -S 06:00 -s 20:00" + # TODO fix fcitx5 + #"fcitx5" + # TODO do these do anything anymore + "${pkgs.systemd}/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP" + "rot8 --threshold 0.75" + "${handle_hyprland_events}/bin/handle_hyprland_events" + "wvkbd-mobintl --hidden -L 500" + ]; + + exec = [ + # kill (almost) everything on special workspaces + "${pkgs.procps}/bin/pkill btop" + "${pkgs.procps}/bin/pkill helvum" + "${pkgs.procps}/bin/pkill pavucontrol" + # and run it all again + "[workspace special:btop silent;tile] ${foot}/bin/foot -e ${pkgs.btop}/bin/btop" + "[workspace special:pipewire silent;tile] ${pkgs.helvum}/bin/helvum" + "[workspace special:pipewire silent;tile] ${pkgs.pavucontrol}/bin/pavucontrol" + + # wait a bit then set the wallpapers +# "sleep 0.5 && ${swww}/bin/swww img -o eDP-1 ~/catppuccin-wall0.png" +# "sleep 0.5 && ${swww}/bin/swww img -o HDMI-A-1 ~/catppuccin-wall1.png" + + "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator" + "${pkgs.blueman}/bin/blueman-applet" + ]; + + layerrule = [ + # no black border on grimblast screenshots + "noanim, ^(selection)$" + + "blur, ^(waybar)$" + "blur, ^(eww)$" + + # TODO maybe this isn't needed + # temporary fix to swaylock screenshoting rofi before locking + #"noanim, ^(rofi)$" + + "blur, ^(anyrun)$" + ]; + + plugin = { + split-monitor-workspaces = { + count = 10; + keep_focused = true; + }; + }; + } // cfg.extraSettings; + }; + }; + }; +} diff --git a/hosts/vali/mars/hypr/lock.nix b/hosts/vali/mars/hypr/lock.nix new file mode 100644 index 0000000..d622ef8 --- /dev/null +++ b/hosts/vali/mars/hypr/lock.nix @@ -0,0 +1,81 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.hypr.lock; + username = config.myOptions.other.system.username; + + text_color = "rgba(eae0e4FF)"; +in { + options.myOptions.programs.hypr.lock = { + enable = mkEnableOption "hiper zamek"; + extraSettings = mkOption { + type = types.attrs; + description = "extra per host hyprlock settings"; + default = {}; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + imports = [ inputs.hyprlock.homeManagerModules.default ]; + + programs.hyprlock = { + enable = true; + package = inputs.hyprlock.packages.${pkgs.system}.hyprlock; + general = { + grace = 2; + }; + backgrounds = [ + { + color = "rgba(120f1177)"; + path = "screenshot"; + blur_size = 5; + blur_passes = 4; + } + ]; + + input-fields = [ + { + size = { + width = 600; + height = 50; + }; + outline_thickness = 3; + dots_size = 0.1; + dots_spacing = 0.3; + outer_color = "rgba(9a8d9555)"; + inner_color = "rgba(120f1111)"; + font_color = "rgba(d1c2cbff)"; + fade_on_empty = true; + position = { + x = 0; + y = 20; + }; + halign = "center"; + valign = "center"; + } + ]; + + labels = [ + { + # clock + text = "$TIME"; + color = text_color; + font_size = 65; + position = { + x = 0; + y = 300; + }; + halign = "center"; + valign = "center"; + } + + ]; + }; + }; + }; +} diff --git a/hosts/vali/mars/profile.nix b/hosts/vali/mars/profile.nix index ef62882..2d36ff1 100644 --- a/hosts/vali/mars/profile.nix +++ b/hosts/vali/mars/profile.nix @@ -4,6 +4,7 @@ _: { ../../../options/desktop/fonts.nix ../../../options/common/networking.nix ../../../options/common/gpu/nvidia.nix + ../../../overlay.nix # ../../options/common/pin-registry.nix # ../../options/common/preserve-system.nix #../../options/ diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 7b0fa9b..ab0fbb8 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -12,6 +12,7 @@ in { asciinema betterbird bibata-cursors + chromium dig element-desktop eza ripgrep @@ -24,8 +25,10 @@ in { "rustfmt" ]) ffmpeg_6-full + foot gcc gdb + grimblast git httpie imagemagick diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 09d557f..0821731 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -8,5 +8,7 @@ _: { ./schizofox.nix ./zathura.nix ./obs.nix + ./foot.nix +# ./vivado.nix ]; } diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix new file mode 100644 index 0000000..d94b898 --- /dev/null +++ b/modules/gui/foot.nix @@ -0,0 +1,121 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.foot; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.foot = { + enable = mkEnableOption "foot"; + server = mkEnableOption "foot server mode"; + }; + + config = mkIf cfg.enable { + environment.sessionVariables = { + TERM = "foot"; + }; + home-manager.users.${username} = { + programs.foot = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; + server.enable = cfg.server; + settings = { + main = { + term = "foot"; + app-id = "foot"; + title = "foot"; + locked-title = "no"; + + font = "JetBrains Mono Nerd Font:size=16"; + line-height = 20; + letter-spacing = 0; + horizontal-letter-offset = 0; + vertical-letter-offset = -0.75; + box-drawings-uses-font-glyphs = "no"; + dpi-aware = "no"; + + initial-window-size-chars = "104x36"; + initial-window-mode = "windowed"; + pad = "5x5 center"; + resize-delay-ms = 100; + + notify = "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; + + bold-text-in-bright = "no"; + word-delimiters = ",│`|:\"'()[]{}<>"; + selection-target = "primary"; + }; + bell = { + urgent = "yes"; + notify = "yes"; + command = "notify-send bell"; + command-focused = "no"; + }; + scrollback = { + lines = 100000; + multiplier = 10.0; + indicator-position = "relative"; + indicator-format = "line"; + }; + url = { + launch = "${pkgs.xdg-utils}/bin/xdg-open \${url}"; + label-letters = "sadfjklewcmpgh"; + osc8-underline = "always"; + protocols = "http, https, ftp, ftps, file, gemini, gopher, irc, ircs"; + uri-characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+=\"'()[]"; + }; + cursor = { + style = "block"; + blink = "no"; + }; + mouse = { + hide-when-typing = "yes"; + alternate-scroll-mode = "yes"; + }; + colors = { + alpha = 0.85; + foreground = "cdd6f4"; # Text + background = "1e1e2e"; # Base + regular0 = "45475a"; # Surface 1 + regular1 = "f38ba8"; # red + regular2 = "a6e3a1"; # green + regular3 = "f9e2af"; # yellow + regular4 = "89b4fa"; # blue + regular5 = "f5c2e7"; # pink + regular6 = "94e2d5"; # teal + regular7 = "bac2de"; # Subtext 1 + bright0 = "585b70"; # Surface 2 + bright1 = "f38ba8"; # red + bright2 = "a6e3a1"; # green + bright3 = "f9e2af"; # yellow + bright4 = "89b4fa"; # blue + bright5 = "f5c2e7"; # pink + bright6 = "94e2d5"; # teal + bright7 = "a6adc8"; # Subtext 0 + }; + csd = { + preferred = "server"; + }; + key-bindings = { + show-urls-launch = "Control+Shift+u"; + unicode-input = "Control+Shift+i"; + }; + mouse-bindings = { + selection-override-modifiers = "Shift"; + primary-paste = "BTN_MIDDLE"; + select-begin = "BTN_LEFT"; + select-begin-block = "Control+BTN_LEFT"; + select-extend = "BTN_RIGHT"; + select-extend-character-wise = "Control+BTN_RIGHT"; + select-word = "BTN_LEFT-2"; + select-word-whitespace = "Control+BTN_LEFT-2"; + #select-row = "BTN_LEFT-3"; + }; + }; + }; + }; + }; +} diff --git a/modules/gui/vivado.nix b/modules/gui/vivado.nix new file mode 100644 index 0000000..9f9a3c8 --- /dev/null +++ b/modules/gui/vivado.nix @@ -0,0 +1,52 @@ +{ pkgs, nur, ...}: + + +let + vivado-desktop-symbol = pkgs.makeDesktopItem { + name = "vivado-2022_2"; + desktopName = "Vivado"; + exec = "${pkgs.nur.repos.lschuermann.vivado-2022_2}/bin/vivado"; + }; +in +{ + + environment.systemPackages = with pkgs; [ + # this propietary software is huge, but I need it for + # university + pkgs.nur.repos.lschuermann.vivado-2022_2 + vivado-desktop-symbol + ]; + + + # Create udev rules. Reference: https://blog.kotatsu.dev/posts/2021-09-14-vivado-on-nixos/ + services.udev.packages = [ + (pkgs.writeTextFile { + name = "xilinx-dilligent-usb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-digilent-usb.rules"; + text = '' + ATTR{idVendor}=="1443", MODE:="666" + ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666" + ''; + }) + (pkgs.writeTextFile { + name = "xilinx-pcusb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-pcusb.rules"; + text = '' + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", MODE="666" + ''; + }) + (pkgs.writeTextFile { + name = "xilinx-ftdi-usb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-ftdi-usb.rules"; + text = '' + ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666" + ''; + }) + ]; +} diff --git a/modules/other/default.nix b/modules/other/default.nix index 3093507..dc00064 100644 --- a/modules/other/default.nix +++ b/modules/other/default.nix @@ -6,3 +6,4 @@ _: { ./displaymanager.nix ]; } + diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..1db6ef0 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,16 @@ +{ inputs, outputs, ... }: + +let +add_nur = self: super: { + # nur-no-pkgs = import inputs.nur-no-pkgs { pkgs = inputs.nixpkgs.legacyPackages.${profile-config.system}; nurpkgs = inputs.nixpkgs.legacyPackages.${profile-config.system}; }; + nur = import inputs.nur { + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; }; # .legacyPackages.${profile-config.system}; + nurpkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; }; #.legacyPackages.${profile-config.system}; + }; +}; +in +{ + nixpkgs.overlays = [ + add_nur + ]; +} From a6d01825596ce05fc49af6a7f29367c2570d5c4a Mon Sep 17 00:00:00 2001 From: get Date: Fri, 12 Apr 2024 19:30:10 +0200 Subject: [PATCH 03/12] Optimized hyprland config --- hosts/lars/dyonisos/configuration.nix | 4 ++++ hosts/lars/hyprland.nix | 24 ++++++++++++++++++------ hosts/lars/kronos/configuration.nix | 4 ++++ hosts/lars/programs.nix | 3 +++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/hosts/lars/dyonisos/configuration.nix b/hosts/lars/dyonisos/configuration.nix index a702148..1bc5392 100644 --- a/hosts/lars/dyonisos/configuration.nix +++ b/hosts/lars/dyonisos/configuration.nix @@ -7,5 +7,9 @@ username = "lars"; }; }; + hyprland = { + enable = true; + monitor = ",preferred,auto,1"; + }; }; } diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 24afae1..1404c6d 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -4,7 +4,14 @@ with lib; let cfg = config.myOptions.hyprland; in { options.myOptions.hyprland.nvidia.enable = mkEnableOption "nvidia"; - options.myOptions.hyprland.enable = mkEnableOption "hyprland"; + options.myOptions.hyprland = { + enable = mkEnableOption "hyprland"; + monitor = mkOption { + description = "hyprland monitor config"; + default = ",preferred,auto,1"; + type = types.listof(types.str); + }; + }; config = mkIf cfg.enable { environment.sessionVariables = mkIf cfg.nvidia.enable { @@ -36,11 +43,6 @@ in { settings = { "$mod" = "SUPER"; - monitor = [ - "DP-2,2560x1440@144,0x0,1" - "DP-1,1920x1080@60,2560x0,1" - ]; - input = { kb_layout = "ch"; }; @@ -53,6 +55,16 @@ in { # Monitor management "$mod SHIFT, k, movecurrentworkspacetomonitor, DP-2" "$mod SHIFT, j, movecurrentworkspacetomonitor, DP-1" + + # Window Management + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod, F, fullscreen" + + # Screenshot + "$mod SHIFT, s, exec, grim -g 'slurp -d' - | wl-copy" ] ++ ( builtins.concatLists (builtins.genList ( diff --git a/hosts/lars/kronos/configuration.nix b/hosts/lars/kronos/configuration.nix index 5d796f5..3cc0d21 100644 --- a/hosts/lars/kronos/configuration.nix +++ b/hosts/lars/kronos/configuration.nix @@ -10,6 +10,10 @@ hyprland = { enable = true; nvidia.enable = true; + monitor = [ + "DP-2,2560x1440@144,0x0,1" + "DP-1,1920x1080@60,2560x0,1" + ]; }; }; diff --git a/hosts/lars/programs.nix b/hosts/lars/programs.nix index 97a5b03..46cac30 100644 --- a/hosts/lars/programs.nix +++ b/hosts/lars/programs.nix @@ -48,6 +48,9 @@ in { tmux firefox kitty + grim + slurp + wl-clipboard ]; }; } From 4720f2bd69b3fd339ac594e1cddf7567070f8337 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 19:45:13 +0200 Subject: [PATCH 04/12] added some vivado shit stuff --- hosts/vali/mars/programs.nix | 1 + modules/gui/vivado2.nix | 58 ++++ modules/other/autorandr.nix | 370 ++++++++++++++++++++++++++ notes.md | 4 + options/common/gpu/nvidia_wayland.nix | 32 +++ 5 files changed, 465 insertions(+) create mode 100644 modules/gui/vivado2.nix create mode 100644 modules/other/autorandr.nix create mode 100644 options/common/gpu/nvidia_wayland.nix diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index ab0fbb8..44dfaab 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -56,6 +56,7 @@ in { strawberry telegram-desktop texliveFull + thunderbird tor-browser-bundle-bin trash-cli tree diff --git a/modules/gui/vivado2.nix b/modules/gui/vivado2.nix new file mode 100644 index 0000000..c73846f --- /dev/null +++ b/modules/gui/vivado2.nix @@ -0,0 +1,58 @@ +{ config, lib, pkgs, ...}: + +let + vivado-desktop-symbol = pkgs.makeDesktopItem { + name = "vivado-2022_2"; + desktopName = "Vivado"; + exec = "${pkgs.nur.repos.lschuermann.vivado-2022_2}/bin/vivado"; + }; + cfg = with lib; [ config.myOptions.programs.vivado ]; + username = with lib; [ config.myOptions.other.system.username ]; +in +{ + options.myOptions.programs.vivado.enable = mkEnableOption "vivado"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + environment.systemPackages = with pkgs; [ + # this propietary software is huge, but I need it for + # university + pkgs.nur.repos.lschuermann.vivado-2022_2 + vivado-desktop-symbol + ]; + + + # Create udev rules. Reference: https://blog.kotatsu.dev/posts/2021-09-14-vivado-on-nixos/ + services.udev.packages = [ + (pkgs.writeTextFile { + name = "xilinx-dilligent-usb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-digilent-usb.rules"; + text = '' + ATTR{idVendor}=="1443", MODE:="666" + ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666" + ''; + }) + (pkgs.writeTextFile { + name = "xilinx-pcusb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-pcusb.rules"; + text = '' + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", MODE="666" + ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", MODE="666" + ''; + }) + (pkgs.writeTextFile { + name = "xilinx-ftdi-usb-udev"; + destination = "/etc/udev/rules.d/52-xilinx-ftdi-usb.rules"; + text = '' + ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666" + ''; + }) + ]; + }; + }; +} diff --git a/modules/other/autorandr.nix b/modules/other/autorandr.nix new file mode 100644 index 0000000..f9b4d7c --- /dev/null +++ b/modules/other/autorandr.nix @@ -0,0 +1,370 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.services.autorandr; + hookType = types.lines; + + matrixOf = n: m: elemType: + mkOptionType rec { + name = "matrixOf"; + description = + "${toString n}×${toString m} matrix of ${elemType.description}s"; + check = xss: + let listOfSize = l: xs: isList xs && length xs == l; + in listOfSize n xss + && all (xs: listOfSize m xs && all elemType.check xs) xss; + merge = mergeOneOption; + getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "*" "*" ]); + getSubModules = elemType.getSubModules; + substSubModules = mod: matrixOf n m (elemType.substSubModules mod); + functor = (defaultFunctor name) // { wrapped = elemType; }; + }; + + profileModule = types.submodule { + options = { + fingerprint = mkOption { + type = types.attrsOf types.str; + description = lib.mdDoc '' + Output name to EDID mapping. + Use `autorandr --fingerprint` to get current setup values. + ''; + default = { }; + }; + + config = mkOption { + type = types.attrsOf configModule; + description = lib.mdDoc "Per output profile configuration."; + default = { }; + }; + + hooks = mkOption { + type = hooksModule; + description = lib.mdDoc "Profile hook scripts."; + default = { }; + }; + }; + }; + + configModule = types.submodule { + options = { + enable = mkOption { + type = types.bool; + description = lib.mdDoc "Whether to enable the output."; + default = true; + }; + + crtc = mkOption { + type = types.nullOr types.ints.unsigned; + description = lib.mdDoc "Output video display controller."; + default = null; + example = 0; + }; + + primary = mkOption { + type = types.bool; + description = lib.mdDoc "Whether output should be marked as primary"; + default = false; + }; + + position = mkOption { + type = types.str; + description = lib.mdDoc "Output position"; + default = ""; + example = "5760x0"; + }; + + mode = mkOption { + type = types.str; + description = lib.mdDoc "Output resolution."; + default = ""; + example = "3840x2160"; + }; + + rate = mkOption { + type = types.str; + description = lib.mdDoc "Output framerate."; + default = ""; + example = "60.00"; + }; + + gamma = mkOption { + type = types.str; + description = lib.mdDoc "Output gamma configuration."; + default = ""; + example = "1.0:0.909:0.833"; + }; + + rotate = mkOption { + type = types.nullOr (types.enum [ "normal" "left" "right" "inverted" ]); + description = lib.mdDoc "Output rotate configuration."; + default = null; + example = "left"; + }; + + transform = mkOption { + type = types.nullOr (matrixOf 3 3 types.float); + default = null; + example = literalExpression '' + [ + [ 0.6 0.0 0.0 ] + [ 0.0 0.6 0.0 ] + [ 0.0 0.0 1.0 ] + ] + ''; + description = lib.mdDoc '' + Refer to + {manpage}`xrandr(1)` + for the documentation of the transform matrix. + ''; + }; + + dpi = mkOption { + type = types.nullOr types.ints.positive; + description = lib.mdDoc "Output DPI configuration."; + default = null; + example = 96; + }; + + scale = mkOption { + type = types.nullOr (types.submodule { + options = { + method = mkOption { + type = types.enum [ "factor" "pixel" ]; + description = lib.mdDoc "Output scaling method."; + default = "factor"; + example = "pixel"; + }; + + x = mkOption { + type = types.either types.float types.ints.positive; + description = lib.mdDoc "Horizontal scaling factor/pixels."; + }; + + y = mkOption { + type = types.either types.float types.ints.positive; + description = lib.mdDoc "Vertical scaling factor/pixels."; + }; + }; + }); + description = lib.mdDoc '' + Output scale configuration. + + Either configure by pixels or a scaling factor. When using pixel method the + {manpage}`xrandr(1)` + option + `--scale-from` + will be used; when using factor method the option + `--scale` + will be used. + + This option is a shortcut version of the transform option and they are mutually + exclusive. + ''; + default = null; + example = literalExpression '' + { + x = 1.25; + y = 1.25; + } + ''; + }; + }; + }; + + hooksModule = types.submodule { + options = { + postswitch = mkOption { + type = types.attrsOf hookType; + description = lib.mdDoc "Postswitch hook executed after mode switch."; + default = { }; + }; + + preswitch = mkOption { + type = types.attrsOf hookType; + description = lib.mdDoc "Preswitch hook executed before mode switch."; + default = { }; + }; + + predetect = mkOption { + type = types.attrsOf hookType; + description = lib.mdDoc '' + Predetect hook executed before autorandr attempts to run xrandr. + ''; + default = { }; + }; + }; + }; + + hookToFile = folder: name: hook: + nameValuePair "xdg/autorandr/${folder}/${name}" { + source = "${pkgs.writeShellScriptBin "hook" hook}/bin/hook"; + }; + profileToFiles = name: profile: + with profile; + mkMerge ([ + { + "xdg/autorandr/${name}/setup".text = concatStringsSep "\n" + (mapAttrsToList fingerprintToString fingerprint); + "xdg/autorandr/${name}/config".text = + concatStringsSep "\n" (mapAttrsToList configToString profile.config); + } + (mapAttrs' (hookToFile "${name}/postswitch.d") hooks.postswitch) + (mapAttrs' (hookToFile "${name}/preswitch.d") hooks.preswitch) + (mapAttrs' (hookToFile "${name}/predetect.d") hooks.predetect) + ]); + fingerprintToString = name: edid: "${name} ${edid}"; + configToString = name: config: + if config.enable then + concatStringsSep "\n" ([ "output ${name}" ] + ++ optional (config.position != "") "pos ${config.position}" + ++ optional (config.crtc != null) "crtc ${toString config.crtc}" + ++ optional config.primary "primary" + ++ optional (config.dpi != null) "dpi ${toString config.dpi}" + ++ optional (config.gamma != "") "gamma ${config.gamma}" + ++ optional (config.mode != "") "mode ${config.mode}" + ++ optional (config.rate != "") "rate ${config.rate}" + ++ optional (config.rotate != null) "rotate ${config.rotate}" + ++ optional (config.transform != null) ("transform " + + concatMapStringsSep "," toString (flatten config.transform)) + ++ optional (config.scale != null) + ((if config.scale.method == "factor" then "scale" else "scale-from") + + " ${toString config.scale.x}x${toString config.scale.y}")) + else '' + output ${name} + off + ''; + +in { + + options = { + + services.autorandr = { + enable = mkEnableOption (lib.mdDoc "handling of hotplug and sleep events by autorandr"); + + defaultTarget = mkOption { + default = "default"; + type = types.str; + description = lib.mdDoc '' + Fallback if no monitor layout can be detected. See the docs + (https://github.com/phillipberndt/autorandr/blob/v1.0/README.md#how-to-use) + for further reference. + ''; + }; + + ignoreLid = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc "Treat outputs as connected even if their lids are closed"; + }; + + matchEdid = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc "Match displays based on edid instead of name"; + }; + + hooks = mkOption { + type = hooksModule; + description = lib.mdDoc "Global hook scripts"; + default = { }; + example = literalExpression '' + { + postswitch = { + "notify-i3" = "''${pkgs.i3}/bin/i3-msg restart"; + "change-background" = readFile ./change-background.sh; + "change-dpi" = ''' + case "$AUTORANDR_CURRENT_PROFILE" in + default) + DPI=120 + ;; + home) + DPI=192 + ;; + work) + DPI=144 + ;; + *) + echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE" + exit 1 + esac + echo "Xft.dpi: $DPI" | ''${pkgs.xorg.xrdb}/bin/xrdb -merge + '''; + }; + } + ''; + }; + profiles = mkOption { + type = types.attrsOf profileModule; + description = lib.mdDoc "Autorandr profiles specification."; + default = { }; + example = literalExpression '' + { + "work" = { + fingerprint = { + eDP1 = ""; + DP1 = ""; + }; + config = { + eDP1.enable = false; + DP1 = { + enable = true; + crtc = 0; + primary = true; + position = "0x0"; + mode = "3840x2160"; + gamma = "1.0:0.909:0.833"; + rate = "60.00"; + rotate = "left"; + }; + }; + hooks.postswitch = readFile ./work-postswitch.sh; + }; + } + ''; + }; + + }; + + }; + + config = mkIf cfg.enable { + + services.udev.packages = [ pkgs.autorandr ]; + + environment = { + systemPackages = [ pkgs.autorandr ]; + etc = mkMerge ([ + (mapAttrs' (hookToFile "postswitch.d") cfg.hooks.postswitch) + (mapAttrs' (hookToFile "preswitch.d") cfg.hooks.preswitch) + (mapAttrs' (hookToFile "predetect.d") cfg.hooks.predetect) + (mkMerge (mapAttrsToList profileToFiles cfg.profiles)) + ]); + }; + + systemd.services.autorandr = { + wantedBy = [ "sleep.target" ]; + description = "Autorandr execution hook"; + after = [ "sleep.target" ]; + + startLimitIntervalSec = 5; + startLimitBurst = 1; + serviceConfig = { + ExecStart = '' + ${pkgs.autorandr}/bin/autorandr \ + --batch \ + --change \ + --default ${cfg.defaultTarget} \ + ${optionalString cfg.ignoreLid "--ignore-lid"} \ + ${optionalString cfg.matchEdid "--match-edid"} + ''; + Type = "oneshot"; + RemainAfterExit = false; + KillMode = "process"; + }; + }; + + }; + + meta.maintainers = with maintainers; [ alexnortung ]; +} diff --git a/notes.md b/notes.md index cc2d0a1..509de23 100644 --- a/notes.md +++ b/notes.md @@ -1 +1,5 @@ # Used Stuff +https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/autorandr.nix +https://github.com/phillipberndt/autorandr + + diff --git a/options/common/gpu/nvidia_wayland.nix b/options/common/gpu/nvidia_wayland.nix new file mode 100644 index 0000000..2dcd218 --- /dev/null +++ b/options/common/gpu/nvidia_wayland.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ...}: +{ + services.xserver.videoDrivers = [ "nvidia" ]; + environment.variables = { + GBM_BACKEND = "nvidia-drm"; + WLR_NO_HARDWARE_CURSORS = "1"; + LIBVA_DRIVER_NAME = "nvidia"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + }; + environment.systemPackages = with pkgs; [ + vulkan-loader + vulkan-validation-layers + vulkan-tools + ]; + hardware = { + nvidia = { + open = true; + nvidiaSettings = false; + powerManagement.enable = true; + powerManagement.finegrained = false; + modesetting.enable = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; + }; + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ nvidia-vaapi-driver ]; + }; +} + From 633bd97abfe736e85a7f4e06a22e5bff6b6391fa Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 19:57:24 +0200 Subject: [PATCH 05/12] fixed i3, removed overlay for the time being --- hosts/vali/mars/i3.nix | 1 - hosts/vali/mars/profile.nix | 2 +- modules/other/default.nix | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hosts/vali/mars/i3.nix b/hosts/vali/mars/i3.nix index 8805701..6da1180 100644 --- a/hosts/vali/mars/i3.nix +++ b/hosts/vali/mars/i3.nix @@ -9,7 +9,6 @@ in { enable = true; xkb.layout = "de"; windowManager = { - bspwm.enable = true; i3.enable = true; }; displayManager = { diff --git a/hosts/vali/mars/profile.nix b/hosts/vali/mars/profile.nix index 2d36ff1..ded3887 100644 --- a/hosts/vali/mars/profile.nix +++ b/hosts/vali/mars/profile.nix @@ -4,7 +4,7 @@ _: { ../../../options/desktop/fonts.nix ../../../options/common/networking.nix ../../../options/common/gpu/nvidia.nix - ../../../overlay.nix +# ../../../overlay.nix # ../../options/common/pin-registry.nix # ../../options/common/preserve-system.nix #../../options/ diff --git a/modules/other/default.nix b/modules/other/default.nix index dc00064..549359d 100644 --- a/modules/other/default.nix +++ b/modules/other/default.nix @@ -2,7 +2,7 @@ _: { imports = [ ./home-manager.nix ./system.nix - ./xdg.nix +# ./xdg.nix ./displaymanager.nix ]; } From e1f8a2e1d4a3f2f9034260c1799e6125a8e8e00d Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 19:57:56 +0200 Subject: [PATCH 06/12] cleanup of configuration.nix --- hosts/vali/mars/configuration.nix | 15 +-------------- hosts/vali/mars/hypr/land.nix | 11 ++++------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index 2d9f20a..fa98be9 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -23,12 +23,8 @@ btop.enable = true; mpv.enable = true; i3.enable = true; - awesome.enable = true; schizofox.enable = true; - #foot.enable = true; -# obs.enable = true; displaymanager.enable = true; -# vivado.enable = true; #neovim.enable = true; #git = { # enable = true; @@ -37,15 +33,6 @@ # defaultBranch = "main"; #}; starship.enable = true; - hypr = { - land = { - enable = false; - extraPlugins = [ - inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces - ]; - }; - #lock.enable = true; - }; zsh = { enable = true; profiling = false; @@ -53,7 +40,7 @@ }; services = { pipewire.enable = true; - }; + }; themes = { cursor = { enable = true; diff --git a/hosts/vali/mars/hypr/land.nix b/hosts/vali/mars/hypr/land.nix index cf566df..475d78c 100644 --- a/hosts/vali/mars/hypr/land.nix +++ b/hosts/vali/mars/hypr/land.nix @@ -1,10 +1,7 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: with lib; let +{ config, inputs, lib, pkgs, ... }: + +with lib; let + cfg = config.myOptions.programs.hypr.land; username = config.myOptions.other.system.username; hmCfg = config.home-manager.users.${username}; From 46e680b035aa26dc973239255ffa62836064391c Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:24:19 +0200 Subject: [PATCH 07/12] removed autorandr again, see my i3.nix --- flake.nix | 2 +- hosts/vali/mars/i3.nix | 7 + hosts/vali/mars/programs.nix | 1 + modules/other/autorandr.nix | 370 ----------------------------------- 4 files changed, 9 insertions(+), 371 deletions(-) delete mode 100644 modules/other/autorandr.nix diff --git a/flake.nix b/flake.nix index 1995b4e..df11d3f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ nur = { url = "github:nix-community/NUR"; - inputs.nixpkgs.follows = "nixpkgs"; + #inputs.nixpkgs.follows = "nixpkgs"; }; agenix.url = "github:ryantm/agenix"; diff --git a/hosts/vali/mars/i3.nix b/hosts/vali/mars/i3.nix index 6da1180..3dc1dcb 100644 --- a/hosts/vali/mars/i3.nix +++ b/hosts/vali/mars/i3.nix @@ -14,6 +14,13 @@ in { displayManager = { gdm.enable = true; defaultSession = "none+i3"; + setupCommands = '' + LEFT='DP-2' + CENTER='HDMI-1' + RIGHT='HDMI-0' + ${pkgs.xorg.xrandr}/bin/xrandr --output $CENTER --rotate left --output $LEFT --rotate left --left-of $CENTER --output $RIGHT --right-of $CENTER + ''; +# ❯ xrandr --output HDMI-1 --rotate normal --output DP-2 --rotate normal --left-of HDMI-1 --output HDMI-0 --right-of HDMI-1 }; }; }; diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 44dfaab..9f820a9 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -62,6 +62,7 @@ in { tree unzip ventoy-full + vesktop vlc xclip yt-dlp diff --git a/modules/other/autorandr.nix b/modules/other/autorandr.nix deleted file mode 100644 index f9b4d7c..0000000 --- a/modules/other/autorandr.nix +++ /dev/null @@ -1,370 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.services.autorandr; - hookType = types.lines; - - matrixOf = n: m: elemType: - mkOptionType rec { - name = "matrixOf"; - description = - "${toString n}×${toString m} matrix of ${elemType.description}s"; - check = xss: - let listOfSize = l: xs: isList xs && length xs == l; - in listOfSize n xss - && all (xs: listOfSize m xs && all elemType.check xs) xss; - merge = mergeOneOption; - getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "*" "*" ]); - getSubModules = elemType.getSubModules; - substSubModules = mod: matrixOf n m (elemType.substSubModules mod); - functor = (defaultFunctor name) // { wrapped = elemType; }; - }; - - profileModule = types.submodule { - options = { - fingerprint = mkOption { - type = types.attrsOf types.str; - description = lib.mdDoc '' - Output name to EDID mapping. - Use `autorandr --fingerprint` to get current setup values. - ''; - default = { }; - }; - - config = mkOption { - type = types.attrsOf configModule; - description = lib.mdDoc "Per output profile configuration."; - default = { }; - }; - - hooks = mkOption { - type = hooksModule; - description = lib.mdDoc "Profile hook scripts."; - default = { }; - }; - }; - }; - - configModule = types.submodule { - options = { - enable = mkOption { - type = types.bool; - description = lib.mdDoc "Whether to enable the output."; - default = true; - }; - - crtc = mkOption { - type = types.nullOr types.ints.unsigned; - description = lib.mdDoc "Output video display controller."; - default = null; - example = 0; - }; - - primary = mkOption { - type = types.bool; - description = lib.mdDoc "Whether output should be marked as primary"; - default = false; - }; - - position = mkOption { - type = types.str; - description = lib.mdDoc "Output position"; - default = ""; - example = "5760x0"; - }; - - mode = mkOption { - type = types.str; - description = lib.mdDoc "Output resolution."; - default = ""; - example = "3840x2160"; - }; - - rate = mkOption { - type = types.str; - description = lib.mdDoc "Output framerate."; - default = ""; - example = "60.00"; - }; - - gamma = mkOption { - type = types.str; - description = lib.mdDoc "Output gamma configuration."; - default = ""; - example = "1.0:0.909:0.833"; - }; - - rotate = mkOption { - type = types.nullOr (types.enum [ "normal" "left" "right" "inverted" ]); - description = lib.mdDoc "Output rotate configuration."; - default = null; - example = "left"; - }; - - transform = mkOption { - type = types.nullOr (matrixOf 3 3 types.float); - default = null; - example = literalExpression '' - [ - [ 0.6 0.0 0.0 ] - [ 0.0 0.6 0.0 ] - [ 0.0 0.0 1.0 ] - ] - ''; - description = lib.mdDoc '' - Refer to - {manpage}`xrandr(1)` - for the documentation of the transform matrix. - ''; - }; - - dpi = mkOption { - type = types.nullOr types.ints.positive; - description = lib.mdDoc "Output DPI configuration."; - default = null; - example = 96; - }; - - scale = mkOption { - type = types.nullOr (types.submodule { - options = { - method = mkOption { - type = types.enum [ "factor" "pixel" ]; - description = lib.mdDoc "Output scaling method."; - default = "factor"; - example = "pixel"; - }; - - x = mkOption { - type = types.either types.float types.ints.positive; - description = lib.mdDoc "Horizontal scaling factor/pixels."; - }; - - y = mkOption { - type = types.either types.float types.ints.positive; - description = lib.mdDoc "Vertical scaling factor/pixels."; - }; - }; - }); - description = lib.mdDoc '' - Output scale configuration. - - Either configure by pixels or a scaling factor. When using pixel method the - {manpage}`xrandr(1)` - option - `--scale-from` - will be used; when using factor method the option - `--scale` - will be used. - - This option is a shortcut version of the transform option and they are mutually - exclusive. - ''; - default = null; - example = literalExpression '' - { - x = 1.25; - y = 1.25; - } - ''; - }; - }; - }; - - hooksModule = types.submodule { - options = { - postswitch = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc "Postswitch hook executed after mode switch."; - default = { }; - }; - - preswitch = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc "Preswitch hook executed before mode switch."; - default = { }; - }; - - predetect = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc '' - Predetect hook executed before autorandr attempts to run xrandr. - ''; - default = { }; - }; - }; - }; - - hookToFile = folder: name: hook: - nameValuePair "xdg/autorandr/${folder}/${name}" { - source = "${pkgs.writeShellScriptBin "hook" hook}/bin/hook"; - }; - profileToFiles = name: profile: - with profile; - mkMerge ([ - { - "xdg/autorandr/${name}/setup".text = concatStringsSep "\n" - (mapAttrsToList fingerprintToString fingerprint); - "xdg/autorandr/${name}/config".text = - concatStringsSep "\n" (mapAttrsToList configToString profile.config); - } - (mapAttrs' (hookToFile "${name}/postswitch.d") hooks.postswitch) - (mapAttrs' (hookToFile "${name}/preswitch.d") hooks.preswitch) - (mapAttrs' (hookToFile "${name}/predetect.d") hooks.predetect) - ]); - fingerprintToString = name: edid: "${name} ${edid}"; - configToString = name: config: - if config.enable then - concatStringsSep "\n" ([ "output ${name}" ] - ++ optional (config.position != "") "pos ${config.position}" - ++ optional (config.crtc != null) "crtc ${toString config.crtc}" - ++ optional config.primary "primary" - ++ optional (config.dpi != null) "dpi ${toString config.dpi}" - ++ optional (config.gamma != "") "gamma ${config.gamma}" - ++ optional (config.mode != "") "mode ${config.mode}" - ++ optional (config.rate != "") "rate ${config.rate}" - ++ optional (config.rotate != null) "rotate ${config.rotate}" - ++ optional (config.transform != null) ("transform " - + concatMapStringsSep "," toString (flatten config.transform)) - ++ optional (config.scale != null) - ((if config.scale.method == "factor" then "scale" else "scale-from") - + " ${toString config.scale.x}x${toString config.scale.y}")) - else '' - output ${name} - off - ''; - -in { - - options = { - - services.autorandr = { - enable = mkEnableOption (lib.mdDoc "handling of hotplug and sleep events by autorandr"); - - defaultTarget = mkOption { - default = "default"; - type = types.str; - description = lib.mdDoc '' - Fallback if no monitor layout can be detected. See the docs - (https://github.com/phillipberndt/autorandr/blob/v1.0/README.md#how-to-use) - for further reference. - ''; - }; - - ignoreLid = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Treat outputs as connected even if their lids are closed"; - }; - - matchEdid = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Match displays based on edid instead of name"; - }; - - hooks = mkOption { - type = hooksModule; - description = lib.mdDoc "Global hook scripts"; - default = { }; - example = literalExpression '' - { - postswitch = { - "notify-i3" = "''${pkgs.i3}/bin/i3-msg restart"; - "change-background" = readFile ./change-background.sh; - "change-dpi" = ''' - case "$AUTORANDR_CURRENT_PROFILE" in - default) - DPI=120 - ;; - home) - DPI=192 - ;; - work) - DPI=144 - ;; - *) - echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE" - exit 1 - esac - echo "Xft.dpi: $DPI" | ''${pkgs.xorg.xrdb}/bin/xrdb -merge - '''; - }; - } - ''; - }; - profiles = mkOption { - type = types.attrsOf profileModule; - description = lib.mdDoc "Autorandr profiles specification."; - default = { }; - example = literalExpression '' - { - "work" = { - fingerprint = { - eDP1 = ""; - DP1 = ""; - }; - config = { - eDP1.enable = false; - DP1 = { - enable = true; - crtc = 0; - primary = true; - position = "0x0"; - mode = "3840x2160"; - gamma = "1.0:0.909:0.833"; - rate = "60.00"; - rotate = "left"; - }; - }; - hooks.postswitch = readFile ./work-postswitch.sh; - }; - } - ''; - }; - - }; - - }; - - config = mkIf cfg.enable { - - services.udev.packages = [ pkgs.autorandr ]; - - environment = { - systemPackages = [ pkgs.autorandr ]; - etc = mkMerge ([ - (mapAttrs' (hookToFile "postswitch.d") cfg.hooks.postswitch) - (mapAttrs' (hookToFile "preswitch.d") cfg.hooks.preswitch) - (mapAttrs' (hookToFile "predetect.d") cfg.hooks.predetect) - (mkMerge (mapAttrsToList profileToFiles cfg.profiles)) - ]); - }; - - systemd.services.autorandr = { - wantedBy = [ "sleep.target" ]; - description = "Autorandr execution hook"; - after = [ "sleep.target" ]; - - startLimitIntervalSec = 5; - startLimitBurst = 1; - serviceConfig = { - ExecStart = '' - ${pkgs.autorandr}/bin/autorandr \ - --batch \ - --change \ - --default ${cfg.defaultTarget} \ - ${optionalString cfg.ignoreLid "--ignore-lid"} \ - ${optionalString cfg.matchEdid "--match-edid"} - ''; - Type = "oneshot"; - RemainAfterExit = false; - KillMode = "process"; - }; - }; - - }; - - meta.maintainers = with maintainers; [ alexnortung ]; -} From 6176cbf39d620e853e954add853ebc8b95da968e Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:45:33 +0200 Subject: [PATCH 08/12] removed hyprland --- flake.lock | 390 ++++++++++++++++++++++++++++++++++- hosts/vali/mars/programs.nix | 7 +- 2 files changed, 389 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index bd91b52..1c1e138 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712136515, + "narHash": "sha256-LpjQJYC24S5P5XhJsZX6HqsQT1pohcFzM6N42I6qo/U=", + "owner": "Kirottu", + "repo": "anyrun", + "rev": "be6728884d543665e7bd137bbef62dc1d04a210b", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "anyrun", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -87,6 +108,21 @@ } }, "flake-compat": { + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -103,6 +139,49 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "schizofox", @@ -123,9 +202,9 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_4": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1698882062, @@ -141,6 +220,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": [ @@ -335,6 +432,127 @@ "type": "github" } }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprlock", + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlock": { + "inputs": { + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1712861866, + "narHash": "sha256-7ISUD6Z8FivTw/Db8tGJdiJeqpvJs7CSCwadopb1oro=", + "owner": "hyprwm", + "repo": "hyprlock", + "rev": "6fa65e1172d633e61ed957a49e7cf96010432623", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlock", + "type": "github" + } + }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1712491724, + "narHash": "sha256-E5EcBzf/zaR3hD8g1CDtqqwXXebSWtqOvoaR+LDjTME=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "2737d0204685c3274390229a09eb8f7eaa1a9e89", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1705242886, + "narHash": "sha256-TLj334vRwFtSym3m+NnKcNCnKKPNoTC/TDZL40vmOso=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "6b03a93296faf174b97546fd573c8b379f523a8d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701208414, + "narHash": "sha256-xrQ0FyhwTZK6BwKhahIkUVZhMNk21IEI1nUcWSONtpo=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "93e39cc1a087d65bcf7a132e75a650c44dd2b734", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpak": { "inputs": { "flake-parts": [ @@ -378,6 +596,21 @@ } }, "nixpkgs-lib": { + "locked": { + "lastModified": 1712450863, + "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { "locked": { "dir": "lib", "lastModified": 1698611440, @@ -395,6 +628,27 @@ "type": "github" } }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1712942143, + "narHash": "sha256-pTpvq5EXPD9noOBkmTEa7mkwMpeda8+8u3anmjxhRAI=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "8ed6e0db00db83e5a598afa6cdf32c9b41f083bd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1712791164, @@ -411,6 +665,38 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1703134684, + "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d6863cbcbbb80e71cecfc03356db1cda38919523", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1712791164, + "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1712918680, @@ -429,12 +715,16 @@ "root": { "inputs": { "agenix": "agenix", + "anyrun": "anyrun", "fenix": "fenix", "home-manager": "home-manager_2", "hyprland": "hyprland", + "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", + "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", - "schizofox": "schizofox" + "schizofox": "schizofox", + "split-monitor-workspaces": "split-monitor-workspaces" } }, "rust-analyzer-src": { @@ -456,8 +746,8 @@ }, "schizofox": { "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_3", "home-manager": "home-manager_3", "nixpak": "nixpak", "nixpkgs": [ @@ -482,7 +772,7 @@ "searx-randomizer": { "inputs": { "crane": "crane", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_4", "nixpkgs": [ "schizofox", "nixpkgs" @@ -502,6 +792,27 @@ "type": "github" } }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1712527107, + "narHash": "sha256-stmJqifOWf8oXxKwHvCo3RaVapXSk1n/+Sf9nKNENEA=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "c5696000777f6586aaa255bd0a9b0627d5da911f", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -532,6 +843,73 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702979157, + "narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2961375283668d867e64129c22af532de8e77734", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "wlroots": { "flake": false, "locked": { diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 9f820a9..1f84cdd 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -14,8 +14,10 @@ in { bibata-cursors chromium dig + easyeffects element-desktop - eza ripgrep + eza + ripgrep fastfetch (fenix.complete.withComponents [ "cargo" @@ -39,6 +41,7 @@ in { neofetch neovim networkmanagerapplet + nextcloud-client pamixer pavucontrol pcmanfm @@ -53,7 +56,7 @@ in { smartmontools st steam - strawberry + strawberry-qt6 telegram-desktop texliveFull thunderbird From 7a4fc4cadb62966dea3b4d8ec8b1a66f8275a870 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:58:33 +0200 Subject: [PATCH 09/12] added ssh, removed unnecessary imports in flake.nix --- flake.nix | 11 +---------- hosts/vali/mars/configuration.nix | 1 + modules/services/default.nix | 1 + modules/services/ssh.nix | 16 ++++++++++++++++ options/common/networking.nix | 5 ++++- 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 modules/services/ssh.nix diff --git a/flake.nix b/flake.nix index df11d3f..9e0b0ea 100644 --- a/flake.nix +++ b/flake.nix @@ -36,19 +36,10 @@ url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; - - hyprland = { - url = "github:hyprwm/Hyprland"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs.nixpkgs.follows = "nixpkgs"; - }; split-monitor-workspaces = { url = "github:Duckonaut/split-monitor-workspaces"; - inputs.hyprland.follows = "hyprland"; +# inputs.hyprland.follows = "hyprland"; }; }; } diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index fa98be9..3f0b0c6 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -20,6 +20,7 @@ }; programs = { vesktop.enable = true; + ssh.enable = true; btop.enable = true; mpv.enable = true; i3.enable = true; diff --git a/modules/services/default.nix b/modules/services/default.nix index a17ae8a..433a36b 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,5 +1,6 @@ _: { imports = [ ./pipewire.nix + ./ssh.nix ]; } diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix new file mode 100644 index 0000000..448aeaf --- /dev/null +++ b/modules/services/ssh.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... } +with lib; let + cfg = config.myOptions.programs.ssh; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.ssh.enable = mkEnableOption "ssh"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.ssh = { + startAgent = true; + }; + }; + }; + +} diff --git a/options/common/networking.nix b/options/common/networking.nix index 9023909..b1601cd 100644 --- a/options/common/networking.nix +++ b/options/common/networking.nix @@ -10,7 +10,10 @@ networking = { }; services.resolved = { enable = true; - fallbackDns = ["9.9.9.9"]; + fallbackDns = [ + "9.9.9.9" + "2620::fe::fe" + ]; }; users.users.${username}.extraGroups = [ "networkmanager" ]; } From 95378081a258987a3a4a5ac7ea16c4f562342717 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:59:27 +0200 Subject: [PATCH 10/12] fixed ssh AGAIN --- modules/services/ssh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 448aeaf..64aaf5d 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... } +{ config, lib, pkgs, ... }: with lib; let cfg = config.myOptions.programs.ssh; username = config.myOptions.other.system.username; From 638e474deebbe3eae59e22d1b94b495c60885e20 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 21:01:02 +0200 Subject: [PATCH 11/12] fixed ssh --- flake.lock | 153 +++++++++++++-------------------------- modules/services/ssh.nix | 2 - 2 files changed, 49 insertions(+), 106 deletions(-) diff --git a/flake.lock b/flake.lock index 1c1e138..4eb23a1 100644 --- a/flake.lock +++ b/flake.lock @@ -222,7 +222,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_2" }, "locked": { "lastModified": 1710146030, @@ -330,14 +330,17 @@ "hyprcursor": { "inputs": { "hyprlang": [ + "split-monitor-workspaces", "hyprland", "hyprlang" ], "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -361,19 +364,17 @@ "hyprcursor": "hyprcursor", "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_2", + "nixpkgs": "nixpkgs_5", + "systems": "systems_3", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1712877538, - "narHash": "sha256-FK4Rhq9mEf8wpS3/K/ueB5Sql2XOeCQX/SzCe/QySNk=", + "lastModified": 1712947921, + "narHash": "sha256-tDnNWtr4y22Qoyneg0TKcIncaeZ/5v1V90gPrLIQd3A=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "b1a94302897ae559c877471f7d365651bcd24ad4", + "rev": "dd6fdf49d9deebfe792ab5cd0332432249922fa9", "type": "github" }, "original": { @@ -385,10 +386,12 @@ "hyprland-protocols": { "inputs": { "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -410,10 +413,12 @@ "hyprlang": { "inputs": { "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -432,50 +437,6 @@ "type": "github" } }, - "hyprlang_2": { - "inputs": { - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": "systems_3" - }, - "locked": { - "lastModified": 1711250455, - "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlock": { - "inputs": { - "hyprlang": "hyprlang_2", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_4" - }, - "locked": { - "lastModified": 1712861866, - "narHash": "sha256-7ISUD6Z8FivTw/Db8tGJdiJeqpvJs7CSCwadopb1oro=", - "owner": "hyprwm", - "repo": "hyprlock", - "rev": "6fa65e1172d633e61ed957a49e7cf96010432623", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlock", - "type": "github" - } - }, "lib-aggregate": { "inputs": { "flake-utils": "flake-utils", @@ -697,6 +658,22 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1712918680, @@ -718,8 +695,6 @@ "anyrun": "anyrun", "fenix": "fenix", "home-manager": "home-manager_2", - "hyprland": "hyprland", - "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", @@ -794,9 +769,7 @@ }, "split-monitor-workspaces": { "inputs": { - "hyprland": [ - "hyprland" - ], + "hyprland": "hyprland", "nix-filter": "nix-filter" }, "locked": { @@ -830,16 +803,16 @@ }, "systems_2": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -858,36 +831,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -913,37 +856,39 @@ "wlroots": { "flake": false, "locked": { - "host": "gitlab.freedesktop.org", - "lastModified": 1709983277, - "narHash": "sha256-wXWIJLd4F2JZeMaihWVDW/yYXCLEC8OpeNJZg9a9ly8=", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "lastModified": 1712935342, + "narHash": "sha256-zzIbTFNFd/as42jyGx23fil2uBDYYv+8GA5JmRq5y9c=", + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "type": "github" }, "original": { - "host": "gitlab.freedesktop.org", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "type": "github" } }, "xdph": { "inputs": { "hyprland-protocols": [ + "split-monitor-workspaces", "hyprland", "hyprland-protocols" ], "hyprlang": [ + "split-monitor-workspaces", "hyprland", "hyprlang" ], "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 64aaf5d..621a741 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -6,11 +6,9 @@ in { options.myOptions.programs.ssh.enable = mkEnableOption "ssh"; config = mkIf cfg.enable { - home-manager.users.${username} = { programs.ssh = { startAgent = true; }; - }; }; } From 48f8ac7b1958ec4fe1205a0d7c9e236cb486dfd9 Mon Sep 17 00:00:00 2001 From: Dragyx <66752602+Dragyx@users.noreply.github.com> Date: Fri, 12 Apr 2024 22:03:29 +0200 Subject: [PATCH 12/12] rename myOptions to modules --- flake.lock | 390 +++++++++++++++++- hosts/default.nix | 11 + hosts/dragyx/common/packages.nix | 65 +++ hosts/dragyx/flocke/configuration.nix | 163 ++++++++ hosts/dragyx/flocke/default.nix | 8 + .../dragyx/flocke/hardware-configuration.nix | 35 ++ hosts/dragyx/flocke/packages.nix | 56 +++ hosts/lars/default.nix | 2 +- hosts/lars/dyonisos/configuration.nix | 2 +- hosts/lars/dyonisos/programs.nix | 2 +- hosts/lars/hyprland.nix | 8 +- hosts/lars/kronos/configuration.nix | 2 +- hosts/lars/kronos/programs.nix | 2 +- hosts/lars/programs.nix | 2 +- hosts/vali/mars/awesome.nix | 4 +- hosts/vali/mars/configuration.nix | 2 +- hosts/vali/mars/hypr/land.nix | 8 +- hosts/vali/mars/hypr/lock.nix | 6 +- hosts/vali/mars/i3.nix | 4 +- hosts/vali/mars/programs.nix | 2 +- modules/cli/git.nix | 6 +- modules/cli/starship.nix | 8 +- modules/cli/zsh.nix | 10 +- modules/gui/WM/default.nix | 5 + modules/gui/WM/hyprland.nix | 185 +++++++++ modules/gui/cursor.nix | 6 +- modules/gui/default.nix | 1 + modules/gui/foot.nix | 6 +- modules/gui/gtk.nix | 6 +- modules/gui/mpv.nix | 6 +- modules/gui/obs.nix | 6 +- modules/gui/qt.nix | 6 +- modules/gui/schizofox.nix | 6 +- modules/gui/vesktop.nix | 6 +- modules/gui/vivado2.nix | 6 +- modules/gui/zathura.nix | 6 +- modules/other/displaymanager.nix | 4 +- modules/other/home-manager.nix | 6 +- modules/other/system.nix | 4 +- modules/other/xdg.nix | 4 +- modules/services/pipewire.nix | 4 +- modules/tui/btop.nix | 6 +- modules/tui/neovim.nix | 6 +- options/common/networking.nix | 2 +- options/desktop/monitors.nix | 69 ++++ 45 files changed, 1065 insertions(+), 89 deletions(-) create mode 100644 hosts/dragyx/common/packages.nix create mode 100644 hosts/dragyx/flocke/configuration.nix create mode 100644 hosts/dragyx/flocke/default.nix create mode 100644 hosts/dragyx/flocke/hardware-configuration.nix create mode 100644 hosts/dragyx/flocke/packages.nix create mode 100644 modules/gui/WM/default.nix create mode 100644 modules/gui/WM/hyprland.nix create mode 100644 options/desktop/monitors.nix diff --git a/flake.lock b/flake.lock index bd91b52..1c1e138 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712136515, + "narHash": "sha256-LpjQJYC24S5P5XhJsZX6HqsQT1pohcFzM6N42I6qo/U=", + "owner": "Kirottu", + "repo": "anyrun", + "rev": "be6728884d543665e7bd137bbef62dc1d04a210b", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "anyrun", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -87,6 +108,21 @@ } }, "flake-compat": { + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -103,6 +139,49 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "schizofox", @@ -123,9 +202,9 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_4": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1698882062, @@ -141,6 +220,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": [ @@ -335,6 +432,127 @@ "type": "github" } }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprlock", + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlock": { + "inputs": { + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1712861866, + "narHash": "sha256-7ISUD6Z8FivTw/Db8tGJdiJeqpvJs7CSCwadopb1oro=", + "owner": "hyprwm", + "repo": "hyprlock", + "rev": "6fa65e1172d633e61ed957a49e7cf96010432623", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlock", + "type": "github" + } + }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1712491724, + "narHash": "sha256-E5EcBzf/zaR3hD8g1CDtqqwXXebSWtqOvoaR+LDjTME=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "2737d0204685c3274390229a09eb8f7eaa1a9e89", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1705242886, + "narHash": "sha256-TLj334vRwFtSym3m+NnKcNCnKKPNoTC/TDZL40vmOso=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "6b03a93296faf174b97546fd573c8b379f523a8d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701208414, + "narHash": "sha256-xrQ0FyhwTZK6BwKhahIkUVZhMNk21IEI1nUcWSONtpo=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "93e39cc1a087d65bcf7a132e75a650c44dd2b734", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpak": { "inputs": { "flake-parts": [ @@ -378,6 +596,21 @@ } }, "nixpkgs-lib": { + "locked": { + "lastModified": 1712450863, + "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { "locked": { "dir": "lib", "lastModified": 1698611440, @@ -395,6 +628,27 @@ "type": "github" } }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1712942143, + "narHash": "sha256-pTpvq5EXPD9noOBkmTEa7mkwMpeda8+8u3anmjxhRAI=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "8ed6e0db00db83e5a598afa6cdf32c9b41f083bd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1712791164, @@ -411,6 +665,38 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1703134684, + "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d6863cbcbbb80e71cecfc03356db1cda38919523", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1712791164, + "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1712918680, @@ -429,12 +715,16 @@ "root": { "inputs": { "agenix": "agenix", + "anyrun": "anyrun", "fenix": "fenix", "home-manager": "home-manager_2", "hyprland": "hyprland", + "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", + "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", - "schizofox": "schizofox" + "schizofox": "schizofox", + "split-monitor-workspaces": "split-monitor-workspaces" } }, "rust-analyzer-src": { @@ -456,8 +746,8 @@ }, "schizofox": { "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_3", "home-manager": "home-manager_3", "nixpak": "nixpak", "nixpkgs": [ @@ -482,7 +772,7 @@ "searx-randomizer": { "inputs": { "crane": "crane", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_4", "nixpkgs": [ "schizofox", "nixpkgs" @@ -502,6 +792,27 @@ "type": "github" } }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1712527107, + "narHash": "sha256-stmJqifOWf8oXxKwHvCo3RaVapXSk1n/+Sf9nKNENEA=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "c5696000777f6586aaa255bd0a9b0627d5da911f", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -532,6 +843,73 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702979157, + "narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2961375283668d867e64129c22af532de8e77734", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "wlroots": { "flake": false, "locked": { diff --git a/hosts/default.nix b/hosts/default.nix index 79af885..bc46ddb 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -37,4 +37,15 @@ in { inputs.agenix.nixosModules.default ]; }; + + flocke = lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit lib inputs self; }; + modules = [ + ./dragyx/flocke + ../modules + inputs.home-manager.nixosModules.home-manager + inputs.agenix.nixosModules.default + ]; + }; } diff --git a/hosts/dragyx/common/packages.nix b/hosts/dragyx/common/packages.nix new file mode 100644 index 0000000..6289173 --- /dev/null +++ b/hosts/dragyx/common/packages.nix @@ -0,0 +1,65 @@ +# which default packages to use for the system +{ inputs, outputs, profile-config, pkgs, ...}: + +let + python-packages = ps: with ps; [ + pandas + numpy + opencv4 + ipython + ]; +in +{ + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + (python3.withPackages python-packages) + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + neovim + eza # exa is unmaintained + hwinfo + zsh + git + broot + unzip + rsync + # neofetch + # fastfetch has the option to set a timeout for + # for each module, which makes it dramatically faster + # as counting the number of packages takes over 800 (!!!) ms, + # which makes it very unpleasant to use as default thing + # to display when starting a terminal + fastfetch + alacritty + wget + gnumake + zoxide + python3 + nodejs + gcc + cargo + rustc + rust-analyzer + clippy + lsof + htop + okular + smartmontools + networkmanager + pkg-config + sof-firmware # audio + nix-index + # --------- optional + gnome.eog + sherlock + xfce.thunar + + plocate + alsa-utils + + # partition management + parted + gnufdisk + lapce + ]; +} diff --git a/hosts/dragyx/flocke/configuration.nix b/hosts/dragyx/flocke/configuration.nix new file mode 100644 index 0000000..8e4f41d --- /dev/null +++ b/hosts/dragyx/flocke/configuration.nix @@ -0,0 +1,163 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../../../options/common/pin-registry.nix + ../../../options/common/preserve-system.nix + ../../../options/desktop/fonts.nix + ]; + + + nixpkgs.config.allowUnfree = true; + time.timeZone = "Europe/Zurich"; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; + + services.xserver = { + enable = true; + displayManager = { + sessionPackages = [ pkgs.hyprland ]; # pkgs.gnome.gnome-session.sessions ]; + defaultSession = "hyprland"; + sddm = { + enable = true; + }; + }; + windowManager.hypr.enable = true; + }; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + hardware.opengl.driSupport = true; + hardware.opengl.driSupport32Bit = true; + hardware.opengl.enable = true; + + services.logrotate.checkConfig = false; + + networking.hostName = "flocke"; # Define your hostname. + networking.hostId = "adf23c31"; + networking.interfaces.wlp1s0.useDHCP = true; + networking.networkmanager.enable = true; + environment.systemPackages = with pkgs; [ networkmanager ]; # cli tool for managing connections + + boot = { + kernelParams = [ ]; + initrd.supportedFilesystems = [ "ext4" ]; + supportedFilesystems = [ "ext4" ]; + loader = { + efi.efiSysMountPoint = "/boot"; + efi.canTouchEfiVariables = true; + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + enableCryptodisk = true; + }; + }; + initrd.luks.devices = { + cryptroot = { + device = "/dev/disk/by-uuid/ec5ff3a1-9b39-4ba5-aa0f-19e898b4f6e8"; + preLVM = true; + }; + }; + }; + + # see https://nixos.wiki/wiki/AMD_GPU + services.xserver.videoDrivers = [ "amdgpu" ]; + systemd.tmpfiles.rules = [ + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + ]; + hardware.opengl.extraPackages = with pkgs; [ + rocmPackages.clr.icd + ]; + + services.power-profiles-daemon.enable = false; + + # stock nixos power management + powerManagement.enable = true; + + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 20; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 85; # 80 and above it stops charging + + }; +}; + + swapDevices = [ { + device = "/var/lib/swapfile"; + size = 32*1024; + } ]; + + + # be nice to your ssds + services.fstrim.enable = true; + # services.xserver.enable = pkgs.lib.mkForce false; + + security.polkit.enable = true; + + modules = { + other = { + system = { + hostname = "flocke"; + username = "dragyx"; + monitors = { + name = "LaptopMain"; + resolution = { + x = 2256; + y = 1504; + }; + scale = 1.0; + refresh_rate = 60; + }; + }; + home-manager = { + enable = true; + enableDirenv = true; + }; + }; + programs = { + vesktop.enable = true; + btop.enable = true; + mpv.enable = true; + schizofox.enable = true; + obs.enable = true; + neovim.enable = true; + git = { + enable = true; + userName = "Dragyx"; + userEmail = "66752602+Dragyx@users.noreply.github.com"; + defaultBranch = "main"; + }; + starship.enable = true; + zsh = { + enable = true; + profiling = false; + }; + # badneovim.enable = true; + }; + services = { + pipewire.enable = true; + }; + WM.hyprland.enable = true; + }; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? +} diff --git a/hosts/dragyx/flocke/default.nix b/hosts/dragyx/flocke/default.nix new file mode 100644 index 0000000..8401175 --- /dev/null +++ b/hosts/dragyx/flocke/default.nix @@ -0,0 +1,8 @@ +_: { + imports = [ + ../../../options/desktop/monitors.nix + ./configuration.nix + ./hardware-configuration.nix + # ./packages.nix + ]; +} diff --git a/hosts/dragyx/flocke/hardware-configuration.nix b/hosts/dragyx/flocke/hardware-configuration.nix new file mode 100644 index 0000000..f4e236c --- /dev/null +++ b/hosts/dragyx/flocke/hardware-configuration.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2aaba0f2-e8dc-4583-a81e-2d35cc238e79"; + fsType = "ext4"; + }; + + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9D34-36F8"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/dragyx/flocke/packages.nix b/hosts/dragyx/flocke/packages.nix new file mode 100644 index 0000000..a4a4afe --- /dev/null +++ b/hosts/dragyx/flocke/packages.nix @@ -0,0 +1,56 @@ +# which default packages to use for the system +{ inputs, outputs, profile-config, pkgs, ...}: + +let + python-packages = ps: with ps; [ + pandas + numpy + opencv4 + ipython + ]; +in +{ + + imports = [ + ../common/packages.nix + ]; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + + # security audits + lynis + element-desktop + jetbrains.idea-community + baobab + amdvlk + texlive.combined.scheme-full + android-tools + signal-desktop + nextcloud-client + etcher + vlc + audacity + thunderbird + eclipses.eclipse-java + openjdk + firefox + # pkgs.nordvpn # nur.repos.LuisChDev.nordvpn + material-icons + material-design-icons + libreoffice + gimp + spotify + okular + # minecraft + prismlauncher-unwrapped + glfw-wayland-minecraft + glxinfo + # window manager + flameshot + feh + # Animeeeeee! + ani-cli # The stable version is very outdated + ]; + +} diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index 4d9dc8f..da685ac 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -5,7 +5,7 @@ security.sudo.package = pkgs.sudo.override { withInsults = true; }; security.polkit.enable = true; programs.kdeconnect.enable = true; - myOptions = { + modules = { other = { system = { gitPath = "/home/lars/nichts"; diff --git a/hosts/lars/dyonisos/configuration.nix b/hosts/lars/dyonisos/configuration.nix index 1bc5392..95cb45a 100644 --- a/hosts/lars/dyonisos/configuration.nix +++ b/hosts/lars/dyonisos/configuration.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: { - myOptions = { + modules = { other = { system = { hostname = "dyonisos"; diff --git a/hosts/lars/dyonisos/programs.nix b/hosts/lars/dyonisos/programs.nix index 89e5314..631e805 100644 --- a/hosts/lars/dyonisos/programs.nix +++ b/hosts/lars/dyonisos/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 1404c6d..0c1f219 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -1,10 +1,10 @@ { config, lib, inputs, pkgs, ... }: with lib; let - username = config.myOptions.other.system.username; - cfg = config.myOptions.hyprland; + username = config.modules.other.system.username; + cfg = config.modules.hyprland; in { - options.myOptions.hyprland.nvidia.enable = mkEnableOption "nvidia"; - options.myOptions.hyprland = { + options.modules.hyprland.nvidia.enable = mkEnableOption "nvidia"; + options.modules.hyprland = { enable = mkEnableOption "hyprland"; monitor = mkOption { description = "hyprland monitor config"; diff --git a/hosts/lars/kronos/configuration.nix b/hosts/lars/kronos/configuration.nix index 3cc0d21..0189d05 100644 --- a/hosts/lars/kronos/configuration.nix +++ b/hosts/lars/kronos/configuration.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: { - myOptions = { + modules = { other = { system = { hostname = "kronos"; diff --git a/hosts/lars/kronos/programs.nix b/hosts/lars/kronos/programs.nix index 89e5314..631e805 100644 --- a/hosts/lars/kronos/programs.nix +++ b/hosts/lars/kronos/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/hosts/lars/programs.nix b/hosts/lars/programs.nix index 46cac30..52a1141 100644 --- a/hosts/lars/programs.nix +++ b/hosts/lars/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/hosts/vali/mars/awesome.nix b/hosts/vali/mars/awesome.nix index fdf180c..ad418a0 100644 --- a/hosts/vali/mars/awesome.nix +++ b/hosts/vali/mars/awesome.nix @@ -1,8 +1,8 @@ { pkgs, lib, config, ... }: with lib; let - cfg = config.myOptions.programs.awesome; + cfg = config.modules.programs.awesome; in { - options.myOptions.programs.awesome.enable = mkEnableOption "awesome"; + options.modules.programs.awesome.enable = mkEnableOption "awesome"; config = mkIf cfg.enable { services.xserver = { diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index fa98be9..9ee06dd 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -6,7 +6,7 @@ security.sudo.package = pkgs.sudo.override { withInsults = true; }; security.polkit.enable = true; programs.kdeconnect.enable = true; - myOptions = { + modules = { other = { system = { hostname = "mars"; diff --git a/hosts/vali/mars/hypr/land.nix b/hosts/vali/mars/hypr/land.nix index 475d78c..9816796 100644 --- a/hosts/vali/mars/hypr/land.nix +++ b/hosts/vali/mars/hypr/land.nix @@ -2,8 +2,8 @@ with lib; let - cfg = config.myOptions.programs.hypr.land; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.hypr.land; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; smwPresent = elem inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces cfg.extraPlugins; @@ -13,7 +13,7 @@ with lib; let inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; inherit (inputs.hyprlock.packages.${pkgs.system}) hyprlock; in { - options.myOptions.programs.hypr.land = { + options.modules.programs.hypr.land = { enable = mkEnableOption "huperland"; startupSound = mkOption { type = with types; nullOr path; @@ -359,7 +359,7 @@ in { "[workspace special:rog silent;tile] ${config.services.asusd.package}/bin/rog-control-center") "[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc" - (if config.myOptions.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";") + (if config.modules.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";") "${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24" diff --git a/hosts/vali/mars/hypr/lock.nix b/hosts/vali/mars/hypr/lock.nix index d622ef8..25c65ca 100644 --- a/hosts/vali/mars/hypr/lock.nix +++ b/hosts/vali/mars/hypr/lock.nix @@ -5,12 +5,12 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.hypr.lock; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.hypr.lock; + username = config.modules.other.system.username; text_color = "rgba(eae0e4FF)"; in { - options.myOptions.programs.hypr.lock = { + options.modules.programs.hypr.lock = { enable = mkEnableOption "hiper zamek"; extraSettings = mkOption { type = types.attrs; diff --git a/hosts/vali/mars/i3.nix b/hosts/vali/mars/i3.nix index 6da1180..9d10566 100644 --- a/hosts/vali/mars/i3.nix +++ b/hosts/vali/mars/i3.nix @@ -1,8 +1,8 @@ { pkgs, lib, config, callPackage, ... }: with lib; let - cfg = config.myOptions.programs.i3; + cfg = config.modules.programs.i3; in { - options.myOptions.programs.i3.enable = mkEnableOption "i3"; + options.modules.programs.i3.enable = mkEnableOption "i3"; config = mkIf cfg.enable { services.xserver = { diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 44dfaab..1dd2e71 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/modules/cli/git.nix b/modules/cli/git.nix index f9d4429..6d65c2c 100644 --- a/modules/cli/git.nix +++ b/modules/cli/git.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.git; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.git; + username = config.modules.other.system.username; in { - options.myOptions.programs.git = { + options.modules.programs.git = { enable = mkEnableOption "git"; userName = mkOption { type = types.str; diff --git a/modules/cli/starship.nix b/modules/cli/starship.nix index 09ae8af..60acfdc 100644 --- a/modules/cli/starship.nix +++ b/modules/cli/starship.nix @@ -3,16 +3,16 @@ lib, ... }: with lib; let - cfg = config.myOptions.programs.starship; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.starship; + username = config.modules.other.system.username; in { - options.myOptions.programs.starship.enable = mkEnableOption "starship"; + options.modules.programs.starship.enable = mkEnableOption "starship"; config = mkIf cfg.enable { home-manager.users.${username} = { programs.starship = { enable = true; - enableZshIntegration = config.myOptions.programs.zsh.enable; + enableZshIntegration = config.modules.programs.zsh.enable; settings = { add_newline = false; command_timeout = 1000; diff --git a/modules/cli/zsh.nix b/modules/cli/zsh.nix index 93f0910..cb02c19 100644 --- a/modules/cli/zsh.nix +++ b/modules/cli/zsh.nix @@ -1,11 +1,11 @@ { config, lib, pkgs, ... }: with lib; let - cfg = config.myOptions.programs.zsh; - username = config.myOptions.other.system.username; - hostname = config.myOptions.other.system.hostname; - gitPath = config.myOptions.other.system.gitPath; + cfg = config.modules.programs.zsh; + username = config.modules.other.system.username; + hostname = config.modules.other.system.hostname; + gitPath = config.modules.other.system.gitPath; in { - options.myOptions.programs.zsh = { + options.modules.programs.zsh = { enable = mkEnableOption "zsh"; extraAliases = mkOption { type = types.attrs; diff --git a/modules/gui/WM/default.nix b/modules/gui/WM/default.nix new file mode 100644 index 0000000..90f980b --- /dev/null +++ b/modules/gui/WM/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./hyprland.nix + ]; +} diff --git a/modules/gui/WM/hyprland.nix b/modules/gui/WM/hyprland.nix new file mode 100644 index 0000000..c65b784 --- /dev/null +++ b/modules/gui/WM/hyprland.nix @@ -0,0 +1,185 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.WM.hyprland; + username = config.modules.other.system.username; + monitors = config.modules.other.system.monitors; +in +{ + options.modules.WM.hyprland = { + enable = mkEnableOption "hyprland"; + gnome-keyring = mkEnableOption "gnome-keyring"; + }; + + + config = mkIf cfg.enable { + programs.xwayland.enable = true; + /* + programs.hyprland = { + enable = true; + xwayland = true; + }; + */ + services.gnome.gnome-keyring.enable = mkDefault cfg.gnome-keyring; + systemd.user.services.polkit-gnome-authentication-agent-1 = mkIf cfg.gnome-keyring { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + home-manager.users.${username} = { + home.packages = with pkgs; [ + rofi + waybar + hyprpaper + hyprlock + hyprland + hyprshade + lxqt.lxqt-openssh-askpass + + dunst + # wireplumber + unstable.xwayland + pciutils # lspci is needed by hyprland + # from some obscure tutorial on youtube + # xorg.libxcb + # mesa + libglvnd + egl-wayland + libdrm + vulkan-tools + dunst + swww + flameshot + bluetuith + brightnessctl + # needed for wayland copy / paste support in neovim + wl-clipboard + ]; + + programs.hyprland = { + enable = true; + settings = { + exec-once = mkIf cfg.gnome-keyring "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + monitor = map ( + m: "${m.device},${m.resolution.x}x${m.resolution.y}@${m.refresh_rate},${m.position.x}x${m.position.y},${m.scale},transform,${m.transform}" + ) monitors; #TODO: default value + input = { + kb_layout = console.keyMap; + natural_scroll = true; + sensitivity = 0; + }; + general = { + gaps_in = 2; + gaps_out = 1; + border_size = 1; + col.active_border = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + col.inactive_border = "rgba(595959aa)"; + layout = dwindle; + }; + decoration.rounding = 5; + misc.disable_hyprland_logo = true; + animations = { + enabled = true; + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = ["myBezier, 0.05, 0.9, 0.1, 1.05"]; + + animation = [ + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + "windows, 1, 7, myBezier" + ]; + }; + gestures.workspace_swipe = true; + debug.enable_stdout_logs = true; + bind = [ + + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "SUPER, RETURN, exec, alacritty" + "SUPER SHIFT, RETURN, exec, rofi -show drun" + "SUPER SHIFT, Q, killactive," + "SUPER, M, exit, " + "SUPER, B, exec, firefox" + "SUPER, f, fullscreen" + "SUPER, E, exec, nautilus --new-window " + "SUPER, V, togglefloating, " + "SUPER, P, pseudo, # dwindle" + "SUPER, S, togglesplit, # dwindle" + "SUPER, C, exec, /home/vali/.config/wallpaper/colorscheme-setter" + ",PRINT, exec, flameshot" + + "binde = ,XF86MonBrightnessUp, exec, brightnessctl set 10%+" + "binde = ,XF86MonBrightnessDown, exec, brightnessctl set 10%-" + + # Example volume button that allows press and hold, volume limited to 150%" + "binde = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + # Example volume button that will activate even while an input inhibitor is active" + "binde = ,XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86AudioMute, exec, $ wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + + # Move focus with mainMod + arrow keys" + "SUPER, h, movefocus, l" + "SUPER, l, movefocus, r" + "SUPER, k, movefocus, u" + "SUPER, j, movefocus, d" + + # move window to next / previous workspace" + "SUPER CTRL, h, movetoworkspace, -1" + "SUPER CTRL, l, movetoworkspace, +1" + + # move to next / previous workspace" + "SUPER CTRL, h, workspace, -1" + "SUPER CTRL, l, workspace, +1" + + + # Switch workspaces with mainMod + [0-9]" + "SUPER, 1, workspace, 1" + "SUPER, 2, workspace, 2" + "SUPER, 3, workspace, 3" + "SUPER, 4, workspace, 4" + "SUPER, 5, workspace, 5" + "SUPER, 6, workspace, 6" + "SUPER, 7, workspace, 7" + "SUPER, 8, workspace, 8" + "SUPER, 9, workspace, 9" + "SUPER, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9]" + "SUPER SHIFT, 1, movetoworkspace, 1" + "SUPER SHIFT, 2, movetoworkspace, 2" + "SUPER SHIFT, 3, movetoworkspace, 3" + "SUPER SHIFT, 4, movetoworkspace, 4" + "SUPER SHIFT, 5, movetoworkspace, 5" + "SUPER SHIFT, 6, movetoworkspace, 6" + "SUPER SHIFT, 7, movetoworkspace, 7" + "SUPER SHIFT, 8, movetoworkspace, 8" + "SUPER SHIFT, 9, movetoworkspace, 9" + "SUPER SHIFT, 0, movetoworkspace, 10" + + # Scroll through existing workspaces with mainMod + scroll" + "SUPER, mouse_down, workspace, e+1" + "SUPER, mouse_up, workspace, e-1" + " + # Move/resize windows with mainMod + LMB/RMB and dragging" + #bindm = SUPER, mouse:272, movewindow" + #bindm = SUPER, mouse:273, resizewindow" + ]; + }; + }; + }; + }; +} diff --git a/modules/gui/cursor.nix b/modules/gui/cursor.nix index 6b3a454..1f39448 100644 --- a/modules/gui/cursor.nix +++ b/modules/gui/cursor.nix @@ -3,10 +3,10 @@ lib, ... }: with lib; let - cfg = config.myOptions.themes.cursor; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.cursor; + username = config.modules.other.system.username; in { - options.myOptions.themes.cursor = { + options.modules.themes.cursor = { enable = mkEnableOption "cursor theming"; package = mkOption { description = "cursor theme package"; diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 0821731..d4cd205 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -10,5 +10,6 @@ _: { ./obs.nix ./foot.nix # ./vivado.nix + ./WM ]; } diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix index d94b898..6d72aab 100644 --- a/modules/gui/foot.nix +++ b/modules/gui/foot.nix @@ -5,10 +5,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.foot; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.foot; + username = config.modules.other.system.username; in { - options.myOptions.programs.foot = { + options.modules.programs.foot = { enable = mkEnableOption "foot"; server = mkEnableOption "foot server mode"; }; diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix index df5b0db..a8f9a7e 100644 --- a/modules/gui/gtk.nix +++ b/modules/gui/gtk.nix @@ -3,11 +3,11 @@ lib, ... }: with lib; let - cfg = config.myOptions.themes.gtk; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.gtk; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; in { - options.myOptions.themes.gtk = { + options.modules.themes.gtk = { enable = mkEnableOption "gtk theming"; name = mkOption { description = "gtk theme name"; diff --git a/modules/gui/mpv.nix b/modules/gui/mpv.nix index 0e3ba5d..cbe606e 100644 --- a/modules/gui/mpv.nix +++ b/modules/gui/mpv.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.mpv; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.mpv; + username = config.modules.other.system.username; in { - options.myOptions.programs.mpv.enable = mkEnableOption "mpv"; + options.modules.programs.mpv.enable = mkEnableOption "mpv"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/obs.nix b/modules/gui/obs.nix index d5c7bcf..f979cfb 100644 --- a/modules/gui/obs.nix +++ b/modules/gui/obs.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, ... }: with lib; let - cfg = config.myOptions.programs.obs; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.obs; + username = config.modules.other.system.username; in { - options.myOptions.programs.obs.enable = mkEnableOption "obs"; + options.modules.programs.obs.enable = mkEnableOption "obs"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/qt.nix b/modules/gui/qt.nix index a448f55..eac9ef2 100644 --- a/modules/gui/qt.nix +++ b/modules/gui/qt.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.themes.qt; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.qt; + username = config.modules.other.system.username; in { - options.myOptions.themes.qt = { + options.modules.themes.qt = { enable = mkEnableOption "qt theming"; name = mkOption { description = "qt theme name"; diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix index 561d668..9727041 100644 --- a/modules/gui/schizofox.nix +++ b/modules/gui/schizofox.nix @@ -1,9 +1,9 @@ { config, inputs, lib, ... }: with lib; let - cfg = config.myOptions.programs.schizofox; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.schizofox; + username = config.modules.other.system.username; in { - options.myOptions.programs.schizofox = { + options.modules.programs.schizofox = { enable = mkEnableOption "schizofox"; }; diff --git a/modules/gui/vesktop.nix b/modules/gui/vesktop.nix index ab8eb18..044ec77 100644 --- a/modules/gui/vesktop.nix +++ b/modules/gui/vesktop.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.vesktop; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.vesktop; + username = config.modules.other.system.username; in { - options.myOptions.programs.vesktop = { + options.modules.programs.vesktop = { enable = mkEnableOption "vesktop"; }; diff --git a/modules/gui/vivado2.nix b/modules/gui/vivado2.nix index c73846f..0e5417e 100644 --- a/modules/gui/vivado2.nix +++ b/modules/gui/vivado2.nix @@ -6,11 +6,11 @@ let desktopName = "Vivado"; exec = "${pkgs.nur.repos.lschuermann.vivado-2022_2}/bin/vivado"; }; - cfg = with lib; [ config.myOptions.programs.vivado ]; - username = with lib; [ config.myOptions.other.system.username ]; + cfg = with lib; [ config.modules.programs.vivado ]; + username = with lib; [ config.modules.other.system.username ]; in { - options.myOptions.programs.vivado.enable = mkEnableOption "vivado"; + options.modules.programs.vivado.enable = mkEnableOption "vivado"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/zathura.nix b/modules/gui/zathura.nix index 74082fb..26c67aa 100644 --- a/modules/gui/zathura.nix +++ b/modules/gui/zathura.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.zathura; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.zathura; + username = config.modules.other.system.username; in { - options.myOptions.programs.zathura.enable = mkEnableOption "zathura"; + options.modules.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/other/displaymanager.nix b/modules/other/displaymanager.nix index a3caa8e..02f3ffe 100644 --- a/modules/other/displaymanager.nix +++ b/modules/other/displaymanager.nix @@ -1,8 +1,8 @@ {pkgs, lib, config, ...}: with lib; let - cfg = config.myOptions.programs.displaymanager; + cfg = config.modules.programs.displaymanager; in { - options.myOptions.programs.displaymanager.enable = mkEnableOption "displaymanager"; + options.modules.programs.displaymanager.enable = mkEnableOption "displaymanager"; config = mkIf cfg.enable { services.xserver.displayManager = { diff --git a/modules/other/home-manager.nix b/modules/other/home-manager.nix index 78f2cdb..ef5de08 100644 --- a/modules/other/home-manager.nix +++ b/modules/other/home-manager.nix @@ -5,10 +5,10 @@ self, ... }: with lib; let - cfg = config.myOptions.other.home-manager; - username = config.myOptions.other.system.username; + cfg = config.modules.other.home-manager; + username = config.modules.other.system.username; in { - options.myOptions.other.home-manager = { + options.modules.other.home-manager = { enable = mkEnableOption "home-manager"; enableDirenv = mkEnableOption "direnv"; }; diff --git a/modules/other/system.nix b/modules/other/system.nix index e4d1328..ab21d91 100644 --- a/modules/other/system.nix +++ b/modules/other/system.nix @@ -3,9 +3,9 @@ lib, ... }: with lib; let - cfg = config.myOptions.other.system; + cfg = config.modules.other.system; in { - options.myOptions.other.system = { + options.modules.other.system = { hostname = mkOption { description = "hostname for this system"; type = types.str; diff --git a/modules/other/xdg.nix b/modules/other/xdg.nix index c20b7b4..ac53692 100644 --- a/modules/other/xdg.nix +++ b/modules/other/xdg.nix @@ -2,7 +2,7 @@ config, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; primary_browser = "firefox-schizo.desktop"; @@ -31,7 +31,7 @@ in { XAUTHORITY = "\$XDG_RUNTIME_DIR/Xauthority"; }; */ - myOptions.programs.zsh.extraAliases = { + modules.programs.zsh.extraAliases = { gdb = "gdb -n -x ${hmCfg.xdg.configHome}/gdb/init"; pidgin = "pidgin --config=${hmCfg.xdg.dataHome}/purple"; svn = "svn --config-dir ${hmCfg.xdg.configHome}/subversion"; diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix index c3845c7..3de50d7 100644 --- a/modules/services/pipewire.nix +++ b/modules/services/pipewire.nix @@ -1,8 +1,8 @@ { config, lib, ... }: with lib; let - cfg = config.myOptions.services.pipewire; + cfg = config.modules.services.pipewire; in { - options.myOptions.services.pipewire.enable = mkEnableOption "pipewire"; + options.modules.services.pipewire.enable = mkEnableOption "pipewire"; config = mkIf cfg.enable { hardware.pulseaudio.enable = false; diff --git a/modules/tui/btop.nix b/modules/tui/btop.nix index 332d0f7..105b008 100644 --- a/modules/tui/btop.nix +++ b/modules/tui/btop.nix @@ -1,9 +1,9 @@ { config, lib, ... }: with lib; let - cfg = config.myOptions.programs.btop; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.btop; + username = config.modules.other.system.username; in { - options.myOptions.programs.btop.enable = mkEnableOption "btop"; + options.modules.programs.btop.enable = mkEnableOption "btop"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/tui/neovim.nix b/modules/tui/neovim.nix index d3b81fe..b19c255 100644 --- a/modules/tui/neovim.nix +++ b/modules/tui/neovim.nix @@ -5,10 +5,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.neovim; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.neovim; + username = config.modules.other.system.username; in { - options.myOptions.programs.neovim.enable = mkEnableOption "neovim"; + options.modules.programs.neovim.enable = mkEnableOption "neovim"; config = mkIf cfg.enable { nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay ]; diff --git a/options/common/networking.nix b/options/common/networking.nix index 9023909..bb6c715 100644 --- a/options/common/networking.nix +++ b/options/common/networking.nix @@ -1,6 +1,6 @@ { config, lib, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { networking = { networkmanager = { diff --git a/options/desktop/monitors.nix b/options/desktop/monitors.nix new file mode 100644 index 0000000..a9036e7 --- /dev/null +++ b/options/desktop/monitors.nix @@ -0,0 +1,69 @@ +{ config, lib, ... }: + +with lib; +{ + options.modules.other.system.monitors = mkOption { + description = " + List of monitors to use + "; + default = []; + type = with types; listOf submodule { + name = mkOption { + type = types.str; + description = "Give your monitor a cute name"; + default = "monitor0(I am lazy)"; + }; + device = mkOption { + type = types.str; + description = "The actual device name of the monitor"; + }; + resolution = mkOption { + type = types.submodule { + width = mkOption { + type = types.int; + description = "monitor width"; + default = "1920"; + }; + height = mkOption { + type = types.int; + description = "monitor height"; + default = "1080"; + }; + }; + }; + scale = mkOption { + type = types.number; + description = "monitor scale"; + default = 1.0; + }; + refresh_rate = mkOption { + type = types.int; + description = "monitor refresh rate (in Hz)"; + default = 60; + }; + position = mkOption { + type = types.submodule { + x = mkOption { + type = types.int; + default = 0; + }; + y = mkOption { + type = types.int; + default = 0; + }; + }; + description = "absolute monitor posititon"; + default = { + x = 0; + y = 0; + }; + }; + transform = mkOption { + type = types.ints.between 0 3; + description = "Rotation of the monitor counterclockwise"; + default = 0; + }; + }; + }; + +}