From 8c7f8dba524967ab9d4e9be18504cdfca2d5263c Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 15 May 2023 11:12:17 +0100 Subject: [PATCH] Rearrange again to reduce complexity Move collections to use default.nix in relevant directories Combine GUI elements into gui directory --- Vanguard.nix | 6 ++--- common.nix | 18 ++----------- home/Legion-xenia.nix | 11 -------- home/Monarch-tux.nix | 17 ++---------- home/Northstar-xenia.nix | 12 --------- home/browser/chromium-wayland.nix | 4 --- home/browser/chromium.nix | 8 ------ home/browser/firefox.nix | 4 --- home/browser/librewolf.nix | 4 --- home/collections/common/desktop.nix | 26 ------------------- home/default.nix | 4 +-- home/env/default.nix | 14 ++++++++++ home/env/pypoetry.nix | 4 --- home/env/syncthing.nix | 8 ------ .../config/wezterm/key_tables.lua | 0 .../{terminal => gui}/config/wezterm/keys.lua | 0 .../config/wezterm/navigator.lua | 0 .../config/wezterm/status.lua | 0 .../config/wezterm/tab_bar_style.lua | 0 .../config/wezterm/wezterm.lua | 0 home/gui/default.nix | 12 +++++++++ home/{terminal => gui}/foot.nix | 0 home/{terminal => gui}/kitty.nix | 0 home/{terminal => gui}/urxvt.nix | 0 home/gui/wezterm.nix | 13 ++++++++++ .../personal/default.nix => personal.nix} | 8 +++--- home/ssh/personal.nix | 13 +++------- home/terminal/wezterm.nix | 5 ---- home/tui/default.nix | 7 +++++ home/tui/neovim.nix | 3 ++- .../work/default.nix => work.nix} | 8 +++--- 31 files changed, 69 insertions(+), 140 deletions(-) delete mode 100644 home/Legion-xenia.nix delete mode 100644 home/Northstar-xenia.nix delete mode 100644 home/browser/chromium-wayland.nix delete mode 100644 home/browser/chromium.nix delete mode 100644 home/browser/firefox.nix delete mode 100644 home/browser/librewolf.nix delete mode 100644 home/collections/common/desktop.nix create mode 100644 home/env/default.nix delete mode 100644 home/env/pypoetry.nix delete mode 100644 home/env/syncthing.nix rename home/{terminal => gui}/config/wezterm/key_tables.lua (100%) rename home/{terminal => gui}/config/wezterm/keys.lua (100%) rename home/{terminal => gui}/config/wezterm/navigator.lua (100%) rename home/{terminal => gui}/config/wezterm/status.lua (100%) rename home/{terminal => gui}/config/wezterm/tab_bar_style.lua (100%) rename home/{terminal => gui}/config/wezterm/wezterm.lua (100%) create mode 100644 home/gui/default.nix rename home/{terminal => gui}/foot.nix (100%) rename home/{terminal => gui}/kitty.nix (100%) rename home/{terminal => gui}/urxvt.nix (100%) create mode 100644 home/gui/wezterm.nix rename home/{collections/personal/default.nix => personal.nix} (65%) delete mode 100644 home/terminal/wezterm.nix create mode 100644 home/tui/default.nix rename home/{collections/work/default.nix => work.nix} (69%) diff --git a/Vanguard.nix b/Vanguard.nix index 6c89d070..d13600fd 100644 --- a/Vanguard.nix +++ b/Vanguard.nix @@ -27,7 +27,6 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAcvAQ8W71Bn8pdMYst1hoVCmVJ+0h4HBlJzu1C6dwy xenia@Northstar" ]; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.xenia = { isNormalUser = true; description = "Evie Litherland-Smith"; @@ -39,10 +38,9 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAcvAQ8W71Bn8pdMYst1hoVCmVJ+0h4HBlJzu1C6dwy xenia@Northstar" ]; }; + home-manager.users.xenia = { ... }: { - imports = [ ./home/collections/personal ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. + imports = [ ./home/personal.nix ]; home.username = "xenia"; home.homeDirectory = "/home/xenia"; home.stateVersion = "22.11"; diff --git a/common.nix b/common.nix index c0651316..7674248a 100644 --- a/common.nix +++ b/common.nix @@ -8,17 +8,7 @@ home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true; home-manager.users.root = { ... }: { - imports = [ - ./home/env/bash.nix - ./home/env/fish.nix - ./home/env/bat.nix - ./home/env/starship.nix - ./home/tui/neovim.nix - ./home/tui/lazygit.nix - ./home/git/personal.nix - ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. + imports = [ ./home/env ./home/tui ./home/git/personal.nix ./home/ssh/personal.nix ]; home.username = "root"; home.homeDirectory = "/root"; home.stateVersion = "22.11"; @@ -30,11 +20,7 @@ # Enable power-profiles services.power-profiles-daemon.enable = true; - environment.systemPackages = with pkgs; [ - dig - gnumake - home-manager - ]; + environment.systemPackages = with pkgs; [ home-manager ]; programs.nix-ld = { enable = true; diff --git a/home/Legion-xenia.nix b/home/Legion-xenia.nix deleted file mode 100644 index 4e08c43d..00000000 --- a/home/Legion-xenia.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: { - imports = [ - ./env/xenia.nix - ./tui - ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "xenia"; - home.homeDirectory = "/home/xenia"; - home.stateVersion = "22.11"; -} diff --git a/home/Monarch-tux.nix b/home/Monarch-tux.nix index ac9f4d95..e20bcceb 100644 --- a/home/Monarch-tux.nix +++ b/home/Monarch-tux.nix @@ -1,25 +1,12 @@ -{ pkgs, ... }: +{ ... }: { - imports = [ - ./git/personal.nix - ./env/zsh.nix - ./env/fish.nix - ./env/bat.nix - ./env/direnv.nix - ./env/keychain.nix - ./env/starship.nix - ./ssh/personal.nix - ./terminal/wezterm.nix - ./tui/neovim.nix - ./tui/lazygit.nix - ]; + imports = [ ./personal.nix ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "tux"; home.homeDirectory = "/Users/tux"; home.stateVersion = "22.11"; - home.packages = with pkgs; [ silver-searcher ]; services.syncthing.enable = true; programs.zsh.shellAliases.update = "home-manager switch"; diff --git a/home/Northstar-xenia.nix b/home/Northstar-xenia.nix deleted file mode 100644 index f0cc8d1b..00000000 --- a/home/Northstar-xenia.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: { - imports = [ - ./env - ./env/git/personal.nix - ./tui - ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "xenia"; - home.homeDirectory = "/home/xenia"; - home.stateVersion = "22.11"; -} diff --git a/home/browser/chromium-wayland.nix b/home/browser/chromium-wayland.nix deleted file mode 100644 index c661fd60..00000000 --- a/home/browser/chromium-wayland.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - programs.chromium.enable = true; -} diff --git a/home/browser/chromium.nix b/home/browser/chromium.nix deleted file mode 100644 index f9c84895..00000000 --- a/home/browser/chromium.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ ./chromium.nix ]; - programs.chromium.commandLineArgs = [ - "--enable-features=UseOzonePlatform" - "--ozone-platform=wayland" - ]; -} diff --git a/home/browser/firefox.nix b/home/browser/firefox.nix deleted file mode 100644 index 29d130b1..00000000 --- a/home/browser/firefox.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - programs.firefox.enable = true; -} diff --git a/home/browser/librewolf.nix b/home/browser/librewolf.nix deleted file mode 100644 index 2e05bfff..00000000 --- a/home/browser/librewolf.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - programs.librewolf.enable = true; -} diff --git a/home/collections/common/desktop.nix b/home/collections/common/desktop.nix deleted file mode 100644 index 12a3ec37..00000000 --- a/home/collections/common/desktop.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ../../browser/librewolf.nix - ../../desktop/wayland/hyprland.nix - ../../env/bash.nix - ../../env/fish.nix - ../../env/bat.nix - ../../env/direnv.nix - ../../env/keychain.nix - ../../env/nix-index.nix - ../../env/pypoetry.nix - ../../env/starship.nix - ../../terminal/wezterm.nix - ../../tui/neovim.nix - ../../tui/lazygit.nix - ]; - home.packages = with pkgs; [ - bitwarden - file - marktext - silver-searcher - signal-desktop - zotero - ]; -} diff --git a/home/default.nix b/home/default.nix index 470bebd3..38c29fdd 100644 --- a/home/default.nix +++ b/home/default.nix @@ -2,6 +2,4 @@ let home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; in -{ - imports = [ (import "${home-manager}/nixos") ]; -} +{ imports = [ (import "${home-manager}/nixos") ]; } diff --git a/home/env/default.nix b/home/env/default.nix new file mode 100644 index 00000000..6a3ffdfe --- /dev/null +++ b/home/env/default.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + imports = [ + ./bash.nix + ./bat.nix + ./direnv.nix + ./fish.nix + ./keychain.nix + ./nix-index.nix + ./readline.nix + ./starship.nix + ]; + home.packages = with pkgs; [ dig file gnumake silver-searcher ]; +} diff --git a/home/env/pypoetry.nix b/home/env/pypoetry.nix deleted file mode 100644 index ff3c5779..00000000 --- a/home/env/pypoetry.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - xdg.configFile."pypoetry".source = ./config/pypoetry; -} diff --git a/home/env/syncthing.nix b/home/env/syncthing.nix deleted file mode 100644 index b4488669..00000000 --- a/home/env/syncthing.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - services.syncthing = { - enable = true; - tray.enable = true; - }; - home.packages = with pkgs; [ syncthing-cli ]; -} diff --git a/home/terminal/config/wezterm/key_tables.lua b/home/gui/config/wezterm/key_tables.lua similarity index 100% rename from home/terminal/config/wezterm/key_tables.lua rename to home/gui/config/wezterm/key_tables.lua diff --git a/home/terminal/config/wezterm/keys.lua b/home/gui/config/wezterm/keys.lua similarity index 100% rename from home/terminal/config/wezterm/keys.lua rename to home/gui/config/wezterm/keys.lua diff --git a/home/terminal/config/wezterm/navigator.lua b/home/gui/config/wezterm/navigator.lua similarity index 100% rename from home/terminal/config/wezterm/navigator.lua rename to home/gui/config/wezterm/navigator.lua diff --git a/home/terminal/config/wezterm/status.lua b/home/gui/config/wezterm/status.lua similarity index 100% rename from home/terminal/config/wezterm/status.lua rename to home/gui/config/wezterm/status.lua diff --git a/home/terminal/config/wezterm/tab_bar_style.lua b/home/gui/config/wezterm/tab_bar_style.lua similarity index 100% rename from home/terminal/config/wezterm/tab_bar_style.lua rename to home/gui/config/wezterm/tab_bar_style.lua diff --git a/home/terminal/config/wezterm/wezterm.lua b/home/gui/config/wezterm/wezterm.lua similarity index 100% rename from home/terminal/config/wezterm/wezterm.lua rename to home/gui/config/wezterm/wezterm.lua diff --git a/home/gui/default.nix b/home/gui/default.nix new file mode 100644 index 00000000..d5f12dd2 --- /dev/null +++ b/home/gui/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + imports = [ ./wezterm.nix ]; + programs.firefox.enable = true; + programs.librewolf.enable = true; + home.packages = with pkgs; [ + bitwarden + marktext + signal-desktop + zotero + ]; +} diff --git a/home/terminal/foot.nix b/home/gui/foot.nix similarity index 100% rename from home/terminal/foot.nix rename to home/gui/foot.nix diff --git a/home/terminal/kitty.nix b/home/gui/kitty.nix similarity index 100% rename from home/terminal/kitty.nix rename to home/gui/kitty.nix diff --git a/home/terminal/urxvt.nix b/home/gui/urxvt.nix similarity index 100% rename from home/terminal/urxvt.nix rename to home/gui/urxvt.nix diff --git a/home/gui/wezterm.nix b/home/gui/wezterm.nix new file mode 100644 index 00000000..209c65b1 --- /dev/null +++ b/home/gui/wezterm.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + programs.wezterm = { + enable = true; + extraConfig = builtins.readFile ./config/wezterm/wezterm.lua; + }; + xdg.configFile = { + "wezterm/tab_bar_style.lua".source = ./config/wezterm/tab_bar_style.lua; + "wezterm/navigator.lua".source = ./config/wezterm/navigator.lua; + "wezterm/keys.lua".source = ./config/wezterm/keys.lua; + "wezterm/key_tables.lua".source = ./config/wezterm/key_tables.lua; + }; +} diff --git a/home/collections/personal/default.nix b/home/personal.nix similarity index 65% rename from home/collections/personal/default.nix rename to home/personal.nix index 7c6a6fc7..07923256 100644 --- a/home/collections/personal/default.nix +++ b/home/personal.nix @@ -1,9 +1,11 @@ { pkgs, ... }: { imports = [ - ../common/desktop.nix - ../../git/personal.nix - ../../ssh/personal.nix + ./env + ./gui + ./tui + ./git/personal.nix + ./ssh/personal.nix ]; home.packages = with pkgs; [ discord diff --git a/home/ssh/personal.nix b/home/ssh/personal.nix index 53dc09af..1681a21d 100644 --- a/home/ssh/personal.nix +++ b/home/ssh/personal.nix @@ -1,16 +1,11 @@ -{ ... }: +{ lib, ... }: { imports = [ ./common.nix ]; programs.ssh.matchBlocks = { - "legion xenia xenia.me.uk" = { + "legion" = { port = 30; }; + "vanguard" = { hostname = "192.168.1.166"; port = 22; }; + "legion vanguard xenia.me.uk" = lib.hm.dag.entryAfter [ "legion" "vanguard" ] { user = "root"; - hostname = "xenia.me.uk"; - port = 30; - forwardAgent = true; - }; - "vanguard" = { - user = "root"; - hostname = "192.168.1.166"; forwardAgent = true; }; }; diff --git a/home/terminal/wezterm.nix b/home/terminal/wezterm.nix deleted file mode 100644 index 5ae1d074..00000000 --- a/home/terminal/wezterm.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: -{ - programs.wezterm.enable = true; - xdg.configFile."wezterm".source = ./config/wezterm; -} diff --git a/home/tui/default.nix b/home/tui/default.nix new file mode 100644 index 00000000..0d66df78 --- /dev/null +++ b/home/tui/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./neovim.nix + ./lazygit.nix + ]; +} diff --git a/home/tui/neovim.nix b/home/tui/neovim.nix index 88c97223..609dbdc6 100644 --- a/home/tui/neovim.nix +++ b/home/tui/neovim.nix @@ -4,6 +4,7 @@ programs.neovim = { enable = true; defaultEditor = true; + extraLuaConfig = builtins.readFile ./config/nvim/init.lua; viAlias = true; vimAlias = true; vimdiffAlias = true; @@ -40,5 +41,5 @@ ]; }; home.packages = with pkgs; [ tree-sitter ]; - xdg.configFile."nvim".source = ./config/nvim; + xdg.configFile."nvim/lua".source = ./config/nvim/lua; } diff --git a/home/collections/work/default.nix b/home/work.nix similarity index 69% rename from home/collections/work/default.nix rename to home/work.nix index 3acd84b1..c8e6f930 100644 --- a/home/collections/work/default.nix +++ b/home/work.nix @@ -1,9 +1,11 @@ { pkgs, ... }: { imports = [ - ../common/desktop.nix - ../../git/work.nix - ../../ssh/work.nix + ./env + ./gui + ./tui + ./git/work.nix + ./ssh/work.nix ]; home.packages = with pkgs; [ libreoffice-fresh