From 8c7cb1944eab10f6cb17d549a40cd61801bd4911 Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Tue, 25 Feb 2025 22:21:34 +0100 Subject: [PATCH 1/3] 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"; }; }; }; From 5464226af78c9c461506ab75d0db3acfa22541fa Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Mon, 17 Mar 2025 11:28:51 +0100 Subject: [PATCH 2/3] bump lock --- flake.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/flake.lock b/flake.lock index 36aaad2..628cb16 100644 --- a/flake.lock +++ b/flake.lock @@ -278,11 +278,11 @@ "lix": { "flake": false, "locked": { - "lastModified": 1741730072, - "narHash": "sha256-bHsQBdUz2l+DKXcNrCgul1fdMo8MO2YaJo+Lp84GL00=", - "rev": "85a140accb5592c9b5a73f5ea2156f5b0c853d1c", + "lastModified": 1742165831, + "narHash": "sha256-/ssmsf50UERQNlOcUuyfvigcnCNckAhAPZMo0+Y3mdY=", + "rev": "2a336813ad2a4d64d027830507276da32927d215", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/85a140accb5592c9b5a73f5ea2156f5b0c853d1c.tar.gz?rev=85a140accb5592c9b5a73f5ea2156f5b0c853d1c" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2a336813ad2a4d64d027830507276da32927d215.tar.gz?rev=2a336813ad2a4d64d027830507276da32927d215" }, "original": { "type": "tarball", @@ -301,11 +301,11 @@ ] }, "locked": { - "lastModified": 1738176840, - "narHash": "sha256-NG3IRvRs3u3btVCN861FqHvgOwqcNT/Oy6PBG86F5/E=", - "rev": "621aae0f3cceaffa6d73a4fb0f89c08d338d729e", + "lastModified": 1741894565, + "narHash": "sha256-2FD0NDJbEjUHloVrtEIms5miJsj1tvQCc/0YK5ambyc=", + "rev": "a6da43f8193d9e329bba1795c42590c27966082e", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/621aae0f3cceaffa6d73a4fb0f89c08d338d729e.tar.gz?rev=621aae0f3cceaffa6d73a4fb0f89c08d338d729e" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/a6da43f8193d9e329bba1795c42590c27966082e.tar.gz?rev=a6da43f8193d9e329bba1795c42590c27966082e" }, "original": { "type": "tarball", @@ -387,11 +387,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1741792691, - "narHash": "sha256-f0BVt1/cvA0DQ/q3rB+HY4g4tKksd03ZkzI4xehC2Ew=", + "lastModified": 1742180333, + "narHash": "sha256-SrvP0G0fxz35lvQxBhAeJOl6+BueIsxJ4azMX+l/kAU=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "e1f12151258b12c567f456d8248e4694e9390613", + "rev": "113cd3916682def185290145924fa30b30bda972", "type": "github" }, "original": { @@ -403,11 +403,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741600792, - "narHash": "sha256-yfDy6chHcM7pXpMF4wycuuV+ILSTG486Z/vLx/Bdi6Y=", + "lastModified": 1742136038, + "narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ebe2788eafd539477f83775ef93c3c7e244421d3", + "rev": "a1185f4064c18a5db37c5c84e5638c78b46e3341", "type": "github" }, "original": { @@ -447,11 +447,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1741513245, - "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", "type": "github" }, "original": { @@ -567,11 +567,11 @@ ] }, "locked": { - "lastModified": 1741644481, - "narHash": "sha256-E0RrMykMtEv15V3QhpsFutgoSKhL1JBhidn+iZajOyg=", + "lastModified": 1742206174, + "narHash": "sha256-Fwo/KZl8+OLvm/XcA/6cSvoG2XxHrKNITR08S78pGus=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e653d71e82575a43fe9d228def8eddb73887b866", + "rev": "c00da36830ae93f200b4a10eae0a56b733616774", "type": "github" }, "original": { From 0d5bc74f8840864c28d1670c5a1c4cced81f1f2e Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Tue, 25 Feb 2025 22:21:34 +0100 Subject: [PATCH 3/3] some initial work on niri --- flake.lock | 131 ++++++++++++++++++++++++++++++ flake.nix | 21 ++++- hosts/toaster/0xa-home.nix | 21 +++++ hosts/toaster/network/default.nix | 59 ++++++++++---- modules/{sway.nix => niri.nix} | 60 ++++++-------- 5 files changed, 243 insertions(+), 49 deletions(-) create mode 100644 hosts/toaster/0xa-home.nix rename modules/{sway.nix => niri.nix} (71%) diff --git a/flake.lock b/flake.lock index 628cb16..06b446c 100644 --- a/flake.lock +++ b/flake.lock @@ -248,6 +248,27 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739757849, + "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -363,6 +384,65 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1742108116, + "narHash": "sha256-NrV9ysEfSbeRUPo0jdCBeesuNLTVrpHGXg40snH1YGE=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "824f10012de455a1d0ef795a605f28948ee10467", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "ref": "main", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1740117926, + "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.02", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1742103165, + "narHash": "sha256-zAzMwvozlS2gmqdhrgeMz0PNp3kRDkwxIEfqWT3Hj6g=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "287480b541e85b13ff6419d372f82fa8e42c603c", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -445,6 +525,22 @@ "type": "github" } }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1742069588, @@ -523,10 +619,12 @@ "inputs": { "authentik-nix": "authentik-nix", "flake-utils": "flake-utils_2", + "home-manager": "home-manager", "lanzaboote": "lanzaboote", "lix": "lix", "lix-module": "lix-module", "microvm": "microvm", + "niri": "niri", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", @@ -717,6 +815,39 @@ "type": "git", "url": "https://git.oxapentane.com/0xa/website.git" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5.1", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1742083780, + "narHash": "sha256-cVLagXvI4jFbCe76tpvAWA2N2WF94Pl0PpgsGp2P6rM=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "f9ec97b007547ad80147404335ed22e880dbd69d", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 9a59f52..1dca929 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,16 @@ inputs.flake-utils.follows = "flake-utils"; }; + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + niri = { + url = "github:sodiboo/niri-flake/main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + tmux-yank = { url = "github:tmux-plugins/tmux-yank"; flake = false; @@ -56,9 +66,11 @@ outputs = inputs@{ authentik-nix, + home-manager, lanzaboote, lix-module, microvm, + niri, nixos-hardware, nixpkgs, sops-nix, @@ -105,13 +117,20 @@ lanzaboote.nixosModules.lanzaboote nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen3 lix-module.nixosModules.default + home-manager.nixosModules.home-manager + niri.nixosModules.niri + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."0xa" = import ./hosts/toaster/0xa-home.nix; + } ./hosts/toaster ./modules/basic-tools ./modules/binary-caches.nix ./modules/devtools.nix - ./modules/gnome.nix + ./modules/niri.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..b3ff5eb --- /dev/null +++ b/hosts/toaster/0xa-home.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + home.stateVersion = "24.11"; + + home.pointerCursor = { + name = "Banana"; + size = 32; + package = pkgs.banana-cursor; + x11.enable = true; + gtk.enable = true; + }; + + gtk = { + enable = true; + cursorTheme = { + name = "Banana"; + size = 32; + package = pkgs.banana-cursor; + }; + }; +} 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/niri.nix similarity index 71% rename from modules/sway.nix rename to modules/niri.nix index 47f5698..79c4ec9 100644 --- a/modules/sway.nix +++ b/modules/niri.nix @@ -4,6 +4,10 @@ let unstablepkgs = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}; in { + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; + + programs.niri.enable = true; + imports = [ ./desktop-software.nix ./fonts.nix @@ -28,6 +32,25 @@ in spotify-player zathura ncdu + adwaita-icon-theme + bluetui + foot + gammastep + graphicsmagick + grim + unstablepkgs.i3status-rust + impala + kanshi + pamixer + wofi + slurp + swayidle + swaylock + wl-clipboard + wl-mirror + xfce.thunar + banana-cursor + fuzzel ]; # Enable sound. @@ -52,38 +75,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 +112,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.niri-stable}/bin/niri"; }; }; };