!wfudwzqQUiJYJnqfSY:nixos.org

NixOS Module System

81 Members
20 Servers

Load older messages


SenderMessageTime
30 Aug 2024
@mr-qubo:matrix.orgmr-qubo *

I run it with nixos-rebuild -I nixos-config=$(pwd)/users-impl.nix dry-build --show-trace. ./user-impl.nix is the name of the file, contents which I pasted. You also need to put some file in ../users/ dir. I have nix.nix file with those contents:

{
  home.stateVersion = "23.11";
}

home.stateVersion is needed, otherwise there's a different error from home-manager.
And you also need <home-manager> channel.

16:37:23
@mr-qubo:matrix.orgmr-qubo *

I run it with nixos-rebuild -I nixos-config=$(pwd)/users-impl.nix dry-build --show-trace. ./user-impl.nix is the name of the file, contents which I pasted. You also need to put some file in ../users/ dir. I have nix.nix file with those contents:

{
  home.stateVersion = "23.11";
}

home.stateVersion is needed, otherwise there's a different error from home-manager.
And you also need <home-manager> channel (nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager).

16:39:46
@mr-qubo:matrix.orgmr-qubo *

I've made more minimal example:

{ lib, ... }:

let

  users = [
    {
      username = "nix";
      module = {
        home.stateVersion = "23.11";
	# MrQubo.osConfig.services.logrotate.enable = false;
      };
    }
  ];

  evalHmModule = { username, module, config, pkgs, ... }:
    (import <home-manager/modules> {
      configuration = {
        options.MrQubo = {
          osConfig.services = lib.mkOption {
            type = lib.types.raw;
          };
        };
        config = {
          submoduleSupport.enable = true;
          submoduleSupport.externalPackageInstall = false;

          home.username = config.users.users.${username}.name;
          home.homeDirectory = config.users.users.${username}.home;

          # Make activation script use same version of Nix as system as a whole.
          # This avoids problems with Nix not being in PATH.
          nix.package = config.nix.package;
        };
      };
      inherit pkgs;
    }).extendModules {
      modules = [
        {
          MrQubo.osConfig.services = config.services;
        }
        module
      ];
    };

  osConfigModules = lib.flip map users (user: { pkgs, config, ... }:
    { config.services = (evalHmModule ({ inherit pkgs config; } // user)).config.MrQubo.osConfig.services; }
  );

in {
  imports = osConfigModules;
}


# vim: sts=2 sw=2 ts=60 et:

You also need <home-manager> channel, which can be added with nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager.
The configuration can be run with nixos-rebuild -I nixos-config=$(pwd)/users.nix dry-build --show-trace.

16:47:04
@mr-qubo:matrix.orgmr-qubo *

I've made more minimal example:

{ lib, ... }:

let

  users = [
    {
      username = "nix";
      module = {
        home.stateVersion = "23.11";
	# MrQubo.osConfig.services.logrotate.enable = false;
      };
    }
  ];

  evalHmModule = { username, module, config, pkgs, ... }:
    (import <home-manager/modules> {
      configuration = {
        options.MrQubo = {
          osConfig.services = lib.mkOption {
            type = lib.types.raw;
          };
        };
        config = {
          submoduleSupport.enable = true;
          submoduleSupport.externalPackageInstall = false;

          home.username = config.users.users.${username}.name;
          home.homeDirectory = config.users.users.${username}.home;

          # Make activation script use same version of Nix as system as a whole.
          # This avoids problems with Nix not being in PATH.
          nix.package = config.nix.package;
        };
      };
      inherit pkgs;
    }).extendModules {
      modules = [
        {
          MrQubo.osConfig.services = config.services;
        }
        module
      ];
    };

  osConfigModules = lib.flip map users (user: { pkgs, config, ... }:
    { config.services = (evalHmModule ({ inherit pkgs config; } // user)).config.MrQubo.osConfig.services; }
  );

in {
  imports = osConfigModules;
}

You also need <home-manager> channel, which can be added with nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager.
The configuration can be run with nixos-rebuild -I nixos-config=$(pwd)/users.nix dry-build --show-trace.

16:47:19
@mr-qubo:matrix.orgmr-qubo *

I've made more minimal example:

users.nix:

{ lib, ... }:

let

  users = [
    {
      username = "nix";
      module = {
        home.stateVersion = "23.11";
	# MrQubo.osConfig.services.logrotate.enable = false;
      };
    }
  ];

  evalHmModule = { username, module, config, pkgs, ... }:
    (import <home-manager/modules> {
      configuration = {
        options.MrQubo = {
          osConfig.services = lib.mkOption {
            type = lib.types.raw;
          };
        };
        config = {
          submoduleSupport.enable = true;
          submoduleSupport.externalPackageInstall = false;

          home.username = config.users.users.${username}.name;
          home.homeDirectory = config.users.users.${username}.home;

          # Make activation script use same version of Nix as system as a whole.
          # This avoids problems with Nix not being in PATH.
          nix.package = config.nix.package;
        };
      };
      inherit pkgs;
    }).extendModules {
      modules = [
        {
          MrQubo.osConfig.services = config.services;
        }
        module
      ];
    };

  osConfigModules = lib.flip map users (user: { pkgs, config, ... }:
    { config.services = (evalHmModule ({ inherit pkgs config; } // user)).config.MrQubo.osConfig.services; }
  );

in {
  imports = osConfigModules;
}

You also need <home-manager> channel, which can be added with nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager.
The configuration can be run with nixos-rebuild -I nixos-config=$(pwd)/users.nix dry-build --show-trace.

16:47:45
3 Sep 2024
@djacu:matrix.org@djacu:matrix.org left the room.23:29:30
4 Sep 2024
@ss:someonex.netSomeoneSerge (utc+3) changed their display name from SomeoneSerge (UTC+3) to SomeoneSerge (nix.camp).21:49:17
5 Sep 2024
@lingo5080:matrix.orglingo5080 joined the room.15:56:06
7 Sep 2024
@throwachimera:matrix.orgthrowachimera joined the room.11:56:03
@kamillaova:matrix.orgKamilla 'ova joined the room.12:21:15
8 Sep 2024
@jakehamilton:matrix.orgjakehamilton joined the room.01:02:45
@cafkafk:gitter.imcafkafk joined the room.05:21:48
9 Sep 2024
@cdepillabout:matrix.orgcdepillabout joined the room.00:57:13
@pandapip-1:matrix.orgPandapip1 joined the room.03:45:55
10 Sep 2024
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (u) (format nil "~A lost their email!" u)) "Artur Manuel" to Artur Manuel (on break).17:32:40
@artur:glasgow.social(artur 'manuel) changed their profile picture.17:35:01
@artur:glasgow.social(artur 'manuel) changed their display name from Artur Manuel (on break) to (lambda (u) (format nil "~A is not using Matrix right now." u)) "Artur Manuel".17:36:41
12 Sep 2024
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (u) (format nil "~A is not using Matrix right now." u)) "Artur Manuel" to (lambda (u) (format nil "~a ~a")) "Artur" "Manuel".01:49:04
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (u) (format nil "~a ~a")) "Artur" "Manuel" to (lambda (f l) (format nil "~a ~a")) "Artur" "Manuel".01:56:04
14 Sep 2024
@brisingr05:matrix.org@brisingr05:matrix.org joined the room.05:38:23
@ss:someonex.netSomeoneSerge (utc+3) changed their display name from SomeoneSerge (nix.camp) to SomeoneSerge (utc+3).11:38:15
@mwoodpatrickmx:matrix.orgmwoodpatrickmx joined the room.16:12:46
15 Sep 2024
@brisingr05:matrix.org@brisingr05:matrix.org left the room.23:40:59
16 Sep 2024
@silentlurker:matrix.orgsilentlurker joined the room.19:56:52
17 Sep 2024
@vandycarlos:matrix.orgvandycarlos joined the room.01:25:05
18 Sep 2024
@llakala:matrix.orgllakala joined the room.03:12:22
@jopejoe1:matrix.orgjopejoe1 joined the room.14:26:32
@artur:glasgow.social(artur 'manuel) changed their profile picture.23:01:34
21 Sep 2024
@luna-null:matrix.orgluna-null joined the room.05:44:16
24 Sep 2024
@ckie:ckie.devmei 🌒& changed their profile picture.23:21:50

Show newer messages


Back to Room ListRoom Version: 10