-
Notifications
You must be signed in to change notification settings - Fork 107
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
Improve Home Manager support: profiles/suites, modules, extern, flake outputs #156
Conversation
bors try |
tryConfiguration problem: |
313d5a2
to
79f9bfc
Compare
Updated to match the lib changes. Also I dropped hmActivationPackages and this time exported homeConfigurations with a hyphen seperating hosts and users. So all host/user pairs get exported as I think this is significantly simpler. I only exported the activation packages in the first place due to nix's issues with nested outputs. So separating with a hyphen allows for easy debugging. And with the flk script, it really only affects someone who manually builds the activation package and even that isn't that bad. |
This already is looking amazing, once you get it ready for review and it's approved, you can merge it yourself when your confident it's done. Good work. bors delegate+ |
✌️ Pacman99 can now approve this pull request. To approve and merge a pull request, simply reply with |
Wow thats cool! Thanks! I think I might try to get the sharedModules and extraSpecialArgs PR backported to 20.09 in home-manager so I can get this merged sooner. |
Alternatively, I was thinking of upgrading the nixos flake to nixos-unstable for the time being, at least until the next stable release. |
Ohh that makes things simpler. Can you do that as a separate commit? There might be other things to fix after upgrading, that doesn't make sense to include in this PR. |
Yeah, I'll try to manage it soon. I'm working on cleaning up some other things as well. Hopefully by the end of the day. |
I dropped the commit updating the flake, so this should theoretically merge cleanly once the flake is updated. But I can fix any other conflicts once you upgrade. |
I added some more defaults to the hmConfig. Although, optimally, that would not be needed with #127. |
I've update my local config to nixos-unstable and it seems to be working fine, after some fixes. However, I can't push it up yet, as it somehow broke the ci runner and all tests are failing with an exception. Once I figure it out, I'll push it. |
I think the check for devshell on aarch64 will fail. Because nix flake check tries to evaluate it(not build) and nixUnstable is still broken for aarch64 on nixos-unstable - hydra hasn't updated the channel with the fix yet. |
Yeah I saw that, but actually every single derivation is failing due to an exception in hercules-ci's cpp code. I am gonna try reverting the update to the hercules flake and see if that helps. If not, it may be related to the update to Nix. I believe I can work around it either way, hopefully won't take too long. |
It seems fixing the ci-agent is going to be slightly more involved than I initially suspected. hercules-ci/hercules-ci-agent#291 We may have to rely on upstream to patch it before it works. I was thinking I could use a container as a workaround, but the containers seem to use the hosts nix-daemon, so it didn't pan out. So the alternatives seem to be:
|
Is the ci runner on an old revision evaluate the checks ok? I think the first option is the best so at least we can keep changing things. |
yes it seems to be working again after downgrading. Assuming all these checks pass, I'll push the changes with the |
Before we merge this, be sure to rebase after I push the update, because I'm also going to make a change to the bors.toml. After merging my last PR as a squash merge, I decided I don't like it, and am going to use a regular merge commit instead. BORS pulls the toml from the PR and not the main branch so it's important you have the new one. |
Ok thats makes sense, will do. Yeah squash merges aren't great for larger PR's. |
besides the merge conflicts, is this still blocked? |
I rebased and fixed conflicts. But I can't actually test this new version, so after the update I will have to rebase again and run through any errors that may have come up after the rebase. Also I switched to use user@host pairs based on the pr in home-manager that adds |
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.
My review was pretty brief on this as I don't really have a ton of time and don't want to hold it up any longer. I've already delegated merge permission to you, so if you've tested it and believe it is ready. Please go ahead and merge it.
bors try |
tryBuild failed: |
This is ready for final review. I updated the home-manager input in this PR(first commit), and rebased with core. Checks succeed for me. I added some docs to users/README.md, so I think thats the last thing to check - @blaggacao I would appreciate your input for that, you're usually good with docs.. |
tryBuild succeeded: |
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.
I don't think any of my comments are major blockers. Overall this looks great. Good job on another great PR.
CHANGELOG.md
Outdated
@@ -43,6 +43,7 @@ | |||
- iso: avoid systemd service startup [\#202](https://github.com/divnix/devos/pull/202) | |||
- hosts/devosSystem: pass modules as attrset [\#198](https://github.com/divnix/devos/pull/198) | |||
- doc: enact bootstrapping section [\#196](https://github.com/divnix/devos/pull/196) | |||
- flake: nixos -\> nixos-unstable [\#192](https://github.com/divnix/devos/pull/192) |
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.
why is this here? Isn't it already in core?
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.
rebase error, fixed
…-manager only defaults
I'm going to go ahead and merge, this should be complete. |
Build succeeded: |
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.
We are gonna need a follow up, cleanup/enhancement PR. I wouldn't mind doing it, if nobody else wishes to do so. I've mentions a copule places that need fixing.
home-manager.useUserPackages = lib.mkForce false; | ||
home-manager.sharedModules = [ | ||
{ | ||
home.packages = config.environment.systemPackages; |
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.
hindsight review:
As it turns out, this may be a bit too aggressive. We may have to have a follow up PR to remove it, as it includes a lot of unrelated system packages and, worse, causes package conflicts in the community branch.
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.
Yeah thats fine we can remove that line. It worked for me and I didn't think it would cause any issues.
useGlobalPkgs = true; | ||
useUserPackages = true; | ||
|
||
extraSpecialArgs = extern.userSpecialArgs // { suites = suites.user; }; |
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.
We may need to add inherit (config.nixpkgs) pkgs
as home-manager doesn't seem to have a pkgs
argument. This may be a bug upstream however, as I believe home-manager is supposed to pass in packages. In practice though, at least with this implementation, I had to add a pkgs
arg to get doom-emacs to work, for example.
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.
Are you sure thats the problem? Because home-manager already does that when useGlobalPkgs
is true.
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.
" using the system configuration's pkgs
argument in Home Manager. This disables the Home Manager
options nixpkgs.*"
^ from hm nixos module
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.
I ran into these issues while trying to merge this into community. I just pushed the merge so you should now be able to reproduce by simply checking out the latest community branch and running flk home NixOS nixos
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.
Perhaps shared modules don't get passed a pkgs
arg, since that is how doom-emacs is entering the configuration. Not sure if this intentional by upstream or a bug. I'll search hm issue tracker to see if I can find some additional context.
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.
Could be true, I tried adding pkgs to the hm section in users/nixos
and used it to add vim to home.packages
and that works fine. So your theory does make sense.
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 home manager, the ways pkgs is set is using _module.args.pkgs
in home-manager/modules/modules.nix. And I wonder if doesn't get passed to modules that were imported before that. But that doesn't make sense to me, since the module system should be recursive.
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.
I believe I've isolated the problem. Gonna fix and test locally then will link to an new home-manager PR if I'm correct.
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.
okay, I've offered a minimally invasive solution in nix-community/home-manager#1879
I likely won't be able to test the fixes since I can't reproduce the issues. |
A really simple method of implementing #119.
This relies on a feature that I added in home-manager master for module options of extraSpecialArgs and sharedModules, nix-community/home-manager#1793. I could try and get that backported to 20.09. But I thought I'd get some feedback on these changes first.