dotfiles

andersuno dotfiles
git clone git://git.andersuno.nu/dotfiles.git
Log | Files | Refs | README

home.nix (4964B)


      1 {
      2   config,
      3   pkgs,
      4   user,
      5   homedir,
      6   dotdir,
      7   ...
      8 }:
      9 
     10 {
     11   # Home Manager needs a bit of information about you and the paths it should
     12   # manage.
     13   home.username = user;
     14   home.homeDirectory = homedir;
     15 
     16   programs.git = {
     17     enable = true;
     18     userName = "Anders Hedman";
     19     userEmail = "anders.hedman01gmail.com";
     20     extraConfig = {
     21       init = {
     22         defaultBranch = "main";
     23       };
     24     };
     25   };
     26 
     27   # This value determines the Home Manager release that your configuration is
     28   # compatible with. This helps avoid breakage when a new Home Manager release
     29   # introduces backwards incompatible changes.
     30   #
     31   # You should not change this value, even if you update Home Manager. If you do
     32   # want to update the value, then make sure to first check the Home Manager
     33   # release notes.
     34   home.stateVersion = "24.05"; # Please read the comment before changing.
     35 
     36   # The home.packages option allows you to install Nix packages into your
     37   # environment.
     38   home.packages = with pkgs; [
     39     # # Adds the 'hello' command to your environment. It prints a friendly
     40     # # "Hello, world!" when run.
     41     # pkgs.hello
     42 
     43     # # It is sometimes useful to fine-tune packages, for example, by applying
     44     # # overrides. You can do that directly here, just don't forget the
     45     # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
     46     # # fonts?
     47     # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
     48 
     49     # # You can also create simple shell scripts directly inside your
     50     # # configuration. For example, this adds a command 'my-hello' to your
     51     # # environment:
     52     # (pkgs.writeShellScriptBin "my-hello" ''
     53     #   echo "Hello, ${config.home.username}!"
     54     # '')
     55     nixfmt-rfc-style
     56     nixd
     57   ];
     58 
     59   # Home Manager is pretty good at managing dotfiles. The primary way to manage
     60   # plain files is through 'home.file'.
     61   home.file = {
     62     # # Building this configuration will create a copy of 'dotfiles/screenrc' in
     63     # # the Nix store. Activating the configuration will then make '~/.screenrc' a
     64     # # symlink to the Nix store copy.
     65     # ".screenrc".source = dotfiles/screenrc;
     66 
     67     # # You can also set the file content immediately.
     68     # ".gradle/gradle.properties".text = ''
     69     #   org.gradle.console=verbose
     70     #   org.gradle.daemon.idletimeout=3600000
     71     # '';
     72     ".doom.d".source = "${dotdir}/.doom.d";
     73   };
     74 
     75   # Home Manager can also manage your environment variables through
     76   # 'home.sessionVariables'. These will be explicitly sourced when using a
     77   # shell provided by Home Manager. If you don't want to manage your shell
     78   # through Home Manager then you have to manually source 'hm-session-vars.sh'
     79   # located at either
     80   #
     81   #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
     82   #
     83   # or
     84   #
     85   #  ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
     86   #
     87   # or
     88   #
     89   #  /etc/profiles/per-user/anders/etc/profile.d/hm-session-vars.sh
     90   #
     91   home.sessionVariables = {
     92     # EDITOR = "emacs";
     93   };
     94 
     95   dconf.settings = {
     96     "org/gnome/desktop/interface" = {
     97       clock-show-weekday = true;
     98       color-scheme = "prefer-dark";
     99     };
    100     "org/gnome/desktop/input-sources" = {
    101       xkb-options = [ "caps:escape" ];
    102     };
    103     "org/gnome/desktop/wm/keybindings" = {
    104       activate-window-menu = [ "Menu" ];
    105       switch-applications = [ "<Super>Tab" ];
    106       switch-applications-backward = [ "<Shift><Super>Tab" ];
    107       close = [ "<Super>w" ];
    108       minimize = [ "<Shift><Alt>h" ];
    109       move-to-workspace-1 = [
    110         "<Shift><Super>h"
    111         "<Shift><Super>Home"
    112       ];
    113       move-to-workspace-last = [
    114         "<Shift><Super>l"
    115         "<Shift><Super>End"
    116       ];
    117       move-to-workspace-left = [
    118         "<Shift><Super>j"
    119         "<Shift><Super>Page_Up"
    120       ];
    121       move-to-workspace-right = [
    122         "<Shift><Super>k"
    123         "<Shift><Super>Page_Down"
    124       ];
    125       switch-to-workspace-1 = [
    126         "<Super>h"
    127         "<Super>Home"
    128       ];
    129       switch-to-workspace-last = [
    130         "<Super>l"
    131         "<Super>End"
    132       ];
    133       switch-to-workspace-left = [
    134         "<Super>j"
    135         "<Super>Page_Up"
    136       ];
    137       switch-to-workspace-right = [
    138         "<Super>k"
    139         "<Super>Page_Down"
    140       ];
    141       switch-windows = [ "<Alt>Tab" ];
    142       switch-windows-backward = [ "<Shift><Alt>Tab" ];
    143     };
    144     "org/gnome/desktop/wm/preferences" = {
    145       button-layout = "appmenu:minimize,maximize,close";
    146       #focus-mode = "click";
    147       #focus-new-window = "smart";
    148     };
    149     "org/gnome/settings-daemon/plugins/media-keys" = {
    150       screensaver = [ "<Shift><Alt>l" ];
    151       custom-keybindings = [
    152         "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
    153         "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
    154       ];
    155     };
    156     "org/gnome/shell/window-switcher" = {
    157       current-workspace-only = false;
    158     };
    159   };
    160 
    161   # Let Home Manager install and manage itself.
    162   programs.home-manager.enable = true;
    163 }