| 26 Jan 2026 |
| @silvio:booq.org left the room. | 15:09:46 |
hanke | A question if anyone has the time and energy to help a noob;
I always want stuff installed in the system if possible, but if running on a system where I do not control the root, I at least want the same stuff installed for my user.
How do I go about that in a convenient way with modules like programs.firefox = { <lots of different values set here> }; ? And how do I achieve that with normal packages as well?
I have technically got it working with home-manager by doing this:
{ config, pkgs, lib, ... }:
let
cfg = config.myHome;
in
{
options = {
myHome.useUserPackages = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Install packages in userspace.";
};
};
config = {
home-manager.users.hanke = {
home.stateVersion = "25.11";
home.packages = lib.optionals cfg.useUserPackages (import ./packages.nix {inherit pkgs;});
};
};
}
But I am not sure if this is the best way to do it.. | 19:21:05 |
K900 | There is no real distinction between "user" and "system" in most cases | 19:21:39 |
K900 | Just install things through HM if you're dealing with machines where you only have HM | 19:21:52 |
hanke | The distinction in my eyes is that the "system" applies to all users, so I prefer that if it is an option. | 19:22:22 |
K900 | Do you plan on having more than one user? | 19:22:34 |
hanke | My user + root | 19:22:46 |
hanke | sudo vim should work as well as just vim | 19:22:56 |
K900 | You can import the same config for your user and for root | 19:22:56 |
K900 | I basically do that | 19:22:58 |
K900 | https://gitlab.com/K900/nix/-/blob/master/shared/base/common-config.nix?ref_type=heads#L114 | 19:23:31 |
hanke | Ahaaaaa damn boy that's convenient | 19:24:56 |
hanke | That repository.. is quite something | 19:25:25 |
hanke | I have 3 files in mine haha | 19:25:34 |
K900 | Please don't consider what I'm doing there known good practices | 19:41:04 |
hanke | What are you doing that are not good practice? | 19:41:44 |
K900 | I don't know | 19:41:58 |
K900 | That's the fun part | 19:42:02 |
hanke | okay haha | 19:42:29 |
adamcstephens | is there "good practice" for nix defined infra :) | 19:55:12 |
adamcstephens | everybody writes it differently | 19:55:22 |
hanke | I am slowly realizing this | 19:55:54 |
magic_rb | mhm | 19:55:57 |
hanke | It's a blessing and a curse | 19:56:00 |
magic_rb | this applies to everything in nix :P | 19:56:03 |
hanke | Difficult to learn when everyone does it differently :D | 19:56:14 |
hanke | * Difficult to learn when everyone does it differently :smile | 19:56:19 |
hanke | * Difficult to learn when everyone does it differently :smile: | 19:56:23 |
hanke | * Difficult to learn when everyone does it differently 😄 | 19:56:27 |
magic_rb | but we'll eventually land on good practices cause everyone is trying random shit. more innovation and whatnot | 19:56:41 |