-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
steam: init with option to install adwaita theme #696
base: master
Are you sure you want to change the base?
Conversation
eadc2fa
to
7108ef4
Compare
In case the uncontained nature of the activation script is a problem, I can try to implement the solution suggested in #551 (comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reedrw Are you OK with me using most parts of your suggested code here?
Ideally, their contribution should be acknowledged by specifying their Git credentials with a Co-authored-by:
tag in the commit body.
(lib.mkIf cfg.adwaitaForSteam.enable { | ||
home.packages = with pkgs; [adwsteamgtk]; | ||
|
||
home.activation.adwaitaForSteam = let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the uncontained nature of the activation script is a problem, I can try to implement the solution suggested in #551 (comment).
Is it possible to make this reproducible? ${lib.getExe pkgs.adwsteamgtk} --install
does not sound very reproducible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One could probably run this script in a stdenv and extract the relevant files, or better yet, extract them from the source repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracting the necessary files from the source repo is definitely the best solution, as the activation hook hack isn't easily reversible should a user choose to disable it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
94c9912
to
46553d7
Compare
Looking into the install script, it seems that the only file directly overwritten is library.css (located at Running the install script in stdenv is quite easy, see proof of concept here: pkgs.stdenv.mkDerivation (self: {
name = "Adwaita-for-Steam";
version = "3.1";
src = pkgs.fetchFromGitHub {
owner = "tkashkin";
repo = "Adwaita-for-Steam";
rev = "v${self.version}";
sha256 = "sha256-V2Ps4jP7UeoXTY1q7gLbWVQW9WwUzMM6RPYUvNDAJ0I=";
};
buildInputs = with pkgs; [
python3
];
buildPhase = ''
mkdir -p $out/steamui/css
touch $out/steamui/css/library.css
python3 install.py -t $out
'';
}); I think running the install script in stdenv is a fairly good way to do things, as it will make it easy to customize the install parameters through our home-manager module |
This looks perfect! It's both flexible by using the official CLI and it's isolated by being wrapped in a derivation. I'll try to integrate your solution into the stylix module tomorrow. |
Even better, if this file goes missing, steam will just redownload the stock version, so it should be fine to let home-manager link this as well Edit: nevermind. Steam will redownload library.css if it is a symlink |
Related comment tkashkin/Adwaita-for-Steam#120 (comment). I wonder if there is any way to circumvent this, like symlinking a read only parent directory to prevent steam from writing to it. Otherwise, the only option to uninstall the theme might be to run a script that removes the Edit: Symlinking parent directories seems to leave steam in a startup loop. |
@reedw I found the reason this version wasn't working! It seems like the Edit: This doesn't seem possible because Home Manager can't read local files in pure evaluation. |
Within bootstrap_log.txt (
So I assume Steam is not happy with it being a symlink whatsoever |
The only solution I can imagine is to run a specified version of steam to replicate the local configuration and then run the script in the same container. |
Any way we can conveniently patch Steam or wrap it: wrapProgram $out/bin/steam \
--please-work /nix/store/<HASH>-home-manager-files/.local/share/Steam/steamui/css/library.css |
I'm not familiar with |
I just found this useful information.
Edit: There is some useful information on Steam's CLI in https://developer.valvesoftware.com/wiki/Command_line_options#Steam |
Forget what I said, SteamCMD seems to be "updating Steam" the same way the GUI does. It even downloads the required theme files. This solves most of the problems I was pointing to. I only have to see if this works without logging in too. Edit: Derivations don't have access to the internet so this doesn't work. |
What I meant by this is that SteamCMD, which is used to generate the |
If we fetch an unpinned version, like the latest version, instead of a pinned version, this solution will inevitably break in the future. Seems like Steam itself is the problem...
@danth, do you know how we could resolve this issue? |
e686d4d
to
321e43b
Compare
This adds the steam module and its adwaitaForSteam.enable option which installs Adwaita for Steam with the Stylix color palette. Note that Adwaita for Steam is installed directly on the host system using an activation script. Co-authored-by: Reed <[email protected]>
Co-authored-by: NAHO <[email protected]>
Co-authored-by: NAHO <[email protected]>
Co-authored-by: NAHO <[email protected]>
Co-authored-by: NAHO <[email protected]>
321e43b
to
73df133
Compare
This adds the
steam
module and itsadwaitaForSteam.enable
option, which installs Adwaita for Steam with the Stylix color palette. This is a slightly modifed version of #551 (comment) and resolves #551. Note that Adwaita for Steam is installed directly on the host system using an activation script.Preview Adwaita for Steam with the Catppuccin Mocha theme applied by Stylix
@reedrw Are you OK with me using most parts of your suggested code here?