Use nixosModules and homeManagerModules for config

This commit is contained in:
Oliver Davies 2025-03-05 15:09:06 +00:00
parent 88a054f3b4
commit 2de0e1a2d6
46 changed files with 151 additions and 190 deletions

View file

@ -1,18 +1,15 @@
{
features = {
cli = {
direnv.enable = true;
neovim.enable = true;
tmux.enable = true;
homeManagerModules = {
direnv.enable = true;
neovim.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/tfw-notes";
};
syncthing.enable = true;
tmux-sessionizer.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/tfw-notes";
};
syncthing.enable = true;
tmux.enable = true;
tmux-sessionizer.enable = true;
};
}

View file

@ -1,30 +1,21 @@
{ ... }:
{
features = {
cli = {
direnv.enable = true;
syncthing.enable = true;
tmux-sessionizer.enable = true;
};
desktop = {
copyq.enable = true;
discord.enable = true;
espanso.enable = true;
flameshot.enable = true;
gtk.enable = true;
slack.enable = true;
media = {
gimp.enable = true;
handbrake.enable = true;
kdenlive.enable = true;
pocket-casts.enable = true;
mpv.enable = true;
};
zoom.enable = true;
};
homeManagerModules = {
copyq.enable = true;
direnv.enable = true;
discord.enable = true;
espanso.enable = true;
flameshot.enable = true;
gimp.enable = true;
gtk.enable = true;
handbrake.enable = true;
kdenlive.enable = true;
mpv.enable = true;
pocket-casts.enable = true;
slack.enable = true;
syncthing.enable = true;
tmux-sessionizer.enable = true;
zoom.enable = true;
};
}

View file

@ -1,15 +1,9 @@
{ ... }:
{
features = {
cli = {
direnv.enable = true;
syncthing.enable = true;
};
desktop = {
dwm.enable = true;
# gtk.enable = true;
};
homeManagerModules = {
direnv.enable = true;
dwm.enable = true;
syncthing.enable = true;
};
}

View file

@ -1,42 +1,32 @@
{ pkgs, ... }:
{
features = {
cli = {
bluetuith.enable = true;
direnv.enable = true;
neovim.enable = true;
homeManagerModules = {
bluetuith.enable = true;
copyq.enable = true;
direnv.enable = true;
discord.enable = true;
dwm.enable = true;
espanso.enable = true;
flameshot.enable = true;
gimp.enable = true;
gtk.enable = true;
handbrake.enable = true;
kdenlive.enable = true;
mpv.enable = true;
neovim.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/notes";
};
syncthing.enable = true;
tmux.enable = true;
tmux-sessionizer.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/notes";
};
desktop = {
copyq.enable = true;
discord.enable = true;
dwm.enable = true;
espanso.enable = true;
flameshot.enable = true;
gtk.enable = true;
slack.enable = true;
media = {
gimp.enable = true;
handbrake.enable = true;
kdenlive.enable = true;
pocket-casts.enable = true;
mpv.enable = true;
};
zoom.enable = true;
};
pocket-casts.enable = true;
slack.enable = true;
syncthing.enable = true;
tmux.enable = true;
tmux-sessionizer.enable = true;
zoom.enable = true;
};
home.packages = with pkgs; [

View file

@ -15,10 +15,8 @@
wl-clipboard
];
features = {
cli = {
docker.enable = true;
};
nixosModules = {
docker.enable = true;
};
wsl = {

View file

@ -15,25 +15,19 @@
../../users/opdavies
];
features = {
cli = {
docker.enable = true;
};
desktop.dwm.enable = true;
homelab = {
audiobookshelf.enable = true;
beaverhabits.enable = true;
freshrss.enable = true;
gitea.enable = true;
immich.enable = true;
jellyfin.enable = true;
paperless.enable = true;
pihole.enable = true;
tubearchivist-container.enable = true;
vaultwarden.enable = true;
};
nixosModules = {
audiobookshelf.enable = true;
beaverhabits.enable = true;
docker.enable = true;
dwm.enable = true;
freshrss.enable = true;
gitea.enable = true;
immich.enable = true;
jellyfin.enable = true;
paperless.enable = true;
pihole.enable = true;
tubearchivist-container.enable = true;
vaultwarden.enable = true;
};
programs.dconf.enable = true;

View file

@ -16,17 +16,12 @@
];
nixosModules = {
autorandr.enable = true;
dwm.enable = true;
gaming.enable = true;
st.enable = true;
};
features = {
desktop = {
autorandr.enable = true;
dwm.enable = true;
gaming.enable = true;
thunar.enable = true;
peek.enable = true;
};
thunar.enable = true;
peek.enable = true;
};
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
@ -58,6 +53,7 @@
environment.systemPackages = with pkgs; [
gtypist
newsboat
pam_gnupg
rclone
rclone-browser
sxiv

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.cli.bluetuith.enable = mkEnableOption "Enable bluetuith";
options.homeManagerModules.bluetuith.enable = mkEnableOption "Enable bluetuith";
config = mkIf config.features.cli.bluetuith.enable {
config = mkIf config.homeManagerModules.bluetuith.enable {
home.packages = with pkgs; [
bluetuith
];

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.cli.direnv.enable = mkEnableOption "Enable direnv";
options.homeManagerModules.direnv.enable = mkEnableOption "Enable direnv";
config = mkIf config.features.cli.direnv.enable {
config = mkIf config.homeManagerModules.direnv.enable {
programs.direnv = {
enable = true;
enableZshIntegration = true;

View file

@ -13,9 +13,9 @@ let
phpPackages = pkgs.php82Packages;
in
{
options.features.cli.neovim.enable = mkEnableOption "Enable neovim";
options.homeManagerModules.neovim.enable = mkEnableOption "Enable neovim";
config = mkIf config.features.cli.neovim.enable {
config = mkIf config.homeManagerModules.neovim.enable {
programs.neovim = {
enable = true;

View file

@ -8,10 +8,10 @@
with lib;
let
cfg = config.features.cli.notes;
cfg = config.homeManagerModules.notes;
in
{
options.features.cli.notes = {
options.homeManagerModules.notes = {
enable = mkEnableOption "Enable notes";
directory = mkOption {

View file

@ -3,10 +3,10 @@
with lib;
let
cfg = config.features.cli.syncthing;
cfg = config.homeManagerModules.syncthing;
in
{
options.features.cli.syncthing.enable = mkEnableOption "Enable syncthing";
options.homeManagerModules.syncthing.enable = mkEnableOption "Enable syncthing";
config = mkIf cfg.enable {
services.syncthing.enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.cli.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
options.homeManagerModules.tmux-sessionizer.enable = mkEnableOption "Enable tmux-sessionizer";
config = mkIf config.features.cli.tmux-sessionizer.enable {
config = mkIf config.homeManagerModules.tmux-sessionizer.enable {
home.packages = with pkgs; [ tmux-sessionizer ];
home.file.".tmux-sessionizer".source = "${

View file

@ -11,9 +11,9 @@ let
inherit (pkgs) tmuxPlugins;
in
{
options.features.cli.tmux.enable = mkEnableOption "Enable tmux";
options.homeManagerModules.tmux.enable = mkEnableOption "Enable tmux";
config = mkIf config.features.cli.tmux.enable {
config = mkIf config.homeManagerModules.tmux.enable {
programs.tmux = {
enable = true;

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.desktop.copyq.enable = mkEnableOption "Enable copyq";
options.homeManagerModules.copyq.enable = mkEnableOption "Enable copyq";
config = mkIf config.features.desktop.copyq.enable {
config = mkIf config.homeManagerModules.copyq.enable {
services.copyq.enable = true;
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.discord.enable = mkEnableOption "Enable Discord";
options.homeManagerModules.discord.enable = mkEnableOption "Enable Discord";
config = mkIf config.features.desktop.discord.enable {
config = mkIf config.homeManagerModules.discord.enable {
home.packages = with pkgs; [ discord ];
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.dwm.enable = mkEnableOption "Enable dwm";
options.homeManagerModules.dwm.enable = mkEnableOption "Enable dwm";
config = mkIf config.features.desktop.dwm.enable {
config = mkIf config.homeManagerModules.dwm.enable {
home = {
file.".xinitrc".text = ''
systemctl --user import-environment DISPLAY

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.desktop.espanso.enable = mkEnableOption "Enable espanso";
options.homeManagerModules.espanso.enable = mkEnableOption "Enable espanso";
config = mkIf config.features.desktop.espanso.enable {
config = mkIf config.homeManagerModules.espanso.enable {
services.espanso = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.flameshot.enable = mkEnableOption "Enable flameshot";
options.homeManagerModules.flameshot.enable = mkEnableOption "Enable flameshot";
config = mkIf config.features.desktop.flameshot.enable {
config = mkIf config.homeManagerModules.flameshot.enable {
services.flameshot = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.gtk.enable = mkEnableOption "Enable gtk";
options.homeManagerModules.gtk.enable = mkEnableOption "Enable gtk";
config = mkIf config.features.desktop.gtk.enable {
config = mkIf config.homeManagerModules.gtk.enable {
gtk = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.media.gimp.enable = mkEnableOption "Enable gimp";
options.homeManagerModules.gimp.enable = mkEnableOption "Enable gimp";
config = mkIf config.features.desktop.media.gimp.enable {
config = mkIf config.homeManagerModules.gimp.enable {
home.packages = with pkgs; [ gimp ];
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.media.handbrake.enable = mkEnableOption "Enable handbrake";
options.homeManagerModules.handbrake.enable = mkEnableOption "Enable handbrake";
config = mkIf config.features.desktop.media.handbrake.enable {
config = mkIf config.homeManagerModules.handbrake.enable {
home.packages = with pkgs; [ handbrake ];
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.media.kdenlive.enable = mkEnableOption "Enable kdenlive";
options.homeManagerModules.kdenlive.enable = mkEnableOption "Enable kdenlive";
config = mkIf config.features.desktop.media.kdenlive.enable {
config = mkIf config.homeManagerModules.kdenlive.enable {
home.packages = with pkgs; [ kdePackages.kdenlive ];
};
}

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.desktop.media.mpv.enable = mkEnableOption "Enable mpv media player";
options.homeManagerModules.mpv.enable = mkEnableOption "Enable mpv media player";
config = mkIf config.features.desktop.media.mpv.enable {
config = mkIf config.homeManagerModules.mpv.enable {
programs.mpv = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.media.pocket-casts.enable = mkEnableOption "Enable Pocket Casts";
options.homeManagerModules.pocket-casts.enable = mkEnableOption "Enable Pocket Casts";
config = mkIf config.features.desktop.media.pocket-casts.enable {
config = mkIf config.homeManagerModules.pocket-casts.enable {
home.packages = with pkgs; [ pocket-casts ];
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.slack.enable = mkEnableOption "Enable Slack";
options.homeManagerModules.slack.enable = mkEnableOption "Enable Slack";
config = mkIf config.features.desktop.slack.enable {
config = mkIf config.homeManagerModules.slack.enable {
home.packages = with pkgs; [ slack ];
};
}

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.zoom.enable = mkEnableOption "Enable zoom";
options.homeManagerModules.zoom.enable = mkEnableOption "Enable zoom";
config = mkIf config.features.desktop.zoom.enable {
config = mkIf config.homeManagerModules.zoom.enable {
home.packages = with pkgs; [ zoom-us ];
};
}

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.cli.docker.enable = mkEnableOption "Enable Docker";
options.nixosModules.docker.enable = mkEnableOption "Enable Docker";
config = mkIf config.features.cli.docker.enable {
config = mkIf config.nixosModules.docker.enable {
virtualisation.docker = {
enable = true;

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.desktop.autorandr.enable = mkEnableOption "Enable autorandr";
options.nixosModules.autorandr.enable = mkEnableOption "Enable autorandr";
config = mkIf config.features.desktop.autorandr.enable {
config = mkIf config.nixosModules.autorandr.enable {
services.autorandr = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.dwm.enable = mkEnableOption "Enable dwm";
options.nixosModules.dwm.enable = mkEnableOption "Enable dwm";
config = mkIf config.features.desktop.dwm.enable {
config = mkIf config.nixosModules.dwm.enable {
services = {
dwm-status = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.peek.enable = mkEnableOption "Enable peek";
options.nixosModules.peek.enable = mkEnableOption "Enable peek";
config = mkIf config.features.desktop.peek.enable {
config = mkIf config.nixosModules.peek.enable {
environment.systemPackages = with pkgs; [ peek ];
};
}

View file

@ -9,9 +9,9 @@
with lib;
{
options.features.desktop.screenkey.enable = mkEnableOption "Enable screenkey";
options.nixosModules.screenkey.enable = mkEnableOption "Enable screenkey";
config = mkIf config.features.desktop.screenkey.enable {
config = mkIf config.nixosModules.screenkey.enable {
environment.systemPackages = with pkgs; [ screenkey ];
home-manager.users.${username}.xdg.configFile."screenkey.json".text = builtins.toJSON {

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.thunar.enable = mkEnableOption "Enable thunar";
options.nixosModules.thunar.enable = mkEnableOption "Enable thunar";
config = mkIf config.features.desktop.thunar.enable {
config = mkIf config.nixosModules.thunar.enable {
programs.thunar = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.desktop.gaming.enable = mkEnableOption "Enable games";
options.nixosModules.gaming.enable = mkEnableOption "Enable games";
config = mkIf config.features.desktop.gaming.enable {
config = mkIf config.nixosModules.gaming.enable {
programs.steam.enable = true;
environment.systemPackages = with pkgs; [ zeroad ];

View file

@ -3,10 +3,10 @@
with lib;
let
cfg = config.features.homelab.audiobookshelf;
cfg = config.nixosModules.audiobookshelf;
in
{
options.features.homelab.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
options.nixosModules.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
config = mkIf cfg.enable {
services = {

View file

@ -9,12 +9,12 @@
with lib;
let
cfg = config.features.homelab.beaverhabits;
cfg = config.nixosModules.beaverhabits;
port = 8084;
in
{
options.features.homelab.beaverhabits.enable = mkEnableOption "Enable beaverhabits";
options.nixosModules.beaverhabits.enable = mkEnableOption "Enable beaverhabits";
config = mkIf cfg.enable {
virtualisation = {

View file

@ -8,11 +8,11 @@
with lib;
let
cfg = config.features.homelab.freshrss;
cfg = config.nixosModules.freshrss;
port = 4003;
in
{
options.features.homelab.freshrss.enable = mkEnableOption "Enable freshrss";
options.nixosModules.freshrss.enable = mkEnableOption "Enable freshrss";
config = mkIf cfg.enable {
# Auto-generated using compose2nix v0.3.2-pre.

View file

@ -11,9 +11,9 @@ let
port = 8082;
in
{
options.features.homelab.pihole.enable = mkEnableOption "Enable pihole";
options.nixosModules.pihole.enable = mkEnableOption "Enable pihole";
config = mkIf config.features.homelab.pihole.enable {
config = mkIf config.nixosModules.pihole.enable {
virtualisation = {
docker = {
enable = true;

View file

@ -8,13 +8,13 @@
with lib;
let
cfg = config.features.homelab.tubearchivist-container;
cfg = config.nixosModules.tubearchivist-container;
port = 8085;
url = "tubearchivist.oliverdavies.uk";
in
{
options.features.homelab.tubearchivist-container = {
options.nixosModules.tubearchivist-container = {
enable = mkEnableOption "Enable the tubearchivist-container service.";
};

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.homelab.forgejo.enable = mkEnableOption "Enable forgejo";
options.nixosModules.forgejo.enable = mkEnableOption "Enable forgejo";
config = mkIf config.features.homelab.forgejo.enable {
config = mkIf config.nixosModules.forgejo.enable {
services = {
forgejo = {
enable = true;

View file

@ -6,9 +6,9 @@ let
port = 2222;
in
{
options.features.homelab.gitea.enable = mkEnableOption "Enable gitea";
options.nixosModules.gitea.enable = mkEnableOption "Enable gitea";
config = mkIf config.features.homelab.gitea.enable {
config = mkIf config.nixosModules.gitea.enable {
services = {
gitea = {
enable = true;

View file

@ -8,9 +8,9 @@
with lib;
{
options.features.homelab.immich.enable = mkEnableOption "Enable immich";
options.nixosModules.immich.enable = mkEnableOption "Enable immich";
config = mkIf config.features.homelab.immich.enable {
config = mkIf config.nixosModules.immich.enable {
services.immich = {
enable = true;
group = "media";

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.homelab.jellyfin.enable = mkEnableOption "Enable jellyfin";
options.nixosModules.jellyfin.enable = mkEnableOption "Enable jellyfin";
config = mkIf config.features.homelab.jellyfin.enable {
config = mkIf config.nixosModules.jellyfin.enable {
services.jellyfin = {
enable = true;
openFirewall = true;

View file

@ -6,9 +6,9 @@ let
url = "paperless.oliverdavies.uk";
in
{
options.features.homelab.paperless.enable = mkEnableOption "Enable paperless";
options.nixosModules.paperless.enable = mkEnableOption "Enable paperless";
config = mkIf config.features.homelab.paperless.enable {
config = mkIf config.nixosModules.paperless.enable {
services = {
paperless = {
enable = true;

View file

@ -3,9 +3,9 @@
with lib;
{
options.features.homelab.vaultwarden.enable = mkEnableOption "Enable vaultwarden";
options.nixosModules.vaultwarden.enable = mkEnableOption "Enable vaultwarden";
config = mkIf config.features.homelab.vaultwarden.enable {
config = mkIf config.nixosModules.vaultwarden.enable {
services = {
vaultwarden = {
enable = true;

View file

@ -4,3 +4,4 @@ Replace doppler with agenix
Evaluate services.languagetool as a replacement for Grammarly
Make git email address configurable
Finish configuring syncthing with nix - https://github.com/neeasade/dotfiles/blob/694c2a11107c10947af956befe16cbe5cee0abda/os/nixos/config/shared.nix#L62