!BgJZHVOYkwVcEKLAyM:nixos.org

NixOS Deployments

1277 Members
NixOS Deployment tooling310 Servers

Load older messages


SenderMessageTime
26 Jan 2026
@silvio:booq.org@silvio:booq.org left the room.15:09:46
@hanke:hanke.sehanke
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:0upti.meK900There is no real distinction between "user" and "system" in most cases19:21:39
@k900:0upti.meK900Just install things through HM if you're dealing with machines where you only have HM19:21:52
@hanke:hanke.sehankeThe 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:0upti.meK900Do you plan on having more than one user?19:22:34
@hanke:hanke.sehankeMy user + root19:22:46
@hanke:hanke.sehankesudo vim should work as well as just vim19:22:56
@k900:0upti.meK900You can import the same config for your user and for root19:22:56
@k900:0upti.meK900I basically do that19:22:58
@k900:0upti.meK900https://gitlab.com/K900/nix/-/blob/master/shared/base/common-config.nix?ref_type=heads#L11419:23:31
@hanke:hanke.sehankeAhaaaaa damn boy that's convenient19:24:56
@hanke:hanke.sehankeThat repository.. is quite something19:25:25
@hanke:hanke.sehankeI have 3 files in mine haha19:25:34
@k900:0upti.meK900Please don't consider what I'm doing there known good practices19:41:04
@hanke:hanke.sehankeWhat are you doing that are not good practice?19:41:44
@k900:0upti.meK900I don't know19:41:58
@k900:0upti.meK900That's the fun part19:42:02
@hanke:hanke.sehankeokay haha19:42:29
@adam:robins.wtfadamcstephensis there "good practice" for nix defined infra :)19:55:12
@adam:robins.wtfadamcstephenseverybody writes it differently19:55:22
@hanke:hanke.sehankeI am slowly realizing this19:55:54
@magic_rb:matrix.redalder.orgmagic_rbmhm19:55:57
@hanke:hanke.sehankeIt's a blessing and a curse19:56:00
@magic_rb:matrix.redalder.orgmagic_rbthis applies to everything in nix :P19:56:03
@hanke:hanke.sehankeDifficult to learn when everyone does it differently :D19:56:14
@hanke:hanke.sehanke* Difficult to learn when everyone does it differently :smile19:56:19
@hanke:hanke.sehanke* Difficult to learn when everyone does it differently :smile:19:56:23
@hanke:hanke.sehanke* Difficult to learn when everyone does it differently 😄19:56:27
@magic_rb:matrix.redalder.orgmagic_rbbut we'll eventually land on good practices cause everyone is trying random shit. more innovation and whatnot19:56:41

Show newer messages


Back to Room ListRoom Version: 6