[-] [email protected] 13 points 6 months ago

Previously arch now NixOS, just love the reproducibility.

7
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/[email protected]

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}

[-] [email protected] 4 points 1 year ago* (last edited 1 year ago)

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

6
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]

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).

[-] [email protected] 15 points 2 years ago

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

[-] [email protected] 6 points 2 years ago

Fingers crossed that means Amrabat incoming.

Also liking the sell on clauses they are adding to deals makes a lot of sense and is nice little bonus down the line.

[-] [email protected] 5 points 2 years ago

Well it's a better start than last season, was expecting more. Really don't like Rashford up top, just doesn't suit him, hopefully Rasmus will be available soon, as I think until we get him in the team, it's not going to be to dissimilar to last season.

[-] [email protected] 4 points 2 years ago

Disappointed in hearing this as really rated him, but hearing there is a buy back clause I actually think this is a really good move to a excellent club where he can get some really good experience. Then potentially we can get him back on the cheap if needed.

[-] [email protected] 7 points 2 years ago

Good luck, always liked Fred, although his inconsistency was frustrating, always loved watching him when he was told to man mark a player out of the game.

[-] [email protected] 8 points 2 years ago

Good news, never been the biggest fan of Maguire but I think West Ham will suit him and hopefully he can get some confidence back before the Euros as Southgate will more than likely continue to select him.

21
submitted 2 years ago by [email protected] to c/[email protected]
[-] [email protected] 5 points 2 years ago* (last edited 2 years ago)

Absolutely loved this episode, Boimler getting wrapped in the cables when jerry-rigging the sensors had me in tears; and the Riker as he swung his leg over the saddle brilliant bit of improv made even funnier knowing Drakes directed this.

They managed to tone down the lower deckers slighter whilst still having their full personalities come through.

Pikes getting more exacerbated with them throughout the episode was well done, and the amount of physical comedy I'm running out of superlatives for this episode.

It was just brilliant, easily my favourite of the current era.

Edit. Just wanted to add, loved seeing the LD uniform in love action; thought it translated really well.

[-] [email protected] 4 points 2 years ago

Two great finishes, let's keep this up

[-] [email protected] 5 points 2 years ago

Let's get this done quickly

9
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/[email protected]

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)

[-] [email protected] 4 points 2 years ago

Personally I'm not convinced on the accent, at least at the moment. But the character seems like fun.

view more: next ›

letThemPlay

0 post score
0 comment score
joined 2 years ago