ublue-os / fleek

[deprecated] Own your $HOME
https://getfleek.dev
Apache License 2.0
833 stars 24 forks source link

`fleek add` doesn't #237

Closed mtalexan closed 1 year ago

mtalexan commented 1 year ago

Describe the bug
fleek apply doesn't install any of the fleek added packages or make any of the custom aliases available.

To Reproduce

  1. Install nix on a fresh system with the Determinate Nix installer
  2. Install fleek with the curl command
  3. fleek init
  4. fleek add neovim
  5. fleek apply -v
  6. Open new terminal
  7. fleeks
  8. alias
  9. which nvim
  10. nix profile list
  11. cat ~/.fleek.yaml

Actual behavior fleeks reports the command is unknown.
alias reports the fleeks alias doesn't exist.
which nvim reports no such command is found.
nix profile list reports that only home-manager-path is installed and not neovim.

Expected behavior
The default fleeks alias should exist and work.
The nvim command, which is installed as part of neovim should be installed in the nix profile.

Environment

Additional context

The ~/.fleek.yaml lists neovim in the packages section after the fleek add neovim, and the aliases section does include the default fleeks alias.


EDIT: It turns out the issue is fleek add adding to the wrong list in the .fleek.yaml so the package isn't usable (not sure what the package list can even be used for, it seems to be completely non-functional).

mtalexan commented 1 year ago

EDIT: So apparently I was looking at the index in nix profile list with my initial report, not the home-manager generation, so I've updated the description with the more specific usage problem I'm encountering: nothing actually got installed.

mtalexan commented 1 year ago

Maybe fleek is only adding the home-manager config for these packages and isn't installing the actual nix packages? If so, that would probably be at least part of the bug, but doesn't explain the aliases not working.

I can run nix profile install nixpkgs#neovim and it installs it successfully.

mtalexan commented 1 year ago

Confirmed. fleek add adds to the packages list and not the programs list. Also, having the same package in both the packages and programs list causes a conflict. If it's added to the programs list and removed from the packages list, the fleek apply correctly installs it and it shows up in the nix profile list.

I'm updating the title accordingly.

mtalexan commented 1 year ago

At this point there's no documentation on what was intended from these, so I'm just guessing.

In the current state it appears fleek can be used to (mutually exclusively) define the nix packages you want installed (programs section), or define the home-manager config of a package you installed manually (packages section). Fleek produces an error if the same package is listed in both places, even though that seems to be the exact use case for the tool. Or maybe I'm misunderstanding what the packages list does, but either way fleek add then fleek apply does not work like the fleek.gif in the README.md shows, that will fail 100% of the time on the final which dnf command.

mtalexan commented 1 year ago

I just cleared out the old fleek config and re-installed:

  1. fleek eject
  2. rm ~/.fleek.yaml
  3. rm -rf ~/.local/share/fleek

And re-installed it from scratch with git already setup:

  1. curl -fsSL https://getfleek.dev/installer | bash
    1. Accept detected git config --global user.email
    2. Pick previously setup GitHub SSH key

Then edit the .fleek.yaml to set bling: none. Then I ran the all-in-one command fleek add --apply neovim and got a warning message about my .bash_profile and .bashrc being in the way and getting backed up (for the first time ever).

The nix profile list still only lists the home-manager-path, but which nvim is successfully finding the package now.


So it seems there's a bug somewhere in the fleek installation and fleek init process. Likely an interrupted fleek init (which is guaranteed to happen since the GitHub email and SSH key requirements are undocumented) can cause a screwed up init state that in my case manifested as home-manager not actually managing the environment.

mtalexan commented 1 year ago

I'm closing the issue since I seem to have gotten past the problem and can't figure out what caused it in the first place.