summaryrefslogtreecommitdiff
path: root/modules/shared/users/seth.nix
blob: 796171d068077ec6b5ebc9791d00e415c091fdf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  config,
  lib,
  pkgs,
  inputs,
  ...
}:

let
  cfg = config.borealis.users.seth;

  inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
in

{
  options.borealis.users.seth = {
    enable = lib.mkEnableOption "Seth's user & home configurations";
  };

  config = lib.mkIf cfg.enable (
    lib.mkMerge [
      {
        users.users.seth.shell = pkgs.fish;

        programs.fish.enable = true;

        home-manager.users.seth = {
          imports = [ (inputs.self + "/users/seth") ];
        };
      }

      (lib.mkIf isDarwin {
        users.users.seth = {
          home = lib.mkDefault "/Users/seth";
        };
      })

      (lib.mkIf isLinux {
        users.users.seth = {
          extraGroups = [ "wheel" ];
          isNormalUser = true;
        };
      })
    ]
  );
}