[simpler dotfile management]
See the code[!WARNING] This repository will migrate to Codeberg! https://codeberg.org/viperML/nix-maid To perform the migration, please do the following:
If you are using npins:
npins add forgejo codeberg.org viperML nix-maid --branch masterIf you are using flakes:
sed -i 's#github:viperML/nix-maid#git+https://codeberg.org/viperML/nix-maid#g' ./flake.nix
nix flake update --flake . nix-maidOtherwise:
sed -i 's#github.com/viperML/nix-maid#codeberg.org/viperML/nix-maid#g'If you have any issues during the migration, please open a bug report! https://codeberg.org/viperML/nix-maid/issues
Nix-maid is a library for managing your dotfiles, powered by Nix. Simple by design, it will make configuring your desktop environment a breeze. As an alternative to Home-Manager, we throw away many outdated concepts, making nix-maid the state of the art in dotfile management. Join us into making the desktop experience great again! ❄️🧹
Nix-Maid's options are fully documented: https://viperml.codeberg.page/nix-maid/api. Documentation is top priority for the project.
To get a feel of how nix-maid is used, the following example shows a standalone nix-maid configuration:
# my-config.nix
let
sources = import ./npins;
pkgs = import sources.nixpkgs;
nix-maid = import sources.nix-maid;
in
nix-maid pkgs {
file.home.".gitconfig".text = ''
[user]
name=Maid
'';
# {{mustache syntax}} resolves at runtime
# Giving more flexibility and portability across users
file.xdg_config."hypr/hyprland.conf".source = "{{home}}/dotfiles/hyprland.conf";
# Define systemd-user services, like you would on NixOS
systemd.services.waybar = {
path = [ pkgs.waybar ];
script = ''
exec waybar
'';
wantedBy = [ "graphical-session.target" ];
};
# Configure gnome with dconf or gsettings
gsettings.settings = {
org.gnome.mutter.experimental-features = [
"scale-monitor-framebuffer" "xwayland-native-scaling"
];
};
dconf.settings = {
"/org/gnome/desktop/interface/color-scheme" = "prefer-dark";
};
# Configure KDE Plasma
kconfig.settings = {
kwinrc = {
Desktops.Number = 4;
};
baloofilerc = {
"Basic Settings".Indexing-Enabled = false;
};
};
}
# install and activate:
$ nix-env -if ./my-config.nix
$ activate
Nix-maid also supports being installed as a NixOS module, which is as simple as possible:
# configuration.nix
{ config, pkgs, ...}: {
imports = [
(import (import ./npins).nix-maid).nixosModules.default
];
users.users.alice = {
isNormalUser = true;
maid = {
gsettings.settings = {
org.gnome.desktop.interface.accent-color = "pink";
};
file.home.".gitconfig".text = ''
[user]
name=Alice
'';
};
};
}
If you like the implementation details, these are some details that we improve on Home-Manager:
file.home, the symlink will not be direct. Instead, we use a "static directory":
~/.gitconfig -> <static>/.gitconfig -> /nix/store/...gitconfig. This is also done by NixOS for /etc and has several advantages:
file.home.foo.source = "{{home}}/bar". This variable is resolved at activation time. This
means that your nix-maid configuration doesn't require setting a home.homeDirectory, and is easily shareable with other people.environment.etc.<name>.source. If you declare .source = "string",
nix-maid won't try to coerce it into the nix-store, thus avoiding the non-ergonomic mkOutOfStoreSymlink function of home-manager, and all
the weirdness and bugs that stem from it.home-manager switch, which makes it feel sluggish.Nix
88.6%
Python
11.3%
[simpler dotfile management]
See the code[!WARNING] This repository will migrate to Codeberg! https://codeberg.org/viperML/nix-maid To perform the migration, please do the following:
If you are using npins:
npins add forgejo codeberg.org viperML nix-maid --branch masterIf you are using flakes:
sed -i 's#github:viperML/nix-maid#git+https://codeberg.org/viperML/nix-maid#g' ./flake.nix
nix flake update --flake . nix-maidOtherwise:
sed -i 's#github.com/viperML/nix-maid#codeberg.org/viperML/nix-maid#g'If you have any issues during the migration, please open a bug report! https://codeberg.org/viperML/nix-maid/issues
Nix-maid is a library for managing your dotfiles, powered by Nix. Simple by design, it will make configuring your desktop environment a breeze. As an alternative to Home-Manager, we throw away many outdated concepts, making nix-maid the state of the art in dotfile management. Join us into making the desktop experience great again! ❄️🧹
Nix-Maid's options are fully documented: https://viperml.codeberg.page/nix-maid/api. Documentation is top priority for the project.
To get a feel of how nix-maid is used, the following example shows a standalone nix-maid configuration:
# my-config.nix
let
sources = import ./npins;
pkgs = import sources.nixpkgs;
nix-maid = import sources.nix-maid;
in
nix-maid pkgs {
file.home.".gitconfig".text = ''
[user]
name=Maid
'';
# {{mustache syntax}} resolves at runtime
# Giving more flexibility and portability across users
file.xdg_config."hypr/hyprland.conf".source = "{{home}}/dotfiles/hyprland.conf";
# Define systemd-user services, like you would on NixOS
systemd.services.waybar = {
path = [ pkgs.waybar ];
script = ''
exec waybar
'';
wantedBy = [ "graphical-session.target" ];
};
# Configure gnome with dconf or gsettings
gsettings.settings = {
org.gnome.mutter.experimental-features = [
"scale-monitor-framebuffer" "xwayland-native-scaling"
];
};
dconf.settings = {
"/org/gnome/desktop/interface/color-scheme" = "prefer-dark";
};
# Configure KDE Plasma
kconfig.settings = {
kwinrc = {
Desktops.Number = 4;
};
baloofilerc = {
"Basic Settings".Indexing-Enabled = false;
};
};
}
# install and activate:
$ nix-env -if ./my-config.nix
$ activate
Nix-maid also supports being installed as a NixOS module, which is as simple as possible:
# configuration.nix
{ config, pkgs, ...}: {
imports = [
(import (import ./npins).nix-maid).nixosModules.default
];
users.users.alice = {
isNormalUser = true;
maid = {
gsettings.settings = {
org.gnome.desktop.interface.accent-color = "pink";
};
file.home.".gitconfig".text = ''
[user]
name=Alice
'';
};
};
}
If you like the implementation details, these are some details that we improve on Home-Manager:
file.home, the symlink will not be direct. Instead, we use a "static directory":
~/.gitconfig -> <static>/.gitconfig -> /nix/store/...gitconfig. This is also done by NixOS for /etc and has several advantages:
file.home.foo.source = "{{home}}/bar". This variable is resolved at activation time. This
means that your nix-maid configuration doesn't require setting a home.homeDirectory, and is easily shareable with other people.environment.etc.<name>.source. If you declare .source = "string",
nix-maid won't try to coerce it into the nix-store, thus avoiding the non-ergonomic mkOutOfStoreSymlink function of home-manager, and all
the weirdness and bugs that stem from it.home-manager switch, which makes it feel sluggish.Nix
88.6%
Python
11.3%