!RRerllqmbATpmbJgCn:nixos.org

Nix / NixOS

3853 Members
Nix/NixOS user help channel | Latest NixOS: 24.05 (Uakari) | Ask your question here or on https://discourse.nixos.org | All NixOS rooms are moderated! Ask for help in #moderation:nixos.org660 Servers

Load older messages


SenderMessageTime
21 Oct 2024
@jaafar:kde.orgJaafar Is it possible to share one Home Manager configuration across multiple nixosConfigurations? 21:02:28
@frontear:matrix.orgfrontearyeah lockfile is the only issue you will have21:02:30
@frontear:matrix.orgfrontearyep, just import it for each one21:02:45
@mjm:midna.devmjm
In reply to @jaafar:kde.org
Is it possible to share one Home Manager configuration across multiple nixosConfigurations?
yes
21:02:45
@mjm:midna.devmjm home-manager.users.your-username = ./home.nix or something 21:03:13
@jaafar:kde.orgJaafar
In reply to @mjm:midna.dev
home-manager.users.your-username = ./home.nix or something

I do have this code under nixosConfigurations.myHostName { modules }, but how do I ensure that this code can be shared to other hostnames like myOtherHostName or yetAnotherHostname?

I'll share what I mean, hold on

21:06:06
@jaafar:kde.orgJaafar
    nixosConfigurations = {
      amestris = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = { inherit inputs; };

        modules = [
          ./hosts/amestris
          home-manager.nixosModules.home-manager
          {
            # foo
            home-manager = {
              extraSpecialArgs = { inherit inputs; };
              useGlobalPkgs = true;
              useUserPackages = true;
              users = {
                ed = import ./homes/ed;
              };
            };
          }
        ];
      };
    };
21:06:35
@mjm:midna.devmjmwhat is your concern here? you can just do that in each other host?21:07:11
@mjm:midna.devmjm or even pull lines 9-19 into their own file and put that in modules 21:07:40
@jaafar:kde.orgJaafar So far I have one NixOS configuration, amestris and one HM configuration for the user ed. I want to make more NixOS configurations that also have the account ed along with its HM config 21:08:23
@jaafar:kde.orgJaafar
In reply to @mjm:midna.dev
or even pull lines 9-19 into their own file and put that in modules
Do I need flake-parts for that?
21:08:35
@mjm:midna.devmjmno21:08:41
@jaafar:kde.orgJaafarsorry for the stupid question21:08:45
@jaafar:kde.orgJaafarOh, good.21:08:52
@mjm:midna.devmjmmaybe this is helpful? https://slab.midna.dev/posts/how-should-i-structure-my-nix-os-config-for-multiple-machines-cv2qjdsk21:09:11
@mjm:midna.devmjmit's not about this specific thing but it's similar21:09:31
@jaafar:kde.orgJaafarIt seems on first glance to be exactly what I'm looking for.21:10:08
@schuelermine:matrix.orgschuelermineHas the Determinate Systems blog post from an hour ago been discussed here already?21:15:21
@wuyoli:c3d2.dewuyoli
In reply to @emilazy:matrix.org
I think those are the same?
no, they have different amounts of members
21:15:24
@emilazy:matrix.orgemilynot for me. so, I guess the problem is that you are sending aliases whose state is themselves split-brained21:15:49
@emilazy:matrix.orgemilycan you copy the !aisodjasoid IDs for the rooms instead?21:15:58
@emilazy:matrix.orgemilycog → settings → advanced → room ID21:16:16
@wuyoli:c3d2.dewuyoli
In reply to @emilazy:matrix.org
cog → settings → advanced → room ID
!RRerllqmbATpmbJgCn:nixos.org I don't mean the room. I mean the space.
21:19:35
@emilazy:matrix.orgemilyright. spaces are rooms21:19:51
@emilazy:matrix.orgemilyRedacted or Malformed Event21:20:01
@emilazy:matrix.orgemilyuh21:20:09
@emilazy:matrix.orgemilysorry, right, useless UI advice :)21:20:35
@emilazy:matrix.orgemilybecause I was looking at my own private space that nests stuff21:20:40
@emilazy:matrix.orgemilyanyway, the right one is the one with 3185 members.21:21:01
@emilazy:matrix.orgemilythat's probably the simplest way to disambiguate.21:21:05

Show newer messages


Back to Room ListRoom Version: 10