!UUqahLbShAYkkrXmKs:matrix.org

DevOS

36 Members
Seeking help and geeking out together on https://github.com/divnix/devos & https://github.com/divnix/digga10 Servers

Load older messages


SenderMessageTime
22 Sep 2021
@zrsk:matrix.org@zrsk:matrix.org *

HI!
I can't understand how to use suites, for example in my flake.nix I have the following:

home = {
          imports = [ (digga.lib.importModules ./users/modules) ];
          externalModules = [ ];
          importables = rec {
            profiles = digga.lib.rakeLeaves ./users/profiles;
            suites = with profiles; rec {
              base = [ direnv git zsh ];
              gui = [ sway ];
            };
          };
          users = {
            ccr = { suites, ... }: { import = suites.base };
          }; # digga.lib.importers.rakeLeaves ./users/hm;
        };

And in users/ccr/default.nix:

{ hmUsers, pkgs, suites, ... }:
{
  home-manager.users = {
    inherit (hmUsers); #what is this?
    ccr.imports = import suites.gui; #here I want to import the suite with the home-manager configs for sway and related things
    home.packages = with pkgs; [
      # packages for this user
    ];
  };

  users.users.ccr = {
    # my user config
  }
}

I get this error:

error: attribute 'gui' missing

       at /nix/store/280x4jmhhi4mnf23bbg744d35s4ls9kq-source/users/ccr/default.nix:5:26:

            4|     inherit (hmUsers);
            5|     ccr.imports = import suites.gui;
             |                          ^
            6|     home.packages = with pkgs; [
(use '--show-trace' to show detailed location information)
08:58:40
@zrsk:matrix.org@zrsk:matrix.org *

HI!
I can't understand how to use suites, for example in my flake.nix I have the following:

home = {
          imports = [ (digga.lib.importModules ./users/modules) ];
          externalModules = [ ];
          importables = rec {
            profiles = digga.lib.rakeLeaves ./users/profiles;
            suites = with profiles; rec {
              base = [ direnv git zsh ];
              gui = [ sway ];
            };
          };
          users = {
            ccr = { suites, ... }: { imports = suites.base };
          }; # digga.lib.importers.rakeLeaves ./users/hm;
        };

And in users/ccr/default.nix:

{ hmUsers, pkgs, suites, ... }:
{
  home-manager.users = {
    inherit (hmUsers); #what is this?
    ccr.imports = import suites.gui; #here I want to import the suite with the home-manager configs for sway and related things
    home.packages = with pkgs; [
      # packages for this user
    ];
  };

  users.users.ccr = {
    # my user config
  }
}

I get this error:

error: attribute 'gui' missing

       at /nix/store/280x4jmhhi4mnf23bbg744d35s4ls9kq-source/users/ccr/default.nix:5:26:

            4|     inherit (hmUsers);
            5|     ccr.imports = import suites.gui;
             |                          ^
            6|     home.packages = with pkgs; [
(use '--show-trace' to show detailed location information)
08:58:51
@zrsk:matrix.org@zrsk:matrix.org But I just noticed that in my users/ccr/default.nix I can access suites defined inside the importables of the "nixos part" of the flake.nix, but I want to access to the ones defined inside the importables of "home part". 09:05:09
@zrsk:matrix.org@zrsk:matrix.org

I solved this way:

home = {
          imports = [ (digga.lib.importModules ./users/modules) ];
          externalModules = [ ];
          importables = rec {
            profiles = digga.lib.rakeLeaves ./users/profiles;
            suites = with profiles; rec {
              base = [ direnv git zsh ];
              gui = [ sway ];
            };
          };
          users = {
            ccr = { suites, ... }: { imports = suites.base; home-manager.users.ccr.imports = suites.gui; };
          }; # digga.lib.importers.rakeLeaves ./users/hm;
        };

Is this correct?

09:18:30
@zrsk:matrix.org@zrsk:matrix.org *

I also tried this but doesn't work:

home = {
          imports = [ (digga.lib.importModules ./users/modules) ];
          externalModules = [ ];
          importables = rec {
            profiles = digga.lib.rakeLeaves ./users/profiles;
            suites = with profiles; rec {
              base = [ direnv git zsh ];
              gui = [ sway ];
            };
          };
          users = {
            ccr = { suites, ... }: { imports = suites.base; home-manager.users.ccr.imports = suites.gui; };
          }; # digga.lib.importers.rakeLeaves ./users/hm;
        };
09:27:29
@zrsk:matrix.org@zrsk:matrix.org

Maybe I solved with this

{ pkgs, suites, ... }:
{
  home-manager.users.ccr = { suites, ...}: {
    imports = with suites; shell ++ gui ++ browser ++ dev;
    #etc...
  };
#etc...
}

in my users/ccr/default.nix and this in my flake.nix:

home = {
          imports = [ (digga.lib.importModules ./users/modules) ];
          externalModules = [ ];
          importables = rec {
            profiles = digga.lib.rakeLeaves ./users/profiles;
            suites = with profiles; rec {
              # As NixOS profiles
              base = [ direnv git zsh ];
              # As home-manager profiles
              shell = [ zsh ];
              gui = [ sway ];
              browser = [ firefox ];
              dev = [ vscode ];
            };
          };
        };

Is this a correct approach?

10:14:22
@blaggacao:matrix.orgDavid Arnold (blaggacao)I guess we have to.lift the question from DevOS to the Nixpkgs module system level.12:31:11
@blaggacao:matrix.orgDavid Arnold (blaggacao) The nix module system can imports suites because they are passed as so called specialArgs, whicj we have rebbtist to importables. 12:32:18
@blaggacao:matrix.orgDavid Arnold (blaggacao) imports receives a list of paths or modules. 12:32:45
@blaggacao:matrix.orgDavid Arnold (blaggacao) suites.gui is not a list of paths, but a list of modules. 12:33:24
@blaggacao:matrix.orgDavid Arnold (blaggacao) imports = suites.gui is importsing, not importinga list of modules, hence. 12:34:16
@blaggacao:matrix.orgDavid Arnold (blaggacao)* `imports = suites.gui` is `imports`ing, not `import`ing, a list of modules, hence.12:34:26
@blaggacao:matrix.orgDavid Arnold (blaggacao)* I guess we have to lift the question from DevOS to the Nixpkgs module system level.12:34:35
@blaggacao:matrix.orgDavid Arnold (blaggacao)* The nix module system can `imports` `suites` because they are passed as so called `specialArgs`, which we have rebabtist to `importables`.12:34:53
@blaggacao:matrix.orgDavid Arnold (blaggacao)(I only looked at your first code snipped - I hope this was the relevant one) 😁12:36:00
@zrsk:matrix.org@zrsk:matrix.org left the room.15:54:01
@aciceri:nixos.devaciceri joined the room.15:55:12
@aciceri:nixos.devaciceri David Arnold (blaggacao): yeah, I think I solved however, thank you. In the last snipped there is a snippet of what I'm currently using. 21:11:24
@aciceri:nixos.devaciceri

However currently I've another problem with the build workflow in the github repository, I just tried to clone a fresh copy of the devos repository and change the check.yml to use my binary cache, it correctly worked. But when I did a nix flake update locally and then pushed the newly generated flake.lock it broke with a not so nice error:

error (ignored): error: bad archive: input doesn't look like a Nix archive
21:15:48
@aciceri:nixos.devaciceri * David Arnold (blaggacao): yeah, I think I solved however, thank you. In the last message there is a snippet of what I'm currently using. 22:10:33
@aciceri:nixos.devaciceri

Maybe I solved but I really can't understand why: adding a --show-trace in the workflow command showed me that the "bad" archive was the NUR's one. Then I simply added a nur.url = github:nix-community/NUR; my flake.nix inputs and the Github's workflow worked.

To be honest I don't even understand how the flake.nix of the template has in its inputs NUR by default.

22:28:53
23 Sep 2021
@kraftnix:matrix.org@kraftnix:matrix.org I was also questioning how a bit earlier, and I couldn't figure out how nur made it's way in as an input either. 10:49:24
@aciceri:nixos.devaciceriFor now I fear it will remain a mystery. Changing the topic: someone here has hosts with different architecture in its configuration?11:10:58
@aciceri:nixos.devaciceri * For now I fear it will remain a mystery. Changing the topic: someone here has hosts with different architectures in its configuration?11:11:06
@blaggacao:matrix.orgDavid Arnold (blaggacao) With regard to their sharing model nur & devos ate somewhat subsitutes. The idea has been to bridge the two evosystems to avoid reinventing stuff "inside" DevOS. 12:17:18
@blaggacao:matrix.orgDavid Arnold (blaggacao)* With regard to their sharing model nur & devos ate somewhat substitutes. The idea has been to bridge the two ecosystems to avoid reinventing stuff "inside" DevOS.12:17:29
@blaggacao:matrix.orgDavid Arnold (blaggacao)So far that hasn't yet fully played out.12:17:39
@kraftnix:matrix.org@kraftnix:matrix.org I mainly use nur for firefox addons, albeit I could replicate that workflow with nvfetcher + the firefox addon build wrapper but I have been too lazy for now 12:34:13
@aciceri:nixos.devaciceri David Arnold (blaggacao): But I can't even find in which part of digga's mkFlake (I suppose I've to look there) nur is put as output. I think there is something broken, I don't think that just generating a repo from the template and then updating the inputs should broke the CI workflow on Github.
I'm really a noob with Nix but I would like to help, if you confirm that this is a bug and turns out that it's too difficult to me I could open an issue better addressing the problem.
19:59:06
24 Sep 2021
@cw:kernelpanic.cafe@cw:kernelpanic.cafe changed their display name from Rev. CornWallace III (sun/tzu) to Rev. CornWallace III (novus ordo seclorum).01:01:35

Show newer messages


Back to Room ListRoom Version: 6