summaryrefslogtreecommitdiff
path: root/home-manager/home.nix
blob: 35678e27fcfc344bcfa87579b4a3908905c5777e (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{ user, config, pkgs, lib, ... }:

let
  nvim-spell-pl-utf8-dict = builtins.fetchurl {
    url = "http://ftp.vim.org/vim/runtime/spell/pl.utf-8.spl";
    sha256 = "1sg7hnjkvhilvh0sidjw5ciih0vdia9vas8vfrd9vxnk9ij51khl";
  };
in {
  home.username = "${user}";
  home.homeDirectory = "/home/${user}";

  home.stateVersion = "22.05"; # Please read the comment before changing.

  # Allow Specific Unfree Packages
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    # Add additional package names here
    "pureref"
    "hplip"
  ];

  home.packages = [
    pkgs.picom
    pkgs.libnotify

    pkgs.pureref
    pkgs.hplipWithPlugin

    (import ./sh/screenshot.nix {inherit pkgs; })
    (import ./sh/wp.nix {inherit pkgs; })
    (import ./sh/colors.nix {inherit pkgs; })
    (import ./sh/yt.nix {inherit pkgs; })
    (import ./sh/mpv.nix {inherit pkgs; })
  ];

  nixpkgs.config.packageOverrides = pkgs: {
    nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
      inherit pkgs;
    };
  };

  home.file = {
    ".config/nvim/spell/pl.utf-8.spl".source = nvim-spell-pl-utf8-dict;

    ".config/sx/sxrc".source = ./sxrc;
    ".config/Xresources".source = ./.Xresources;

    ".config/alacritty/alacritty.yml".text = ''
      font:
        normal:
          family: Neo Comic Mono
          style: Regular
        bold:
          family: Neo Comic Mono
          style: Bold
        size: 12

      colors:
        primary:
          background: '0x181921'
          foreground: '0xeceadd'
        normal:
          black:   '0x090618'
          red:     '0xe32929'
          green:   '0xbdcc27'
          yellow:  '0xff920d'
          blue:    '0x1984db'
          magenta: '0xaf18db'
          cyan:    '0x55c8b9'
          white:   '0x9ca7b2'
        bright:
          black:   '0x413e53'
          red:     '0xd94545'
          green:   '0xbac455'
          yellow:  '0xe59e46'
          blue:    '0x5a9dd4'
          magenta: '0xba5ac9'
          cyan:    '0x61b5aa'
          white:   '0xf1f1f1'
    '';

    ".local/share/gnupg/gpg-agent.conf".text = ''
      debug-pinentry
      debug ipc
      verbose
      enable-ssh-support
      # disable-scdaemon
      #pinentry-program /run/current-system/sw/bin/pinentry
      pinentry-program /run/current-system/sw/bin/pinentry-gtk-2
    '';
  };

  dconf = {
    enable = true;
    settings = {
      "org/gnome/desktop/interface" = {
        color-scheme = "prefer-dark";
      };
    };
  };

  gtk = {
    enable = true;

    font.name = "Neo Comic Mono 12";

    theme = {
      name = "Flat-Remix-GTK-Violet-Dark";
      package = pkgs.flat-remix-gtk;
    };

    iconTheme = {
      name = "Flat-Remix-Violet-Dark";
      package = pkgs.flat-remix-icon-theme;
    };

    cursorTheme = {
      name = "Adwaita";
      package = pkgs.gnome.adwaita-icon-theme;
    };
  };

  services = {
    dunst.enable = true;
  };

  programs = {
    bash = {
      enable = true;

      shellAliases = {
        nr = "sudo nixos-rebuild switch";
        hr = "home-manager switch";
        se = "sudoedit";
        trans = "${pkgs.sdcv}/bin/sdcv --color";
        yta = "yt-dlp -x --audio-format vorbis";
      };

      sessionVariables = {
        EDITOR = "nvim";
        PATH = "$PATH:$HOME/.local/bin";

        XDG_DATA_HOME = "$HOME/.local/share";
        XDG_CONFIG_HOME = "$HOME/.config";
        XDG_STATE_HOME = "$HOME/.local/state";
        XDG_CACHE_HOME = "$HOME/.cache";

        HISTFILE = "$HOME/.local/state/bash/history";

        GNUPGHOME = "$HOME/.local/share/gnupg";
        PASSWORD_STORE_DIR = "$HOME/.local/share/pass";

        #QT_STYLE_OVERRIDE=adwaita
        #QT_QPA_PLATFORMTHEME=gnome
      };

      profileExtra = ''
        if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
          exec sx
        fi
      '';
    };

    git = {
      enable = true;

      userEmail = "jptrzy@gmail.com";
      userName = "Jakub Trzeciak";

      signing = {
        key = "FC040CC63D2527E3";
        signByDefault = true;
      };
    };
  };

  imports = [ ./firefox.nix ];
}
Software created with 💖