Skip to content

fix kmscon module#391574

Closed
hustlerone wants to merge 1 commit into
NixOS:masterfrom
hustlerone:master
Closed

fix kmscon module#391574
hustlerone wants to merge 1 commit into
NixOS:masterfrom
hustlerone:master

Conversation

@hustlerone
Copy link
Copy Markdown
Contributor

@hustlerone hustlerone commented Mar 20, 2025

Things done

Adjusted the systemd unit for kmscon to fix #385497

This however will completely disable DRM for kmscon and now seats will be unspecified.
If someone absolutely requires DRM for kmscon, let me know.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 20, 2025
@hustlerone hustlerone marked this pull request as draft March 20, 2025 14:25
@hustlerone
Copy link
Copy Markdown
Contributor Author

As per fbcon fashion, there's rendering issues. I guess the PR will get much more complicated if this doesn't turn out to be a fluke.

@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 20, 2025
@hustlerone hustlerone marked this pull request as ready for review March 20, 2025 14:31
@hustlerone
Copy link
Copy Markdown
Contributor Author

Ok, this might just be a greetd issue I'm having.

Either way, it would be great if someone would test this under "normal" circumstances

@liff
Copy link
Copy Markdown
Contributor

liff commented Mar 21, 2025

Enabled with GNOME and it seems to work like it used to. Didn’t test extensively, but at least GDM is able to start now.

@hustlerone
Copy link
Copy Markdown
Contributor Author

Yeah, I suspect the current rev we're in actually works as intended and we actually have to disable DRM specifically.

There also is the option to patch kmscon to allow it to free the gpu on demand. However, we would also have to modify every single derivation that starts a graphical session or needs /dev/dri/cardX so it also tells kmscon to free the GPU, just so we use DRM for kmscon (and I don't know any benefits of using DRM over fbcon for kmscon)

@github-actions github-actions Bot removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 30, 2025
@hustlerone
Copy link
Copy Markdown
Contributor Author

how do i undo this git has played me

@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 30, 2025
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5352

Comment thread nixos/modules/services/ttys/kmscon.nix Outdated
Comment thread nixos/modules/services/ttys/kmscon.nix Outdated
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 24, 2026
Comment thread nixos/modules/services/ttys/kmscon.nix
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 24, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 27, 2026
ccicnce113424

This comment was marked as duplicate.

@ccicnce113424 ccicnce113424 requested review from ccicnce113424 and removed request for ccicnce113424 and omasanori January 27, 2026 09:50
ccicnce113424

This comment was marked as resolved.

@hustlerone
Copy link
Copy Markdown
Contributor Author

That's strange considering i copied the service verbatim.

I don't have the issue on agetty. What's your setup?

@ccicnce113424

This comment was marked as resolved.

@gaelj
Copy link
Copy Markdown
Contributor

gaelj commented Jan 27, 2026

I'm using zsh too and it's working well for me when the VT is opened first time, which covers 90% of my use. But if I open another VT and then I go back into an already open VT:

  • screen stays black until I press a key (always)
  • Ctrl key appears to be "stuck" (always pressed) but this happens on random. I haven't found a way to unstick it once the VT is in this mode

However both problems still exist when I don't use this PR, so it looks like an upstream issue.

@ccicnce113424

This comment was marked as resolved.

@ccicnce113424

This comment was marked as outdated.

'';
};

kmscon = mkOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kmscon = mkOption {
kmsconGettyArgs = mkOption {

cfg = config.services.kmscon;

autologinArg = lib.optionalString (cfg.autologinUser != null) "-f ${cfg.autologinUser}";
gettyCmd = config.services.getty.kmscon;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gettyCmd = config.services.getty.kmscon;
gettyCmd = config.services.getty.kmsconGettyArgs;

package = mkPackageOption pkgs "kmscon" { };

hwRender = mkEnableOption "3D hardware acceleration to render the console";
hwRender = mkEnableOption "Enable hardware acceleration + DRM backend";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hwRender = mkEnableOption "Enable hardware acceleration + DRM backend";
hwRender = mkEnableOption "hardware acceleration + DRM backend";

mkEnableOption adds "Enable" or something like that to the description already.

cfg.package
];

systemd.services."kmsconvt@" = {
Copy link
Copy Markdown
Contributor

@r-vdp r-vdp Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you repeating here a bunch of settings that will already be loaded by the service included in the package? I think you should only set the options that are not already in the upstream service.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to patch kmscon for that.

After all, some consistency regarding agetty would be nice.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that? You can just load the service from the package and then set additional settings in the nixos module, or unset and reset. We do that in so many places.

Copy link
Copy Markdown
Member

@ccicnce113424 ccicnce113424 Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r-vdp You can take a look at my attempt in #489469.

You can just load the service from the package

For some reason, it doesn't work. It's ready now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, why did you open a new PR? This one can be closed then?

I'm traveling today, so I'll probably only be able to try out the other PR tomorrow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, why did you open a new PR? This one can be closed then?

I'm traveling today, so I'll probably only be able to try out the other PR tomorrow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that? You can just load the service from the package and then set additional settings in the nixos module, or unset and reset. We do that in so many places.

Because you'd have to edit kmscon@vt.service.in, or edit it a posteriori.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to manually modify the systemd unit files. Changes made in the config will be saved as an overlay.
My PR utilizes the unit files provided by kmscon. It has now passed testing and is ready.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, that's what I meant, I didn't notice that the new PR is by a different author.

I'll have a look at it tomorrow.

@hustlerone are you OK with this? Attribution was maintained in the new PR for your commit that was cherry-picked from here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes go ahead

@ccicnce113424
Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 391574 -p nixosTests.kmscon
Commit: 0b68ffcf72d7f2563ae40557d37e69d67a783108 (subsequent changes)
Merge: f1ff1e74adee25bc83ca41500f99d2825b10f8af

Logs: https://github.com/ccicnce113424/nixpkgs-review-gha/actions/runs/21835473974


x86_64-linux

✅ 1 test built:
  • nixosTests.kmscon

ccicnce113424 added a commit to ccicnce113424/nixpkgs that referenced this pull request Feb 11, 2026
Cherry-picked from NixOS#391574

Co-authored-by: ccicnce113424 <ccicnce113424@gmail.com>
ccicnce113424 added a commit to ccicnce113424/nixpkgs that referenced this pull request Feb 11, 2026
Cherry-picked from NixOS#391574

Co-authored-by: ccicnce113424 <ccicnce113424@gmail.com>
ccicnce113424 added a commit to ccicnce113424/nixpkgs that referenced this pull request Feb 11, 2026
Cherry-picked from NixOS#391574

Co-authored-by: ccicnce113424 <ccicnce113424@gmail.com>
@ccicnce113424
Copy link
Copy Markdown
Member

Closed as #489469 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos/kmscon: prevents entering the desktop environment