Files
dotfiles/home/default.nix
T

58 lines
1.6 KiB
Nix

{ config, lib, pkgs, osRelease, ... }:
let
cfg = config.dotfiles;
in
{
imports = [
./shell.nix
./git.nix
./dev.nix
./ssh.nix
./agents.nix
./gui
];
options.dotfiles = {
work = lib.mkEnableOption "work-only desktop subset";
gui = lib.mkEnableOption "GUI layer (KDE Plasma, Flatpaks, Konsole, themes)";
dir = lib.mkOption {
type = lib.types.str;
description = "Absolute path of the dotfiles checkout; used for writable out-of-store links.";
};
os = lib.mkOption {
type = lib.types.str;
default = osRelease;
description = "ID= from /etc/os-release at switch time (steamos, fedora, arch, cachyos, ...).";
};
# Link a file from the checkout instead of the Nix store, so apps that write
# their own config (Claude, Vesktop, Konsole) can, and the change shows up in git.
link = lib.mkOption {
type = lib.types.functionTo lib.types.anything;
readOnly = true;
default = rel: config.lib.file.mkOutOfStoreSymlink "${cfg.dir}/${rel}";
};
};
config = {
home.stateVersion = "25.11";
programs.home-manager.enable = true;
targets.genericLinux.enable = true;
# Its GPU shim needs a root unit in /etc; the only Nix GUI app (XPipe) renders fine in software.
targets.genericLinux.gpu.enable = false;
news.display = "silent";
nix = {
package = lib.mkDefault pkgs.nix;
settings.experimental-features = [ "nix-command" "flakes" ];
};
home.sessionPath = [ "$HOME/.local/bin" "${cfg.dir}/bin" ];
home.sessionVariables = {
DOTFILES_DIR = cfg.dir;
EDITOR = "nano";
};
xdg.enable = true;
};
}