~ruther/nixos-config

ref: a6a97b76ca659d1d93d4f3181608f66049173b3f nixos-config/home/modules/profiles/desktop/qtile/default.nix -rw-r--r-- 2.2 KiB
a6a97b76 — Frantisek Bohacek feat: add TERMINAL and EDITOR user env vars 1 year, 9 days ago
                                                                                
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
{ lib, inputs, config, pkgs, ... }:

let
  configFormat = pkgs.formats.json {};
  configJson = configFormat.generate "qtile-config.json" {
    scripts = {
      brightness = ./config/brightness.sh;
      notifications = {
        clear_popups = "${inputs.self}/scripts/notifications/clear-popups.sh";
        pause = "${inputs.self}/scripts/notifications/pause.sh";
        unpause = "${inputs.self}/scripts/notifications/unpause.sh";
        show_center = "${inputs.self}/scripts/notifications/show-center.sh";
      };
    };
    wallpaper = "${inputs.self}/wall.png";
    defaults = {
      terminal = config.home-config.defaultTerminal.meta.mainProgram;
    };
    programs = {
      sequence_detector = "${lib.getExe inputs.self.packages.${pkgs.system}.sequence-detector} -c ${./config/sequence-detector.config.json}";
    };
    startup = {
      apps = config.home-config.startup.apps;
      hooks = [
        "systemctl start --user wm-services.target"
      ];
    };
  };
in {
  imports = [
    ./launcher.nix
    ./services.nix
    ./autorandr.nix
  ];

  options = {
    profiles.desktop.qtile = {
      enable = lib.mkEnableOption "qtile";
    };
  };

  config = lib.mkIf config.profiles.desktop.qtile.enable {

    home.packages = [
      pkgs.ksnip
    ];

    # xdg.configFile."qtile/config.py".text = ''
    #   import sys
    #   sys.path.insert(0, "${./config}")
    #   import config
    # '';

    xdg.configFile."qtile/nixenvironment.py".text = ''
      import json

      class obj(object):
          def __init__(self, dict_):
              self.__dict__.update(dict_)

      with open('${configJson}', 'r') as f:
        nixConfig = json.load(f, object_hook = obj)
      print('Loaded nix config')
    '';

    xdg.configFile."qtile/config.py".source = ./config/config.py;
    xdg.configFile."qtile/utils.py".source = ./config/utils.py;
    xdg.configFile."qtile/functions.py".source = ./config/functions.py;
    xdg.configFile."qtile/bars.py".source = ./config/bars.py;
    xdg.configFile."qtile/screens.py".source = ./config/screens.py;
    xdg.configFile."qtile/styling.py".source = ./config/styling.py;

    xdg.configFile."qtile/tasklist.py".source = ./config/tasklist.py;
    xdg.configFile."qtile/xmonadcustom.py".source = ./config/xmonadcustom.py;
  };
}
Do not follow this link