From f9646bec233995be0aa236450775a101656ab4ad Mon Sep 17 00:00:00 2001 From: ooks-io Date: Fri, 10 Nov 2023 17:14:05 +1300 Subject: [PATCH] restructure: home-manager config --- home/ooks/{standard => base}/default.nix | 3 +- home/ooks/{opt => base}/shell/bash.nix | 0 home/ooks/{opt => base}/shell/bat.nix | 0 home/ooks/{opt => base}/shell/default.nix | 6 +- home/ooks/{opt => base}/shell/fish.nix | 0 home/ooks/base/shell/fzf.nix | 5 ++ home/ooks/{opt => base}/shell/git.nix | 0 .../{opt => base}/shell/helix/default.nix | 0 home/ooks/{opt => base}/shell/helix/theme.nix | 0 .../shell/joshuto/config/bookmarks.toml | 0 .../shell/joshuto/config/joshuto.toml | 0 .../shell/joshuto/config/keymap.toml | 0 .../shell/joshuto/config/mimetype.toml | 0 .../shell/joshuto/config/preview_file.sh | 0 .../shell/joshuto/config/theme.toml | 0 .../{opt => base}/shell/joshuto/default.nix | 0 .../{opt => base}/shell/live-buds-cli.nix | 0 .../nvim/default.nix => base/shell/nvim.nix} | 0 home/ooks/{opt => base}/shell/pfetch.nix | 0 home/ooks/{opt => base}/shell/starship.nix | 0 .../essentials}/default.nix | 1 + .../essentials}/fonts.nix | 0 .../standard => features/essentials}/gtk.nix | 0 .../standard => features/essentials}/imv.nix | 0 .../essentials/music.nix} | 0 .../essentials}/pavucontrol.nix | 0 .../essentials}/playerctl.nix | 0 .../standard => features/essentials}/qt.nix | 0 .../essentials}/yt-dlp.nix | 0 .../wayland/essentials}/cursor.nix | 0 .../wayland/essentials}/default.nix | 0 .../wayland/essentials}/eww/config/eww.yuck | 0 .../wayland/essentials}/eww/default.nix | 0 .../wayland/essentials}/firefox.nix | 0 .../wayland/essentials}/gammastep.nix | 0 .../wayland/essentials}/gimp.nix | 0 .../wayland/essentials}/kitty.nix | 0 .../wayland/essentials}/mako.nix | 0 .../wayland/essentials}/swaylock.nix | 0 .../wayland/essentials}/zathura.nix | 0 .../window-manager}/hyprland/binds.nix | 0 .../window-manager}/hyprland/default.nix | 32 +++++----- .../hyprland/environment-variables.nix} | 0 .../window-manager}/hyprland/systemd-fix.nix | 0 .../window-manager}/hyprland/tty-init.nix | 0 home/ooks/ooksmicro.nix | 11 ++++ home/ooks/ookst480s.nix | 14 ++++- modules/home-manager/default.nix | 1 + modules/home-manager/monitors.nix | 62 +++++++++++++++++++ 49 files changed, 110 insertions(+), 25 deletions(-) rename home/ooks/{standard => base}/default.nix (97%) rename home/ooks/{opt => base}/shell/bash.nix (100%) rename home/ooks/{opt => base}/shell/bat.nix (100%) rename home/ooks/{opt => base}/shell/default.nix (93%) rename home/ooks/{opt => base}/shell/fish.nix (100%) create mode 100644 home/ooks/base/shell/fzf.nix rename home/ooks/{opt => base}/shell/git.nix (100%) rename home/ooks/{opt => base}/shell/helix/default.nix (100%) rename home/ooks/{opt => base}/shell/helix/theme.nix (100%) rename home/ooks/{opt => base}/shell/joshuto/config/bookmarks.toml (100%) rename home/ooks/{opt => base}/shell/joshuto/config/joshuto.toml (100%) rename home/ooks/{opt => base}/shell/joshuto/config/keymap.toml (100%) rename home/ooks/{opt => base}/shell/joshuto/config/mimetype.toml (100%) rename home/ooks/{opt => base}/shell/joshuto/config/preview_file.sh (100%) rename home/ooks/{opt => base}/shell/joshuto/config/theme.toml (100%) rename home/ooks/{opt => base}/shell/joshuto/default.nix (100%) rename home/ooks/{opt => base}/shell/live-buds-cli.nix (100%) rename home/ooks/{opt/nvim/default.nix => base/shell/nvim.nix} (100%) rename home/ooks/{opt => base}/shell/pfetch.nix (100%) rename home/ooks/{opt => base}/shell/starship.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/default.nix (90%) rename home/ooks/{opt/desktop/standard => features/essentials}/fonts.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/gtk.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/imv.nix (100%) rename home/ooks/{opt/desktop/music/default.nix => features/essentials/music.nix} (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/pavucontrol.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/playerctl.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/qt.nix (100%) rename home/ooks/{opt/desktop/standard => features/essentials}/yt-dlp.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/cursor.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/default.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/eww/config/eww.yuck (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/eww/default.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/firefox.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/gammastep.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/gimp.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/kitty.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/mako.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/swaylock.nix (100%) rename home/ooks/{opt/desktop/standard/wayland => features/wayland/essentials}/zathura.nix (100%) rename home/ooks/{opt/desktop => features/wayland/window-manager}/hyprland/binds.nix (100%) rename home/ooks/{opt/desktop => features/wayland/window-manager}/hyprland/default.nix (74%) rename home/ooks/{opt/desktop/env/hypr-variable.nix => features/wayland/window-manager/hyprland/environment-variables.nix} (100%) rename home/ooks/{opt/desktop => features/wayland/window-manager}/hyprland/systemd-fix.nix (100%) rename home/ooks/{opt/desktop => features/wayland/window-manager}/hyprland/tty-init.nix (100%) create mode 100644 home/ooks/ooksmicro.nix create mode 100644 modules/home-manager/monitors.nix diff --git a/home/ooks/standard/default.nix b/home/ooks/base/default.nix similarity index 97% rename from home/ooks/standard/default.nix rename to home/ooks/base/default.nix index 5b025b0..4c2b19a 100644 --- a/home/ooks/standard/default.nix +++ b/home/ooks/base/default.nix @@ -5,8 +5,7 @@ in { imports = [ inputs.nix-colors.homeManagerModule - ../opt/shell - ../opt/nvim + ./shell ] ++ (builtins.attrValues outputs.homeManagerModules); nixpkgs = { diff --git a/home/ooks/opt/shell/bash.nix b/home/ooks/base/shell/bash.nix similarity index 100% rename from home/ooks/opt/shell/bash.nix rename to home/ooks/base/shell/bash.nix diff --git a/home/ooks/opt/shell/bat.nix b/home/ooks/base/shell/bat.nix similarity index 100% rename from home/ooks/opt/shell/bat.nix rename to home/ooks/base/shell/bat.nix diff --git a/home/ooks/opt/shell/default.nix b/home/ooks/base/shell/default.nix similarity index 93% rename from home/ooks/opt/shell/default.nix rename to home/ooks/base/shell/default.nix index 300c0b8..7de48b3 100644 --- a/home/ooks/opt/shell/default.nix +++ b/home/ooks/base/shell/default.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { imports = [ ./bat.nix + ./nvim.nix + ./fzf.nix ./git.nix ./bash.nix ./fish.nix @@ -33,8 +35,4 @@ acpi ]; - - programs = { - fzf.enable = true; - }; } diff --git a/home/ooks/opt/shell/fish.nix b/home/ooks/base/shell/fish.nix similarity index 100% rename from home/ooks/opt/shell/fish.nix rename to home/ooks/base/shell/fish.nix diff --git a/home/ooks/base/shell/fzf.nix b/home/ooks/base/shell/fzf.nix new file mode 100644 index 0000000..9134638 --- /dev/null +++ b/home/ooks/base/shell/fzf.nix @@ -0,0 +1,5 @@ +{ + programs.fzf = { + enable = true; + }; +} diff --git a/home/ooks/opt/shell/git.nix b/home/ooks/base/shell/git.nix similarity index 100% rename from home/ooks/opt/shell/git.nix rename to home/ooks/base/shell/git.nix diff --git a/home/ooks/opt/shell/helix/default.nix b/home/ooks/base/shell/helix/default.nix similarity index 100% rename from home/ooks/opt/shell/helix/default.nix rename to home/ooks/base/shell/helix/default.nix diff --git a/home/ooks/opt/shell/helix/theme.nix b/home/ooks/base/shell/helix/theme.nix similarity index 100% rename from home/ooks/opt/shell/helix/theme.nix rename to home/ooks/base/shell/helix/theme.nix diff --git a/home/ooks/opt/shell/joshuto/config/bookmarks.toml b/home/ooks/base/shell/joshuto/config/bookmarks.toml similarity index 100% rename from home/ooks/opt/shell/joshuto/config/bookmarks.toml rename to home/ooks/base/shell/joshuto/config/bookmarks.toml diff --git a/home/ooks/opt/shell/joshuto/config/joshuto.toml b/home/ooks/base/shell/joshuto/config/joshuto.toml similarity index 100% rename from home/ooks/opt/shell/joshuto/config/joshuto.toml rename to home/ooks/base/shell/joshuto/config/joshuto.toml diff --git a/home/ooks/opt/shell/joshuto/config/keymap.toml b/home/ooks/base/shell/joshuto/config/keymap.toml similarity index 100% rename from home/ooks/opt/shell/joshuto/config/keymap.toml rename to home/ooks/base/shell/joshuto/config/keymap.toml diff --git a/home/ooks/opt/shell/joshuto/config/mimetype.toml b/home/ooks/base/shell/joshuto/config/mimetype.toml similarity index 100% rename from home/ooks/opt/shell/joshuto/config/mimetype.toml rename to home/ooks/base/shell/joshuto/config/mimetype.toml diff --git a/home/ooks/opt/shell/joshuto/config/preview_file.sh b/home/ooks/base/shell/joshuto/config/preview_file.sh similarity index 100% rename from home/ooks/opt/shell/joshuto/config/preview_file.sh rename to home/ooks/base/shell/joshuto/config/preview_file.sh diff --git a/home/ooks/opt/shell/joshuto/config/theme.toml b/home/ooks/base/shell/joshuto/config/theme.toml similarity index 100% rename from home/ooks/opt/shell/joshuto/config/theme.toml rename to home/ooks/base/shell/joshuto/config/theme.toml diff --git a/home/ooks/opt/shell/joshuto/default.nix b/home/ooks/base/shell/joshuto/default.nix similarity index 100% rename from home/ooks/opt/shell/joshuto/default.nix rename to home/ooks/base/shell/joshuto/default.nix diff --git a/home/ooks/opt/shell/live-buds-cli.nix b/home/ooks/base/shell/live-buds-cli.nix similarity index 100% rename from home/ooks/opt/shell/live-buds-cli.nix rename to home/ooks/base/shell/live-buds-cli.nix diff --git a/home/ooks/opt/nvim/default.nix b/home/ooks/base/shell/nvim.nix similarity index 100% rename from home/ooks/opt/nvim/default.nix rename to home/ooks/base/shell/nvim.nix diff --git a/home/ooks/opt/shell/pfetch.nix b/home/ooks/base/shell/pfetch.nix similarity index 100% rename from home/ooks/opt/shell/pfetch.nix rename to home/ooks/base/shell/pfetch.nix diff --git a/home/ooks/opt/shell/starship.nix b/home/ooks/base/shell/starship.nix similarity index 100% rename from home/ooks/opt/shell/starship.nix rename to home/ooks/base/shell/starship.nix diff --git a/home/ooks/opt/desktop/standard/default.nix b/home/ooks/features/essentials/default.nix similarity index 90% rename from home/ooks/opt/desktop/standard/default.nix rename to home/ooks/features/essentials/default.nix index ee3b7d2..f263796 100644 --- a/home/ooks/opt/desktop/standard/default.nix +++ b/home/ooks/features/essentials/default.nix @@ -6,6 +6,7 @@ ./fonts.nix ./playerctl.nix ./pavucontrol.nix + ./music.nix ./yt-dlp.nix ./playerctl.nix ]; diff --git a/home/ooks/opt/desktop/standard/fonts.nix b/home/ooks/features/essentials/fonts.nix similarity index 100% rename from home/ooks/opt/desktop/standard/fonts.nix rename to home/ooks/features/essentials/fonts.nix diff --git a/home/ooks/opt/desktop/standard/gtk.nix b/home/ooks/features/essentials/gtk.nix similarity index 100% rename from home/ooks/opt/desktop/standard/gtk.nix rename to home/ooks/features/essentials/gtk.nix diff --git a/home/ooks/opt/desktop/standard/imv.nix b/home/ooks/features/essentials/imv.nix similarity index 100% rename from home/ooks/opt/desktop/standard/imv.nix rename to home/ooks/features/essentials/imv.nix diff --git a/home/ooks/opt/desktop/music/default.nix b/home/ooks/features/essentials/music.nix similarity index 100% rename from home/ooks/opt/desktop/music/default.nix rename to home/ooks/features/essentials/music.nix diff --git a/home/ooks/opt/desktop/standard/pavucontrol.nix b/home/ooks/features/essentials/pavucontrol.nix similarity index 100% rename from home/ooks/opt/desktop/standard/pavucontrol.nix rename to home/ooks/features/essentials/pavucontrol.nix diff --git a/home/ooks/opt/desktop/standard/playerctl.nix b/home/ooks/features/essentials/playerctl.nix similarity index 100% rename from home/ooks/opt/desktop/standard/playerctl.nix rename to home/ooks/features/essentials/playerctl.nix diff --git a/home/ooks/opt/desktop/standard/qt.nix b/home/ooks/features/essentials/qt.nix similarity index 100% rename from home/ooks/opt/desktop/standard/qt.nix rename to home/ooks/features/essentials/qt.nix diff --git a/home/ooks/opt/desktop/standard/yt-dlp.nix b/home/ooks/features/essentials/yt-dlp.nix similarity index 100% rename from home/ooks/opt/desktop/standard/yt-dlp.nix rename to home/ooks/features/essentials/yt-dlp.nix diff --git a/home/ooks/opt/desktop/standard/wayland/cursor.nix b/home/ooks/features/wayland/essentials/cursor.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/cursor.nix rename to home/ooks/features/wayland/essentials/cursor.nix diff --git a/home/ooks/opt/desktop/standard/wayland/default.nix b/home/ooks/features/wayland/essentials/default.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/default.nix rename to home/ooks/features/wayland/essentials/default.nix diff --git a/home/ooks/opt/desktop/standard/wayland/eww/config/eww.yuck b/home/ooks/features/wayland/essentials/eww/config/eww.yuck similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/eww/config/eww.yuck rename to home/ooks/features/wayland/essentials/eww/config/eww.yuck diff --git a/home/ooks/opt/desktop/standard/wayland/eww/default.nix b/home/ooks/features/wayland/essentials/eww/default.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/eww/default.nix rename to home/ooks/features/wayland/essentials/eww/default.nix diff --git a/home/ooks/opt/desktop/standard/wayland/firefox.nix b/home/ooks/features/wayland/essentials/firefox.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/firefox.nix rename to home/ooks/features/wayland/essentials/firefox.nix diff --git a/home/ooks/opt/desktop/standard/wayland/gammastep.nix b/home/ooks/features/wayland/essentials/gammastep.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/gammastep.nix rename to home/ooks/features/wayland/essentials/gammastep.nix diff --git a/home/ooks/opt/desktop/standard/wayland/gimp.nix b/home/ooks/features/wayland/essentials/gimp.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/gimp.nix rename to home/ooks/features/wayland/essentials/gimp.nix diff --git a/home/ooks/opt/desktop/standard/wayland/kitty.nix b/home/ooks/features/wayland/essentials/kitty.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/kitty.nix rename to home/ooks/features/wayland/essentials/kitty.nix diff --git a/home/ooks/opt/desktop/standard/wayland/mako.nix b/home/ooks/features/wayland/essentials/mako.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/mako.nix rename to home/ooks/features/wayland/essentials/mako.nix diff --git a/home/ooks/opt/desktop/standard/wayland/swaylock.nix b/home/ooks/features/wayland/essentials/swaylock.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/swaylock.nix rename to home/ooks/features/wayland/essentials/swaylock.nix diff --git a/home/ooks/opt/desktop/standard/wayland/zathura.nix b/home/ooks/features/wayland/essentials/zathura.nix similarity index 100% rename from home/ooks/opt/desktop/standard/wayland/zathura.nix rename to home/ooks/features/wayland/essentials/zathura.nix diff --git a/home/ooks/opt/desktop/hyprland/binds.nix b/home/ooks/features/wayland/window-manager/hyprland/binds.nix similarity index 100% rename from home/ooks/opt/desktop/hyprland/binds.nix rename to home/ooks/features/wayland/window-manager/hyprland/binds.nix diff --git a/home/ooks/opt/desktop/hyprland/default.nix b/home/ooks/features/wayland/window-manager/hyprland/default.nix similarity index 74% rename from home/ooks/opt/desktop/hyprland/default.nix rename to home/ooks/features/wayland/window-manager/hyprland/default.nix index fba7cb6..be74830 100644 --- a/home/ooks/opt/desktop/hyprland/default.nix +++ b/home/ooks/features/wayland/window-manager/hyprland/default.nix @@ -1,16 +1,12 @@ { lib, config, pkgs, ... }: { imports = [ - ../standard - ../standard/wayland - ../music - ../standard/wayland/eww - ../standard/wayland/swaylock.nix - -# ./tty-init.nix - ./binds.nix - ./systemd-fix.nix - ../env/hypr-variable.nix - ]; + ../../essentials #import essential wayland specific programs + ../../../essentials #import essential programs + #./tty-init.nix + ./binds.nix #hyprland keybindings + ./systemd-fix.nix #fix for systemd and hyprland + ./environment-variables.nix #hyprland environment variables + ]; wayland.windowManager.hyprland = { enable = true; @@ -73,18 +69,22 @@ "fadeDim,1,3,easeout" "border,1,3,easeout" ]; + }; windowrulev2 = [ "float,move 191 15,size 924 396,class:(1Password)" ]; - monitor = [ - ",prefered,auto,auto" - ]; - }; + monitor = map (m: let + resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}"; + position = "${toString m.x}x${toString m.y}"; + transform = if m.transform != 0 then ",transform,${toString m.transform}" else ""; + in + "${m.name},${if m.enabled then "${resolution},${position},1${transform}" else "disable"}" + ) (config.monitors); exec = [ - "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" + "pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.swaybg}/bin/swaybg -i ~/.dotfiles/nix/walls/gruvbox/gruvbox-blank.png --mode fill" ]; exec-once = [ diff --git a/home/ooks/opt/desktop/env/hypr-variable.nix b/home/ooks/features/wayland/window-manager/hyprland/environment-variables.nix similarity index 100% rename from home/ooks/opt/desktop/env/hypr-variable.nix rename to home/ooks/features/wayland/window-manager/hyprland/environment-variables.nix diff --git a/home/ooks/opt/desktop/hyprland/systemd-fix.nix b/home/ooks/features/wayland/window-manager/hyprland/systemd-fix.nix similarity index 100% rename from home/ooks/opt/desktop/hyprland/systemd-fix.nix rename to home/ooks/features/wayland/window-manager/hyprland/systemd-fix.nix diff --git a/home/ooks/opt/desktop/hyprland/tty-init.nix b/home/ooks/features/wayland/window-manager/hyprland/tty-init.nix similarity index 100% rename from home/ooks/opt/desktop/hyprland/tty-init.nix rename to home/ooks/features/wayland/window-manager/hyprland/tty-init.nix diff --git a/home/ooks/ooksmicro.nix b/home/ooks/ooksmicro.nix new file mode 100644 index 0000000..8afb094 --- /dev/null +++ b/home/ooks/ooksmicro.nix @@ -0,0 +1,11 @@ +{ inputs, outputs, ... }: + +{ + imports = [ + ./opt/desktop/hyprland + ./base + ]; + + colorscheme = inputs.nix-colors.colorSchemes.gruvbox-dark-soft; + +} \ No newline at end of file diff --git a/home/ooks/ookst480s.nix b/home/ooks/ookst480s.nix index 071e183..ba6549b 100644 --- a/home/ooks/ookst480s.nix +++ b/home/ooks/ookst480s.nix @@ -2,12 +2,20 @@ { imports = [ - ./opt/nvim - ./opt/shell ./opt/desktop/hyprland - ./standard + ./features/essentials + ./base ]; + monitor = [{ + name = "eDP-1"; + width = "1920"; + height = "1080"; + workspace = "1"; + primary = true; + transform = "0"; + }]; + colorscheme = inputs.nix-colors.colorSchemes.gruvbox-dark-soft; } \ No newline at end of file diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 6d9825f..5a9ebb9 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,3 +1,4 @@ { fonts = import ./fonts.nix; + monitors = import ./monitors.nix; } diff --git a/modules/home-manager/monitors.nix b/modules/home-manager/monitors.nix new file mode 100644 index 0000000..6620852 --- /dev/null +++ b/modules/home-manager/monitors.nix @@ -0,0 +1,62 @@ +{ lib, config, ... }: + +let + inherit (lib) mkOption types; + cfg = config.monitors; +in +{ + options.monitors = mkOption { + type = types.listOf (types.submodule { + options = { + name = mkOption { + type = types.str; + example = "DP-1"; + }; + primary = mkOption { + type = types.bool; + default = false; + }; + width = mkOption { + type = types.int; + example = 1920; + }; + height = mkOption { + type = types.int; + example = 1080; + }; + refreshRate = mkOption { + type = types.int; + default = 60; + }; + x = mkOption { + type = types.int; + default = 0; + }; + y = mkOption { + type = types.int; + default = 0; + }; + transform = mkOption { + type = types.int; + default = 0; + }; + enabled = mkOption { + type = types.bool; + default = true; + }; + workspace = mkOption { + type = types.nullOr types.str; + default = null; + }; + }; + }); + default = [ ]; + }; + config = { + assertions = [{ + assertion = ((lib.length config.monitors) != 0) -> + ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1); + message = "Exactly one monitor must be set to primary."; + }]; + }; +} \ No newline at end of file