-
Notifications
You must be signed in to change notification settings - Fork 6
Add "portable" PlayOS flavour #338
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2bfa713
Show correct network watchdog status when it is not installed
yfyf 95da421
Make the update download limit in controller configurable
yfyf c1ab273
Check that download limiting is applied in e2e tests
yfyf 3eefbec
Add a "portable" flavor of PlayOS
yfyf b8e3dd1
Add volume media key support
yfyf efa4ec9
Add target for conveniently building VM with portable flavour
yfyf 7a4cda9
Add basic CI test for checking that the portable flavor is buildable
yfyf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| let | ||
| defaults = import ../application.nix; | ||
| in | ||
| { | ||
| inherit (defaults) safeProductName version overlays greeting; | ||
|
|
||
| fullProductName = "${defaults.fullProductName} (portable)"; | ||
|
|
||
| module = { config, lib, pkgs, ... }: { | ||
| imports = [ | ||
| defaults.module | ||
| ]; | ||
|
|
||
| # use a lower download limit to ensure minimal interference | ||
| playos.controller.downloadLimit = "2M"; | ||
|
|
||
| # we do not expect a stable/permanent network connection | ||
| playos.networking.watchdog.enable = lib.mkForce false; | ||
|
|
||
| # metrics are optimized for specific hardware and stable setup, probably | ||
| # not very useful for ad-hoc portable setups | ||
| playos.monitoring.enable = lib.mkForce false; | ||
|
|
||
| # Do not hard-code HDMI as default | ||
| hardware.pulseaudio = { | ||
| extraConfig = lib.mkForce '' | ||
| # Respond to changes in connected outputs | ||
| load-module module-switch-on-port-available | ||
| load-module module-switch-on-connect blacklist="" | ||
|
|
||
| # Prevent PulseAudio from remembering previous muted states. | ||
| # First, we unload the default restore module, then reload it | ||
| # explicitly telling it NOT to restore mute states. | ||
| unload-module module-device-restore | ||
| load-module module-device-restore restore_volume=true restore_muted=false | ||
| ''; | ||
| }; | ||
|
|
||
| systemd.user.services.force-unmute = { | ||
| description = "Force unmute PulseAudio on login"; | ||
| wantedBy = [ "default.target" ]; | ||
| after = [ "pulseaudio.service" ]; | ||
|
|
||
| path = [ pkgs.pulseaudio ]; | ||
|
|
||
| script = '' | ||
| # Brief pause to ensure PulseAudio has fully initialized its sinks | ||
| sleep 2 | ||
| pactl set-sink-mute @DEFAULT_SINK@ 0 | ||
|
|
||
| # Optional: Force volume to a safe default so it is never at 0% | ||
| pactl set-sink-volume @DEFAULT_SINK@ 70% | ||
| ''; | ||
|
|
||
| serviceConfig = { | ||
| Type = "oneshot"; | ||
| RemainAfterExit = true; | ||
| }; | ||
| }; | ||
|
|
||
| # Add bindings for media keys to allow volume control | ||
| environment.etc."sxhkd/sxhkdrc".text = '' | ||
| XF86AudioLowerVolume | ||
| ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5% | ||
|
|
||
| XF86AudioRaiseVolume | ||
| ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5% | ||
|
|
||
| XF86AudioMute | ||
| ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle | ||
| ''; | ||
|
|
||
| services.xserver.displayManager.sessionCommands = '' | ||
| # Provides media key bindings for volume control | ||
| ${pkgs.sxhkd}/bin/sxhkd -c /etc/sxhkd/sxhkdrc & | ||
| ''; | ||
| }; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.