Replies: 3 comments
-
If your NixOS configuration includes overlays and such then it would be a bit tricky to make use of that in your HM configuration. In principle it would probably work but you would need to evaluate your NixOS configuration and assign its final pkgs into HM's If your NixOS configuration simply uses a plain nixpkgs clone then you can simply make sure
in my configuration. Then |
Beta Was this translation helpful? Give feedback.
-
That assignment @rycee talks about I have implemented like so: In system overlays (this { inputs, pkgs, unstable, ... }:
{
nixpkgs.overlays = [
(import ./some-overlay.nix)
];
# this *adds* unstable to the available args for all modules
_module.args.unstable = import inputs.nixpkgs-unstable { inherit (pkgs) system config; };
nix.nixPath = [ "nixpkgs=${pkgs.path}" "unstable=${unstable.path}" ];
} and for the HM generation I'm doing something like (simplified): let
inherit (systemConfigs."${hostname}") pkgs config;
in
{
...
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
...
};
} where systemConfigs = inputs.self.nixosConfigurations // inputs.self.darwinConfigurations; (it seems I need to do this myself, since the documented standard argument |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick responses! I think I was a bit confused, and I still am (Nix is so complicated!) — thanks for bearing with me.
I think the above means that # the zsh defined in `configuration.nix`:
#
# ```
# programs.zsh.enable = true;
# users.defaultUserShell = pkgs.zsh;
# ```
$ realpath /run/current-system/sw/bin/zsh
/nix/store/6fm0farw5fgl8w04nxl3241s1kgwijjq-zsh-5.9/bin/zsh
# the zsh defined in `home.nix`:
#
# ```
# programs.zsh.enable = true;
# ```
$ realpath ~/.nix-profile/bin/zsh
/nix/store/6fm0farw5fgl8w04nxl3241s1kgwijjq-zsh-5.9/bin/zsh Specifically what I was trying to do was use a 1Password wrapper in my # the 1Password defined in `configuration.nix`:
#
# ```
# programs._1password-gui.enable = true;
# ```
$ realpath /run/current-system/sw/bin/1password
/nix/store/sh9rir830bxdz24a094ny49v9ffw9h93-1password-8.9.8/bin/1password
# the 1Password defined in `home.nix`:
#
# ```
# programs.git.extraConfig.gpg.ssh.program = "${pkgs._1password-gui}/share/1password/op-ssh-sign";
# ```
$ cat ~/.config/git/config | grep 1password
program = "/nix/store/xz00fxs1kh5w5m51dpqbllx7d8v9vcs7-1password-8.9.8/share/1password/op-ssh-sign"
# expected: "/nix/store/sh9rir830bxdz24a094ny49v9ffw9h93-1password-8.9.8/share/1password/op-ssh-sign" The specific question I'm trying to answer is: Why do these store paths differ? and is there a way that they can … not? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to set
home-manager.useGlobalPkgs
(or achieve the same goal — using the globalpkgs
) using the standalone installation? I am on a NixOS system, if it makes a difference. Thanks!Beta Was this translation helpful? Give feedback.
All reactions