Developers profile
Powered by Home Manager, this project offers a variety of user profiles, each packed with command-line programs and configurations designed specifically for developers.
Leveraging the Nix package manager, Home Manager provides a declarative approach to managing a user's environment. It focuses on user-specific (non-global) packages and dotfiles, offering a "ready-to-use" profile for command-line enthusiasts. The cornerstone of this project is its commitment to reproducibility across all machines, ensuring consistent experiences for users in different environments.
Compatibility
This configuration has been rigorously tested and confirmed to work seamlessly on a range of operating systems, including:
- Any Linux
- Amazon SRV4Dev
- Apple MacOS
With this broad compatibility, developers can trust in a uniform setup process and working environment, regardless of their OS choice.
Requirements
- Nix package manager,
- No root access required.
Installation
Install this developer profile in three steps:
-
Install Nix: Ensure Nix is installed on your system. We recommend using the Determinate System installer with the following command:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
-
Enable a specific profile: To apply a profile to your user, execute the following command in a terminal:
nix run home-manager/master -- switch --flake git+https://code.europa.eu/ecphp/devs-profile#light --impure
Here, the
light
profile is used as an example. You can replace it with any other profile, such asdefault
, see the section "Profiles" for more information.Restart your terminal afterwards.
--impure
flag
Note about To use this home-manager profile, you must include the --impure
flag. This
necessity arises from the fact that the profile is designed to function with any
username on any machine. As usernames vary across different machines, it's
essential to have a method to read the current username within this profile.
This can be accomplished by accessing the environment variable USER
. However,
by design, a Nix flake does not have permission to access local environment
variables. Adding the --impure
flag grants this access, ensuring that the
variable can be read and the profile can function as intended.
Update
The flake.lock
file in this repository pins all necessary information for a
reproducible and fully functional environment. To update, rerun the installation
command. Nix ensures the user environment matches this repository's state.
Usage
Once installed, users will have access to the list of softwares, see section
"What's inside". Some of them are pre-configured, like fish
and git
.
Profiles
Light
This profile is a lightweight profile, containing only the essentials for a cool and efficient command-line experience.
Install it by doing: home-manager switch --flake git+https://code.europa.eu/ecphp/devs-profile#light --impure
Default
This profiles, the default one, is a more complete profile, containing the
light
profile and more tools for a complete development experience.
List of tools included:
Install it by doing: home-manager switch --flake git+https://code.europa.eu/ecphp/devs-profile#default --impure
More profiles?
More profiles will be added in the future, each tailored to a specific use case. Feel free to suggest new profiles or contribute your own!
Customisations
git
git
comes with a handful of aliases, to list them use git aliases
. However,
the default configuration of git
is managed by nix
in ~/.config/git/config
and it's better to not modify this file directly. Therefore, if you want to make
changes in the git configuration, it is advised to create a file ~/.gitconfig
containing all your local changes, such as:
[user]
email = "username@domain"
name = "John Doe"