Closed bbigras closed 2 years ago
That is strange, do you install a package in nix-on-droid and home-manager? Maybe share your current config.
It would help, if we know, what package is causing the conflict, so if you have ~/.nix-profile/etc/man_db.conf
already present, could you run a ls -l
for it, that we see the link target?
I installed openssh with nix-env and I have this:
-bash-4.4$ ls -l ~/.nix-profile/etc/man_db.conf
lrwxrwxrwx 1 nix-on-droid nix-on-droid 82 Jan 1 1970 /data/data/com.termux.nix/files/home/.nix-profile/etc/man_db.conf -> /nix/store/naig9qc4bmx1gp4nmsmxwmnllx0cjlvc-nix-on-droid-path/etc/man_db.conf
config
{ pkgs, ... }:
{
# Simply install just the packages
environment.packages = with pkgs; [
# User-facing stuff that you really really want to have
vim # or some other editor, e.g. nano or neovim
# Some common stuff that people expect to have
diffutils
findutils
utillinux
tzdata
hostname
man
gnugrep
gnupg
gnused
gnutar
bzip2
gzip
xz
zip
unzip
];
# Backup etc files instead of failing to activate generation if a file already exists in /etc
environment.etcBackupExtension = ".bak";
# Read the changelog before changing this value
system.stateVersion = "20.03";
# After installing home-manager channel like
# nix-channel --add https://github.com/rycee/home-manager/archive/release-20.03.tar.gz home-manager
# nix-channel --update
# you can configure home-manager in here like
home-manager.config =
{ pkgs, ... }:
{
programs.bat.enable = true;
programs.command-not-found.enable = true;
programs.fzf.enable = true;
programs.starship.enable = true;
home.packages = [
pkgs.neofetch
];
};
}
# vim: ft=nix
channels
home-manager https://github.com/rycee/home-manager/archive/release-20.03.tar.gz
nix-on-droid https://github.com/t184256/nix-on-droid/archive/release-20.03.tar.gz
nixpkgs https://nixos.org/channels/nixos-20.03
It seems fine if I remove man
from environment.packages
Maybe there is an implicit reference of man
in your home-manager config.. You could also use the option home-manager.useUserPackages
, which may fix this issue for you too.
Thanks!
You could also use the option
home-manager.useUserPackages
, which may fix this issue for you too.
This approach definitely needs documentation. This is a common issue with high reproducibility.
Maybe we should also consider changing the default value for home-manager.useUserPackages
to true.
@Gerschtli, what would be the downsides?
Can't think of any.. Maybe someone depends on this in his custom config so a conditional default value based on the stateVersion seems to be the most apprpriate options besides adding a small comment in the README that this option is recommended to be set to true.
@Gerschtli, is it OK to bump stateVersion at any moment or should we wait until the next NixOS release?
You mean the default value? I think we should never change it. We should add a conditional switch to enable useUserPackages if stateVersion is higher or equal than 20.09. That is the default behaviour of nixos and home-manager too. And of course add this change to a not yet created changelog.
I have to correct myself: I have just checked and nixos sets stateVersion default to current release, home-manager never changes its default value.
I think the most consistent and predictable way to handle this is the home-manager way: The user has to manually update the stateVersion because essentially this value should not have any default value at all and is just set to provide backwards compatibility for system installations before introducing this option.
I meant, should I introduce an intermediate 20.08 to make the change sooner, or rather do it in some staging-20.09 and only fold it back to master when 20.09 is out. Now I see us both leaning towards 20.09.
Ah okay, now I understand.
How about adding it to master (aka the unstable bleeding edge channel) and when 20.09 is released creating a new channel? Of course you could create a staging-20.09 but I don't see the real benefit.
The only problem could be that users of nix-on-droid use the master channel and don't know of the stable ones, but I would consider it minor and just provide a Changelog or a short Paragraph in the Readme for all possible channels and branches (and maybe a date for end of support).
I see similar output when doing:
nix-channel --update
nix-env -iA nixpkgs.nix
error: packages '/nix/store/m3zf69cqn7a85y2bjvg5rn7a9llf0d9w-nix-on-droid-path/share/nix/sandbox/sandbox-network.sb' and '/nix/store/g4d6n09a189ird2rnr6ab79pbbz3vfm9-nix-2.3.6/share/nix/sandbox/sandbox-network.sb' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
But why do you want to do this? nix is already included in nix-on-droid-path
@Gerschtli basically want to upgrade it. Pls correct me if I misunderstood something ?
nix-on-droid-path contains the nix package of the installed nixpkgs channel. If you want another version of nix, you should add an overlay where you change the nix package to the latest version.
For reference, nix is installed in modules/environment/path.nix
, an overlay would be the best option to change the version.
For future reference: If you want to use a different nix package, use config.nix.package
option.
I will close this issue as it seems to be solved. Feel free to reopen if necessary.
"aarch64-linux"
Linux 4.4.200-g122700c1790b
no
no
nix-env (Nix) 2.3.5
"home-manager-20.03, nix-on-droid-20.03, nixpkgs-20.03.2015.e7752db2fb6"
/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs