Hello guys! May I ask if you have any helpful links which I should check out in order to write a home-manager module for my toy-wm (for x11) so I can see an entry in the login-manager to select it?
EDIT:
Ok, so here is my current flake.nix
of my toy-wm simp-wm
:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { nixpkgs, rust-overlay, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs
{
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
simp-pkg = pkgs.callPackage
({ rustPlatform, lib, ... }: rustPlatform.buildRustPackage rec {
pname = "simp-wm";
version = "0.0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = with pkgs; [
xorg.xmodmap
];
nativeBuildInputs = buildInputs;
})
{ };
in
{
nixosModules.default = { config, lib, ... }: with lib;
let
cfg = config.services.xserver.windowManager.simp-wm;
in
{
options.services.xserver.windowManager.simp-wm = {
enable = mkEnableOption (lib.mdDoc "Simp WM");
};
config = mkIf cfg.enable {
services.xserver.windowManager.session = [{
name = "simp-wm";
manage = "window";
start = ''
systemctl --user import-environment PATH DISPLAY XAUTHORITY DESKTOP_SESSION XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID DBUS_SESSION_BUS_ADDRESS || true
dbus-update-activation-environment --systemd --all || true
simp-wm
waitPID=$!
'';
}];
environment.systemPackages = [ simp-pkg pkgs.xorg.xmodmap ];
};
};
devShells.${system}.default = pkgs.mkShell.override
{
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
}
{
packages = [ toolchain pkgs.xorg.xmodmap ];
};
};
}
but the problem is, that I’m getting the following error message in the logs, when I selected simp-wm
in lightdm
and login:
[+199.02s] DEBUG: Greeter requests session none+simp-wm
[+199.03s] DEBUG: Seat seat0: Failed to find session configuration none+simp-wm
[+199.03s] DEBUG: Seat seat0: Can't find session 'none+simp-wm'
If I’m not wrong, my nixosModules.default
almost equals the i3.nix
file from nixpkgs
but my nixosModules
can’t get started.
Does anyone know how to fix this?