From b85728470ca34a577c7f7f7ce3aa9e9f7f6e2a3c Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Thu, 11 Dec 2025 19:36:56 +0000 Subject: [PATCH] refactor --- hosts/chidi/default.nix | 2 +- hosts/jason/default.nix | 2 +- hosts/michael/default.nix | 34 ++++++++++++- hosts/tahani/default.nix | 51 +++++++++++++++++-- modules/{home => }/atuin.nix | 0 modules/{home => }/bash.nix | 0 modules/{home => }/bat.nix | 0 .../dock/default.nix => darwin-dock.nix} | 0 .../home/ghostty.nix => darwin-ghostty.nix} | 0 .../home/default.nix => darwin-home.nix} | 6 +-- .../homebrew.nix => darwin-homebrew.nix} | 0 .../packages.nix => darwin-packages.nix} | 0 .../syncthing.nix => darwin-syncthing.nix} | 0 .../{darwin/system.nix => darwin-system.nix} | 0 .../wallpaper.nix => darwin-wallpaper.nix} | 0 modules/{darwin/default.nix => darwin.nix} | 16 +++--- modules/{home => }/direnv.nix | 0 modules/{home => }/eza.nix | 0 modules/{home => }/fish.nix | 0 modules/{home => }/fzf.nix | 0 modules/{home => }/git.nix | 0 modules/{home/default.nix => home.nix} | 2 +- modules/{home => }/jjui.nix | 0 modules/{home => }/jujutsu.nix | 0 modules/{home => }/lazygit.nix | 0 modules/{home => }/mise.nix | 0 modules/{home => }/neovim/autocmd.nix | 0 modules/{home => }/neovim/default.nix | 0 modules/{home => }/neovim/mappings.nix | 0 modules/{home => }/neovim/options.nix | 0 .../{home => }/neovim/plugins/blink-cmp.nix | 0 modules/{home => }/neovim/plugins/conform.nix | 0 modules/{home => }/neovim/plugins/copilot.nix | 0 .../{home => }/neovim/plugins/grug-far.nix | 0 modules/{home => }/neovim/plugins/harpoon.nix | 0 modules/{home => }/neovim/plugins/hunk.nix | 0 modules/{home => }/neovim/plugins/lsp.nix | 0 modules/{home => }/neovim/plugins/mini.nix | 0 modules/{home => }/neovim/plugins/oil.nix | 0 .../{home => }/neovim/plugins/toggleterm.nix | 0 .../{home => }/neovim/plugins/treesitter.nix | 0 modules/{home => }/neovim/plugins/zk.nix | 0 .../packages.nix => nixos-packages.nix} | 0 modules/{nixos/default.nix => nixos.nix} | 7 +-- modules/nixos/home/default.nix | 5 -- modules/{bin => }/open-project.nix | 0 modules/{home => }/opencode.nix | 0 modules/packages.nix | 4 +- modules/{home => }/ripgrep.nix | 0 modules/{home => }/ssh.nix | 0 modules/{home => }/starship.nix | 0 modules/{home => }/zellij.nix | 0 modules/{home => }/zk.nix | 0 modules/{home => }/zoxide.nix | 0 modules/{home => }/zsh.nix | 0 55 files changed, 96 insertions(+), 33 deletions(-) rename modules/{home => }/atuin.nix (100%) rename modules/{home => }/bash.nix (100%) rename modules/{home => }/bat.nix (100%) rename modules/{darwin/dock/default.nix => darwin-dock.nix} (100%) rename modules/{darwin/home/ghostty.nix => darwin-ghostty.nix} (100%) rename modules/{darwin/home/default.nix => darwin-home.nix} (63%) rename modules/{darwin/homebrew.nix => darwin-homebrew.nix} (100%) rename modules/{darwin/packages.nix => darwin-packages.nix} (100%) rename modules/{darwin/syncthing.nix => darwin-syncthing.nix} (100%) rename modules/{darwin/system.nix => darwin-system.nix} (100%) rename modules/{darwin/bin/wallpaper.nix => darwin-wallpaper.nix} (100%) rename modules/{darwin/default.nix => darwin.nix} (89%) rename modules/{home => }/direnv.nix (100%) rename modules/{home => }/eza.nix (100%) rename modules/{home => }/fish.nix (100%) rename modules/{home => }/fzf.nix (100%) rename modules/{home => }/git.nix (100%) rename modules/{home/default.nix => home.nix} (87%) rename modules/{home => }/jjui.nix (100%) rename modules/{home => }/jujutsu.nix (100%) rename modules/{home => }/lazygit.nix (100%) rename modules/{home => }/mise.nix (100%) rename modules/{home => }/neovim/autocmd.nix (100%) rename modules/{home => }/neovim/default.nix (100%) rename modules/{home => }/neovim/mappings.nix (100%) rename modules/{home => }/neovim/options.nix (100%) rename modules/{home => }/neovim/plugins/blink-cmp.nix (100%) rename modules/{home => }/neovim/plugins/conform.nix (100%) rename modules/{home => }/neovim/plugins/copilot.nix (100%) rename modules/{home => }/neovim/plugins/grug-far.nix (100%) rename modules/{home => }/neovim/plugins/harpoon.nix (100%) rename modules/{home => }/neovim/plugins/hunk.nix (100%) rename modules/{home => }/neovim/plugins/lsp.nix (100%) rename modules/{home => }/neovim/plugins/mini.nix (100%) rename modules/{home => }/neovim/plugins/oil.nix (100%) rename modules/{home => }/neovim/plugins/toggleterm.nix (100%) rename modules/{home => }/neovim/plugins/treesitter.nix (100%) rename modules/{home => }/neovim/plugins/zk.nix (100%) rename modules/{nixos/packages.nix => nixos-packages.nix} (100%) rename modules/{nixos/default.nix => nixos.nix} (92%) delete mode 100644 modules/nixos/home/default.nix rename modules/{bin => }/open-project.nix (100%) rename modules/{home => }/opencode.nix (100%) rename modules/{home => }/ripgrep.nix (100%) rename modules/{home => }/ssh.nix (100%) rename modules/{home => }/starship.nix (100%) rename modules/{home => }/zellij.nix (100%) rename modules/{home => }/zk.nix (100%) rename modules/{home => }/zoxide.nix (100%) rename modules/{home => }/zsh.nix (100%) diff --git a/hosts/chidi/default.nix b/hosts/chidi/default.nix index dbe4711..51ea7f7 100644 --- a/hosts/chidi/default.nix +++ b/hosts/chidi/default.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - ../../modules/darwin + ../../modules/darwin.nix ]; networking.hostName = "chidi"; diff --git a/hosts/jason/default.nix b/hosts/jason/default.nix index b9e3080..5c534a9 100644 --- a/hosts/jason/default.nix +++ b/hosts/jason/default.nix @@ -1,6 +1,6 @@ {user, ...}: { imports = [ - ../../modules/darwin + ../../modules/darwin.nix ]; networking.hostName = "jason"; diff --git a/hosts/michael/default.nix b/hosts/michael/default.nix index 3551aa6..5debcdd 100644 --- a/hosts/michael/default.nix +++ b/hosts/michael/default.nix @@ -2,6 +2,9 @@ modulesPath, hostname, inputs, + user, + pkgs, + constants, ... }: { imports = [ @@ -9,10 +12,39 @@ (modulesPath + "/profiles/qemu-guest.nix") ./disk-config.nix ./hardware-configuration.nix - ../../modules/nixos + ../../modules/nixos.nix inputs.disko.nixosModules.disko ]; + home-manager.users.${user} = { + imports = [ + ../../modules/bash.nix + ../../modules/bat.nix + ../../modules/direnv.nix + ../../modules/eza.nix + ../../modules/fish.nix + ../../modules/fzf.nix + ../../modules/git.nix + ../../modules/jjui.nix + ../../modules/jujutsu.nix + ../../modules/lazygit.nix + ../../modules/neovim + ../../modules/ripgrep.nix + ../../modules/ssh.nix + ../../modules/starship.nix + ../../modules/zoxide.nix + ]; + + programs.home-manager.enable = true; + + home = { + packages = + (pkgs.callPackage ../../modules/packages.nix {inherit inputs;}) + ++ (pkgs.callPackage ../../modules/nixos-packages.nix {}); + stateVersion = constants.stateVersions.homeManager; + }; + }; + networking.firewall.allowedTCPPorts = [80 443]; services.gitea = { diff --git a/hosts/tahani/default.nix b/hosts/tahani/default.nix index 658ea2a..770fec4 100644 --- a/hosts/tahani/default.nix +++ b/hosts/tahani/default.nix @@ -2,12 +2,57 @@ config, hostname, user, + inputs, + pkgs, + constants, ... }: { imports = [ - ../../modules/nixos + ../../modules/nixos.nix + ../../modules/syncthing.nix ]; + home-manager.users.${user} = { + imports = [ + ../../modules/atuin.nix + ../../modules/bash.nix + ../../modules/bat.nix + ../../modules/direnv.nix + ../../modules/eza.nix + ../../modules/fish.nix + ../../modules/fzf.nix + ../../modules/git.nix + ../../modules/jjui.nix + ../../modules/jujutsu.nix + ../../modules/lazygit.nix + ../../modules/mise.nix + ../../modules/neovim + ../../modules/opencode.nix + ../../modules/ripgrep.nix + ../../modules/ssh.nix + ../../modules/starship.nix + ../../modules/zellij.nix + ../../modules/zk.nix + ../../modules/zoxide.nix + ../../modules/zsh.nix + ]; + + programs.home-manager.enable = true; + + home = { + packages = + (pkgs.callPackage ../../modules/packages.nix {inherit inputs;}) + ++ (pkgs.callPackage ../../modules/nixos-packages.nix {}) + ++ [ + inputs.beads.packages.${pkgs.system}.default + inputs.nix-ai-tools.packages.${pkgs.system}.amp + ]; + stateVersion = constants.stateVersions.homeManager; + }; + + programs.git.settings.user.email = "christoph@schmatzler.com"; + }; + services.adguardhome = { enable = true; port = 10000; @@ -105,8 +150,4 @@ # Allow Caddy to fetch Tailscale HTTPS certs services.tailscale.permitCertUid = "caddy"; - - home-manager.users.${user} = { - programs.git.settings.user.email = "christoph@schmatzler.com"; - }; } diff --git a/modules/home/atuin.nix b/modules/atuin.nix similarity index 100% rename from modules/home/atuin.nix rename to modules/atuin.nix diff --git a/modules/home/bash.nix b/modules/bash.nix similarity index 100% rename from modules/home/bash.nix rename to modules/bash.nix diff --git a/modules/home/bat.nix b/modules/bat.nix similarity index 100% rename from modules/home/bat.nix rename to modules/bat.nix diff --git a/modules/darwin/dock/default.nix b/modules/darwin-dock.nix similarity index 100% rename from modules/darwin/dock/default.nix rename to modules/darwin-dock.nix diff --git a/modules/darwin/home/ghostty.nix b/modules/darwin-ghostty.nix similarity index 100% rename from modules/darwin/home/ghostty.nix rename to modules/darwin-ghostty.nix diff --git a/modules/darwin/home/default.nix b/modules/darwin-home.nix similarity index 63% rename from modules/darwin/home/default.nix rename to modules/darwin-home.nix index fd1c97f..72775b8 100644 --- a/modules/darwin/home/default.nix +++ b/modules/darwin-home.nix @@ -3,14 +3,14 @@ lib, ... }: let - setWallpaperScript = import ../bin/wallpaper.nix {inherit pkgs;}; + setWallpaperScript = import ./darwin-wallpaper.nix {inherit pkgs;}; in { imports = [ - ./ghostty.nix + ./darwin-ghostty.nix ]; home = { - packages = pkgs.callPackage ../packages.nix {}; + packages = pkgs.callPackage ./darwin-packages.nix {}; activation = { "setWallpaper" = lib.hm.dag.entryAfter ["revealHomeLibraryDirectory"] '' diff --git a/modules/darwin/homebrew.nix b/modules/darwin-homebrew.nix similarity index 100% rename from modules/darwin/homebrew.nix rename to modules/darwin-homebrew.nix diff --git a/modules/darwin/packages.nix b/modules/darwin-packages.nix similarity index 100% rename from modules/darwin/packages.nix rename to modules/darwin-packages.nix diff --git a/modules/darwin/syncthing.nix b/modules/darwin-syncthing.nix similarity index 100% rename from modules/darwin/syncthing.nix rename to modules/darwin-syncthing.nix diff --git a/modules/darwin/system.nix b/modules/darwin-system.nix similarity index 100% rename from modules/darwin/system.nix rename to modules/darwin-system.nix diff --git a/modules/darwin/bin/wallpaper.nix b/modules/darwin-wallpaper.nix similarity index 100% rename from modules/darwin/bin/wallpaper.nix rename to modules/darwin-wallpaper.nix diff --git a/modules/darwin/default.nix b/modules/darwin.nix similarity index 89% rename from modules/darwin/default.nix rename to modules/darwin.nix index 6c55d7f..12dc474 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin.nix @@ -7,13 +7,13 @@ ... }: { imports = [ - ../core.nix - ../syncthing.nix - ../tailscale.nix - ./dock - ./homebrew.nix + ./core.nix ./syncthing.nix - ./system.nix + ./tailscale.nix + ./darwin-dock.nix + ./darwin-homebrew.nix + ./darwin-syncthing.nix + ./darwin-system.nix inputs.sops-nix.darwinModules.sops ]; @@ -49,8 +49,8 @@ _module.args = {inherit user constants inputs;}; imports = [ inputs.nixvim.homeModules.nixvim - ../home/default.nix - ./home/default.nix + ./home.nix + ./darwin-home.nix ]; fonts.fontconfig.enable = true; }; diff --git a/modules/home/direnv.nix b/modules/direnv.nix similarity index 100% rename from modules/home/direnv.nix rename to modules/direnv.nix diff --git a/modules/home/eza.nix b/modules/eza.nix similarity index 100% rename from modules/home/eza.nix rename to modules/eza.nix diff --git a/modules/home/fish.nix b/modules/fish.nix similarity index 100% rename from modules/home/fish.nix rename to modules/fish.nix diff --git a/modules/home/fzf.nix b/modules/fzf.nix similarity index 100% rename from modules/home/fzf.nix rename to modules/fzf.nix diff --git a/modules/home/git.nix b/modules/git.nix similarity index 100% rename from modules/home/git.nix rename to modules/git.nix diff --git a/modules/home/default.nix b/modules/home.nix similarity index 87% rename from modules/home/default.nix rename to modules/home.nix index cc01f83..933c76c 100644 --- a/modules/home/default.nix +++ b/modules/home.nix @@ -31,7 +31,7 @@ programs.home-manager.enable = true; home = { - packages = pkgs.callPackage ../packages.nix {inherit inputs;}; + packages = pkgs.callPackage ./packages.nix {inherit inputs;}; stateVersion = constants.stateVersions.homeManager; }; } diff --git a/modules/home/jjui.nix b/modules/jjui.nix similarity index 100% rename from modules/home/jjui.nix rename to modules/jjui.nix diff --git a/modules/home/jujutsu.nix b/modules/jujutsu.nix similarity index 100% rename from modules/home/jujutsu.nix rename to modules/jujutsu.nix diff --git a/modules/home/lazygit.nix b/modules/lazygit.nix similarity index 100% rename from modules/home/lazygit.nix rename to modules/lazygit.nix diff --git a/modules/home/mise.nix b/modules/mise.nix similarity index 100% rename from modules/home/mise.nix rename to modules/mise.nix diff --git a/modules/home/neovim/autocmd.nix b/modules/neovim/autocmd.nix similarity index 100% rename from modules/home/neovim/autocmd.nix rename to modules/neovim/autocmd.nix diff --git a/modules/home/neovim/default.nix b/modules/neovim/default.nix similarity index 100% rename from modules/home/neovim/default.nix rename to modules/neovim/default.nix diff --git a/modules/home/neovim/mappings.nix b/modules/neovim/mappings.nix similarity index 100% rename from modules/home/neovim/mappings.nix rename to modules/neovim/mappings.nix diff --git a/modules/home/neovim/options.nix b/modules/neovim/options.nix similarity index 100% rename from modules/home/neovim/options.nix rename to modules/neovim/options.nix diff --git a/modules/home/neovim/plugins/blink-cmp.nix b/modules/neovim/plugins/blink-cmp.nix similarity index 100% rename from modules/home/neovim/plugins/blink-cmp.nix rename to modules/neovim/plugins/blink-cmp.nix diff --git a/modules/home/neovim/plugins/conform.nix b/modules/neovim/plugins/conform.nix similarity index 100% rename from modules/home/neovim/plugins/conform.nix rename to modules/neovim/plugins/conform.nix diff --git a/modules/home/neovim/plugins/copilot.nix b/modules/neovim/plugins/copilot.nix similarity index 100% rename from modules/home/neovim/plugins/copilot.nix rename to modules/neovim/plugins/copilot.nix diff --git a/modules/home/neovim/plugins/grug-far.nix b/modules/neovim/plugins/grug-far.nix similarity index 100% rename from modules/home/neovim/plugins/grug-far.nix rename to modules/neovim/plugins/grug-far.nix diff --git a/modules/home/neovim/plugins/harpoon.nix b/modules/neovim/plugins/harpoon.nix similarity index 100% rename from modules/home/neovim/plugins/harpoon.nix rename to modules/neovim/plugins/harpoon.nix diff --git a/modules/home/neovim/plugins/hunk.nix b/modules/neovim/plugins/hunk.nix similarity index 100% rename from modules/home/neovim/plugins/hunk.nix rename to modules/neovim/plugins/hunk.nix diff --git a/modules/home/neovim/plugins/lsp.nix b/modules/neovim/plugins/lsp.nix similarity index 100% rename from modules/home/neovim/plugins/lsp.nix rename to modules/neovim/plugins/lsp.nix diff --git a/modules/home/neovim/plugins/mini.nix b/modules/neovim/plugins/mini.nix similarity index 100% rename from modules/home/neovim/plugins/mini.nix rename to modules/neovim/plugins/mini.nix diff --git a/modules/home/neovim/plugins/oil.nix b/modules/neovim/plugins/oil.nix similarity index 100% rename from modules/home/neovim/plugins/oil.nix rename to modules/neovim/plugins/oil.nix diff --git a/modules/home/neovim/plugins/toggleterm.nix b/modules/neovim/plugins/toggleterm.nix similarity index 100% rename from modules/home/neovim/plugins/toggleterm.nix rename to modules/neovim/plugins/toggleterm.nix diff --git a/modules/home/neovim/plugins/treesitter.nix b/modules/neovim/plugins/treesitter.nix similarity index 100% rename from modules/home/neovim/plugins/treesitter.nix rename to modules/neovim/plugins/treesitter.nix diff --git a/modules/home/neovim/plugins/zk.nix b/modules/neovim/plugins/zk.nix similarity index 100% rename from modules/home/neovim/plugins/zk.nix rename to modules/neovim/plugins/zk.nix diff --git a/modules/nixos/packages.nix b/modules/nixos-packages.nix similarity index 100% rename from modules/nixos/packages.nix rename to modules/nixos-packages.nix diff --git a/modules/nixos/default.nix b/modules/nixos.nix similarity index 92% rename from modules/nixos/default.nix rename to modules/nixos.nix index e58042d..753e26b 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos.nix @@ -6,9 +6,8 @@ ... }: { imports = [ - ../core.nix - ../syncthing.nix - ../tailscale.nix + ./core.nix + ./tailscale.nix inputs.sops-nix.nixosModules.sops ]; @@ -73,8 +72,6 @@ _module.args = {inherit user constants inputs;}; imports = [ inputs.nixvim.homeModules.nixvim - ../home/default.nix - ./home/default.nix ]; }; }; diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix deleted file mode 100644 index baff4cc..0000000 --- a/modules/nixos/home/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{pkgs, ...}: { - home = { - packages = pkgs.callPackage ../packages.nix {}; - }; -} diff --git a/modules/bin/open-project.nix b/modules/open-project.nix similarity index 100% rename from modules/bin/open-project.nix rename to modules/open-project.nix diff --git a/modules/home/opencode.nix b/modules/opencode.nix similarity index 100% rename from modules/home/opencode.nix rename to modules/opencode.nix diff --git a/modules/packages.nix b/modules/packages.nix index ae34996..1bca5ca 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -4,9 +4,7 @@ ... }: with pkgs; [ - inputs.beads.packages.${pkgs.system}.default - inputs.nix-ai-tools.packages.${pkgs.system}.amp - (callPackage ./bin/open-project.nix {}) + (callPackage ./open-project.nix {}) age alejandra ast-grep diff --git a/modules/home/ripgrep.nix b/modules/ripgrep.nix similarity index 100% rename from modules/home/ripgrep.nix rename to modules/ripgrep.nix diff --git a/modules/home/ssh.nix b/modules/ssh.nix similarity index 100% rename from modules/home/ssh.nix rename to modules/ssh.nix diff --git a/modules/home/starship.nix b/modules/starship.nix similarity index 100% rename from modules/home/starship.nix rename to modules/starship.nix diff --git a/modules/home/zellij.nix b/modules/zellij.nix similarity index 100% rename from modules/home/zellij.nix rename to modules/zellij.nix diff --git a/modules/home/zk.nix b/modules/zk.nix similarity index 100% rename from modules/home/zk.nix rename to modules/zk.nix diff --git a/modules/home/zoxide.nix b/modules/zoxide.nix similarity index 100% rename from modules/home/zoxide.nix rename to modules/zoxide.nix diff --git a/modules/home/zsh.nix b/modules/zsh.nix similarity index 100% rename from modules/home/zsh.nix rename to modules/zsh.nix