From e35a926cb65e8ec8d0ff82b8e2ad40753749e6b7 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 23 Apr 2023 14:46:59 +0100 Subject: [PATCH] Reorganise common directory with env for less duplication --- home/H0615-elitherl.nix | 2 +- home/J0162-elitherl.nix | 2 +- home/Legion-xenia.nix | 3 +- home/Monarch-tux.nix | 5 +- home/Northstar-xenia.nix | 7 +-- home/Vanguard-xenia.nix | 3 +- home/common/work.nix | 25 --------- home/env/common.nix | 52 ------------------- home/env/common/config/ssh | 32 ++++++++++++ home/env/{ => common}/config/starship.toml | 0 home/env/common/default.nix | 14 +++++ home/env/common/direnv.nix | 10 ++++ home/env/common/fonts/default.nix | 7 +++ home/env/common/fonts/firacode.nix | 7 +++ home/env/common/fonts/iosevka.nix | 7 +++ home/env/common/git.nix | 17 ++++++ home/env/common/keychain.nix | 19 +++++++ .../default.nix => env/common/nixpkgs.nix} | 1 - home/env/{ => common}/qemu.nix | 1 - home/env/{ => common/shell}/bash.nix | 1 - home/env/{ => common/shell}/default.nix | 2 - home/env/{ => common/shell}/fish.nix | 1 - home/env/{ => common/shell}/zsh.nix | 1 - home/env/common/ssh.nix | 13 +++++ home/env/common/starship.nix | 11 ++++ home/{common => env}/personal.nix | 1 + home/env/work.nix | 12 +++++ home/gui/chromium-wayland.nix | 1 - home/gui/cloud.nix | 1 - home/gui/common.nix | 4 -- home/gui/firefox.nix | 1 - home/gui/foot.nix | 1 - home/gui/gaming.nix | 1 - home/gui/kitty.nix | 1 - home/gui/messaging.nix | 1 - home/gui/nomachine.nix | 4 +- home/gui/ukaea.nix | 2 - home/gui/urxvt.nix | 2 +- home/tui/common.nix | 10 +--- home/ukaea-elitherl.nix | 17 ++++++ 40 files changed, 176 insertions(+), 126 deletions(-) delete mode 100644 home/common/work.nix delete mode 100644 home/env/common.nix create mode 100644 home/env/common/config/ssh rename home/env/{ => common}/config/starship.toml (100%) create mode 100644 home/env/common/default.nix create mode 100644 home/env/common/direnv.nix create mode 100644 home/env/common/fonts/default.nix create mode 100644 home/env/common/fonts/firacode.nix create mode 100644 home/env/common/fonts/iosevka.nix create mode 100644 home/env/common/git.nix create mode 100644 home/env/common/keychain.nix rename home/{common/default.nix => env/common/nixpkgs.nix} (98%) rename home/env/{ => common}/qemu.nix (66%) rename home/env/{ => common/shell}/bash.nix (90%) rename home/env/{ => common/shell}/default.nix (82%) rename home/env/{ => common/shell}/fish.nix (90%) rename home/env/{ => common/shell}/zsh.nix (93%) create mode 100644 home/env/common/ssh.nix create mode 100644 home/env/common/starship.nix rename home/{common => env}/personal.nix (89%) create mode 100644 home/env/work.nix delete mode 100644 home/gui/common.nix create mode 100644 home/ukaea-elitherl.nix diff --git a/home/H0615-elitherl.nix b/home/H0615-elitherl.nix index 91e4610d..c6d8ed5c 100644 --- a/home/H0615-elitherl.nix +++ b/home/H0615-elitherl.nix @@ -1,4 +1,4 @@ { ... }: { - imports = [ ./common/work.nix ]; + imports = [ ./ukaea-elitherl.nix ]; home.stateVersion = "22.11"; } diff --git a/home/J0162-elitherl.nix b/home/J0162-elitherl.nix index 91e4610d..c6d8ed5c 100644 --- a/home/J0162-elitherl.nix +++ b/home/J0162-elitherl.nix @@ -1,4 +1,4 @@ { ... }: { - imports = [ ./common/work.nix ]; + imports = [ ./ukaea-elitherl.nix ]; home.stateVersion = "22.11"; } diff --git a/home/Legion-xenia.nix b/home/Legion-xenia.nix index bdcbfbf7..866bdd58 100644 --- a/home/Legion-xenia.nix +++ b/home/Legion-xenia.nix @@ -1,7 +1,6 @@ { ... }: { imports = [ - ./common/personal.nix - ./env/bash.nix + ./env/personal.nix ./tui ]; home.stateVersion = "22.11"; diff --git a/home/Monarch-tux.nix b/home/Monarch-tux.nix index b9b63a9e..8883866a 100644 --- a/home/Monarch-tux.nix +++ b/home/Monarch-tux.nix @@ -1,11 +1,8 @@ { ... }: { imports = [ - ./env/bash.nix - ./env/zsh.nix + ./env/personal.nix ./tui - ./gui/wezterm.nix - ./gui/neovide.nix ]; # Home Manager needs a bit of information about you and the # paths it should manage. diff --git a/home/Northstar-xenia.nix b/home/Northstar-xenia.nix index b2735fde..866bdd58 100644 --- a/home/Northstar-xenia.nix +++ b/home/Northstar-xenia.nix @@ -1,12 +1,7 @@ { ... }: { imports = [ - ./common/personal.nix - ./desktop/gtk.nix - ./desktop/wayland.nix - ./env + ./env/personal.nix ./tui - ./gui/firefox - ./gui/kitty.nix ]; home.stateVersion = "22.11"; } diff --git a/home/Vanguard-xenia.nix b/home/Vanguard-xenia.nix index 81a03345..2d38b261 100644 --- a/home/Vanguard-xenia.nix +++ b/home/Vanguard-xenia.nix @@ -1,9 +1,8 @@ { ... }: { imports = [ - ./common/personal.nix + ./env/personal.nix ./desktop/gtk.nix ./desktop/wayland.nix - ./env ./tui ./gui/firefox.nix ./gui/cloud.nix diff --git a/home/common/work.nix b/home/common/work.nix deleted file mode 100644 index f520d675..00000000 --- a/home/common/work.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ ... }: -{ - imports = [ - ../desktop/gtk.nix - ../desktop/wayland.nix - ../env - ../tui - ../gui/chromium-wayland.nix - ../gui/neovide.nix - ../gui/libreoffice.nix - ../gui/cloud.nix - ../gui/kitty.nix - ../gui/messaging.nix - ../gui/nomachine.nix - ../gui/ukaea.nix - ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "elitherl"; - home.homeDirectory = "/home/elitherl"; - - programs.git = { - userEmail = "evie.litherland-smith@ukaea.uk"; - }; -} diff --git a/home/env/common.nix b/home/env/common.nix deleted file mode 100644 index 582e7979..00000000 --- a/home/env/common.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ ... }: - -{ - imports = [ ../common ]; - programs.ssh = { - enable = true; - includes = [ "config.d/*" ]; - forwardAgent = true; - serverAliveInterval = 15; - serverAliveCountMax = 3; - controlMaster = "auto"; - controlPersist = "5s"; - }; - programs.keychain = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - enableXsessionIntegration = true; - extraFlags = [ - "--quiet" - "--ignore-missing" - ]; - keys = [ - "id_rsa" - "id_ed25519" - ]; - }; - programs.git = { - enable = true; - userName = "Evie Litherland-Smith"; - delta.enable = true; - extraConfig = { - pull = { - rebase = false; - }; - }; - }; - xdg.configFile."starship.toml".source = ./config/starship.toml; - programs.starship = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - }; - programs.direnv = { - enable = true; - #enableBashIntegration = true; - #enableZshIntegration = true; - #enableFishIntegration = true; - }; -} diff --git a/home/env/common/config/ssh b/home/env/common/config/ssh new file mode 100644 index 00000000..2b68a1f6 --- /dev/null +++ b/home/env/common/config/ssh @@ -0,0 +1,32 @@ +# vim: ft=sshconfig + +Host legion xenia xenia.me.uk + User xenia + HostName xenia.me.uk + Port 30 + ForwardAgent yes + +Host git.ccfe.ac.uk + user git + +Host heimdall + HostName heimdall003.jet.uk + +Host heimdall??? + HostName %h.jet.uk + +Host batch + User cxsbatch + HostName heimdall115.jetdata.eu + +Host jdc + HostName 10.40.4.103 + +Host freia + HostName freia022.hpc.l + +Host freia??? + HostName %h.hpc.l + +Host heimdall* jdc* freia* batch + User elitherl diff --git a/home/env/config/starship.toml b/home/env/common/config/starship.toml similarity index 100% rename from home/env/config/starship.toml rename to home/env/common/config/starship.toml diff --git a/home/env/common/default.nix b/home/env/common/default.nix new file mode 100644 index 00000000..7ee59ba8 --- /dev/null +++ b/home/env/common/default.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + imports = [ + ./fonts + ./shell + ./direnv.nix + ./git.nix + ./keychain.nix + ./nixpkgs.nix + ./qemu.nix + ./ssh.nix + ./starship.nix + ]; +} diff --git a/home/env/common/direnv.nix b/home/env/common/direnv.nix new file mode 100644 index 00000000..b3de9421 --- /dev/null +++ b/home/env/common/direnv.nix @@ -0,0 +1,10 @@ +{...}: +{ + imports = [ ./shell ]; + programs.direnv = { + enable = true; + #enableBashIntegration = true; + #enableZshIntegration = true; + #enableFishIntegration = true; + }; +} diff --git a/home/env/common/fonts/default.nix b/home/env/common/fonts/default.nix new file mode 100644 index 00000000..7fbd4ea7 --- /dev/null +++ b/home/env/common/fonts/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./firacode.nix + ./iosevka.nix + ]; +} diff --git a/home/env/common/fonts/firacode.nix b/home/env/common/fonts/firacode.nix new file mode 100644 index 00000000..5f41458c --- /dev/null +++ b/home/env/common/fonts/firacode.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + fira-code + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + ]; +} diff --git a/home/env/common/fonts/iosevka.nix b/home/env/common/fonts/iosevka.nix new file mode 100644 index 00000000..4ec67414 --- /dev/null +++ b/home/env/common/fonts/iosevka.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + iosevka + (nerdfonts.override { fonts = [ "Iosevka" ]; }) + ]; +} diff --git a/home/env/common/git.nix b/home/env/common/git.nix new file mode 100644 index 00000000..4eef79bb --- /dev/null +++ b/home/env/common/git.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + imports = [ + ./ssh.nix + ./shell + ]; + programs.git = { + enable = true; + userName = "Evie Litherland-Smith"; + delta.enable = true; + extraConfig = { + pull = { + rebase = false; + }; + }; + }; +} diff --git a/home/env/common/keychain.nix b/home/env/common/keychain.nix new file mode 100644 index 00000000..6ebcf7db --- /dev/null +++ b/home/env/common/keychain.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + imports = [ ./shell ]; + programs.keychain = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + enableXsessionIntegration = true; + extraFlags = [ + "--quiet" + "--ignore-missing" + ]; + keys = [ + "id_rsa" + "id_ed25519" + ]; + }; +} diff --git a/home/common/default.nix b/home/env/common/nixpkgs.nix similarity index 98% rename from home/common/default.nix rename to home/env/common/nixpkgs.nix index 13726235..ce863af9 100644 --- a/home/common/default.nix +++ b/home/env/common/nixpkgs.nix @@ -1,5 +1,4 @@ { ... }: - { nixpkgs.config.allowUnfree = true; } diff --git a/home/env/qemu.nix b/home/env/common/qemu.nix similarity index 66% rename from home/env/qemu.nix rename to home/env/common/qemu.nix index 5c36382a..036d1077 100644 --- a/home/env/qemu.nix +++ b/home/env/common/qemu.nix @@ -1,6 +1,5 @@ { pkgs, ... }: { - imports = [ ./common.nix ]; home.packages = with pkgs; [ qemu ]; } diff --git a/home/env/bash.nix b/home/env/common/shell/bash.nix similarity index 90% rename from home/env/bash.nix rename to home/env/common/shell/bash.nix index 7c85834f..431df53b 100644 --- a/home/env/bash.nix +++ b/home/env/common/shell/bash.nix @@ -1,7 +1,6 @@ { ... }: { - imports = [ ./common.nix ]; programs.bash = { enable = true; shellAliases = { diff --git a/home/env/default.nix b/home/env/common/shell/default.nix similarity index 82% rename from home/env/default.nix rename to home/env/common/shell/default.nix index ed0601a0..be00e6af 100644 --- a/home/env/default.nix +++ b/home/env/common/shell/default.nix @@ -1,10 +1,8 @@ { ... }: - { imports = [ ./bash.nix ./zsh.nix ./fish.nix - ./qemu.nix ]; } diff --git a/home/env/fish.nix b/home/env/common/shell/fish.nix similarity index 90% rename from home/env/fish.nix rename to home/env/common/shell/fish.nix index a397b04f..26ab66d8 100644 --- a/home/env/fish.nix +++ b/home/env/common/shell/fish.nix @@ -1,7 +1,6 @@ { ... }: { - imports = [ ./common.nix ]; programs.fish = { enable = true; shellAbbrs = { diff --git a/home/env/zsh.nix b/home/env/common/shell/zsh.nix similarity index 93% rename from home/env/zsh.nix rename to home/env/common/shell/zsh.nix index bd35cb12..133a495c 100644 --- a/home/env/zsh.nix +++ b/home/env/common/shell/zsh.nix @@ -1,7 +1,6 @@ { config, ... }: { - imports = [ ./common.nix ]; programs.zsh = { enable = true; shellAliases = { diff --git a/home/env/common/ssh.nix b/home/env/common/ssh.nix new file mode 100644 index 00000000..9832c944 --- /dev/null +++ b/home/env/common/ssh.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ ./shell ]; + programs.ssh = { + enable = true; + includes = [ "config.d/*" ]; + forwardAgent = true; + serverAliveInterval = 15; + serverAliveCountMax = 3; + controlMaster = "auto"; + controlPersist = "5s"; + }; +} diff --git a/home/env/common/starship.nix b/home/env/common/starship.nix new file mode 100644 index 00000000..0aefeccb --- /dev/null +++ b/home/env/common/starship.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ ./shell ]; + xdg.configFile."starship.toml".source = ./config/starship.toml; + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + }; +} diff --git a/home/common/personal.nix b/home/env/personal.nix similarity index 89% rename from home/common/personal.nix rename to home/env/personal.nix index cd3a9f04..1bc8f0ce 100644 --- a/home/common/personal.nix +++ b/home/env/personal.nix @@ -1,5 +1,6 @@ { ... }: { + imports = [ ./common ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "xenia"; diff --git a/home/env/work.nix b/home/env/work.nix new file mode 100644 index 00000000..54f3a6ca --- /dev/null +++ b/home/env/work.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ ./common ]; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "elitherl"; + home.homeDirectory = "/home/elitherl"; + + programs.git = { + userEmail = "evie.litherland-smith@ukaea.uk"; + }; +} diff --git a/home/gui/chromium-wayland.nix b/home/gui/chromium-wayland.nix index dc4fb37a..c661fd60 100644 --- a/home/gui/chromium-wayland.nix +++ b/home/gui/chromium-wayland.nix @@ -1,5 +1,4 @@ { ... }: { - imports = [ ./common.nix ]; programs.chromium.enable = true; } diff --git a/home/gui/cloud.nix b/home/gui/cloud.nix index 2de1cc37..ee3a264b 100644 --- a/home/gui/cloud.nix +++ b/home/gui/cloud.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { - imports = [ ./common.nix ]; #services.nextcloud-client = { # enable = true; # startInBackground = true; diff --git a/home/gui/common.nix b/home/gui/common.nix deleted file mode 100644 index 12bf09b6..00000000 --- a/home/gui/common.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - imports = [ ../common ]; -} diff --git a/home/gui/firefox.nix b/home/gui/firefox.nix index 79c99c84..29d130b1 100644 --- a/home/gui/firefox.nix +++ b/home/gui/firefox.nix @@ -1,5 +1,4 @@ { ... }: { - imports = [ ./common.nix ]; programs.firefox.enable = true; } diff --git a/home/gui/foot.nix b/home/gui/foot.nix index 6101e73d..99a24577 100644 --- a/home/gui/foot.nix +++ b/home/gui/foot.nix @@ -1,6 +1,5 @@ { ... }: { - imports = [ ./common.nix ]; fonts.fontconfig.enable = true; programs.foot = { enable = true; diff --git a/home/gui/gaming.nix b/home/gui/gaming.nix index 1f9e23bb..bd9e35b6 100644 --- a/home/gui/gaming.nix +++ b/home/gui/gaming.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { - imports = [ ./common.nix ]; home.packages = with pkgs; [ mesa steam diff --git a/home/gui/kitty.nix b/home/gui/kitty.nix index 9c8d05a9..82af5255 100644 --- a/home/gui/kitty.nix +++ b/home/gui/kitty.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { - imports = [ ./common.nix ]; programs.kitty = { enable = true; font = { diff --git a/home/gui/messaging.nix b/home/gui/messaging.nix index edc2335a..816dd210 100644 --- a/home/gui/messaging.nix +++ b/home/gui/messaging.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { - imports = [ ./common.nix ]; home.packages = with pkgs; [ signal-desktop element-desktop diff --git a/home/gui/nomachine.nix b/home/gui/nomachine.nix index 9867faf1..a9330055 100644 --- a/home/gui/nomachine.nix +++ b/home/gui/nomachine.nix @@ -1,7 +1,5 @@ -{ config, pkgs, ... }: - +{ pkgs, ... }: { - imports = [ ./common.nix ]; home.packages = with pkgs; [ nomachine-client ]; diff --git a/home/gui/ukaea.nix b/home/gui/ukaea.nix index 68cef783..1bc13cd2 100644 --- a/home/gui/ukaea.nix +++ b/home/gui/ukaea.nix @@ -1,7 +1,5 @@ { pkgs, ... }: - { - imports = [ ./common.nix ]; home.packages = with pkgs; [ teams zoom-us diff --git a/home/gui/urxvt.nix b/home/gui/urxvt.nix index b0282a7c..c2ce0bf0 100644 --- a/home/gui/urxvt.nix +++ b/home/gui/urxvt.nix @@ -1,6 +1,6 @@ { ... }: { - imports = [ ./common.nix ]; + imports = [ ../env/fonts ]; programs.urxvt = { enable = true; fonts = [ diff --git a/home/tui/common.nix b/home/tui/common.nix index 066ac7f4..111eac38 100644 --- a/home/tui/common.nix +++ b/home/tui/common.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { - imports = [ ../common ]; + imports = [ ../env/fonts]; programs.neovim.defaultEditor = true; programs.bat = { enable = true; @@ -19,14 +19,6 @@ }; }; home.packages = with pkgs; [ - fira-code - iosevka - (nerdfonts.override { - fonts = [ - "FiraCode" - "Iosevka" - ]; - }) file silver-searcher lynx diff --git a/home/ukaea-elitherl.nix b/home/ukaea-elitherl.nix new file mode 100644 index 00000000..e24a0017 --- /dev/null +++ b/home/ukaea-elitherl.nix @@ -0,0 +1,17 @@ +{ ... }: { + imports = [ + ./desktop/gtk.nix + ./desktop/wayland.nix + ./env/work.nix + ./tui + ./gui/chromium-wayland.nix + ./gui/neovide.nix + ./gui/libreoffice.nix + ./gui/cloud.nix + ./gui/kitty.nix + ./gui/messaging.nix + ./gui/nomachine.nix + ./gui/ukaea.nix + ]; + home.stateVersion = "22.11"; +}