-
Notifications
You must be signed in to change notification settings - Fork 21
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
Confused about Homes #21
Comments
What I found a little bit confusing too is the fact that Jake is sometimes defining the same stuff twice: in As far as your question goes: I think the separation is not optimal here. Jake doesn't use There are some apps I am not certain about myself. |
Thank you for your advice! I started doing the same after a fair bit of exploring. I’m a bit stuck with how duplicate declarations of home and user interact which caused weird issues on my recently nixified laptop. Could you please share your config? I don’t mind at all if it’s not polished or anything. I just need some example of how someone else does it. You can find my config here: |
Mine is available at https://github.com/mainrs/nixos. What I found a little bit confusing was the fact that options reside inside the I think I had to use this only once here to check if |
I think the purpose of putting all custom options under a namespace is to avoid conflicting with nixos options. At least that was why I switched to a custom namespace. For me, Thanks for your config! I'll check it out |
@PlaneTraveller Hey there! I originally started my configuration with only NixOS, no home-manager support. After a while I started to incorporate home-manager on the NixOS side and eventually wanted to use it on macOS as well. Because of this my config is still mostly NixOS. However, I am slowly moving things from NixOS to be managed by home-manager where possible. Some things need OS-level configuration as well and for that I keep them in the NixOS and nix-darwin modules. My advice for someone starting out right now is to prefer home-manager modules where possible due to their portability. For how to do that with Snowfall Lib, you can add modules to your |
Ohh, good to know! I really liked your approach. There are some applications that I consider to be system-level but that are declarable via |
One of the confusions I have here about duplicate definitions is where user is set and used. There is also the 3 definitions in the snowfallorg library. How do all these definitions interact? Surely user should be defined in just one place. At least for things like Full name and email. |
Could you give me a small example on how this would work on the { config, lib, pkgs, options, ... }:
with lib;
with lib.zt;
let cfg = config.zt.apps.firefox;
in {
options.zt.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
};
config = mkIf cfg.enable {
# Install inside home-manager.
zt.home.extraOptions = {
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = { enableGnomeExtensions = config.zt.desktop.gnome.enable; };
};
# NOTE: Firefox extensions installed via Mozilla Firefox account.
};
};
# Make sure to enable browser connectors in case we have a matching desktop environment enabled.
services.gnome.gnome-browser-connector.enable =
config.zt.desktop.gnome.enable;
};
} It seems to still make sense to abstract once over |
Here is an example of how I'm using it on v3.0.3.
{ lib, config, pkgs, namespace, ... }:
with lib;
with lib.${namespace};
let cfg = config.${namespace}.desktop.rofi;
in {
options.${namespace}.desktop.rofi = { enable = mkEnableOption "rofi"; };
config = mkIf cfg.enable {
home = {
packages = with pkgs; [ rofi-wayland ];
file.".config/rofi" = {
source = ../../../../config/rofi;
recursive = true;
};
};
};
}
{ lib, pkgs, namespace, ... }:
with lib.${namespace}; {
rr-sv = {
desktop = {
rofi = enabled;
};
};
} |
Hello Jake!
After reading all the issues related to homes,
snowfall
documentation, and experimenting a bunch, I'm still confused about whether or not to useHomes
for my use cases (primarily use NixOS, but wouldn't mind the ability to "deploy" my entire home config to foreign distros like Arch).This is more of a design question than a practical one. How is
snowfall
designed to handle home-manager/NixOS segregation? I noticed that most people just throw all their home configs intomodules/nixos
, but I couldn't help but feel that this is not the best practice. If, for example, I were forced to use some foreign distro (on a public server), I would have to redesign a separate config hierarchy usinghome-manager
to be able to have my "home" on said server, which is probably not the design ofsnowfall
. I would also love to be able to share my config with Nix non-believers without imposing my username and other personal data.So what is the best practice for using snowfall with NixOS + separable Home? Should I put everything home-related under
modules/home
and not includehome-manager
at all inmodules/nixos
? Is it possible to do that?As a Nix beginner, configuring stuff in
modules/home
seems super complex, with all the namespaces and referencing. Your config, (and IogaMaster's) are my guides, but yours have ahome
directory under bothmodules/home
andmodules/nixos
. It seems that you are not really usingHomes
that much. At this point, usingHomes
kind of defeats the purpose ofsnowfall
, which is to abstract away the wiring of configurations and provide a simple, elegant structure for them. My current solution is to put everything undernixos
again and call it a day.Is it that I completely misunderstood how snowfall is supposed to be used? It would be really helpful if you could explain how
snowfall
is designed to be used (in the future and right now).Thank you so much for
snowfall
and your config! They made me think a lot about what Nix is capable of and configuring systems in general! These are both wonderful projects and I'm amazed by how you are able to pull it off (almost) alone. If I ever get good enough with Nix, I would love to contribute!Sorry for using github issues completely wrong lol
The text was updated successfully, but these errors were encountered: