My declarative dotfiles configuration using nix and home-manager to manage my systems.
This configuration should work in all distribution in theory, but because nixpkgs has some issue with opengl, some features may not work. Namely alacritty
and picom
won't be able to launch if you are not using NixOS.
Make sure flakes are enabled on your system.
nix develop
home-manager switch --flake .#<profile>
where <profile>
is your desired profile.
Simply run the command with flakes enabled to get my full NixOS configuration
sudo nixos-rebuild switch --flake .#<host>
Diffrent hosts are available.
My old Ideapad Y580 from 2012. A thick boy but still fully functionning. NixOS gave it a breath of fresh air.
My main tower for development, work and games.
Server for hosting a couple services for the family and myself.
The free tier oracle A1 vm. For doing random projects and monitors Sheogorath
.
Different profiles are available in the profiles
directory. Namely minimal
for TUI headless server, dev
for headless development, graphical
for GUI and desktop
for GUI and DE. Each profile is a superset of the other.
You can use this flake as a module to your home-manager configuration or your NixOS configuration.
- To use as a nixos module
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/master";
nix-dotfiles.url = "github:xgroleau/nix-dotfiles";
};
outputs = { nixpkgs, home-manager, nix-dotfiles, ... }: {
nixosConfigurations = {
example = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nix-dotfiles.nixosModules
# Enable some modules
{
modules.kdeconnect.enable = true;
}
];
};
};
};
}
To use for your home-manager configuration.
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/master";
nix-dotfiles.url = "github:xgroleau/nix-dotfiles";
};
outputs = { nixpkgs, home-manager, nix-dotfiles, ... }: {
homeConfigurations = {
example = nix-dotfiles.utils.homeConfigurationFromProfile {
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${flake-utils.lib.system.x86_64-linux};
modules = [
nix-dotfiles.homeManagerModules
# Enable some modules
{
# Minimum HM requirements
home = {
username = "xgroleau";
homeDirectory = "/home/xgroleau";
stateVersion = "23.11";
};
modules.shell.zsh.enable = true;
}
];
};
};
};
}
To check formatting with nixfmt and analyze with statix you can run
nix flake check
Or to apply the changes directly, you can run.
nix run .#fmt