diff --git a/flake.lock b/flake.lock index c742a65..2280d9b 100644 --- a/flake.lock +++ b/flake.lock @@ -54,7 +54,7 @@ }, "locked": { "lastModified": 1680949081, - "narHash": "sha256-Z2OM36Ue6DsNNPnzg7znorZoXNVRwCVvjbbmhQosSxA=", + "narHash": "sha256-9dwAlNJ+owWvgcbhFeoJGX6/0jr+FY6m/wiziVVIu2c=", "type": "git", "url": "file:///home/ccr/.config/emacs" }, diff --git a/hmModules/email/default.nix b/hmModules/email/default.nix index f21deef..c9169c7 100644 --- a/hmModules/email/default.nix +++ b/hmModules/email/default.nix @@ -14,7 +14,8 @@ }; services = { mbsync = { - enable = true; + enable = false; + # FIXME this requires `pass` every 5 minutes that run `pinentry` frequency = "*:0/15"; preExec = "${pkgs.isync}/bin/mbsync -Ha"; # First time run: mu init --maildir ~/.mail --my-address andrea.ciceri@autistici.org diff --git a/hmModules/sway/gammastep.nix b/hmModules/gammastep/default.nix similarity index 100% rename from hmModules/sway/gammastep.nix rename to hmModules/gammastep/default.nix diff --git a/hmModules/gpg/default.nix b/hmModules/gpg/default.nix index c4a6429..6e52e10 100644 --- a/hmModules/gpg/default.nix +++ b/hmModules/gpg/default.nix @@ -3,10 +3,20 @@ enable = true; enableSshSupport = true; sshKeys = ["CE2FD0D9BECBD8876811714925066CC257413416"]; - extraConfig = '' + extraConfig = let + pinentryRofi = pkgs.writeShellApplication { + name = "pinentry-rofi-with-env"; + runtimeInputs = with pkgs; [coreutils rofi]; + text = '' + "${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@" + ''; + }; + in '' allow-emacs-pinentry allow-loopback-pinentry + pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env ''; + pinentryFlavor = null; }; programs.gpg = { diff --git a/hmModules/hyprland/default.nix b/hmModules/hyprland/default.nix index f90d6f2..c071c30 100644 --- a/hmModules/hyprland/default.nix +++ b/hmModules/hyprland/default.nix @@ -2,44 +2,94 @@ config, pkgs, ... -}: { +}: let + screenshotScript = pkgs.writeShellScript "screenshot.sh" '' + filename="$HOME/shots/$(date --iso-8601=seconds).png" + coords="$(${pkgs.slurp}/bin/slurp)" + ${pkgs.grim}/bin/grim -t png -g "$coords" "$filename" + wl-copy -t image/png < $filename + ''; +in { + imports = [ + ./hyprpaper.nix + ../waybar + ../swayidle + ../mako + ../gammastep + ../kitty + ]; + + home.packages = with pkgs; [wl-clipboard]; + + systemd.user.sessionVariables = { + NIXOS_OZONE_WL = "1"; + }; + + services.network-manager-applet.enable = true; + services.blueman-applet.enable = true; + services.pasystray.enable = true; + xsession.enable = true; + + services.udiskie.enable = true; + + gtk = { + enable = true; + font.name = "Sans,Symbols Nerd Font"; + iconTheme = { + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + }; + }; + wayland.windowManager.hyprland = { enable = true; extraConfig = '' - monitor = DP-2, 1920x1200, 0x0, 1, transform, 3 - monitor = DP-1, 2560x1440, 1200x320, 1 - monitor = eDP-1, 1920x1080, 3760x230, 1 + input { + touchpad { + disable_while_typing = true # set to true while playing + } + } - exec-once = ${config.programs.waybar.package}/bin/waybar - exec-once = ${config.services.mako.package}/bin/mako - exec-once = ${pkgs.swaybg}/bin/swaybg ../sway/wallpaper.svg + monitor = DP-2, 1920x1200, 0x0, 1, transform, 3 + monitor = DP-1, 2560x1440, 1200x320, 1 + monitor = eDP-1, 1920x1080, 3760x230, 1 - windowrulev2 = tile, class:^(Spotify)$ - windowrulev2 = workspace 9, class:^(Spotify)$ + exec-once = ${config.programs.waybar.package}/bin/waybar + exec-once = ${config.services.mako.package}/bin/mako + exec-once = ${pkgs.hyprpaper}/bin/hyprpaper - bind = SUPER , F, exec, firefox - bind = SUPER , RETURN, exec, ${config.programs.kitty.package}/bin/kitty ${config.programs.kitty.package}/bin/kitty +kitten ssh mothership.fleet - bind = SUPER, y, exec, ${pkgs.waypipe}/bin/waypipe --compress lz4=10 ssh mothership.fleet emacsclient -c - bind = SUPER, d, exec, ${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0 + windowrulev2 = tile, class:^(Spotify)$ + windowrulev2 = workspace 9, class:^(Spotify)$ - bind = SUPER SHIFT, q, killactive - bind = SUPER SHIFT, f, fullscreen, 0 - bind = SUPER SHIFT, e, exit + bind = SUPER , F, exec, firefox + bind = SUPER , RETURN, exec, ${config.programs.kitty.package}/bin/kitty ${config.programs.kitty.package}/bin/kitty +kitten ssh mothership.fleet + bind = SUPER, x, exec, emacsclient -c + bind = SUPER, y, exec, ${pkgs.waypipe}/bin/waypipe --compress lz4=10 ssh mothership.fleet emacsclient -c + bind = SUPER, d, exec, ${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0 + bind = SUPER, s, exec, ${screenshotScript} + bind = , XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl s +5% + bind = , XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl s 5%- - bind = SUPER, h, movefocus, l - bind = SUPER, l, movefocus, r - bind = SUPER, k, movefocus, u - bind = SUPER, j, movefocus, d + bind = SUPER SHIFT, q, killactive + bind = SUPER SHIFT, f, fullscreen, 0 + bind = SUPER SHIFT, e, exit - bind = SUPER SHIFT, h, movewindow, l - bind = SUPER SHIFT, l, movewindow, r - bind = SUPER SHIFT, k, movewindow, u - bind = SUPER SHIFT, j ,movewindow, d + bind = SUPER, h, movefocus, l + bind = SUPER, l, movefocus, r + bind = SUPER, k, movefocus, u + bind = SUPER, j, movefocus, d - bind = SUPER, p, movecurrentworkspacetomonitor, r - bind = SUPER, o, movecurrentworkspacetomonitor, l + bind = SUPER SHIFT, h, movewindow, l + bind = SUPER SHIFT, l, movewindow, r + bind = SUPER SHIFT, k, movewindow, u + bind = SUPER SHIFT, j ,movewindow, d - bind = SUPER, 1, workspace, 1 + bind = SUPER, p, movecurrentworkspacetomonitor, r + bind = SUPER, o, movecurrentworkspacetomonitor, l + + bindm=ALT,mouse:272,movewindow + + bind = SUPER, 1, workspace, 1 bind = SUPER, 2, workspace, 2 bind = SUPER, 3, workspace, 3 bind = SUPER, 4, workspace, 4 diff --git a/hmModules/hyprland/hyprpaper.nix b/hmModules/hyprland/hyprpaper.nix new file mode 100644 index 0000000..87e7c6a --- /dev/null +++ b/hmModules/hyprland/hyprpaper.nix @@ -0,0 +1,10 @@ +let + wallpaper = ./wallpaper.png; +in { + xdg.configFile."hypr/hyprpaper.conf".text = '' + preload = ${wallpaper} + wallpaper = eDP-1,${wallpaper} + wallpaper = DP-1,${wallpaper} + wallpaper = DP-2,${wallpaper} + ''; +} diff --git a/hmModules/hyprland/wallpaper.png b/hmModules/hyprland/wallpaper.png new file mode 100644 index 0000000..e7ae2b1 Binary files /dev/null and b/hmModules/hyprland/wallpaper.png differ diff --git a/hmModules/hyprland/wallpaper.svg b/hmModules/hyprland/wallpaper.svg new file mode 100644 index 0000000..642563e --- /dev/null +++ b/hmModules/hyprland/wallpaper.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/hmModules/sway/mako.nix b/hmModules/mako/default.nix similarity index 100% rename from hmModules/sway/mako.nix rename to hmModules/mako/default.nix diff --git a/hmModules/password-store/default.nix b/hmModules/password-store/default.nix index c4c0375..adabccb 100644 --- a/hmModules/password-store/default.nix +++ b/hmModules/password-store/default.nix @@ -11,5 +11,5 @@ }; package = pkgs.pass.withExtensions (e: with e; [pass-otp]); }; - services.password-store-sync.enable = true; + services.password-store-sync.enable = false; # FIXME this requires `pass` every 5 minutes that run `pinentry` } diff --git a/hmModules/sway/default.nix b/hmModules/sway/default.nix index 5d69d43..1b80b13 100644 --- a/hmModules/sway/default.nix +++ b/hmModules/sway/default.nix @@ -5,12 +5,10 @@ ... }: { imports = [ - ./waybar.nix - ./idle.nix - ./mako.nix - ./gammastep.nix - # ../foot - # ../alacritty + ../waybar + ../swayidle + ../mako + ../gammastep ../kitty ]; config = { @@ -36,8 +34,6 @@ }; }; - services.swayidle.enable = true; - wayland = { windowManager.sway = let modifier = "Mod4"; diff --git a/hmModules/sway/idle.nix b/hmModules/swayidle/default.nix similarity index 88% rename from hmModules/sway/idle.nix rename to hmModules/swayidle/default.nix index 4426cd9..0c0b3a2 100644 --- a/hmModules/sway/idle.nix +++ b/hmModules/swayidle/default.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: { services.swayidle = let # Downgraded due to # https://github.com/mortie/swaylock-effects/issues/95 @@ -49,4 +53,7 @@ } ]; }; + + # Otherwise it will start only after Sway and will not work with Hyprland + systemd.user.services.swayidle.Unit.PartOf = lib.mkForce []; } diff --git a/hmModules/sway/waybar.nix b/hmModules/waybar/default.nix similarity index 92% rename from hmModules/sway/waybar.nix rename to hmModules/waybar/default.nix index 2385f2d..61fe421 100644 --- a/hmModules/sway/waybar.nix +++ b/hmModules/waybar/default.nix @@ -34,17 +34,16 @@ "wlr/workspaces" = { all-outputs = true; disable-scroll-wraparound = true; - active-only = true; - format = "{icon}"; + # format = "{icon}"; on-click = "activate"; - format-icons = { - "1" = ""; - "2" = ""; - "3" = ""; - "9" = "ﬧ"; - urgent = ""; - }; - sort-by-number = true; + # format-icons = { + # "1" = ""; + # "2" = ""; + # "3" = ""; + # "9" = "ﬧ"; + # urgent = ""; + # }; + # sort-by-number = true; }; "wlr/mode" = {tooltip = false;}; diff --git a/hmModules/sway/style.css b/hmModules/waybar/style.css similarity index 100% rename from hmModules/sway/style.css rename to hmModules/waybar/style.css diff --git a/hosts/pbp/default.nix b/hosts/pbp/default.nix index a49f821..9246316 100644 --- a/hosts/pbp/default.nix +++ b/hosts/pbp/default.nix @@ -16,6 +16,7 @@ "xfce" "battery" "printing" + "wireguard-client" ]; ccr.enable = true; @@ -29,6 +30,11 @@ "chrome" "udiskie" ]; + packages = with pkgs; [ + remmina + rdesktop + freerdp + ]; }; home-manager.users.mara = { diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 1beb281..65f5fc0 100644 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -56,7 +56,6 @@ "qutebrowser" "shell" "slack" - "sway" "hyprland" "udiskie" "vscode" @@ -71,6 +70,8 @@ ]; packages = with pkgs; [ comma + dolphin-emu-beta + sc-controller ]; extraGroups = [ "wheel" @@ -114,6 +115,9 @@ useXkbConfig = true; # use xkbOptions in tty. }; + services.joycond.enable = true; #FIXME not here + services.udev.packages = [pkgs.joycond]; + # Enable the X11 windowing system. # services.xserver.enable = true; diff --git a/modules/nix/default.nix b/modules/nix/default.nix index c850d14..af67cb0 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + fleetFlake, ... }: { nix = { @@ -39,18 +40,29 @@ options = "--delete-older-than 30d"; }; - buildMachines = [ - { - hostName = "rock5b.fleet"; - system = "aarch64-linux"; - maxJobs = 6; - speedFactor = 1; - supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"]; - mandatoryFeatures = []; - # sshKey = "/var/lib/hydra/queue-runner/.ssh/id_rsa"; - sshUser = "root"; - } - ]; + # buildMachines = [ + # { + # hostName = "rock5b.fleet"; + # system = "aarch64-linux"; + # maxJobs = 6; + # speedFactor = 1; + # supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"]; + # mandatoryFeatures = []; + # # sshKey = "/var/lib/hydra/queue-runner/.ssh/id_rsa"; + # sshUser = "root"; + # } + # ]; distributedBuilds = true; + + registry = lib.mkForce { + nixpkgs.to = { + type = "path"; + path = fleetFlake.inputs.nixpkgsUnstable; + }; + n.to = { + type = "path"; + path = fleetFlake.inputs.nixpkgsUnstable; + }; + }; }; } diff --git a/modules/wireguard-server/default.nix b/modules/wireguard-server/default.nix index 6c53d96..0617644 100644 --- a/modules/wireguard-server/default.nix +++ b/modules/wireguard-server/default.nix @@ -10,6 +10,20 @@ networking.nat.internalInterfaces = ["wg0"]; networking.firewall = { allowedUDPPorts = [51820]; + interfaces.wg0 = { + allowedUDPPortRanges = [ + { + from = 0; + to = 65535; + } + ]; + allowedTCPPortRanges = [ + { + from = 0; + to = 65535; + } + ]; + }; }; networking.wireguard.interfaces = {