From 5a18c254aca4be067af777d6801a9fbc892cf165 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 16 May 2023 09:13:59 +0100 Subject: [PATCH] Move home-manager config into separate directories Add platform specific hyprland/hyprpaper/waybar config into platform specific home-manager files, better integration with nix and no conflicing links --- H0615.nix | 13 ++---- J0162.nix | 13 ++---- Vanguard.nix | 14 ++----- common.nix | 8 ---- desktop/steam.nix | 1 - home/H0615/elitherl.nix | 8 ++++ home/J0162/elitherl.nix | 8 ++++ home/{Monarch-tux.nix => Monarch/tux.nix} | 2 +- home/Vanguard/root.nix | 11 ++++++ home/Vanguard/xenia.nix | 48 +++++++++++++++++++++++ 10 files changed, 85 insertions(+), 41 deletions(-) create mode 100644 home/H0615/elitherl.nix create mode 100644 home/J0162/elitherl.nix rename home/{Monarch-tux.nix => Monarch/tux.nix} (92%) create mode 100644 home/Vanguard/root.nix create mode 100644 home/Vanguard/xenia.nix diff --git a/H0615.nix b/H0615.nix index f48cbfa4..90614094 100644 --- a/H0615.nix +++ b/H0615.nix @@ -3,9 +3,9 @@ imports = [ ./home ./common.nix - ./hardware/audio.nix ./locales/en_GB.nix - ./desktop/plasma.nix + ./desktop/hyprland.nix + ./hardware/audio.nix ./syncthing/H0615.nix ]; @@ -18,14 +18,7 @@ extraGroups = [ "networkmanager" "wheel" ]; shell = pkgs.fish; }; - home-manager.users.elitherl = { ... }: { - imports = [ ./home/work.nix ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "elitherl"; - home.homeDirectory = "/home/elitherl"; - home.stateVersion = "22.11"; - }; + home-manager.users.elitherl = import ./home/H0615/elitherl.nix; system.autoUpgrade = { enable = false; diff --git a/J0162.nix b/J0162.nix index c3624040..72548ea5 100644 --- a/J0162.nix +++ b/J0162.nix @@ -3,10 +3,10 @@ imports = [ ./home ./common.nix + ./locales/en_GB.nix + ./desktop/hyprland.nix ./hardware/audio.nix ./hardware/bluetooth.nix - ./locales/en_GB.nix - ./desktop/plasma.nix ]; networking.hostName = "J0162"; # Define your hostname. @@ -18,14 +18,7 @@ extraGroups = [ "networkmanager" "wheel" ]; shell = pkgs.fish; }; - home-manager.users.elitherl = { ... }: { - imports = [ ./home/collections/work ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "elitherl"; - home.homeDirectory = "/home/elitherl"; - home.stateVersion = "22.11"; - }; + home-manager.users.elitherl = import ./home/J0162/elitherl.nix; system.autoUpgrade = { enable = false; diff --git a/Vanguard.nix b/Vanguard.nix index d13600fd..a588cf32 100644 --- a/Vanguard.nix +++ b/Vanguard.nix @@ -6,7 +6,7 @@ ./hardware/audio.nix ./hardware/bluetooth.nix ./locales/en_GB.nix - ./desktop/plasma.nix + ./desktop/hyprland.nix ./desktop/steam.nix ./syncthing/Vanguard.nix ./server/adguardhome.nix @@ -19,8 +19,6 @@ services.openssh.enable = true; networking.firewall = { enable = true; allowedTCPPorts = [ 22 ]; }; - services.xserver.displayManager.defaultSession = "plasmawayland"; - users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1tJFdbiyJApuVZFvo9E9kjlBwvXZeySqVuS2qGdxha tux@monarch" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINI1dWlS16Keil0MGPWmMsBzx8F9ylfz+fRwxUr8/tZ/ ion" @@ -38,14 +36,8 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGAcvAQ8W71Bn8pdMYst1hoVCmVJ+0h4HBlJzu1C6dwy xenia@Northstar" ]; }; - - home-manager.users.xenia = { ... }: { - imports = [ ./home/personal.nix ]; - home.username = "xenia"; - home.homeDirectory = "/home/xenia"; - home.stateVersion = "22.11"; - home.packages = with pkgs; [ prismlauncher ]; - }; + home-manager.users.root = import ./home/Vanguard/root.nix; + home-manager.users.xenia = import ./home/Vanguard/xenia.nix; # Extra hardware configuration hardware.openrazer = { diff --git a/common.nix b/common.nix index 7674248a..a1a6228c 100644 --- a/common.nix +++ b/common.nix @@ -7,12 +7,6 @@ # Home manager integration with NixOS home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true; - home-manager.users.root = { ... }: { - imports = [ ./home/env ./home/tui ./home/git/personal.nix ./home/ssh/personal.nix ]; - home.username = "root"; - home.homeDirectory = "/root"; - home.stateVersion = "22.11"; - }; # Enable networking networking.networkmanager.enable = true; @@ -20,8 +14,6 @@ # Enable power-profiles services.power-profiles-daemon.enable = true; - environment.systemPackages = with pkgs; [ home-manager ]; - programs.nix-ld = { enable = true; libraries = with pkgs; [ diff --git a/desktop/steam.nix b/desktop/steam.nix index 877e5efa..96ca9a97 100644 --- a/desktop/steam.nix +++ b/desktop/steam.nix @@ -1,6 +1,5 @@ { pkgs, ... }: { - imports = [ ./xserver.nix ./sddm.nix ]; environment.systemPackages = [ pkgs.mesa ]; programs.gamescope.enable = true; programs.steam = { diff --git a/home/H0615/elitherl.nix b/home/H0615/elitherl.nix new file mode 100644 index 00000000..f139039b --- /dev/null +++ b/home/H0615/elitherl.nix @@ -0,0 +1,8 @@ +{ ... }: { + imports = [ ../work.nix ../desktop/hyprland.nix ]; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "elitherl"; + home.homeDirectory = "/home/elitherl"; + home.stateVersion = "22.11"; +} diff --git a/home/J0162/elitherl.nix b/home/J0162/elitherl.nix new file mode 100644 index 00000000..f139039b --- /dev/null +++ b/home/J0162/elitherl.nix @@ -0,0 +1,8 @@ +{ ... }: { + imports = [ ../work.nix ../desktop/hyprland.nix ]; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "elitherl"; + home.homeDirectory = "/home/elitherl"; + home.stateVersion = "22.11"; +} diff --git a/home/Monarch-tux.nix b/home/Monarch/tux.nix similarity index 92% rename from home/Monarch-tux.nix rename to home/Monarch/tux.nix index e20bcceb..1d9278f3 100644 --- a/home/Monarch-tux.nix +++ b/home/Monarch/tux.nix @@ -1,6 +1,6 @@ { ... }: { - imports = [ ./personal.nix ]; + imports = [ ../personal.nix ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "tux"; diff --git a/home/Vanguard/root.nix b/home/Vanguard/root.nix new file mode 100644 index 00000000..e3f3f874 --- /dev/null +++ b/home/Vanguard/root.nix @@ -0,0 +1,11 @@ +{ ... }: { + imports = [ + ../env + ../tui + ../git/personal.nix + ../ssh/personal.nix + ]; + home.username = "root"; + home.homeDirectory = "/root"; + home.stateVersion = "22.11"; +} diff --git a/home/Vanguard/xenia.nix b/home/Vanguard/xenia.nix new file mode 100644 index 00000000..e7218043 --- /dev/null +++ b/home/Vanguard/xenia.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: { + imports = [ ../personal.nix ../desktop/hyprland.nix ]; + home.username = "xenia"; + home.homeDirectory = "/home/xenia"; + home.stateVersion = "22.11"; + home.packages = with pkgs; [ prismlauncher ]; + + xdg.configFile."hypr/hyprpaper.conf".source = ../desktop/config/hypr/hyprpaper-Vanguard.conf; + wayland.windowManager.hyprland.extraConfig = '' + source=./common.conf + + misc { + vrr = 2 + } + + monitor=DP-1,highrr,auto,1 + monitor=HDMI-A-1,highres,auto,2 + + exec-once = waybar -c + exec-once=hyprpaper -c ~/.config/hypr/hyprpaper-Vanguard.conf + ''; + programs.waybar = { + style = '' + @import 'common.css'; + ''; + settings = { + main = { + "include" = [ + "~/.config/waybar/modules.json" + "~/.config/waybar/layout.json" + ]; + "modules-left" = [ "custom/launcher" "cpu" "memory" "temperature" ]; + "modules-center" = [ "wlr/workspaces" ]; + "modules-right" = [ + "pulseaudio" + "bluetooth" + "network" + "backlight" + "battery" + "battery#bat2" + "clock" + "tray" + "custom/power" + ]; + }; + }; + }; +}