My Nix Configuration

[modules.home] Actually make profiles options

Changed files
+180 -171
modules
home
profiles
+22 -15
modules/home/profiles/base/default.nix
···
-
{ ... }:
+
{
+
config,
+
lib,
+
osConfig,
+
...
+
}:
+
let
+
cfg = config.py.profiles.base;
+
in
{
-
imports = [
-
../programs/gpg.nix
-
../xdg.nix
-
];
-
programs.home-manager.enable = true;
-
home.stateVersion = "24.05";
-
home.language = {
-
base = "en_US.utf8";
-
};
-
manual = {
-
manpages.enable = false;
-
html.enable = false;
-
json.enable = false;
+
options.py.profiles.base.enable = lib.mkEnableOption "Base Home Profile";
+
config = lib.mkIf cfg.enable {
+
programs.home-manager.enable = true;
+
home.stateVersion = osConfig.system.stateVersion;
+
home.language = {
+
base = "en_US.utf8";
+
};
+
manual = {
+
manpages.enable = false;
+
html.enable = false;
+
json.enable = false;
+
};
+
programs.man.enable = false;
};
-
programs.man.enable = false;
}
+43 -50
modules/home/profiles/cli/default.nix
···
-
{ pkgs, ... }:
{
-
imports = [
-
../programs/bat.nix
-
../programs/direnv.nix
-
../programs/fish.nix
-
../programs/fzf.nix
-
../programs/helix.nix
-
../programs/neovim.nix
-
../programs/nix-index.nix
-
../programs/nushell
-
../programs/pandoc.nix
-
../programs/ssh
-
../programs/starship.nix
-
../programs/zoxide.nix
-
../programs/zsh.nix
-
-
../files/distrobox-config.nix
-
];
-
py.programs = {
-
git.enable = true;
-
gh.enable = true;
-
lazygit.enable = true;
-
};
-
programs = {
-
eza = {
-
enable = true;
-
icons = true;
-
git = true;
-
enableBashIntegration = false;
-
enableIonIntegration = false;
+
pkgs,
+
lib,
+
config,
+
...
+
}:
+
let
+
cfg = config.py.profiles.cli;
+
in
+
{
+
options.py.profiles.cli.enable = lib.mkEnableOption "CLI Profile";
+
config = lib.mkIf cfg.enable {
+
py.programs = {
+
git.enable = true;
+
gh.enable = true;
+
lazygit.enable = true;
+
};
+
programs = {
+
eza = {
+
enable = true;
+
icons = true;
+
git = true;
+
enableBashIntegration = false;
+
enableIonIntegration = false;
+
};
+
btop = {
+
enable = true;
+
catppuccin.enable = true;
+
};
+
glamour.catppuccin.enable = true;
};
-
btop = {
-
enable = true;
-
catppuccin.enable = true;
+
xdg.configFile = {
+
"rbw/config.json".source = ./rbw-config.json;
};
-
glamour.catppuccin.enable = true;
-
};
-
xdg.configFile = {
-
"rbw".source = ../../oldconfig/rbw;
-
"rbw".recursive = true;
+
home.packages = with pkgs; [
+
btrfs-progs
+
fd
+
fzf
+
glow
+
gnupg
+
pinentry
+
rbw
+
rsync
+
xdg-utils
+
yt-dlp
+
];
};
-
home.packages = with pkgs; [
-
btrfs-progs
-
fd
-
fzf
-
glow
-
gnupg
-
pinentry
-
rbw
-
rsync
-
xdg-utils
-
yt-dlp
-
];
}
+1
modules/home/profiles/cli/rbw-config.json
···
+
{"email":"pyrox@pyrox.dev","base_url":"https://bw.pyrox.dev","identity_url":null,"lock_timeout":3600,"pinentry":"pinentry"}
+32 -33
modules/home/profiles/desktop/default.nix
···
-
{ pkgs, ... }:
+
{
+
pkgs,
+
config,
+
lib,
+
...
+
}:
+
let
+
cfg = config.py.profiles.desktop;
+
inherit (lib) mkIf mkDefault mkEnableOption;
+
in
{
-
imports = [
-
./base.nix
-
./cli.nix
-
./gui.nix
-
./development.nix
-
# ../email.nix
-
# ../programs/email.nix
-
];
-
programs.mpv.enable = true;
-
home.packages = with pkgs; [
-
appimage-run
-
brightnessctl
-
ciscoPacketTracer8
-
dex
-
keepassxc
-
(mumble.override { pipewireSupport = true; })
-
playerctl
-
pulseaudio-ctl
-
thunderbird
-
wlogout
-
wl-clipboard
-
zotero
-
];
-
xdg.configFile = {
-
"waybar/style.css" = {
-
source = ../../oldconfig/waybar/style.css;
-
recursive = false;
+
options.py.profiles.desktop.enable = mkEnableOption "Desktop Config";
+
config = mkIf cfg.enable {
+
py.profiles = {
+
base.enable = mkDefault true;
+
gui.enable = mkDefault true;
+
development.enable = mkDefault true;
};
-
"waybar/mocha.css" = {
-
source = ../../oldconfig/waybar/mocha.css;
-
recursive = false;
-
};
+
programs.mpv.enable = mkDefault true;
+
home.packages = with pkgs; [
+
appimage-run
+
brightnessctl
+
ciscoPacketTracer8
+
dex
+
keepassxc
+
(mumble.override { pipewireSupport = true; })
+
playerctl
+
pulseaudio-ctl
+
thunderbird
+
wlogout
+
wl-clipboard
+
zotero
+
];
+
services.easyeffects.enable = mkDefault true;
};
-
services.easyeffects.enable = true;
}
+20 -11
modules/home/profiles/development/default.nix
···
-
{ pkgs, ... }:
+
{
+
pkgs,
+
lib,
+
config,
+
...
+
}:
let
customPython = pkgs.python312.withPackages (ps: [ ps.pip ]);
+
cfg = config.py.profiles.dev;
in
{
-
home.packages = with pkgs; [
-
alejandra
-
any-nix-shell
-
cargo
-
colmena
-
customPython
-
editorconfig-core-c
-
nil
-
nixd
-
];
+
options.py.profiles.development.enable = lib.mkEnableOption "Development Profile";
+
config.home.packages =
+
with pkgs;
+
lib.mkIf cfg.enable [
+
alejandra
+
any-nix-shell
+
cargo
+
colmena
+
customPython
+
editorconfig-core-c
+
nil
+
nixd
+
];
}
+51 -57
modules/home/profiles/gui/default.nix
···
{
pkgs,
-
# games ? true,
-
# social ? true,
+
lib,
+
config,
...
}:
+
let
+
cfg = config.py.profiles.gui;
+
inherit (lib) mkEnableOption mkIf mkDefault;
+
in
{
-
imports = [
-
../wayland/sway.nix
-
-
../programs/kitty.nix
-
../programs/obs.nix
-
../programs/vscodium.nix
-
../programs/wlogout
-
-
../services/gpg-agent.nix
-
../services/kanshi.nix
-
../services/mako.nix
-
../services/mpd.nix
-
../services/syncthing.nix
-
-
../theming.nix
-
-
../files/ssh-auth-signers.nix
-
../files/rbw-gc.nix
-
../files/pamKeys.nix
-
];
-
home.sessionVariables = {
-
XDG_CURRENT_DESKTOP = "sway";
-
};
-
py.programs = {
-
firefox = {
-
enable = true;
-
prefs.enable = true;
-
policies.enable = true;
+
options.py.profiles.gui.enable = mkEnableOption "GUI Profile";
+
config = mkIf cfg.enable {
+
home.sessionVariables = {
+
XDG_CURRENT_DESKTOP = "sway";
};
-
chromium.enable = true;
+
py = {
+
gui.enable = true;
+
programs = {
+
chromium.enable = mkDefault true;
+
firefox = {
+
enable = mkDefault true;
+
prefs.enable = mkDefault true;
+
policies.enable = mkDefault true;
+
};
+
kitty.enable = mkDefault true;
+
obs.enable = mkDefault true;
+
vscodium.enable = mkDefault true;
+
wlogout.enable = mkDefault true;
+
};
+
services = {
+
gpg-agent.enable = mkDefault true;
+
mako.enable = mkDefault true;
+
syncthing.enable = mkDefault true;
+
};
+
};
+
home.packages = with pkgs; [
+
jetbrains-toolbox
+
libappindicator
+
libappindicator-gtk3
+
pavucontrol
+
grim
+
slurp
+
satty
+
sway-launcher-desktop
+
ueberzug
+
lutris
+
py.olympus
+
py.git-credential-rbw
+
prismlauncher
+
protontricks
+
proton-caller
+
gajim
+
tauon
+
(vesktop.override { withSystemVencord = false; })
+
krita
+
];
};
-
home.packages = with pkgs; [
-
jetbrains-toolbox
-
libappindicator
-
libappindicator-gtk3
-
pavucontrol
-
grim
-
slurp
-
satty
-
sway-launcher-desktop
-
ueberzug
-
vscode
-
# ] ++ lib.optionals games [
-
# factorio-experimental
-
lutris
-
# py.olympus
-
prismlauncher
-
protontricks
-
proton-caller
-
# ] ++ lib.optionals social [
-
gajim
-
tauon
-
(vesktop.override { withSystemVencord = false; })
-
# pidginWithPlugins
-
# ] ++ lib.optionals drawing [
-
krita
-
];
}
+11 -5
modules/home/profiles/server/default.nix
···
-
{ ... }:
+
{ lib, config, ... }:
+
let
+
cfg = config.py.profiles.server;
+
in
{
-
imports = [
-
./base.nix
-
./cli.nix
-
];
+
options.py.profiles.server.enable = lib.mkEnableOption "Server Profile";
+
config = lib.mkIf cfg.enable {
+
py.profiles = {
+
base.enable = lib.mkDefault true;
+
cli.enable = lib.mkDefault true;
+
};
+
};
}