diff --git a/flake.nix b/flake.nix index 394ce90..880869a 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,7 @@ flakeDir = ./.; publicsDir = ./publics; secretsDir = ./secrets; - systemsDir = ./systems; + hostsDir = ./hosts; usersDir = ./users; }; in @@ -70,7 +70,7 @@ acc // { "${nixConfig.name}" = nixpkgs.lib.nixosSystem { - modules = [ ./systems/_common/configuration.nix ./systems/${nixConfig.name}/configuration.nix ]; + modules = [ ./hosts/_common/configuration.nix ./hosts/${nixConfig.name}/configuration.nix ]; specialArgs = inputs // { ylib = nypkgs.legacyPackages.${nixConfig.opts.system}.lib; settings = directories // nixConfig.settings // { diff --git a/systems/_common/components/caps_to_escape_in_tty.nix b/hosts/_common/components/caps_to_escape_in_tty.nix similarity index 100% rename from systems/_common/components/caps_to_escape_in_tty.nix rename to hosts/_common/components/caps_to_escape_in_tty.nix diff --git a/systems/_common/components/font_jetbrainsmono.nix b/hosts/_common/components/font_jetbrainsmono.nix similarity index 100% rename from systems/_common/components/font_jetbrainsmono.nix rename to hosts/_common/components/font_jetbrainsmono.nix diff --git a/systems/_common/components/gnome_wayland.nix b/hosts/_common/components/gnome_wayland.nix similarity index 100% rename from systems/_common/components/gnome_wayland.nix rename to hosts/_common/components/gnome_wayland.nix diff --git a/hosts/_common/components/gnome_xorg.nix b/hosts/_common/components/gnome_xorg.nix new file mode 100644 index 0000000..d1ebbf9 --- /dev/null +++ b/hosts/_common/components/gnome_xorg.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + services.xserver = { + enable = true; + displayManager.gdm = { + enable = true; + autoSuspend = false; + wayland = false; + }; + desktopManager.gnome.enable = true; + }; + services.gnome.core-utilities.enable = false; + environment.systemPackages = with pkgs; [ + gnome.dconf-editor + gnomeExtensions.workspace-switch-wraparound + xclip + ]; +} + diff --git a/systems/_common/components/home_manager.nix b/hosts/_common/components/home_manager.nix similarity index 100% rename from systems/_common/components/home_manager.nix rename to hosts/_common/components/home_manager.nix diff --git a/systems/_common/components/ssh.nix b/hosts/_common/components/ssh.nix similarity index 100% rename from systems/_common/components/ssh.nix rename to hosts/_common/components/ssh.nix diff --git a/systems/_common/components/systemd_boot.nix b/hosts/_common/components/systemd_boot.nix similarity index 100% rename from systems/_common/components/systemd_boot.nix rename to hosts/_common/components/systemd_boot.nix diff --git a/systems/_common/components/todo_neovim.nix b/hosts/_common/components/todo_neovim.nix similarity index 100% rename from systems/_common/components/todo_neovim.nix rename to hosts/_common/components/todo_neovim.nix diff --git a/systems/_common/configuration.nix b/hosts/_common/configuration.nix similarity index 93% rename from systems/_common/configuration.nix rename to hosts/_common/configuration.nix index 2992184..975e1a1 100644 --- a/systems/_common/configuration.nix +++ b/hosts/_common/configuration.nix @@ -8,9 +8,9 @@ in # Secrets management ./ragenix.nix # Include the results of the hardware scan. - (/${settings.systemsDir}/${settings.system.hostname}/hardware-configuration.nix) + (/${settings.hostsDir}/${settings.system.hostname}/hardware-configuration.nix) # Include the specific machine's config. - (/${settings.systemsDir}/${settings.system.hostname}/configuration.nix) + (/${settings.hostsDir}/${settings.system.hostname}/configuration.nix) ]; # Enable flakes diff --git a/systems/_common/ragenix.nix b/hosts/_common/ragenix.nix similarity index 100% rename from systems/_common/ragenix.nix rename to hosts/_common/ragenix.nix diff --git a/systems/_common/shellInit.sh b/hosts/_common/shellInit.sh similarity index 100% rename from systems/_common/shellInit.sh rename to hosts/_common/shellInit.sh diff --git a/systems/gpdPocket3/configuration.nix b/hosts/gpdPocket3/configuration.nix similarity index 84% rename from systems/gpdPocket3/configuration.nix rename to hosts/gpdPocket3/configuration.nix index db9b8a6..e765eda 100644 --- a/systems/gpdPocket3/configuration.nix +++ b/hosts/gpdPocket3/configuration.nix @@ -3,14 +3,14 @@ imports = [ # TODO revisit - (settings.systemsDir + "/_common/components/todo_neovim.nix") + (settings.hostsDir + "/_common/components/todo_neovim.nix") # Common components this machine uses - (settings.systemsDir + "/_common/components/systemd_boot.nix") - (settings.systemsDir + "/_common/components/ssh.nix") - (settings.systemsDir + "/_common/components/caps_to_escape_in_tty.nix") - (settings.systemsDir + "/_common/components/font_jetbrainsmono.nix") - (settings.systemsDir + "/_common/components/home_manager.nix") - (settings.systemsDir + "/_common/components/gnome_wayland.nix") + (settings.hostsDir + "/_common/components/systemd_boot.nix") + (settings.hostsDir + "/_common/components/ssh.nix") + (settings.hostsDir + "/_common/components/caps_to_escape_in_tty.nix") + (settings.hostsDir + "/_common/components/font_jetbrainsmono.nix") + (settings.hostsDir + "/_common/components/home_manager.nix") + (settings.hostsDir + "/_common/components/gnome_wayland.nix") # Users this machine has (settings.usersDir + "/root/configuration.nix") (settings.usersDir + "/josh/configuration.nix") diff --git a/systems/gpdPocket3/hardware-configuration.nix b/hosts/gpdPocket3/hardware-configuration.nix similarity index 100% rename from systems/gpdPocket3/hardware-configuration.nix rename to hosts/gpdPocket3/hardware-configuration.nix diff --git a/systems/gpdPocket3/stupid-keyboard.nix b/hosts/gpdPocket3/stupid-keyboard.nix similarity index 100% rename from systems/gpdPocket3/stupid-keyboard.nix rename to hosts/gpdPocket3/stupid-keyboard.nix diff --git a/systems/joe/configuration.nix b/hosts/joe/configuration.nix similarity index 82% rename from systems/joe/configuration.nix rename to hosts/joe/configuration.nix index 932db34..ca73249 100644 --- a/systems/joe/configuration.nix +++ b/hosts/joe/configuration.nix @@ -3,14 +3,14 @@ imports = [ # TODO revisit - (settings.systemsDir + "/_common/components/todo_neovim.nix") + (settings.hostsDir + "/_common/components/todo_neovim.nix") # Common components this machine uses - (settings.systemsDir + "/_common/components/systemd_boot.nix") - (settings.systemsDir + "/_common/components/ssh.nix") - (settings.systemsDir + "/_common/components/caps_to_escape_in_tty.nix") - (settings.systemsDir + "/_common/components/font_jetbrainsmono.nix") - (settings.systemsDir + "/_common/components/home_manager.nix") - (settings.systemsDir + "/_common/components/gnome_xorg.nix") + (settings.hostsDir + "/_common/components/systemd_boot.nix") + (settings.hostsDir + "/_common/components/ssh.nix") + (settings.hostsDir + "/_common/components/caps_to_escape_in_tty.nix") + (settings.hostsDir + "/_common/components/font_jetbrainsmono.nix") + (settings.hostsDir + "/_common/components/home_manager.nix") + (settings.hostsDir + "/_common/components/gnome_xorg.nix") # Users this machine has (settings.usersDir + "/root/configuration.nix") (settings.usersDir + "/josh/configuration.nix") diff --git a/systems/joe/hardware-configuration.nix b/hosts/joe/hardware-configuration.nix similarity index 100% rename from systems/joe/hardware-configuration.nix rename to hosts/joe/hardware-configuration.nix diff --git a/readme.md b/readme.md index 38cabc7..b5f718d 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,7 @@ - `cp -r /etc/nixos ~/nixos_bak` Backup configuration - Checkout this repo into /etc/nixos: `rm -rf /etc/nixos` `git clone https://github.com/ringofstorms/dotfiles /etc/nixos` -- Copy hardware-configuration into the new /etc/nixos/systems/HOSTNAME/hardware-configuration.nix `mkdir /etc/nixos/systems/HOSTNAM && cp ~/hardware-configuration.nix /etx/nixos/systems/HOSTNAME` +- Copy hardware-configuration into the new /etc/nixos/hosts/HOSTNAME/hardware-configuration.nix `mkdir /etc/nixos/hosts/HOSTNAM && cp ~/hardware-configuration.nix /etx/nixos/hosts/HOSTNAME` - copy the existing configuration/other configuration nix of an existing system and edit it to desires state. [[ TODO make this step cleaner/easier... ]] - switch into flake mode `nixos-rebuild switch --flake /etc/nixos[#HOSTNAME]` and switch to new system - copy system ssh public key and create a key for user and copy those into the nixos secrets.nix file @@ -27,7 +27,7 @@ - Push changes to remote using temp user password - rekey secrets with any other onboarded system - TODO -- copy over this systems ssh public key ( /etc/shh/*ed25519* ) into the ./secrets/secrets.nix file - push those up, using another computer re-key all the secrets, push up again +- copy over this host's ssh public key ( /etc/shh/*ed25519* ) into the ./secrets/secrets.nix file - push those up, using another computer re-key all the secrets, push up again - pull new secrets down with new added keys and rebuild - clone neovim setup... diff --git a/users/josh/by_hosts/joe/spotifyd.nix b/users/josh/by_hosts/joe/spotifyd.nix new file mode 100644 index 0000000..286b949 --- /dev/null +++ b/users/josh/by_hosts/joe/spotifyd.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = [ pkgs.spotifyd ]; +} + + diff --git a/users/josh/by_hosts/readme.md b/users/josh/by_hosts/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/users/josh/configuration.nix b/users/josh/configuration.nix index c3630b6..dd31743 100644 --- a/users/josh/configuration.nix +++ b/users/josh/configuration.nix @@ -17,14 +17,14 @@ imports = # Common settings all users share [ (settings.usersDir + "/_common/home.nix") ] - # User programs + # Programs ++ ylib.umport { paths = [ ./programs ]; recursive = true; } - # User theme + # Programs by host ++ ylib.umport { - paths = [ ./theme ]; + paths = [ ./by_hosts/${settings.system.hostname} ]; recursive = true; }; }; diff --git a/users/josh/theme/gnome.nix b/users/josh/programs/de/gnome.nix similarity index 94% rename from users/josh/theme/gnome.nix rename to users/josh/programs/de/gnome.nix index d50a442..9510da7 100644 --- a/users/josh/theme/gnome.nix +++ b/users/josh/programs/de/gnome.nix @@ -54,10 +54,10 @@ move-to-workspace-3 = [ "" ]; move-to-workspace-4 = [ "" ]; move-to-workspace-last = [ "" ]; - move-to-workspace-down = [ "Down" ]; - move-to-workspace-up = [ "Up" ]; - move-to-workspace-left = [ "Left" ]; - move-to-workspace-right = [ "Right" ]; + move-to-workspace-down = [ "j" ]; + move-to-workspace-up = [ "k" ]; + move-to-workspace-left = [ "h" ]; + move-to-workspace-right = [ "l" ]; switch-to-workspace-1 = [ "1" ]; switch-to-workspace0 = [ "2" ]; diff --git a/users/josh/theme/gtk.nix b/users/josh/programs/de/gtk.nix similarity index 100% rename from users/josh/theme/gtk.nix rename to users/josh/programs/de/gtk.nix