From 3c7aa3f03e98128b05a917967cb47b353544b052 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 5 Nov 2024 18:55:05 +0000 Subject: [PATCH] Organise NixOS and Home Manager modules --- home/opdavies/desktop.nix | 16 +++++------ lib/nixos/default.nix | 6 ++-- lib/shared/home-manager.nix | 28 +++++++++---------- .../home-manager}/alacritty.nix | 0 .../modules => modules/home-manager}/bat.nix | 0 .../modules => modules/home-manager}/bin.nix | 0 .../home-manager}/bluetuith.nix | 0 .../home-manager}/copyq.nix | 0 .../home-manager}/direnv.nix | 0 .../home-manager}/espanso.nix | 0 .../home-manager}/espanso/matches/base.nix | 0 .../home-manager}/flameshot.nix | 0 .../modules => modules/home-manager}/fzf.nix | 0 .../modules => modules/home-manager}/git.nix | 0 .../modules => modules/home-manager}/gtk.nix | 0 .../modules => modules/home-manager}/lsd.nix | 0 .../modules => modules/home-manager}/mpv.nix | 0 .../home-manager}/neovim.nix | 0 .../modules => modules/home-manager}/pet.nix | 0 .../home-manager}/phpactor.nix | 0 .../home-manager}/ripgrep.nix | 0 .../home-manager}/syncthing.nix | 0 .../modules => modules/home-manager}/tmux.nix | 0 .../home-manager}/zellij.nix | 0 .../modules => modules/home-manager}/zsh.nix | 0 .../home-manager}/zsh/abbreviations.zsh | 0 .../home-manager}/zsh/aliases.nix | 0 .../modules => modules/nixos}/autorandr.nix | 0 .../modules => modules/nixos}/awesome.nix | 0 .../nixos/modules => modules/nixos}/gnome.nix | 0 todo.txt | 1 + 31 files changed, 26 insertions(+), 25 deletions(-) rename {home/opdavies/modules => modules/home-manager}/alacritty.nix (100%) rename {lib/shared/modules => modules/home-manager}/bat.nix (100%) rename {lib/shared/modules => modules/home-manager}/bin.nix (100%) rename {home/opdavies/modules/desktop => modules/home-manager}/bluetuith.nix (100%) rename {home/opdavies/modules => modules/home-manager}/copyq.nix (100%) rename {lib/shared/modules => modules/home-manager}/direnv.nix (100%) rename {home/opdavies/modules => modules/home-manager}/espanso.nix (100%) rename {home/opdavies/modules => modules/home-manager}/espanso/matches/base.nix (100%) rename {home/opdavies/modules => modules/home-manager}/flameshot.nix (100%) rename {lib/shared/modules => modules/home-manager}/fzf.nix (100%) rename {lib/shared/modules => modules/home-manager}/git.nix (100%) rename {home/opdavies/modules => modules/home-manager}/gtk.nix (100%) rename {lib/shared/modules => modules/home-manager}/lsd.nix (100%) rename {home/opdavies/modules => modules/home-manager}/mpv.nix (100%) rename {lib/shared/modules => modules/home-manager}/neovim.nix (100%) rename {lib/shared/modules => modules/home-manager}/pet.nix (100%) rename {lib/shared/modules => modules/home-manager}/phpactor.nix (100%) rename {lib/shared/modules => modules/home-manager}/ripgrep.nix (100%) rename {lib/shared/modules => modules/home-manager}/syncthing.nix (100%) rename {lib/shared/modules => modules/home-manager}/tmux.nix (100%) rename {lib/shared/modules => modules/home-manager}/zellij.nix (100%) rename {lib/shared/modules => modules/home-manager}/zsh.nix (100%) rename {lib/shared/modules => modules/home-manager}/zsh/abbreviations.zsh (100%) rename {lib/shared/modules => modules/home-manager}/zsh/aliases.nix (100%) rename {lib/nixos/modules => modules/nixos}/autorandr.nix (100%) rename {lib/nixos/modules => modules/nixos}/awesome.nix (100%) rename {lib/nixos/modules => modules/nixos}/gnome.nix (100%) diff --git a/home/opdavies/desktop.nix b/home/opdavies/desktop.nix index 79373df..6467591 100644 --- a/home/opdavies/desktop.nix +++ b/home/opdavies/desktop.nix @@ -6,13 +6,13 @@ }: { imports = [ - ./modules/alacritty.nix - ./modules/copyq.nix - ./modules/desktop/bluetuith.nix - ./modules/espanso.nix - ./modules/gtk.nix - ./modules/flameshot.nix - ./modules/gtk.nix - ./modules/mpv.nix + ../../modules/home-manager/alacritty.nix + ../../modules/home-manager/copyq.nix + ../../modules/home-manager/bluetuith.nix + ../../modules/home-manager/espanso.nix + ../../modules/home-manager/gtk.nix + ../../modules/home-manager/flameshot.nix + ../../modules/home-manager/gtk.nix + ../../modules/home-manager/mpv.nix ]; } diff --git a/lib/nixos/default.nix b/lib/nixos/default.nix index 173e486..da23a1c 100644 --- a/lib/nixos/default.nix +++ b/lib/nixos/default.nix @@ -41,7 +41,7 @@ inputs.nixpkgs.lib.nixosSystem { }; } - (import ./modules/awesome.nix { + (import ../../modules/nixos/awesome.nix { inherit inputs pkgs @@ -49,8 +49,8 @@ inputs.nixpkgs.lib.nixosSystem { username ; }) - (import ./modules/autorandr.nix) - (import ./modules/gnome.nix) + (import ../../modules/nixos/autorandr.nix) + (import ../../modules/nixos/gnome.nix) configuration hardwareConfiguration diff --git a/lib/shared/home-manager.nix b/lib/shared/home-manager.nix index a2c947f..f86739b 100644 --- a/lib/shared/home-manager.nix +++ b/lib/shared/home-manager.nix @@ -16,19 +16,19 @@ programs.home-manager.enable = true; imports = [ - (import ./modules/git.nix { inherit inputs pkgs; }) - (import ./modules/neovim.nix { inherit inputs pkgs; }) - ./modules/bat.nix - ./modules/bin.nix - ./modules/direnv.nix - ./modules/fzf.nix - ./modules/lsd.nix - ./modules/pet.nix - ./modules/phpactor.nix - ./modules/ripgrep.nix - ./modules/syncthing.nix - ./modules/tmux.nix - ./modules/zellij.nix - ./modules/zsh.nix + (import ../../modules/home-manager/git.nix { inherit inputs pkgs; }) + (import ../../modules/home-manager/neovim.nix { inherit inputs pkgs; }) + ../../modules/home-manager/bat.nix + ../../modules/home-manager/bin.nix + ../../modules/home-manager/direnv.nix + ../../modules/home-manager/fzf.nix + ../../modules/home-manager/lsd.nix + ../../modules/home-manager/pet.nix + ../../modules/home-manager/phpactor.nix + ../../modules/home-manager/ripgrep.nix + ../../modules/home-manager/syncthing.nix + ../../modules/home-manager/tmux.nix + ../../modules/home-manager/zellij.nix + ../../modules/home-manager/zsh.nix ]; } diff --git a/home/opdavies/modules/alacritty.nix b/modules/home-manager/alacritty.nix similarity index 100% rename from home/opdavies/modules/alacritty.nix rename to modules/home-manager/alacritty.nix diff --git a/lib/shared/modules/bat.nix b/modules/home-manager/bat.nix similarity index 100% rename from lib/shared/modules/bat.nix rename to modules/home-manager/bat.nix diff --git a/lib/shared/modules/bin.nix b/modules/home-manager/bin.nix similarity index 100% rename from lib/shared/modules/bin.nix rename to modules/home-manager/bin.nix diff --git a/home/opdavies/modules/desktop/bluetuith.nix b/modules/home-manager/bluetuith.nix similarity index 100% rename from home/opdavies/modules/desktop/bluetuith.nix rename to modules/home-manager/bluetuith.nix diff --git a/home/opdavies/modules/copyq.nix b/modules/home-manager/copyq.nix similarity index 100% rename from home/opdavies/modules/copyq.nix rename to modules/home-manager/copyq.nix diff --git a/lib/shared/modules/direnv.nix b/modules/home-manager/direnv.nix similarity index 100% rename from lib/shared/modules/direnv.nix rename to modules/home-manager/direnv.nix diff --git a/home/opdavies/modules/espanso.nix b/modules/home-manager/espanso.nix similarity index 100% rename from home/opdavies/modules/espanso.nix rename to modules/home-manager/espanso.nix diff --git a/home/opdavies/modules/espanso/matches/base.nix b/modules/home-manager/espanso/matches/base.nix similarity index 100% rename from home/opdavies/modules/espanso/matches/base.nix rename to modules/home-manager/espanso/matches/base.nix diff --git a/home/opdavies/modules/flameshot.nix b/modules/home-manager/flameshot.nix similarity index 100% rename from home/opdavies/modules/flameshot.nix rename to modules/home-manager/flameshot.nix diff --git a/lib/shared/modules/fzf.nix b/modules/home-manager/fzf.nix similarity index 100% rename from lib/shared/modules/fzf.nix rename to modules/home-manager/fzf.nix diff --git a/lib/shared/modules/git.nix b/modules/home-manager/git.nix similarity index 100% rename from lib/shared/modules/git.nix rename to modules/home-manager/git.nix diff --git a/home/opdavies/modules/gtk.nix b/modules/home-manager/gtk.nix similarity index 100% rename from home/opdavies/modules/gtk.nix rename to modules/home-manager/gtk.nix diff --git a/lib/shared/modules/lsd.nix b/modules/home-manager/lsd.nix similarity index 100% rename from lib/shared/modules/lsd.nix rename to modules/home-manager/lsd.nix diff --git a/home/opdavies/modules/mpv.nix b/modules/home-manager/mpv.nix similarity index 100% rename from home/opdavies/modules/mpv.nix rename to modules/home-manager/mpv.nix diff --git a/lib/shared/modules/neovim.nix b/modules/home-manager/neovim.nix similarity index 100% rename from lib/shared/modules/neovim.nix rename to modules/home-manager/neovim.nix diff --git a/lib/shared/modules/pet.nix b/modules/home-manager/pet.nix similarity index 100% rename from lib/shared/modules/pet.nix rename to modules/home-manager/pet.nix diff --git a/lib/shared/modules/phpactor.nix b/modules/home-manager/phpactor.nix similarity index 100% rename from lib/shared/modules/phpactor.nix rename to modules/home-manager/phpactor.nix diff --git a/lib/shared/modules/ripgrep.nix b/modules/home-manager/ripgrep.nix similarity index 100% rename from lib/shared/modules/ripgrep.nix rename to modules/home-manager/ripgrep.nix diff --git a/lib/shared/modules/syncthing.nix b/modules/home-manager/syncthing.nix similarity index 100% rename from lib/shared/modules/syncthing.nix rename to modules/home-manager/syncthing.nix diff --git a/lib/shared/modules/tmux.nix b/modules/home-manager/tmux.nix similarity index 100% rename from lib/shared/modules/tmux.nix rename to modules/home-manager/tmux.nix diff --git a/lib/shared/modules/zellij.nix b/modules/home-manager/zellij.nix similarity index 100% rename from lib/shared/modules/zellij.nix rename to modules/home-manager/zellij.nix diff --git a/lib/shared/modules/zsh.nix b/modules/home-manager/zsh.nix similarity index 100% rename from lib/shared/modules/zsh.nix rename to modules/home-manager/zsh.nix diff --git a/lib/shared/modules/zsh/abbreviations.zsh b/modules/home-manager/zsh/abbreviations.zsh similarity index 100% rename from lib/shared/modules/zsh/abbreviations.zsh rename to modules/home-manager/zsh/abbreviations.zsh diff --git a/lib/shared/modules/zsh/aliases.nix b/modules/home-manager/zsh/aliases.nix similarity index 100% rename from lib/shared/modules/zsh/aliases.nix rename to modules/home-manager/zsh/aliases.nix diff --git a/lib/nixos/modules/autorandr.nix b/modules/nixos/autorandr.nix similarity index 100% rename from lib/nixos/modules/autorandr.nix rename to modules/nixos/autorandr.nix diff --git a/lib/nixos/modules/awesome.nix b/modules/nixos/awesome.nix similarity index 100% rename from lib/nixos/modules/awesome.nix rename to modules/nixos/awesome.nix diff --git a/lib/nixos/modules/gnome.nix b/modules/nixos/gnome.nix similarity index 100% rename from lib/nixos/modules/gnome.nix rename to modules/nixos/gnome.nix diff --git a/todo.txt b/todo.txt index 351dcf0..20d6989 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ +Use nixosModules and homeManagerModules outputs in flake.nix to simplify importing modules Add immich for photo hosting Use nginx for jellyfin, immich and gitea Add gitea for local Git hosting