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

Feature Request: Generate config without home-manager #278

Open
minego opened this issue May 25, 2024 · 4 comments · Fixed by YaLTeR/niri#400
Open

Feature Request: Generate config without home-manager #278

minego opened this issue May 25, 2024 · 4 comments · Fixed by YaLTeR/niri#400

Comments

@minego
Copy link

minego commented May 25, 2024

I'd really like to be able to use this module to generate my niri config, but I don't use home manager... I currently am doing this with: ```
nixpkgs.overlays = [
niri.overlays.niri

				(_final: _prev: {
					# Modify the niri startup command to point it to the
					# config file
					niri-unstable = _prev.niri-unstable.overrideAttrs (final: prev: {
						postFixup = ''
							${prev.postFixup}

							substituteInPlace $out/share/systemd/user/niri.service --replace "--session" "--session -c ${./niri.kdl}"
							'';
					});
				})
			];

			programs.niri.enable			= true;
			programs.niri.package			= pkgs.niri-unstable;

I'd like to be able to use this flake to generate my `niri.kdl` file though. That would make it a lot easier to make tweaks for specific machines, etc.

Is it possible to do that, and then use the output in my overlay to point to that derivation?
@sodiboo
Copy link
Owner

sodiboo commented May 26, 2024

(the formatting of your codeblock is kinda horribly broken, just FYI)

What exactly are you asking for?

From your english text, i'm gathering you want to generate a config without using home-manager, as in the program.niri.settings parts? If so, you can use the internal settings module which is exposed through lib.internal. you can see how this is done here in my config and the other half of that to genrate the file itself here in my config.

From your snippet, it looks more like you want to just make it point to an arbitrary location, in which case there isn't really an easy way to do it currently. I've been thinking of implementing an environment variable in niri that lets us (in nixos land) set it in a wrapper. The current -c flag isn't reliable because it should still be overrideable with the prefix (it isn't) and also it preents you from using any subcommands. But i'll see what i can do on the other side of this to make this work well for you.

@minego
Copy link
Author

minego commented May 26, 2024

I'm not sure how I messed up the formatting, but I think you understood my meaning, and the answer was perfect!

I now have it working, using -c to point to my config. The PR you put up looks like a very nice improvement too! Thank you!

@minego minego closed this as completed May 26, 2024
@sodiboo
Copy link
Owner

sodiboo commented May 27, 2024

I'm going to reopen this because I want to create a better interface to perform this. Yes, you can pass --config manually, but that's annoying if you use it more than once.

@sodiboo sodiboo reopened this May 27, 2024
@minego
Copy link
Author

minego commented May 27, 2024

I'm going to reopen this because I want to create a better interface to perform this. Yes, you can pass --config manually, but that's annoying if you use it more than once.

Makes sense. I do have my setup working now, but I agree that it could be done in a much better way.

I appreciate this kind of dedication a lot. This kind of response makes me feel very good about using this project!

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

Successfully merging a pull request may close this issue.

2 participants