Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix home-manager integration #3

Open
mghesh-yseop opened this issue Sep 17, 2024 · 1 comment
Open

Nix home-manager integration #3

mghesh-yseop opened this issue Sep 17, 2024 · 1 comment

Comments

@mghesh-yseop
Copy link

!! This is not a real issue

Thanks for the package, which solves my issue on my Nixos installation, where I run Plasma6 with i3.

So here is my home-manager configuration, which builds your package, and creates a user systemd service.

{ config, lib, pkgs, ... }:

# Example: https://github.com/nix-community/home-manager/blob/master/modules/services/window-managers/i3-sway/i3.nix

let
  fakwin = pkgs.stdenv.mkDerivation rec {
    pname = "fakwin";
    version = "1.0.0";

    src = pkgs.fetchFromGitHub {
      owner = "DMaroo";
      repo = "fakwin";
      rev = "master";
      hash = "sha256-oEMSuy2NMbd3Q7wtGSVz9vrqNWFeZLrNDM3KAsLgUOw=";
    };

    nativeBuildInputs = [ pkgs.cmake pkgs.qt6.wrapQtAppsHook ];

    buildInputs = [ pkgs.qt6.qtbase ];

    installPhase = ''
      mkdir -p $out/bin
      cp fakwin $out/bin/
    '';

    meta = with pkgs.lib; {
      description = "A fake KWin dbus interface for Plasma6 running without KWin";
      license = licenses.mit;
      maintainers = with maintainers; [ "DMaroo" ];
      platforms = platforms.linux;
    };
  };

in
{
  home.packages = [ fakwin ];

  systemd.user.services."fakwin" = {
    Unit = {
      Description = "Plasma Fake KWin dbus interface";
      After = [ "multi-user.target" ];
    };
    Install = {
      WantedBy = [ "default.target" ];
    };
    Service = {
      ExecStart = "${fakwin}/bin/fakwin";
      Slice = "session.slice";
      Restart = "on-failure";
    };
  };

  home.activation = {
    ensureFakwinActive = lib.hm.dag.entryAfter ["writeBoundary"] ''
      ${pkgs.systemd}/bin/systemctl --user enable fakwin.service
    '';
  };
}

I just wanted to share this, but I didn't know where.

@DMaroo DMaroo pinned this issue Sep 19, 2024
@DMaroo
Copy link
Owner

DMaroo commented Sep 19, 2024

Pinning this, thanks for opening the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants