dotfiles

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

home.nix (5076B)


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