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 = { homeManagerModules = {
cli = { direnv.enable = true;
direnv.enable = true; neovim.enable = true;
neovim.enable = true;
tmux.enable = true;
notes = { notes = {
enable = true; enable = true;
directory = "$HOME/Documents/wiki/tfw-notes";
directory = "$HOME/Documents/wiki/tfw-notes";
};
syncthing.enable = true;
tmux-sessionizer.enable = true;
}; };
syncthing.enable = true;
tmux.enable = true;
tmux-sessionizer.enable = true;
}; };
} }

View file

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

View file

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

View file

@ -1,42 +1,32 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
features = { homeManagerModules = {
cli = { bluetuith.enable = true;
bluetuith.enable = true; copyq.enable = true;
direnv.enable = true; direnv.enable = true;
neovim.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 = { notes = {
enable = true; enable = true;
directory = "$HOME/Documents/wiki/notes";
directory = "$HOME/Documents/wiki/notes";
};
syncthing.enable = true;
tmux.enable = true;
tmux-sessionizer.enable = true;
}; };
desktop = { pocket-casts.enable = true;
copyq.enable = true; slack.enable = true;
discord.enable = true; syncthing.enable = true;
dwm.enable = true; tmux.enable = true;
espanso.enable = true; tmux-sessionizer.enable = true;
flameshot.enable = true; zoom.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;
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

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

View file

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

View file

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

View file

@ -8,9 +8,9 @@
with lib; 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; [ home.packages = with pkgs; [
bluetuith bluetuith
]; ];

View file

@ -3,9 +3,9 @@
with lib; 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 = { programs.direnv = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -13,9 +13,9 @@ let
phpPackages = pkgs.php82Packages; phpPackages = pkgs.php82Packages;
in 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 = { programs.neovim = {
enable = true; enable = true;

View file

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

View file

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

View file

@ -8,9 +8,9 @@
with lib; 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.packages = with pkgs; [ tmux-sessionizer ];
home.file.".tmux-sessionizer".source = "${ home.file.".tmux-sessionizer".source = "${

View file

@ -11,9 +11,9 @@ let
inherit (pkgs) tmuxPlugins; inherit (pkgs) tmuxPlugins;
in 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 = { programs.tmux = {
enable = true; enable = true;

View file

@ -3,9 +3,9 @@
with lib; 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; services.copyq.enable = true;
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ discord ];
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 = { home = {
file.".xinitrc".text = '' file.".xinitrc".text = ''
systemctl --user import-environment DISPLAY systemctl --user import-environment DISPLAY

View file

@ -3,9 +3,9 @@
with lib; 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 = { services.espanso = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 = { services.flameshot = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 = { gtk = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ gimp ];
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ handbrake ];
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ kdePackages.kdenlive ];
}; };
} }

View file

@ -3,9 +3,9 @@
with lib; 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 = { programs.mpv = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ pocket-casts ];
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ slack ];
}; };
} }

View file

@ -8,9 +8,9 @@
with lib; 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 ]; home.packages = with pkgs; [ zoom-us ];
}; };
} }

View file

@ -3,9 +3,9 @@
with lib; 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 = { virtualisation.docker = {
enable = true; enable = true;

View file

@ -3,9 +3,9 @@
with lib; 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 = { services.autorandr = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 = { services = {
dwm-status = { dwm-status = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 ]; environment.systemPackages = with pkgs; [ peek ];
}; };
} }

View file

@ -9,9 +9,9 @@
with lib; 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 ]; environment.systemPackages = with pkgs; [ screenkey ];
home-manager.users.${username}.xdg.configFile."screenkey.json".text = builtins.toJSON { home-manager.users.${username}.xdg.configFile."screenkey.json".text = builtins.toJSON {

View file

@ -8,9 +8,9 @@
with lib; 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 = { programs.thunar = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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; programs.steam.enable = true;
environment.systemPackages = with pkgs; [ zeroad ]; environment.systemPackages = with pkgs; [ zeroad ];

View file

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

View file

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

View file

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

View file

@ -11,9 +11,9 @@ let
port = 8082; port = 8082;
in 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 = { virtualisation = {
docker = { docker = {
enable = true; enable = true;

View file

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

View file

@ -3,9 +3,9 @@
with lib; 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 = { services = {
forgejo = { forgejo = {
enable = true; enable = true;

View file

@ -6,9 +6,9 @@ let
port = 2222; port = 2222;
in 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 = { services = {
gitea = { gitea = {
enable = true; enable = true;

View file

@ -8,9 +8,9 @@
with lib; 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 = { services.immich = {
enable = true; enable = true;
group = "media"; group = "media";

View file

@ -3,9 +3,9 @@
with lib; 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 = { services.jellyfin = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;

View file

@ -6,9 +6,9 @@ let
url = "paperless.oliverdavies.uk"; url = "paperless.oliverdavies.uk";
in 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 = { services = {
paperless = { paperless = {
enable = true; enable = true;

View file

@ -3,9 +3,9 @@
with lib; 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 = { services = {
vaultwarden = { vaultwarden = {
enable = true; enable = true;

View file

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