aboutsummaryrefslogtreecommitdiff
path: root/home-manager/home.nix
blob: 4ca6224b15f8a8e5bf2e955ef173ebb567f7f5dd (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ config, lib, pkgs, symlinkRoot, inputs, username, ... }:
let
  inherit (config.lib.file) mkOutOfStoreSymlink;
  inherit (lib) flatten flip map mergeAttrsList;

  pipe = flip lib.pipe;
  flatMerge = pipe [flatten mergeAttrsList];

  toSrcFile = name: "${symlinkRoot}/${name}";
  link = pipe [toSrcFile mkOutOfStoreSymlink];

  linkFile = name: {${name}.source = link name;};
  linkDir = name: {
    ${name} = {
      source = link name;
      recursive = true;
    };
  };

  linkConfFiles = map linkFile;
  linkConfDirs = map linkDir;

  confFiles = linkConfFiles [
    "starship.toml"
  ];

  confDirs = linkConfDirs [
    "foot"
    "fortune"
    "hypr"
    "nvim"
    "quickshell"
    "tmux"
    "yazi"
  ];

  links = flatMerge [confFiles confDirs];
in {
  imports = [ inputs.greyline.homeManagerModules.default ];
  xdg.configFile = links;

  home.username = username;
  home.homeDirectory = "/home/${username}";
  home.stateVersion = "25.05";
  home.packages = with pkgs; [
    devenv
  ];

  home.file = {
    ".bashrc".text = ''
      bash_starship_init_code=$(starship init bash)
      STARSHIP_DEV_MODE=1
      eval "$bash_starship_init_code"
    '';
  };
  home.sessionVariables = {
    EDITOR = "nvim";
  };
  programs.home-manager.enable = true;

  services.greyline = {
    enable = true;
    backend = "swww";
    fontFamily = "JetBrains Mono Nerd Font";
    settings = {
      theme = "dark";
      logo = false;
      format = "24h";
      twilight = { bands = true; darkness = "subtle"; };
      home = { tz = "Asia/Kolkata"; column_highlight = true; };
      city = [
        { name = "Kuala Lumpur"; lat = 3.14;  lon = 101.69; tz = "Asia/Kuala_Lumpur"; }
        { name = "Kolkata";      lat = 22.56;  lon = 88.36; tz = "Asia/Kolkata"; }
        { name = "London";       lat = 51.51; lon = -0.13;  tz = "Europe/London"; }
        { name = "New York";     lat = 40.71; lon = -74.01; tz = "America/New_York"; }
        { name = "Tokyo";        lat = 35.68; lon = 139.69; tz = "Asia/Tokyo"; }
      ];
    };
  };
}