From 8c7cb1944eab10f6cb17d549a40cd61801bd4911 Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Tue, 25 Feb 2025 22:21:34 +0100 Subject: [PATCH] some initial work on hyprland --- flake.nix | 14 ++++++- hosts/toaster/0xa-home.nix | 4 ++ hosts/toaster/network/default.nix | 59 ++++++++++++++++++++++-------- modules/{sway.nix => hyprland.nix} | 58 +++++++++++++---------------- 4 files changed, 86 insertions(+), 49 deletions(-) create mode 100644 hosts/toaster/0xa-home.nix rename modules/{sway.nix => hyprland.nix} (71%) diff --git a/flake.nix b/flake.nix index 9a59f52..815c025 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,11 @@ inputs.flake-utils.follows = "flake-utils"; }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + tmux-yank = { url = "github:tmux-plugins/tmux-yank"; flake = false; @@ -56,6 +61,7 @@ outputs = inputs@{ authentik-nix, + home-manager, lanzaboote, lix-module, microvm, @@ -105,13 +111,19 @@ lanzaboote.nixosModules.lanzaboote nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen3 lix-module.nixosModules.default + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."0xa" = import ./hosts/toster/0xa-home.nix; + } ./hosts/toaster ./modules/basic-tools ./modules/binary-caches.nix ./modules/devtools.nix - ./modules/gnome.nix + ./modules/hyprland.nix ./modules/gnupg.nix ./modules/radio.nix ./modules/science.nix diff --git a/hosts/toaster/0xa-home.nix b/hosts/toaster/0xa-home.nix new file mode 100644 index 0000000..facb35d --- /dev/null +++ b/hosts/toaster/0xa-home.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + +} diff --git a/hosts/toaster/network/default.nix b/hosts/toaster/network/default.nix index 6d96c3c..ee0bdbe 100644 --- a/hosts/toaster/network/default.nix +++ b/hosts/toaster/network/default.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, pkgs, ... }: { imports = [ ./mullvad.nix @@ -6,26 +6,21 @@ ./zw.nix ]; - # Networkmanager shouldn't interfere with systemd managed interfaces - networking.networkmanager.unmanaged = - let - systemd_netdevs = lib.attrsets.attrValues ( - lib.attrsets.mapAttrs (_name: value: value.netdevConfig.Name) config.systemd.network.netdevs - ); - in - systemd_netdevs; + environment.systemPackages = with pkgs; [ + iwgtk + impala + ]; - systemd.network = { - enable = true; - wait-online.enable = false; # uplink is managed by networkmanager - }; - - users.users."0xa".extraGroups = [ "networkmanager" ]; + # kick out networkmanager + networking.networkmanager.enable = lib.mkForce false; + networking.useNetworkd = true; + systemd.network.enable = true; networking = { hostName = "toaster"; firewall.enable = true; wireguard.enable = true; + wireless.iwd.enable = true; }; services.resolved = { @@ -39,4 +34,38 @@ ]; }; + # we might have no interwebs at all + systemd.network.wait-online.enable = false; + + # uplinks + systemd.network.networks = { + "10-ether-uplink" = { + matchConfig.Name = "enp1s0f0"; + networkConfig = { + DHCP = "yes"; + IPv6AcceptRA = true; + }; + }; + "10-dock-uplink" = { + matchConfig.Name = "enp5s0f4u1u1"; + networkConfig = { + DHCP = "yes"; + IPv6AcceptRA = true; + }; + dhcpV4Config = { + RouteMetric = 666; + }; + dhcpV6Config = { + RouteMetric = 666; + }; + }; + "wlan-uplink" = { + matchConfig.Name = "wlan0"; + networkConfig = { + DHCP = "yes"; + IPv6AcceptRA = true; + }; + }; + }; + } diff --git a/modules/sway.nix b/modules/hyprland.nix similarity index 71% rename from modules/sway.nix rename to modules/hyprland.nix index 47f5698..c530e6f 100644 --- a/modules/sway.nix +++ b/modules/hyprland.nix @@ -28,6 +28,27 @@ in spotify-player zathura ncdu + adwaita-icon-theme + bluetui + foot + gammastep + graphicsmagick + grim + unstablepkgs.i3status-rust + impala + kanshi + swaynotificationcenter + pamixer + wofi + slurp + swayidle + swaylock + wl-clipboard + wl-mirror + xfce.thunar + + nwg-look + banana-cursor ]; # Enable sound. @@ -52,38 +73,9 @@ in programs.light.enable = true; programs.xwayland.enable = true; - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - extraSessionCommands = '' - export SDL_VIDEODRIVER=wayland - export QT_QPA_PLATFORM=wayland-egl - export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" - export QT_QPA_PLATFORMTHEME="gnome" - export QT_STYLE_OVERRIDE="adwaita-dark" - # export WLR_DRM_NO_ATOMIC=1 - ''; - extraPackages = with pkgs; [ - adwaita-icon-theme - bluetui - foot - gammastep - graphicsmagick - grim - unstablepkgs.i3status-rust - impala - kanshi - swaynotificationcenter - pamixer - rofi-wayland - slurp - swayidle - swaylock - wl-clipboard - wl-mirror - xfce.thunar - ]; - }; + + programs.hyprland.enable = true; + environment.sessionVariables = { GTK_THEME = "Adwaita:dark"; }; @@ -118,7 +110,7 @@ in enable = true; settings = { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting \"$(${pkgs.fortune}/bin/fortune -s)\" --cmd ${pkgs.sway}/bin/sway"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting \"$(${pkgs.fortune}/bin/fortune -s)\" --cmd ${pkgs.hyprland}/bin/Hyprland"; }; }; };