From 53a39bc6f60b8d19964a64583fbf10088b7c8d20 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Mon, 4 Nov 2024 10:06:11 +0530 Subject: (update): dwl, vm config --- config/dwl.nix | 5 ++-- config/swaylock/config | 2 +- machines/d/home.nix | 39 ------------------------------ machines/v/home.nix | 40 ------------------------------ machines/vm/home.nix | 49 +++++++++++++++++++++++++++++++++++++ machines/x/configuration.nix | 13 +++------- machines/x/home.nix | 10 ++++---- modules/core/bluetooth.nix | 2 +- modules/laptop.nix | 4 +-- modules/login.nix | 3 ++- modules/virtualization.nix | 1 + modules/wm_utils.nix | 4 +++ packages/dwl.nix | 2 +- packages/wayland-protocols.nix | 55 ++++++++++++++++++++++++++++++++++++++++++ packages/wlroots.nix | 4 +-- 15 files changed, 130 insertions(+), 103 deletions(-) delete mode 100644 machines/d/home.nix delete mode 100644 machines/v/home.nix create mode 100644 machines/vm/home.nix create mode 100644 packages/wayland-protocols.nix diff --git a/config/dwl.nix b/config/dwl.nix index 241d7f9..72c59e1 100644 --- a/config/dwl.nix +++ b/config/dwl.nix @@ -1,8 +1,9 @@ { pkgs, home, ... }: let - wlroots = pkgs.callPackage ../packages/wlroots.nix {}; - dwl = (pkgs.callPackage ../packages/dwl.nix { inherit wlroots; }); + wayland-protocols = pkgs.callPackage ../packages/wayland-protocols.nix {}; + wlroots = pkgs.callPackage ../packages/wlroots.nix { inherit wayland-protocols; }; + dwl = (pkgs.callPackage ../packages/dwl.nix { inherit wlroots; inherit wayland-protocols; }); dwlb = (pkgs.callPackage ../packages/dwlb.nix {}); in { home.packages = [ dwl dwlb ]; diff --git a/config/swaylock/config b/config/swaylock/config index 4ca899f..3294324 100644 --- a/config/swaylock/config +++ b/config/swaylock/config @@ -1,4 +1,4 @@ -image=/etc/nixos/dist/wallpaper.jpg +image=/config/dist/wallpaper.jpg font=UbuntuMono Nerd Font Mono bs-hl-color=f5e0dc diff --git a/machines/d/home.nix b/machines/d/home.nix deleted file mode 100644 index 41b1380..0000000 --- a/machines/d/home.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs, ... }: - -{ - nixpkgs.config.allowUnfree = true; - - home = { - username = "compromyse"; - homeDirectory = "/home/compromyse"; - }; - - home.packages = with pkgs; [ - wget - - tmux - fzf - fd - ripgrep - - unzip - zip - - git-lfs - ]; - - programs.bash.initExtra = '' - . "$HOME/.nix-profile/etc/profile.d/nix.sh" - alias ls="ls --color=auto" - ''; - - imports = (map (path: ../../config/${path}) [ - "bash.nix" - "dotfiles.nix" - "git" - "nvim" - ]); - - home.stateVersion = "23.11"; - programs.home-manager.enable = true; -} diff --git a/machines/v/home.nix b/machines/v/home.nix deleted file mode 100644 index 201d8db..0000000 --- a/machines/v/home.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ pkgs, ... }: - -{ - nixpkgs.config.allowUnfree = true; - - home = { - username = "vagrant"; - homeDirectory = "/home/vagrant"; - }; - - home.packages = with pkgs; [ - wget - - tmux - fzf - fd - ripgrep - - unzip - zip - - pyright - git-lfs - ]; - - programs.bash.initExtra = '' - . "$HOME/.nix-profile/etc/profile.d/nix.sh" - alias ls="ls --color=auto" - ''; - - imports = (map (path: ../../config/${path}) [ - "bash.nix" - "dotfiles.nix" - "git" - "nvim" - ]); - - home.stateVersion = "23.11"; - programs.home-manager.enable = true; -} diff --git a/machines/vm/home.nix b/machines/vm/home.nix new file mode 100644 index 0000000..7aca730 --- /dev/null +++ b/machines/vm/home.nix @@ -0,0 +1,49 @@ +{ pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + home = { + username = "compromyse"; + homeDirectory = "/home/compromyse"; + }; + + home.packages = with pkgs; [ + wget + + tmux + fzf + fd + ripgrep + + unzip + zip + + git-lfs + ]; + + programs = { + direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + bash.enable = true; + }; + + programs.bash.initExtra = '' + . "$HOME/.nix-profile/etc/profile.d/nix.sh" + alias ls="ls --color=auto" + ''; + + imports = (map (path: ../../config/${path}) [ + "bash.nix" + "dotfiles.nix" + "git" + "nvim" + ]); + + home.stateVersion = "23.11"; + programs.home-manager.enable = true; +} diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix index fbd553f..c26d6b5 100644 --- a/machines/x/configuration.nix +++ b/machines/x/configuration.nix @@ -27,10 +27,10 @@ in { "virtualization.nix" "remapcapslock.nix" - # "wm_utils.nix" - # "polkit.nix" + "wm_utils.nix" + "polkit.nix" "login.nix" - "plasma.nix" + # "plasma.nix" ]); boot.loader = { @@ -56,10 +56,6 @@ in { networking.hostName = "x"; - environment.variables = { - XCURSOR_SIZE = "16"; - }; - programs.fuse.userAllowOther = true; home-manager = { extraSpecialArgs = { inherit inputs; }; @@ -70,7 +66,6 @@ in { networking.extraHosts = '' - 127.0.0.1 download.labsmartlis.local - 192.168.1.186 cacer.local c + 192.168.122.100 android ''; } diff --git a/machines/x/home.nix b/machines/x/home.nix index a769073..6a3cd25 100644 --- a/machines/x/home.nix +++ b/machines/x/home.nix @@ -54,11 +54,11 @@ "nvim" # "qtile" - # "dwl.nix" - # "themes.nix" - # "way-displays" - # "swaylock" - # "dunst" + "dwl.nix" + "themes.nix" + "way-displays" + "swaylock" + "dunst" "alacritty" ]); diff --git a/modules/core/bluetooth.nix b/modules/core/bluetooth.nix index fbd9b48..5e64d97 100644 --- a/modules/core/bluetooth.nix +++ b/modules/core/bluetooth.nix @@ -3,5 +3,5 @@ { hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; - # services.blueman.enable = true; + services.blueman.enable = true; } diff --git a/modules/laptop.nix b/modules/laptop.nix index 092e61f..3dfdd29 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -1,7 +1,7 @@ { pkgs, config, ... }: { - /* services.tlp = { + services.tlp = { enable = true; settings = { CPU_SCALING_GOVERNOR_ON_AC = "performance"; @@ -10,7 +10,7 @@ CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; }; - }; */ + }; boot = { kernelModules = [ "acpi_call" ]; diff --git a/modules/login.nix b/modules/login.nix index ab32e2d..0789cff 100644 --- a/modules/login.nix +++ b/modules/login.nix @@ -10,7 +10,8 @@ enable = true; settings = { default_session = { - command = "tuigreet --time --remember --cmd \"startplasma-wayland\""; + # command = "tuigreet --time --remember --cmd \"startplasma-wayland\""; + command = "tuigreet --time --remember --cmd \"dwl -s dwlb\""; user = "greeter"; }; }; diff --git a/modules/virtualization.nix b/modules/virtualization.nix index 8ea8fed..28d9fe1 100644 --- a/modules/virtualization.nix +++ b/modules/virtualization.nix @@ -27,6 +27,7 @@ pkgs.libvirt #pkgs.vagrant pkgs.virt-viewer + pkgs.guestfs-tools (pkgs.writeShellScriptBin "pin-cpu" '' if [[ $1 == "" ]]; then diff --git a/modules/wm_utils.nix b/modules/wm_utils.nix index c61bba4..da5c672 100644 --- a/modules/wm_utils.nix +++ b/modules/wm_utils.nix @@ -22,5 +22,9 @@ xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr pkgs.xdg-desktop-portal ]; xdg.portal.config.common.default = "wlr"; + environment.variables = { + XCURSOR_SIZE = "16"; + }; + services.dbus.enable = true; } diff --git a/packages/dwl.nix b/packages/dwl.nix index 28f3cdd..5a9e9dd 100644 --- a/packages/dwl.nix +++ b/packages/dwl.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "compromyse"; repo = "dwl"; rev = "compromyse"; - hash = "sha256-PP9abXvvnfig9rErtMLI50DwydLKng6XuOhXbYys2EY="; + hash = "sha256-nyMxMuhtk/VczZmheknnFitbKZwYeBV3G7xyVFPzi4M="; }; nativeBuildInputs = [ diff --git a/packages/wayland-protocols.nix b/packages/wayland-protocols.nix new file mode 100644 index 0000000..76976be --- /dev/null +++ b/packages/wayland-protocols.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetchurl +, pkg-config +, meson, ninja, wayland-scanner +, python3, wayland +, gitUpdater, testers +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "wayland-protocols"; + version = "1.38"; + + doCheck = stdenv.hostPlatform == stdenv.buildPlatform && + # https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48 + stdenv.hostPlatform.linker == "bfd" && lib.meta.availableOn stdenv.hostPlatform wayland; + + src = fetchurl { + url = "https://gitlab.freedesktop.org/wayland/${finalAttrs.pname}/-/releases/${finalAttrs.version}/downloads/${finalAttrs.pname}-${finalAttrs.version}.tar.xz"; + hash = "sha256-/xcpLAUVnSsgzmys/kLX4xooGY+hQpp2mwOvfDhYHb4="; + }; + + postPatch = lib.optionalString finalAttrs.doCheck '' + patchShebangs tests/ + ''; + + depsBuildBuild = [ pkg-config ]; + nativeBuildInputs = [ meson ninja wayland-scanner ]; + nativeCheckInputs = [ python3 ]; + checkInputs = [ wayland ]; + + mesonFlags = [ "-Dtests=${lib.boolToString finalAttrs.doCheck}" ]; + + meta = { + description = "Wayland protocol extensions"; + longDescription = '' + wayland-protocols contains Wayland protocols that add functionality not + available in the Wayland core protocol. Such protocols either add + completely new functionality, or extend the functionality of some other + protocol either in Wayland core, or some other protocol in + wayland-protocols. + ''; + homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols"; + license = lib.licenses.mit; # Expat version + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ primeos ]; + pkgConfigModules = [ "wayland-protocols" ]; + }; + + passthru.updateScript = gitUpdater { + url = "https://gitlab.freedesktop.org/wayland/wayland-protocols.git"; + }; + passthru.version = finalAttrs.version; + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; +}) diff --git a/packages/wlroots.nix b/packages/wlroots.nix index 6d8a2b3..c632018 100644 --- a/packages/wlroots.nix +++ b/packages/wlroots.nix @@ -15,8 +15,8 @@ let repo = "wlroots"; repo_git = "https://${domain}/${owner}/${repo}"; branch = "master"; - rev = "47fb00f66d5a8367d0108bd960f99e51ab1a1318"; - sha256 = "sha256-HkpTML14tbYBLiHkqoFRSn/qKsVny/oso2TuG6LY/fk="; + rev = "d835fa813f82501eb668708af33afc42010707cf"; + sha256 = "sha256-YXLa0fjqND7Gys4KK/CZmRqGU70gMVqU3T+j+e6S9qw="; }; ignore = [ "wlroots" -- cgit v1.2.3