!UUqahLbShAYkkrXmKs:matrix.org

DevOS

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

Load older messages


SenderMessageTime
21 Sep 2021
@kraftnix:matrix.org@kraftnix:matrix.org

I am quite confused with how the nur integration works with devos, I cannot seem to update my nur input via nix flake lock --update-input nur, but if I add in nur.url = "github:nix-community/NUR"; then the lockfile is actually updated.

I guess my main question is how is nur actually integrated when it's not defined as an input?

15:04:38
@timdeh:matrix.org@timdeh:matrix.orghmm was it removed at some point? It used to be15:08:06
@timdeh:matrix.org@timdeh:matrix.orgis it a digga input?15:10:10
@kraftnix:matrix.org@kraftnix:matrix.orgI couldn't find it amongst quite a few of the inputs I looked across15:11:55
@kraftnix:matrix.org@kraftnix:matrix.org

well this is interesting, if I remove nur.url input from the flake, then run nix flake lock --recreate-lock-file it updates the path of the nur input from a github url to a store path, but does not remove it from the lock file (I guess since I use/rely on nur or because it is an argument to outputs)

• Updated input 'nur':
    'github:nix-community/NUR/7ad8de0eab7c38e0b84ffa817582223a0293e732' (2021-09-21)
  → 'path:/nix/store/0wad8flznsfv3jr4qggyq65jqminxzpn-source?lastModified=1632235753&narHash=sha256-GTfOKPZ5L+uTQDbm4LhXx3
UfQpOyCJzbf%2f2zOQdZEPM=&rev=7ad8de0eab7c38e0b84ffa817582223a0293e732' (2021-09-21)
15:20:31
@kraftnix:matrix.org@kraftnix:matrix.org if you take the latest commit of develop branch of devos and run nix flake lock --recreate-lock-file this also happens with nur and latest, and additional inputs are added as well (such as bud flake dependecies and digga/nix), in fact nearly all the locked inputs from devos's master branch seem very out of date 15:26:04
@kraftnix:matrix.org@kraftnix:matrix.org * if you take the latest commit of master branch of devos and run nix flake lock --recreate-lock-file this also happens with nur and latest, and additional inputs are added as well (such as bud flake dependecies and digga/nix), in fact nearly all the locked inputs from devos's master branch seem very out of date 15:26:11
@timdeh:matrix.org@timdeh:matrix.orgthey are, I want to setup a CI job to update them periodically if the tests pass after update15:27:11
@kraftnix:matrix.org@kraftnix:matrix.org after grepping through commits the earliest mention I can find of nur where there is no input is back in dec 2020 https://github.com/divnix/devos/blob/15003e3de9e9e39b7cb9752b65bad96b819c1624/flake.nix, and I can't seem to figure out how the nur input is being included in there either. 15:39:27
@kraftnix:matrix.org@kraftnix:matrix.org the last time the flake.lock changed for nur was when the ANT CORRUPTION LAYER was added in commit https://github.com/divnix/devos/commit/6ebdf3adb422c79675d2b919025c7f1367a5a665 15:58:48
@kraftnix:matrix.org@kraftnix:matrix.org * the last time the flake.lock changed for nur was when the ANTI CORRUPTION LAYER was added in commit https://github.com/divnix/devos/commit/6ebdf3adb422c79675d2b919025c7f1367a5a665 15:58:57
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, ... }: { };
          }; # 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:57:00
@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 = base ++ [ sway ];
            };
          };
          users = {
            ccr = { suites, ... }: { };
          }; # 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:57:34
@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.devzrsk joined the room.15:55:12

Show newer messages


Back to Room ListRoom Version: 6