letThemPlay

joined 1 year ago
7
submitted 2 months ago* (last edited 2 months ago) by letThemPlay@lemmy.one to c/nix@programming.dev
 

Hi all;

This is a bit of a long shot; but I'm having an issue with trying to modularize my config in preparation for a new laptop.

In particular the issue I have is around passing a path through to an import statement for a home-managed user.

In particular I'm getting undefinedVariable hmPath; but it doesn't seem to be having the same issue when I'm mapping groups and shell; so I can only assume that imports has to be treated differently but I'm at a loss.

Any help on what I've misunderstood would be greatly appreciated.

Snippet below

{ pkgs, config, options, lib, home-manager, ... }:

with lib; let
  cfg = config.ltp.home;

  user = types.submodule ({name, ...}: {
    options = {
      doas.enable = mkEnableOption {
        default = false;
        type = types.bool;
      };

      groups = mkOption {
        default = [];
        type = types.listOf string;
      };

      shell = mkOption {
        default = pkgs.bash;
        type = types.package;
      };

      hmPath = mkOption {
        type = types.path;
      };
    };
  });
in
{
  options.ltp.home = {
    users = mkOption {
      description = Attrset of home-manager users;
      default = {};
      type = types.attrsOf user;
    };
  };

  config = mkIf (cfg.users != {}) (mkMerge [
    {
      users.users = let mkUser =
        lib.attrsets.mapAttrs'
        (
          name: value:
          lib.attrsets.nameValuePair
            "${builtins.baseNameOf name}"
            {
              isNormalUser = true;
              extraGroups = "${groups}";
              shell = "${shell}";
            }
        )
        cfg.users;
      in
      mkUser;
      
      home-manager.users = let mkHmUser =
        lib.attrsets.mapAttrs'
        (
          name: value:
          lib.attrsets.nameValuePair
            "${builtins.baseNameOf name}"
            {
              imports = [ "${hmPath}" ];
            }
        )
        cfg.users;
      in
      mkHmUser;
    }
  ]);
}

Edit...

Solved the initial issue I was confusing myself and should've been using value.hmPath and equivalent inside the lib functions.

Next issue; I'm having is I can't seem to pass through the path for the home-manager module for the user that is give to the import statement.

Edit 2...

I didn't manage to get it working how I was doing it so I've changed my approach; to implicitly reference the users home-manager base module based on the folder structure e.g. ./hosts/${hostname}/users/${builtins.baseNameOf name}

[–] letThemPlay@lemmy.one 1 points 3 months ago

I think you would need something like this

services.libinput.touchpad.additionalOptions = '' Option "ScrollPixelDistance" "YOUR_SPEED" ''

https://man.archlinux.org/man/libinput.4#SCROLL_PIXEL_DISTANCE

I think this should work with touchpad as well but I havent tried it personally.

[–] letThemPlay@lemmy.one 1 points 3 months ago* (last edited 3 months ago)

Might be misunderstanding this myself, but I thought a transparent proxy intercepts the requests to the destination.

Now if this is the case, I wouldn't expect any changes to your nix config, as it should be transparently intercepting the requests to cache.nixos.org. Now how this would work with nginx in this context I haven't quite gotten my head around.

Unless your set your gateway to be your nginx box; to handle all requests and forward them on as necessary.

Might give this a go on my build server if I get a chance.

[–] letThemPlay@lemmy.one 2 points 5 months ago

Yes I'm using Sway; I haven't looked too much into it yet, but I think its more my setting in alacritty itself, that I need to change when opening neovim. But it's low down on my list to look at.

[–] letThemPlay@lemmy.one 3 points 5 months ago (3 children)

I'm currently using nixvim, or at least attempting to, I was previously just using lazygit outside my nix config, but now I'm trying to very slowly create a config I like, but its very slow, and I've got some weird padding issues with neovim and alacritty that I'm trying to solve first.

I hadn't heard of nixneovim, I think once I'm in a settled state I'll take a look at it, I just don't want to be pilling more change on top of an unstable base at the moment.

P.s. I probably should have stated I'm fairy new to neovim in general, so still learning which plugins I like.

[–] letThemPlay@lemmy.one 5 points 5 months ago* (last edited 5 months ago) (1 children)

I do have a function that I cribbed from somewhere, unfortunately I didn't note down the source at the time so can't give them due credit here.

filterNixFiles = k: v: v == "regular" && lib.hasSuffix ".nix" k;

importNixFiles = path: (lib.lists.forEach (lib.mapAttrsToList (name: _: path + ("/" + name)) (lib.filterAttrs filterNixFiles (builtins.readDir path)))) import;

Then used as normal

modules = [ home-manager.nixosModules.home-manager vscode-server.nixosModule ] ++ (importNixFiles ./hosts/required) ++ (importNixFiles ./hosts/machines/${hostname})

Edit

Apologies for formatting on mobile

[–] letThemPlay@lemmy.one 2 points 7 months ago

Modding with IPS screen is fairy easy nowadays with the GBA there is some no soldier options not sure if that is the same with an original dmg.

Another option could be a Epligoue GB operator, which allows you to play your original cartridges on pc.

[–] letThemPlay@lemmy.one 2 points 7 months ago

That's the weird thing I've run up the image and the directory isn't there. I did try a similar command in my ci.yml but it didn't work.

[–] letThemPlay@lemmy.one 1 points 7 months ago

Nope but I've loaded up the image it's running and the directory isn't there.

6
submitted 7 months ago* (last edited 7 months ago) by letThemPlay@lemmy.one to c/nix@programming.dev
 

Hi all,

For my sins I've been attempting to build my nix configuration on my build server and subsequently push it into a binary cache.

I'm having an issue where the build is currently failing with the following error

error: home directory '/homeless-shelter' exists; please remove it to assure purity of builds without sandboxing

The build is being run on a docker image node:20-bullseye to be precise with the following command.

nix build .#nixosConfigurations.${{ matrix.machine.host }}.config.system.build.toplevel

Any thoughts would be greatly appreciated.

Edit.

Should have mentioned I've ran up the image with docker run and the directory didn't exist

Edit 2.

This is also about 23 minutes into the build when it throws this error; after having built a lot of packages and derivations already. I'm also using cachix/nix-install-action to get nix on the running container.

Edit 3.

Finally got it building this morning, I haven't dug into it but switching from the cachix/nix-install-action to manually installing the determinate systems nix installer (action didn't work for a strange reason).

[–] letThemPlay@lemmy.one 1 points 7 months ago

I've been using Sway for over 2 years, and for my workflow it works well, with one exception I just can't get vscode to scale properly for my display.

[–] letThemPlay@lemmy.one 15 points 1 year ago

Perfect food reference for Migleemo. Don't know if it was 100% intentional but perfect none the less.

[–] letThemPlay@lemmy.one 3 points 1 year ago

Interesting might have to give this a go in a dual boot.

1
submitted 1 year ago* (last edited 1 year ago) by letThemPlay@lemmy.one to c/pcmasterrace@lemmy.world
 

Hi all,

It's been about 8 years since I've treated myself to some new monitors, so I'm a bit out the loop where to comes to what is currently available.

I'm a software developer, so 95% of the time will be spent developing with a small amount of time gaming.

I currently have a pair of Dell U2515H.

Specs I would love

Minimum QHD resolution, Single cable solution (power, display and data over single cable) Matte display Minimum 25"

Bonus

60Hz display VESA mount

Not sold on whether to go for duel screen again or ultrawide

Budget is fairly flexible preferably under £1000 for a pair though.

Looking forward to seeing what people recommend.

If this is the wrong community then my apologies I couldn't see a monitor community.

Edit,

Thank you all for your replies, I'm currently looking at the dell u3223qe which ticks a lot of the boxes, was also considering one if the lg ultrafine models, but the usb hub + KVM is really selling me on the dell.

So while I keep looking for a little longer to make sure I haven't missed anything, I think I'm going to end up with the dell (again)

 

Next article in the framework 16 deep dive posts is out

 

Next part of the deep dive series has been released.

view more: next ›