Home-manager: Creating arbitrary file in home directory

Created on 12 Sep 2020  路  4Comments  路  Source: nix-community/home-manager

Issue description

This is a support question. How do I use nix via home manager to create an abitrary text file? In my case, I want the following content at ~/.ideavimrc :

map <C-k> <C-w>k
map <C-j> <C-w>j
map <C-l> <C-w>l
map <C-h> <C-w>h
let mapleader=","
inoremap jj <ESC>

Any help or pointers would be appreciated.

All 4 comments

You're probably looking for home.file.<name>.text -- more specifically, home.file.".ideavimrc".text.

Thank you! That looks like it should do what I want. I am new to nix and am unsure where to go next to discover the structure and syntax of the rest of the expression, including where to put the actual contents of the file. Where can I find such documentation?

I actually linked to the documentation in my earlier comment. Here is an example of how I use .text and .source.

https://github.com/cole-h/nixos-config/blob/2ba44b448792ac7c811a673a9d34c6c4b8b4d8b6/users/vin/modules/gpg.nix#L4-L18

Thank you. The example above with the multiple file paths and text is helpful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dermetfan picture dermetfan  路  6Comments

loewenheim picture loewenheim  路  7Comments

pmiddend picture pmiddend  路  3Comments

mightybyte picture mightybyte  路  5Comments

turion picture turion  路  7Comments