diff --git a/checks/pre-commit-hooks/default.nix b/checks/pre-commit-hooks/default.nix new file mode 100644 index 0000000..6f56b49 --- /dev/null +++ b/checks/pre-commit-hooks/default.nix @@ -0,0 +1,14 @@ +{ + inputs, + pkgs, + ... +}: +let + inherit (inputs) git-hooks-nix; +in +git-hooks-nix.lib.${pkgs.system}.run { + src = ../..; + hooks = { + pre-commit-hook-ensure-sops.enable = true; + }; +} \ No newline at end of file diff --git a/flake.lock b/flake.lock index e8f916a..865d271 100644 --- a/flake.lock +++ b/flake.lock @@ -240,6 +240,22 @@ } }, "flake-compat_5": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1650374568, @@ -441,6 +457,27 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -948,6 +985,22 @@ } }, "nixpkgs_13": { + "locked": { + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_14": { "locked": { "lastModified": 1744868846, "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", @@ -1117,6 +1170,26 @@ "type": "github" } }, + "pre-commit-hooks-nix_2": { + "inputs": { + "flake-compat": "flake-compat_5", + "gitignore": "gitignore_2", + "nixpkgs": "nixpkgs_13" + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pyproject-build-systems": { "inputs": { "nixpkgs": [ @@ -1189,6 +1262,7 @@ "nixos-raspberrypi": "nixos-raspberrypi", "nixpkgs": "nixpkgs_12", "nixpkgs-stable": "nixpkgs-stable_3", + "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", "snowfall-lib": "snowfall-lib", "sops-nix": "sops-nix", "steam-rom-manager": "steam-rom-manager" @@ -1259,7 +1333,7 @@ }, "snowfall-lib": { "inputs": { - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_6", "flake-utils-plus": "flake-utils-plus", "nixpkgs": [ "nixpkgs" @@ -1281,7 +1355,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1752544651, diff --git a/flake.nix b/flake.nix index 12f5d02..fa9db25 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,8 @@ }; nixos-apple-silicon.url = "github:nix-community/nixos-apple-silicon"; + + pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; }; # We will handle this in the next section. @@ -81,10 +83,6 @@ # Nix files to a separate directory. src = ./.; - # Add modules to all NixOS systems. - systems. - - # Add a module to a specific host. systems = { # common modules @@ -107,9 +105,6 @@ nixos-hardware.nixosModules.common-hidpi nixos-hardware.nixosModules.common-pc ]; - specialArgs = { - hyprlandSettings = import ./systems/x86_64-linux/desktop/hyprland-settings.nix; - }; }; }; }; diff --git a/hosts/base/base-gui/default.nix b/hosts/base/base-gui/default.nix deleted file mode 100644 index b4d14d9..0000000 --- a/hosts/base/base-gui/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./hardware.nix - ./programs.nix - ./services.nix - ]; -} \ No newline at end of file diff --git a/hosts/base/base-gui/hardware.nix b/hosts/base/base-gui/hardware.nix deleted file mode 100644 index 1b3aa0a..0000000 --- a/hosts/base/base-gui/hardware.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ lib, ... }: -{ - # Hardware configs - hardware = { - # Enable graphics - graphics = { - enable = lib.mkDefault true; - enable32Bit = lib.mkDefault true; - }; - }; -} \ No newline at end of file diff --git a/hosts/base/base-gui/services.nix b/hosts/base/base-gui/services.nix deleted file mode 100644 index 9c286b7..0000000 --- a/hosts/base/base-gui/services.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, ... }: -{ - services = { - kmscon.enable = lib.mkForce false; - - # configure pipewire - pipewire = { - enable = lib.mkDefault true; - alsa.enable = lib.mkDefault true; - alsa.support32Bit = lib.mkDefault true; - pulse.enable = lib.mkDefault true; - }; - - # Enable CUPS to print documents. - printing.enable = lib.mkDefault true; - }; -} diff --git a/hosts/base/base-nogui/default.nix b/hosts/base/base-nogui/default.nix deleted file mode 100644 index e17276f..0000000 --- a/hosts/base/base-nogui/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib, pkgs, ... }: -let - timezone = "America/Chicago"; -in -{ - imports = [ - ./boot.nix - ./environment.nix - ./hardware.nix - ./nix-settings.nix - ./programs.nix - ./security.nix - ./services.nix - ]; - - # Time config - time = { - # Set your time zone. - timeZone = timezone; - }; - - fonts.packages = with pkgs; [ - font-awesome - noto-fonts - noto-fonts-color-emoji - meslo-lgs-nf - ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); - - fonts.fontconfig.defaultFonts = { - emoji = [ - "Noto Color Emoji" - ]; - }; - - system.stateVersion = "23.11"; -} diff --git a/hosts/base/base-nogui/environment.nix b/hosts/base/base-nogui/environment.nix deleted file mode 100644 index 41277db..0000000 --- a/hosts/base/base-nogui/environment.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: -{ - environment = { - systemPackages = with pkgs; [ - attic-client - uutils-coreutils - uutils-diffutils - uutils-findutils - coreutils - nixd - ]; - }; -} \ No newline at end of file diff --git a/hosts/base/base-nogui/hardware.nix b/hosts/base/base-nogui/hardware.nix deleted file mode 100644 index f6c6ecd..0000000 --- a/hosts/base/base-nogui/hardware.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, ... }: -{ - hardware = { - # Bluetooth - bluetooth.enable = lib.mkDefault true; - - i2c.enable = lib.mkDefault true; - - # Enable all firmware - enableAllFirmware = lib.mkForce true; - }; -} diff --git a/hosts/base/base-nogui/programs.nix b/hosts/base/base-nogui/programs.nix deleted file mode 100644 index 9bdba54..0000000 --- a/hosts/base/base-nogui/programs.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, ... }: -{ - programs = { - zsh.enable = lib.mkDefault true; - gnupg.agent = { - enable = lib.mkDefault true; - enableSSHSupport = lib.mkDefault true; - }; - nix-index = { - enable = lib.mkDefault true; - enableBashIntegration = lib.mkDefault false; - enableZshIntegration = lib.mkDefault true; - }; - }; -} \ No newline at end of file diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100755 index 9c0f896..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: -{ - imports = [ - ./samba - ./apps/free-games-claimer - ./apps/manyfold - ./apps/mongodb - ./apps/tdarr - ./apps/your-spotify - ]; -} diff --git a/modules/home/desktop/extra/btop/default.nix b/modules/home/desktop/extra/btop/default.nix new file mode 100755 index 0000000..94b5baa --- /dev/null +++ b/modules/home/desktop/extra/btop/default.nix @@ -0,0 +1,126 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.btop; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + config = mkIf cfg.enable { + programs.btop = { + enable = true; + settings = { + color_theme = "nord"; # todo + theme_background = true; + truecolor = true; + force_tty = false; + presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"; + vim_keys = true; + rounded_corners = true; + graph_symbol = "braille"; + graph_symbol_cpu = "default"; + graph_symbol_mem = "default"; + graph_symbol_net = "default"; + graph_symbol_proc = "default"; + shown_boxes = "cpu mem net proc"; + update_ms = 2000; + proc_sorting = "cpu lazy"; + proc_reversed = false; + proc_tree = false; + proc_colors = true; + proc_gradient = true; + proc_per_core = false; + proc_mem_bytes = true; + proc_cpu_graphs = true; + proc_info_smaps = false; + proc_left = false; + proc_filter_kernel = false; + cpu_graph_upper = "total"; + cpu_graph_lower = "total"; + cpu_invert_lower = true; + cpu_single_graph = false; + cpu_bottom = false; + show_uptime = true; + check_temp = true; + cpu_sensor = "Auto"; + show_coretemp = true; + cpu_core_map = ""; + temp_scale = "celsius"; + base_10_sizes = false; + show_cpu_freq = true; + clock_format = "%X"; + background_update = true; + custom_cpu_name = ""; + disks_filter = ""; + mem_graphs = true; + mem_below_net = false; + zfs_arc_cached = true; + show_swap = true; + swap_disk = true; + show_disks = true; + only_physical = true; + use_fstab = true; + zfs_hide_datasets = false; + disk_free_priv = false; + show_io_stat = true; + io_mode = false; + io_graph_combined = false; + io_graph_speeds = ""; + net_download = 100; + net_upload = 100; + net_auto = true; + net_sync = true; + net_iface = ""; + show_battery = true; + selected_battery = "Auto"; + log_level = "WARNING"; + }; + themes = { + nord = '' + theme[main_bg]="${nord.polarNight.nord0}" + theme[main_fg]="${nord.snowStorm.nord6}" + theme[title]="${nord.snowStorm.nord6}" + theme[hi_fg]="${nord.frost.nord7}" + theme[selected_bg]="${nord.polarNight.nord1}" + theme[selected_fg]="${nord.frost.nord7}" + theme[inactive_fg]="${nord.polarNight.nord2}" + theme[graph_text]="${nord.snowStorm.nord6}" + theme[meter_bg]="${nord.polarNight.nord1}" + theme[proc_misc]="${nord.snowStorm.nord6}" + theme[cpu_box]="${nord.aurora.nord15}" + theme[mem_box]="${nord.aurora.nord14}" + theme[net_box]="${nord.aurora.nord12}" + theme[proc_box]="${nord.aurora.nord11}" + theme[div_line]="${nord.polarNight.nord1}" + theme[temp_start]="${nord.aurora.nord14}" + theme[temp_mid]="${nord.aurora.nord13}" + theme[temp_end]="${nord.aurora.nord11}" + theme[cpu_start]="${nord.aurora.nord15}" + theme[cpu_mid]="${nord.aurora.nord12}" + theme[cpu_end]="${nord.aurora.nord11}" + theme[free_start]="${nord.aurora.nord14}" + theme[free_mid]="${nord.aurora.nord13}" + theme[free_end]="${nord.aurora.nord12}" + theme[cached_start]="${nord.aurora.nord14}" + theme[cached_mid]="${nord.aurora.nord13}" + theme[cached_end]="${nord.aurora.nord12}" + theme[available_start]="${nord.snowStorm.nord6}" + theme[available_mid]="${nord.aurora.nord11}" + theme[available_end]="${nord.aurora.nord11}" + theme[used_start]="${nord.aurora.nord14}" + theme[used_mid]="${nord.aurora.nord13}" + theme[used_end]="${nord.aurora.nord11}" + theme[download_start]="${nord.frost.nord8}" + theme[download_mid]="${nord.frost.nord8}" + theme[download_end]="${nord.aurora.nord12}" + theme[upload_start]="${nord.frost.nord7}" + theme[upload_mid]="${nord.frost.nord7}" + theme[upload_end]="${nord.aurora.nord12}" + theme[process_start]="${nord.aurora.nord15}" + theme[process_mid]="${nord.aurora.nord12}" + theme[process_end]="${nord.aurora.nord11}" + ''; + }; + }; + }; +} diff --git a/modules/home/desktop/extra/btop/options.nix b/modules/home/desktop/extra/btop/options.nix new file mode 100644 index 0000000..f70aea3 --- /dev/null +++ b/modules/home/desktop/extra/btop/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.btop = { + enable = mkEnableOption "enable btop"; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/kitty/default.nix b/modules/home/desktop/extra/kitty/default.nix new file mode 100755 index 0000000..2a7d47e --- /dev/null +++ b/modules/home/desktop/extra/kitty/default.nix @@ -0,0 +1,105 @@ +{ lib, config, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.kitty; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + programs.kitty = { + enable = true; + shellIntegration.enableZshIntegration = true; + + font = { + name = settings.fontName; + package = settings.fontPackage; + size = settings.fontSize; + }; + + settings = { + bold_font = "auto"; + italic_font = "auto"; + bold_italic_font = "auto"; + mouse_hide_wait = "2.0"; + cursor_shape = "block"; + url_style = "dotted"; + confirm_os_window_close = "0"; + background_opacity = "0.85"; + + # The basic colors + foreground = settings.theme.snowStorm.nord6; + background = settings.theme.polarNight.nord0; + selection_foreground = settings.theme.polarNight.nord0; + selection_background = settings.theme.aurora.nord15; + + # Cursor colors + cursor = settings.theme.aurora.nord15; + cursor_text_color = settings.theme.polarNight.nord0; + + # URL underline color when hovering with mouse + url_color = settings.theme.aurora.nord15; + + # Kitty window border colors + active_border_color = settings.theme.frost.nord10; + inactive_border_color = settings.theme.polarNight.nord1; + bell_border_color = settings.theme.aurora.nord13; + + # OS Window titlebar colors + wayland_titlebar_color = settings.theme.polarNight.nord0; + macos_titlebar_color = settings.theme.polarNight.nord0; + + # Tab bar colors + active_tab_foreground = settings.theme.polarNight.nord3; + active_tab_background = settings.theme.aurora.nord15; + inactive_tab_foreground = settings.theme.snowStorm.nord6; + inactive_tab_background = settings.theme.polarNight.nord1; + tab_bar_background = settings.theme.polarNight.nord3; + + # Colors for marks (marked text in the terminal) + mark1_foreground = settings.theme.polarNight.nord0; + mark1_background = settings.theme.frost.nord10; + mark2_foreground = settings.theme.polarNight.nord0; + mark2_background = settings.theme.aurora.nord15; + mark3_foreground = settings.theme.polarNight.nord0; + mark3_background = settings.theme.frost.nord8; + + # The 16 terminal colors + + # black + color0 = settings.theme.polarNight.nord0; + + # Autosuggestion + color8 = settings.theme.frost.nord10; + + # red + color1 = settings.theme.aurora.nord11; + color9 = settings.theme.aurora.nord11; + + # green + color2 = settings.theme.aurora.nord14; + color10 = settings.theme.aurora.nord14; + + # yellow + color3 = settings.theme.aurora.nord13; + color11 = settings.theme.aurora.nord13; + + # blue + color4 = settings.theme.frost.nord10; + color12 = settings.theme.frost.nord10; + + # magenta + color5 = settings.theme.aurora.nord15; + color13 = settings.theme.aurora.nord15; + + # cyan + color6 = settings.theme.frost.nord8; + color14 = settings.theme.frost.nord8; + + # white + color7 = settings.theme.snowStorm.nord5; + color15 = settings.theme.snowStorm.nord4; + }; + }; + }; +} diff --git a/modules/home/desktop/extra/kitty/options.nix b/modules/home/desktop/extra/kitty/options.nix new file mode 100644 index 0000000..1196008 --- /dev/null +++ b/modules/home/desktop/extra/kitty/options.nix @@ -0,0 +1,27 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.kitty = { + enable = mkEnableOption "enable kitty terminal"; + + font = { + name = mkOption { + type = types.str; + default = "DejaVu Sans"; + }; + package = mkOption { + type = types.package; + default = pkgs.dejavu_fonts; + }; + size = mkOption { + type = with types; null || signed integer || floating point number; + default = 8; + }; + }; + + theme = mkOption { + type = types.attrs; + default = import ../../theme/nord.nix; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/mako/default.nix b/modules/home/desktop/extra/mako/default.nix new file mode 100755 index 0000000..5306a8a --- /dev/null +++ b/modules/home/desktop/extra/mako/default.nix @@ -0,0 +1,32 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.mako; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + config = mkIf cfg.enable { + services.mako = { + enable = true; + settings = { + font = cfg.fontName; + icons = true; + ignore-timeout = true; + sort = "-time"; + width = 500; + height = 110; + layer = "overlay"; + border-radius = 15; + border-size = 1; + max-icon-size = 64; + default-timeout = 5000; + + background-color = nord.polarNight.nord0; + text-color = nord.snowStorm.nord6; + border-color = nord.frost.nord10; + progress-color = "over ${nord.frost.nord8}"; + }; + }; + }; +} diff --git a/modules/home/desktop/extra/mako/options.nix b/modules/home/desktop/extra/mako/options.nix new file mode 100644 index 0000000..e4e658b --- /dev/null +++ b/modules/home/desktop/extra/mako/options.nix @@ -0,0 +1,12 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.mako = { + enable = mkEnableOption "enable mako"; + + fontName = mkOption { + type = types.str; + default = "DejaVu Sans"; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/nwg-dock/default.nix b/modules/home/desktop/extra/nwg-dock/default.nix new file mode 100644 index 0000000..9ad527b --- /dev/null +++ b/modules/home/desktop/extra/nwg-dock/default.nix @@ -0,0 +1,60 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.nwg-dock; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ nwg-dock-hyprland ]; + + home.file = { + ".config/nwg-dock-hyprland/drawer.css".text = '' + window { + background: ${nord.polarNight.nord0}; + border-radius: 10px; + border-style: none; + border-width: 1px; + border-color: ${nord.aurora.nord15}b0 + } + + #box { + /* Define attributes of the box surrounding icons here */ + padding: 10px + } + + active { + /* This is to underline the button representing the currently active window */ + border-bottom: solid 1px; + border-color: ${nord.aurora.nord14}1a + } + + button, image { + background: none; + border-style: none; + box-shadow: none; + color: ${nord.frost.nord10} + } + + button { + padding: 4px; + margin-left: 4px; + margin-right: 4px; + color: #eee; + font-size: 12px + } + + button:hover { + background-color: ${nord.polarNight.nord0}1a; + border-radius: 2px; + } + + button:focus { + box-shadow: none + } + ''; + }; + }; +} diff --git a/modules/home/desktop/extra/nwg-dock/options.nix b/modules/home/desktop/extra/nwg-dock/options.nix new file mode 100644 index 0000000..db33cbd --- /dev/null +++ b/modules/home/desktop/extra/nwg-dock/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.nwg-dock = { + enable = mkEnableOption "enable nwg-dock"; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/nwg-drawer/default.nix b/modules/home/desktop/extra/nwg-drawer/default.nix new file mode 100644 index 0000000..83bb048 --- /dev/null +++ b/modules/home/desktop/extra/nwg-drawer/default.nix @@ -0,0 +1,52 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.nwg-drawer; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ nwg-drawer ]; + + home.file = { + ".config/nwg-drawer/drawer.css".text = '' + window { + background-color: ${nord.polarNight.nord0}bf; + color: ${nord.snowStorm.nord5}00 + } + + /* search entry */ + entry { + background-color: ${nord.polarNight.nord1}0f + } + + button, image { + background: none; + border: none + } + + button:hover { + background-color: ${nord.frost.nord10}1a + } + + /* in case you wanted to give category buttons a different look */ + #category-button { + margin: 0 10px 0 10px + } + + #pinned-box { + padding-bottom: 5px; + border-bottom: 1px dotted ${nord.polarNight.nord3} + } + + #files-box { + padding: 5px; + border: 1px dotted ${nord.polarNight.nord3}; + border-radius: 15px + } + ''; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/nwg-drawer/options.nix b/modules/home/desktop/extra/nwg-drawer/options.nix new file mode 100644 index 0000000..d8adfa9 --- /dev/null +++ b/modules/home/desktop/extra/nwg-drawer/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.nwg-drawer = { + enable = mkEnableOption "enable nwg-drawer"; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/nwg-panel/default.nix b/modules/home/desktop/extra/nwg-panel/default.nix new file mode 100644 index 0000000..20d144e --- /dev/null +++ b/modules/home/desktop/extra/nwg-panel/default.nix @@ -0,0 +1,26 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.nwg-dock; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + home.file = { + ".config/nwg-panel/excluded-dirs".text = '' + + ''; + ".config/nwg-panel/preferred-apps.json".text = '' + { + "\\.pdf$": "${cfg.defaultApps.browser.pname}", + "\\.svg$": "inkscape", + "\\.(jpg|png|tiff|gif)$": "${cfg.defaultApps.imageViewer.pname}", + "\\.(mp3|ogg|flac|wav|wma)$": "audacious", + "\\.(avi|mp4|mkv|mov|wav)$": "${cfg.defaultApps.video.pname}", + "\\.(doc|docx|xls|xlsx)$": "${cfg.defaultApps.office.pname}" + } + ''; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/nwg-panel/options.nix b/modules/home/desktop/extra/nwg-panel/options.nix new file mode 100644 index 0000000..b88eade --- /dev/null +++ b/modules/home/desktop/extra/nwg-panel/options.nix @@ -0,0 +1,12 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.nwg-panel = { + enable = mkEnableOption "enable nwg-panel"; + + defaultApps = mkOption { + type = attrs; + default = { }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/waybar/default.nix b/modules/home/desktop/extra/waybar/default.nix new file mode 100755 index 0000000..4e94d17 --- /dev/null +++ b/modules/home/desktop/extra/waybar/default.nix @@ -0,0 +1,534 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.waybar; + nord = import ../../theme/nord.nix; + + defaultOpacity = "opacity: 0.85;"; + defaultBorderRadius = "border-radius: 1rem;"; + defaultCenterOptions = '' + padding-top: 0.2rem; + padding-bottom: 0.2rem; + padding-left: 0.5rem; + padding-right: 0.5rem; + margin: 3px 0; + ''; + borderRight = '' + padding-top: 0.2rem; + padding-bottom: 0.2rem; + padding-left: 0.5rem; + padding-right: 0.5rem; + margin: 3px 0; + border-radius: 0rem 1rem 1rem 0rem; + margin-right: 0.5rem; + ''; + borderLeft = '' + padding-top: 0.2rem; + padding-bottom: 0.2rem; + padding-left: 0.5rem; + padding-right: 0.5rem; + margin: 3px 0; + border-radius: 1rem 0rem 0rem 1rem; + margin-left: 0.5rem; + ''; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + imports = [ + ./scripts/hass.nix + ./scripts/weather.nix + ]; + # https://github.com/Alexays/Waybar/wiki/Module:-Hyprland + # https://www.nerdfonts.com/cheat-sheet + + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = cfg.layer; + position = "top"; + mod = "dock"; + exclusive = true; + passthrough = false; + gtk-layer-shell = true; + height = 0; + + # Module Layout + modules-left = [ "hyprland/workspaces" ]; + + modules-center = [ "hyprland/window" ]; + + modules-right = cfg.modules-right; + + # Module Definitions + # Left + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + on-click = "activate"; + persistent_workspaces = { + "*" = 1; + }; + }; + + # Center + "hyprland/window" = { + separate-outputs = true; + format = { }; + }; + + # Left + tray = { + icon-size = 16; + spacing = 10; + }; + + temperature = { + hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input"; + critical-threshold = 110; + format-critical = "{temperatureC}°C "; + format = "{temperatureC}°C {icon}"; + format-icons = [ + "" # fa-temperature-empty + "" # fa-temperature-quarter + "" # fa-temperature-half + "" # fa-temperature-three-quarters + "" # fa-temperature-full + ]; + tooltip-format = "CPU: {temperatureC}°C"; + }; + + "temperature#gpu" = { + hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input"; + critical-threshold = 110; + format-critical = "{temperatureC}°C "; + format = "{temperatureC}°C {icon}"; + format-icons = [ + "" # fa-temperature-empty + "" # fa-temperature-quarter + "" # fa-temperature-half + "" # fa-temperature-three-quarters + "" # fa-temperature-full + ]; + on-click = "lact"; + tooltip-format = "GPU: {temperatureC}°C"; + }; + + "keyboard-state#capslock" = { + capslock = true; + format = "{icon}"; + tooltip-format = "Caps Lock {state}"; + format-icons = { + locked = "󰬶"; + unlocked = "󰬵"; + }; + }; + + "keyboard-state#numlock" = { + numlock = true; + format = "{icon}"; + tooltip-format = "Num Lock {state}"; + format-icons = { + locked = "󰎠"; + unlocked = "󱧓"; + }; + }; + + "wireplumber#sink" = { + format = "{icon} {volume}%"; + tooltip = false; + format-muted = "{icon} Muted"; + on-click = "wpctl set-mute @DEFAULT_SINK@ toggle"; + on-click-right = "pavucontrol -t 1"; + on-scroll-up = "wpctl set-volume @DEFAULT_SINK@ 5%+"; + on-scroll-down = "wpctl set-volume @DEFAULT_SINK@ 5%-"; + scroll-step = 5; + format-icons = { + headphone = "󰋋"; + headphone-muted = "󰟎"; + hands-free = "󰋋"; + headset = "󰋋"; + phone = ""; + portable = "󰋋"; + car = ""; + default = [ + "" + "" + "" + "" + ]; + }; + }; + + "wireplumber#source" = { + node-type = "Audio/Source"; + format = ""; + format-muted = ""; + tooltip = false; + # tooltip-format = "{source_desc} | {source_volume}%"; + on-click = "wpctl set-mute @DEFAULT_SOURCE@ toggle"; + on-click-right = "pavucontrol -t 2"; + on-scroll-up = "wpctl set-volume @DEFAULT_SOURCE@ 5%+"; + on-scroll-down = "wpctl set-volume @DEFAULT_SOURCE@ 5%-"; + scroll-step = 5; + }; + + "bluetooth" = { + on-click = "overskride"; + tooltip = true; + format = "{icon}"; + tooltip-format = "{status}"; + tooltip-format-disabled = "{status}"; + tooltip-format-off = "{status}"; + tooltip-format-on = "{status}"; + tooltip-format-connected = "{status}"; + tooltip-format-enumerate-connected = { }; + format-icons = { + disabled = "󰂲"; + off = "󰂲"; + on = "󰂯"; + connected = "󰂱"; + }; + }; + + network = { + interface = cfg.networkInterface; + on-click = "nm-connection-editor"; + format = "{icon}"; + tooltip-format = "{ifname} via {gwaddr} 󰊗"; + tooltip-format-wifi = '' + {essid} ({signalStrength}%) {icon} +  {bandwidthDownBits}  {bandwidthUpBits} + ''; + tooltip-format-ethernet = "{ifname} "; + tooltip-format-disconnected = "Disconnected"; + max-length = 50; + format-icons = { + wifi = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + ethernet = "󰈀"; + linked = "󰤫"; + disconnected = "󰤫"; + }; + }; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = "󰐂"; + deactivated = "󱩜"; + }; + }; + + clock = { + format = "{:%I:%M %p}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "month"; + format = { + months = "{}"; + days = "{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + + battery = { + # bat = "macsmc-battery"; + interval = 60; + # statuses: 'Charging', 'Discharging' + states = { + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-icons = { + default = [ + "󰂃" # critical + "󰁺" # 10% + "󰁻" # 20% + "󰁼" # 30% + "󰁽" # 40% + "󰁾" # 50% + "󰁿" # 60% + "󰂀" # 70% + "󰂁" # 80% + "󰂂" # 90% + "󰁹" # 100% + ]; + charging = [ + "󰢟" # critical + "󰢜" # 10% + "󰂆" # 20% + "󰂇" # 30% + "󰂈" # 40% + "󰢝" # 50% + "󰂉" # 60% + "󰢞" # 70% + "󰂊" # 80% + "󰂋" # 90% + "󰂅" # 100% + ]; + }; + max-length = 25; + }; + + "custom/weather" = { + tooltip = true; + format = { }; + interval = 30; + exec = "waybar-weather"; + return-type = "json"; + markup = "pango"; + }; + } // cfg.extraModules; + }; + + # * { font-size: 13px; } + # window.eDP-1 * { font-size: 10px; } + + style = '' + .blink_me { + animation: blinker 1s linear infinite; + } + + @keyframes blinker { + 50% { + color: ${nord.aurora.nord11}; + } + } + + * { + font-family: + Jetbrains Mono Nerd Font, + monospace; + font-size: 14px; + min-height: 0; + } + + #waybar { + background: transparent; + color: ${nord.snowStorm.nord6}; + margin: 5px 5px; + } + + #workspaces { + background-color: ${nord.polarNight.nord0}; + ${defaultBorderRadius} + ${defaultOpacity} + ${defaultCenterOptions} + margin-left: 0.6rem; + } + + #workspaces button { + color: ${nord.frost.nord10}; + ${defaultBorderRadius} + padding: 0.4rem; + } + + #workspaces button.active { + color: ${nord.frost.nord8}; + ${defaultBorderRadius} + } + + #workspaces button:hover { + color: ${nord.frost.nord7}; + ${defaultBorderRadius} + } + + #workspaces button.focused { + color: ${nord.snowStorm.nord6}; + background: ${nord.aurora.nord13}; + ${defaultBorderRadius} + } + + #workspaces button.urgent { + color: ${nord.polarNight.nord0}; + background: ${nord.snowStorm.nord6}; + ${defaultBorderRadius} + } + + #tooltip { + background: ${nord.polarNight.nord0}; + border-color: ${nord.polarNight.nord0}; + ${defaultBorderRadius} + border-width: 1rem; + border-style: solid; + } + + #window { + color: ${nord.aurora.nord15}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultBorderRadius} + ${defaultCenterOptions} + margin-left: ${hyprlandSettings.waybar.moduleStyle.window.margin-left or "4rem"}; + margin-right: ${hyprlandSettings.waybar.moduleStyle.window.margin-right or "4rem"}; + } + + /* make window module transparent when no windows present */ + #window.empty { + background-color: transparent; + } + + #custom-weather { + color: ${nord.frost.nord10}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${borderRight} + } + + #battery { + color: ${nord.aurora.nord15}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + min-width: 3rem; + } + + #clock { + color: ${nord.frost.nord9}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${borderLeft} + } + + /* ------------- */ + + #idle_inhibitor { + color: ${nord.frost.nord10}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${borderRight} + padding-right: 1rem; + } + + #idle_inhibitor:hover { + background: ${nord.polarNight.nord3}; + } + + #network { + color: ${nord.aurora.nord15}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + padding-right: 15px; + } + + #network:hover { + background: ${nord.polarNight.nord3}; + } + + #bluetooth { + color: ${nord.frost.nord9}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #bluetooth:hover { + background: ${nord.polarNight.nord3}; + } + + #wireplumber.source { + color: ${nord.frost.nord8}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #wireplumber.source.muted { + animation-name: blinker; + animation-duration: 2s; + animation-timing-function: linear; + animation-iteration-count: infinite; + padding-right: 1rem; + } + + #wireplumber.source:hover { + background: ${nord.polarNight.nord3}; + } + + #wireplumber.sink { + color: ${nord.frost.nord7}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #wireplumber.sink.muted { + animation-name: blinker; + animation-duration: 5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + } + + #wireplumber.sink:hover { + background: ${nord.polarNight.nord3}; + } + + #keyboard-state.numlock { + color: ${nord.frost.nord8}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #keyboard-state.capslock { + color: ${nord.frost.nord9}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #temperature.gpu { + color: ${nord.frost.nord10}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + border-radius: 0; + } + + #temperature.gpu:hover { + background: ${nord.polarNight.nord3}; + } + + #temperature { + color: ${nord.frost.nord9}; + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${hyprlandSettings.waybar.moduleStyle.temperature.location or defaultCenterOptions} + border-radius: ${hyprlandSettings.waybar.moduleStyle.temperature.border-radius or "0"} + } + + /* ------------- */ + + #tray { + background-color: ${nord.polarNight.nord0}; + ${defaultOpacity} + ${defaultCenterOptions} + ${defaultBorderRadius} + margin-right: 0.6rem; + } + + /* ------------- */ + '' + hyprlandSettings.waybar.extraModulesStyle or ''''; + }; + }; +} diff --git a/modules/home/desktop/extra/waybar/options.nix b/modules/home/desktop/extra/waybar/options.nix new file mode 100644 index 0000000..a30e6b1 --- /dev/null +++ b/modules/home/desktop/extra/waybar/options.nix @@ -0,0 +1,27 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.waybar = { + enable = mkEnableOption "enable waybar"; + + layer = mkOption { + type = types.str; + default = "top"; + }; + + modules-right = mkOption { + type = with types; listOf string; + default = []; + }; + + networkInterface = mkOption { + type = types.str; + default = "wlan0"; + }; + + extraModules = mkOption { + type = types.attrs; + default = { }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/waybar/scripts/hass.nix b/modules/home/desktop/extra/waybar/scripts/hass.nix similarity index 100% rename from modules/nixos/hyprland/config/waybar/scripts/hass.nix rename to modules/home/desktop/extra/waybar/scripts/hass.nix diff --git a/modules/nixos/hyprland/config/waybar/scripts/weather.nix b/modules/home/desktop/extra/waybar/scripts/weather.nix similarity index 100% rename from modules/nixos/hyprland/config/waybar/scripts/weather.nix rename to modules/home/desktop/extra/waybar/scripts/weather.nix diff --git a/modules/home/desktop/extra/wlogout/default.nix b/modules/home/desktop/extra/wlogout/default.nix new file mode 100644 index 0000000..9545bd9 --- /dev/null +++ b/modules/home/desktop/extra/wlogout/default.nix @@ -0,0 +1,104 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.wlogout; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + config = mkIf cfg.enable { + programs.wlogout = { + enable = true; + layout = { + lock = { + label = "lock"; + action = "hyprlock --immediate"; + text = "Lock"; + keybind = "l"; + }; + hibernate = { + label = "hibernate"; + action = "systemctl hibernate"; + text = "Hibernate"; + keybind = "h"; + }; + logout = { + label = "logout"; + action = "sleep 1; hyprctl dispatch exit"; + text = "Logout"; + keybind = "e"; + }; + shutdown = { + label = "shutdown"; + action = "systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + }; + suspend = { + label = "suspend"; + action = "systemctl suspend"; + text = "Suspend"; + keybind = "u"; + }; + reboot = { + label = "reboot"; + action = "reboot"; + text = "Reboot"; + keybind = "r"; + }; + }; + style = '' + * { + background-image: none; + } + + window { + background-color: ${nord.polarNight.nord0}f0 + } + + button { + margin: 8px; + color: ${nord.frost.nord7}; + background-color: ${nord.polarNight.nord1}; + border-style: solid; + border-width: 2px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + } + + button:active, + button:focus, + button:hover { + color: ${nord.frost.nord8}; + background-color: ${nord.polarNight.nord2}; + outline-style: none; + } + + #lock { + background-image: image(url("icons/lock.png")); + } + + #logout { + background-image: image(url("icons/logout.png")); + } + + #suspend { + background-image: image(url("icons/suspend.png")); + } + + #hibernate { + background-image: image(url("icons/hibernate.png")); + } + + #shutdown { + background-image: image(url("icons/shutdown.png")); + } + + #reboot { + background-image: image(url("icons/reboot.png")); + } + ''; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/wlogout/icons/hibernate.png b/modules/home/desktop/extra/wlogout/icons/hibernate.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/hibernate.png rename to modules/home/desktop/extra/wlogout/icons/hibernate.png diff --git a/modules/nixos/hyprland/config/wlogout/icons/lock.png b/modules/home/desktop/extra/wlogout/icons/lock.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/lock.png rename to modules/home/desktop/extra/wlogout/icons/lock.png diff --git a/modules/nixos/hyprland/config/wlogout/icons/logout.png b/modules/home/desktop/extra/wlogout/icons/logout.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/logout.png rename to modules/home/desktop/extra/wlogout/icons/logout.png diff --git a/modules/nixos/hyprland/config/wlogout/icons/reboot.png b/modules/home/desktop/extra/wlogout/icons/reboot.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/reboot.png rename to modules/home/desktop/extra/wlogout/icons/reboot.png diff --git a/modules/nixos/hyprland/config/wlogout/icons/shutdown.png b/modules/home/desktop/extra/wlogout/icons/shutdown.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/shutdown.png rename to modules/home/desktop/extra/wlogout/icons/shutdown.png diff --git a/modules/nixos/hyprland/config/wlogout/icons/suspend.png b/modules/home/desktop/extra/wlogout/icons/suspend.png similarity index 100% rename from modules/nixos/hyprland/config/wlogout/icons/suspend.png rename to modules/home/desktop/extra/wlogout/icons/suspend.png diff --git a/modules/home/desktop/extra/wlogout/options.nix b/modules/home/desktop/extra/wlogout/options.nix new file mode 100644 index 0000000..ac99c53 --- /dev/null +++ b/modules/home/desktop/extra/wlogout/options.nix @@ -0,0 +1,12 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.wofi = { + enable = mkEnableOption "enable wofi"; + + fontName = mkOption { + type = types.str; + default = "Deja Vu Sans"; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/extra/wofi/default.nix b/modules/home/desktop/extra/wofi/default.nix new file mode 100755 index 0000000..2d12487 --- /dev/null +++ b/modules/home/desktop/extra/wofi/default.nix @@ -0,0 +1,101 @@ +{ config, lib, namespace, ... }: +with lib; +let + cfg = config.${namespace}.desktop.extra.wofi; + nord = import ../../theme/nord.nix; +in +{ + imports = [ ./options.nix ]; + config = mkIf cfg.enable { + programs.wofi = { + enable = true; + style = '' + * { + font-family: "${cfg.fontName}", monospace; + font-size: 14px; + } + + /* Window */ + window { + margin: 0px; + padding: 10px; + border: 0.16em solid ${nord.aurora.nord15}; + border-radius: 0.1em; + background-color: ${nord.polarNight.nord0}; + } + + /* Inner Box */ + #inner-box { + margin: 5px; + padding: 10px; + border: none; + background-color: ${nord.polarNight.nord0}; + } + + /* Outer Box */ + #outer-box { + margin: 5px; + padding: 10px; + border: none; + background-color: ${nord.polarNight.nord0}; + } + + /* Scroll */ + #scroll { + margin: 0px; + padding: 10px; + border: none; + background-color: ${nord.polarNight.nord0}; + } + + /* Input */ + #input { + margin: 5px 20px; + padding: 10px; + border: none; + border-radius: 0.1em; + color: ${nord.snowStorm.nord6}; + background-color: ${nord.polarNight.nord0}; + } + + #input image { + border: none; + color: ${nord.aurora.nord11}; + } + + #input * { + outline: 4px solid ${nord.aurora.nord11}!important; + } + + /* Text */ + #text { + margin: 5px; + border: none; + color: ${nord.snowStorm.nord6}; + } + + #entry { + background-color: ${nord.polarNight.nord0}; + } + + #entry arrow { + border: none; + color: ${nord.aurora.nord15}; + } + + /* Selected Entry */ + #entry:selected { + border: 0.11em solid ${nord.aurora.nord15}; + } + + #entry:selected #text { + color: ${nord.frost.nord7}; + } + + #entry:drop(active) { + background-color: ${nord.aurora.nord15}!important; + } + ''; + }; + }; +} diff --git a/modules/home/desktop/extra/wofi/options.nix b/modules/home/desktop/extra/wofi/options.nix new file mode 100644 index 0000000..ac99c53 --- /dev/null +++ b/modules/home/desktop/extra/wofi/options.nix @@ -0,0 +1,12 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.extra.wofi = { + enable = mkEnableOption "enable wofi"; + + fontName = mkOption { + type = types.str; + default = "Deja Vu Sans"; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/gnome/default.nix b/modules/home/desktop/gnome/default.nix new file mode 100644 index 0000000..2f53e9d --- /dev/null +++ b/modules/home/desktop/gnome/default.nix @@ -0,0 +1,69 @@ +{ config, lib, pkgs, namespace, ... }: +let + cfg = config.${namespace}.desktop.gnome; +in +{ + imports = [ ./options.nix ]; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + apple-cursor + colloid-icon-theme + colloid-gtk-theme + gnome-tweaks + gnomeExtensions.allow-locked-remote-desktop + gnomeExtensions.appindicator + gnomeExtensions.arcmenu + gnomeExtensions.bing-wallpaper-changer + gnomeExtensions.dash-to-dock + gnomeExtensions.dash-to-panel + gnomeExtensions.gsconnect + gnomeExtensions.random-wallpaper + gnomeExtensions.tiling-assistant + gnomeExtensions.user-themes + gnomeExtensions.wikiart-wallpaper + papirus-icon-theme + pop-gtk-theme + ]; + + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface".clock-format = "12h"; + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + "org/gnome/desktop/interface".cursor-theme = lib.mkDefault "macOS"; + "org/gnome/desktop/interface".enable-hot-corners = false; + "org/gnome/desktop/interface".font-antialiasing = "grayscale"; + "org/gnome/desktop/interface".font-hinting = "slight"; + "org/gnome/desktop/interface".gtk-theme = lib.mkDefault "Colloid-Dark"; + "org/gnome/desktop/interface".icon-theme = lib.mkDefault "Colloid-Dark"; + "org/gnome/desktop/peripherals/mouse".accel-profile = "flat"; + "org/gnome/desktop/peripherals/touchpad".two-finger-scrolling-enabled = true; + "org/gnome/desktop/peripherals/touchpad".tap-to-click = true; + "org/gnome/mutter".experimental-features = [ + "scale-monitor-framebuffer" + "variable-refresh-rate" + ]; + "org/gnome/tweaks".show-extensions-notice = false; + "org/gnome/shell".enabled-extensions = [ + "allowlockedremotedesktop@kamens.us" + "appindicatorsupport@rgcjonas.gmail.com" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "tiling-assistant@leleat-on-github" + "dash-to-dock@micxgx.gmail.com" + "BingWallpaper@ineffable-gmail.com" + "gsconnect@andyholmes.github.io" + ]; + "org/gnome/shell/extensions/bingwallpaper".override-lockscreen-blur = true; + "org/gnome/shell/extensions/bingwallpaper".random-mode-enabled = true; + "org/gnome/shell/extensions/bingwallpaper".revert-to-current-image = false; + "org/gnome/shell/extensions/dash-to-panel".primary-monitor = 1; + "org/gnome/shell/extensions/dash-to-panel".multi-monitors = false; + "org/gnome/shell/extensions/gsconnect".id = "4db35bd2-0dcd-42a3-9f77-ef3e8bb83182"; + "org/gnome/shell/extensions/gsconnect".name = "matt-nixos"; + "org/gnome/shell/extensions/user-theme".name = lib.mkDefault "Colloid-Dark"; + "org/gtk/settings/file-chooser".clock-format = "12h"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/gnome/options.nix b/modules/home/desktop/gnome/options.nix new file mode 100644 index 0000000..c0b9f49 --- /dev/null +++ b/modules/home/desktop/gnome/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.gnome = { + enable = mkEnableOption "enable gnome settings"; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/default.nix b/modules/home/desktop/hyprland/default.nix new file mode 100755 index 0000000..481d21d --- /dev/null +++ b/modules/home/desktop/hyprland/default.nix @@ -0,0 +1,406 @@ +{ config, lib, namespace, pkgs, ... }: +with lib; +let + cfg = config.${namespace}.desktop.hyprland; + drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i ${config.home-manager.users.matt.gtk.iconTheme.name}"; +in +{ + imports = [ ./options.nix ]; + + config = mkIf cfg.enable { + imports = [ + ./services/hypridle + ./services/hyprlock + ./services/hyprpaper + ./packages.nix + ./theme.nix + ./variables.nix + ]; + + services = { + hyprpolkitagent.enable = true; + }; + + programs = { + vscode.profiles.default.userSettings."window"."titleBarStyle" = "custom"; + }; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + systemd.enable = true; + + plugins = with pkgs.hyprlandPlugins; [ + hyprgrass + ]; + + settings = { + "$mod" = "SUPER"; + + # Mouse + # mouse_[up|down] - scroll wheel + # middle_mouse - 274 + # thumb_up - 276 + # thumb_down - 275 + + # l -> locked, will also work when an input inhibitor (e.g. a lockscreen) is active. + # r -> release, will trigger on release of a key. + # e -> repeat, will repeat when held. + # n -> non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher. + # m -> mouse, see below. + # t -> transparent, cannot be shadowed by other binds. + # i -> ignore mods, will ignore modifiers. + # s -> separate, will arbitrarily combine keys between each mod/key, see [Keysym combos](#keysym-combos) above. + # d -> has description, will allow you to write a description for your bind. + # p -> bypasses the app's requests to inhibit keybinds. + + # https://wiki.hyprland.org/Configuring/Binds/ + # https://wiki.hyprland.org/Configuring/Binds/#mouse-buttons + + bind = [ + "$mod, Return, exec, ${cfg.defaultApps.terminal.pname}" + "$mod, SPACE, exec, wofi --show drun" + ", xf86Search, exec, wofi --show drun" + "$mod, Q, killactive, " + "$mod, M, exec, wlogout --protocol layer-shell" + "$mod, E, exec, ${cfg.defaultApps.fileExplorer.pname}" + "$mod, V, togglefloating, " + "$mod, D, exec, ${drawer}" + "$mod, P, pseudo, " # dwindle + "$mod, S, togglesplit, " # dwindle + "$mod SHIFT, Q, exec, hyprlock" + "$mod SHIFT, 4, exec, hyprshot -m region --clipboard-only" + "$mod, F, fullscreen, 1" + "$mod SHIFT, F, fullscreen, 0" + "$mod SHIFT, E, exec, smile" + + "$mod, mouse:276, movecurrentworkspacetomonitor, ${cfg.displayLeft.input}" + "$mod, mouse:275, movecurrentworkspacetomonitor, ${cfg.displayRight.input}" + + # alt-tab between workspaces on active monitor + "$mod, Tab, workspace, m+1" + "$mod SHIFT, Tab, workspace, m-1" + + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod ALT, 1, movetoworkspace, 1" + "$mod ALT, 2, movetoworkspace, 2" + "$mod ALT, 3, movetoworkspace, 3" + "$mod ALT, 4, movetoworkspace, 4" + "$mod ALT, 5, movetoworkspace, 5" + "$mod ALT, 6, movetoworkspace, 6" + "$mod ALT, 7, movetoworkspace, 7" + "$mod ALT, 8, movetoworkspace, 8" + "$mod ALT, 9, movetoworkspace, 9" + "$mod ALT, 0, movetoworkspace, discord" + + "$mod CTRL, l, resizeactive, 10 0" + "$mod CTRL, h, resizeactive, -10 0" + "$mod CTRL, k, resizeactive, 0 -10" + "$mod CTRL, j, resizeactive, 0 10" + + "$mod SHIFT, l, movewindow, r" + "$mod SHIFT, h, movewindow, l" + "$mod SHIFT, k, movewindow, u" + "$mod SHIFT, j, movewindow, d" + + "$mod, b, exec, ${cfg.defaultApps.browser.pname}" + ]; + + bindm = [ + # Move/resize windows with mod + LMB/RMB and dragging + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + # middle mouse will grab a window, mod + middle mouse will close it + "$mod SHIFT, mouse:274, movewindow" + ]; + + bindel = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ]; + + bindl = [ + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + + ", XF86MonBrightnessUp, exec, brightnessctl set +5%" + ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" + + "$mod, XF86MonBrightnessUp, exec, brightnessctl -d kbd_backlight set +10%" + "$mod, XF86MonBrightnessDown, exec, brightnessctl -d kbd_backlight set 10%-" + ]; + + monitor = cfg.monitor or [ ]; + monitorv2 = cfg.monitorv2 or { }; + + render = { + cm_fs_passthrough = 1; + }; + + misc = { + vrr = 1; + }; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 1; + "col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg"; + "col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg"; + layout = "dwindle"; + allow_tearing = true; + }; + + decoration = { + rounding = 10; + blur = { + enabled = true; + size = 2; + passes = 2; + new_optimizations = true; + xray = false; + }; + # drop_shadow = "yes"; + # shadow_range = 4; + # shadow_render_power = "3"; + # "col.shadow" = "rgba(1a1a1aee)"; + }; + + animations = { + enabled = "yes"; + bezier = [ + "overshot, 0.05, 0.9, 0.1, 1.05" + "smoothOut, 0.36, 0, 0.66, -0.56" + "smoothIn, 0.25, 1, 0.5, 1" + ]; + animation = [ + "windows, 1, 5, overshot, slide" + "windowsOut, 1, 4, smoothOut, slide" + "windowsMove, 1, 4, default" + "border, 1, 10, default" + "fade, 1, 10, smoothIn" + "fadeDim, 1, 10, smoothIn" + "workspaces, 1, 6, default" + ]; + }; + + dwindle = { + pseudotile = "yes"; + preserve_split = "yes"; + }; + + misc = { + force_default_wallpaper = 0; + }; + + workspace = cfg.workspace; + + windowrule = [ + "float, title:(file_progress)" + "float, title:(.*[Cc]onfirm.*)" + "float, title:(.*[Dd]ialog.*)" + "float, title:(.*[Dd]ownload.*)" + "float, title:(.*[Nn]otification.*)" + "float, title:(.*[Ee]rror.*)" + "float, title:(.*[Ss]plash.*)" + "float, title:(.*[Cc]onfirmreset.*)" + "float, title:(.*[Ss]ign [Ii]n - .*)" + "float, title:(.*[Oo]pen [Ff]ile.*)" + "float, title:(.*branchdialog.*)" + "float, class:(.*pavucontrol.*)" + "move onscreen cursor 0% 0%, class:(.*pavucontrol.*)" + "float, class:(.*[Oo]verskride.*)" + "float, class:(.*FileRoller.*)" + "float, class:(.*wlogout.*)" + "idleinhibit stayfocused, title:(.*mpv.*)" + + "float, class:(.*nm-connection-editor.*)" + "move onscreen cursor 0% 0%, class:(.*nm-connection-editor.*)" + + "float, title:(Media viewer)" + "float, class:(it.mijorus.smile),title:(Smile)" + "float, class:(.blueman-manager-wrapped)$,title:(Bluetooth Devices)" + # Picture in picture windows + "float, title:(.*Picture-in-Picture.*)" + "pin, title::(.*Picture-in-Picture.*)" + + # discord/vesktop + "workspace: name:discord, class:(.*vesktop)" + "float, class:(.*vesktop),title:(.*Discord Popout.*)" + "pin, class:(.*vesktop),title:(.*Discord Popout.*)" + + # Music + "workspace: name:discord, class:(Apple Music.*)" + + # Steam + "float, class:(.*[Ss]team), title:(.*[Ss]team.*)$" + "workspace name:steam silent, class:(.*[Ss]team), title:(.*[Ss]team.*)$" + "tile, class:(.*[Ss]team), title:(.*[Ss]team.*)$" + "float, class:(.*steam),title:(.*Friends List.*)" + + # Code + "pin, class:(.*codium.*),title:(Save As)" + "float, class:(.*codium.*),title:(Save As)" + "float, class:(xdg-desktop-portal-gtk),title:(Open Workspace from File)" + + # Game Tearing??? https://wiki.hyprland.org/Configuring/Tearing/ + "immediate, class:(.*gamescope)" + + # vmware + # this tag will set the below options to the vdi window + # this will have it auto open as a 2160x7680 window + # and makes multi-monitor work + "tag +horizonrdp, class:(.*[Vv][Mm]ware-view),title:(USPS Next VDI)" + + "noanim, tag:horizonrdp" + "noblur, tag:horizonrdp" + "norounding, tag:horizonrdp" + "noshadow, tag:horizonrdp" + "immediate, tag:horizonrdp" + "allowsinput, tag:horizonrdp" + "noborder, tag:horizonrdp" + "nodim, tag:horizonrdp" + "nomaxsize, tag:horizonrdp" + "renderunfocused, tag:horizonrdp" + "idleinhibit, tag:horizonrdp" + "float, tag:horizonrdp" + # "size 2160 7680, tag:horizonrdp" + # "move onscreen 0 0, tag:horizonrdp" + # float the vmware window cause its annoying to use in fullscreen + "float, class:(.*[Vv][Mm]ware-view),title:([Vv][Mm]ware [Hh]orizon [Cc]lient)" + + "tag +waydroid, class:([Ww]aydroid.*)" + "float, tag:waydroid" + "pin, tag:waydroid" + ] ++ cfg.windowRule; + + plugin = { + touch_gestures = { + # The default sensitivity is probably too low on tablet screens, + # I recommend turning it up to 4.0 + sensitivity = "4.0"; + + # must be >= 3 + workspace_swipe_fingers = "3"; + + # switching workspaces by swiping from an edge, this is separate from workspace_swipe_fingers + # and can be used at the same time + # possible values: l, r, u, or d + # to disable it set it to anything else + workspace_swipe_edge = "d"; + + # in milliseconds + long_press_delay = "400"; + + # resize windows by long-pressing on window borders and gaps. + # If general:resize_on_border is enabled, general:extend_border_grab_area is used for floating + # windows + resize_on_border_long_press = true; + + # in pixels, the distance from the edge that is considered an edge + edge_margin = "10"; + + # emulates touchpad swipes when swiping in a direction that does not trigger workspace swipe. + # ONLY triggers when finger count is equal to workspace_swipe_fingers + # + # might be removed in the future in favor of event hooks + emulate_touchpad_swipe = false; + + experimental = { + # send proper cancel events to windows instead of hacky touch_up events, + # NOT recommended as it crashed a few times, once it's stabilized I'll make it the default + send_cancel = "0"; + }; + + hyprgrass-bind = [ + # swipe left from right edge + ", edge:r:l, workspace, +1" + + # swipe up from bottom edge + ", edge:d:u, exec, ${cfg.defaultApps.browser.pname}" + + # swipe down from left edge + ", edge:l:d, exec, pactl set-sink-volume @DEFAULT_SINK@ -4%" + + # swipe down with 4 fingers + ", swipe:4:d, killactive" + + # swipe diagonally left and down with 3 fingers + # l (or r) must come before d and u + ", swipe:3:ld, exec, foot" + + # tap with 3 fingers + ", tap:3, exec, foot" + + # longpress can trigger mouse binds: + ", longpress:2, movewindow" + ", longpress:3, resizewindow" + ]; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_cancel_ratio = "0.15"; + }; + + input = { + kb_layout = "us"; + + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + + numlock_by_default = true; + + follow_mouse = 1; + + touchpad = { + clickfinger_behavior = 1; + natural_scroll = "yes"; + }; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + }; + + experimental = { + xx_color_management_v4 = true; + }; + + debug = { + full_cm_proto = true; + disable_logs = true; + disable_scale_checks = true; + }; + }; + + extraConfig = '' + exec-once = dbus-update-activation-environment --systemd --all + exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + exec-once = xhost +SI:localuser:root + exec-once = nwg-look -a + exec-once = nwg-dock-hyprland -d + '' + cfg.extraConfig or ''''; + }; + }; +} diff --git a/modules/home/desktop/hyprland/options.nix b/modules/home/desktop/hyprland/options.nix new file mode 100644 index 0000000..bbf2b32 --- /dev/null +++ b/modules/home/desktop/hyprland/options.nix @@ -0,0 +1,67 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.hyprland = { + enable = mkEnableOption "enable hyprland desktop"; + + primaryDisplay = mkOption { + type = types.string; + default = "DP-1"; + }; + + wallpaper = mkOption { + type = types.string; + default = "/run/wallpaper.jpeg"; + }; + + monitor = mkOption { + type = with types; listOf str; + default = []; + description = "list of hyprland monitor configs"; + }; + + monitorv2 = mkOption { + type = with types; listOf str; + default = []; + description = "list of hyprland monitorv2 configs"; + }; + + workspace = mkOption { + type = with types; listOf str; + default = []; + description = "list of hyprland workspace definitions"; + }; + + windowRule = mkOption { + type = with types; listOf str; + default = []; + description = "list of hyprland window rules"; + }; + + extraConfig = mkOption { + type = with types; str; + default = ''''; + description = "any extra options"; + }; + + defaultApps = mkOption { + type = attrs; + default = { }; + }; + + hyprIdle = { + lockScreenTimer = mkOption { + type = with types; null || signed integer || floating point number; + default = 5; + }; + screenOffTimer = mkOption { + type = with types; null || signed integer || floating point number; + default = 15; + }; + suspendTimer = mkOption { + type = with types; null || signed integer || floating point number; + default = 30; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/hyprland/environment.nix b/modules/home/desktop/hyprland/packages.nix old mode 100755 new mode 100644 similarity index 91% rename from modules/nixos/hyprland/environment.nix rename to modules/home/desktop/hyprland/packages.nix index 027968b..6188dff --- a/modules/nixos/hyprland/environment.nix +++ b/modules/home/desktop/hyprland/packages.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ + home.packages = with pkgs; [ box64 brightnessctl ddcutil @@ -32,8 +32,6 @@ nautilus networkmanagerapplet nm-tray - nwg-dock-hyprland - nwg-drawer nwg-look overskride pamixer @@ -59,4 +57,4 @@ xsettingsd xwayland ]; -} +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/services/hypridle/default.nix b/modules/home/desktop/hyprland/services/hypridle/default.nix new file mode 100644 index 0000000..757106e --- /dev/null +++ b/modules/home/desktop/hyprland/services/hypridle/default.nix @@ -0,0 +1,41 @@ +{ config, lib, namespace, ... }: +let + cfg = config.${namespace}.desktop.hyprland; +in +{ + imports = [ ../../options.nix ]; + + config = lib.mkIf cfg.enable { + services.hypridle = { + enable = true; + settings = { + general = { + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + ignore_dbus_inhibit = false; + lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. + }; + listener = [ + # { + # timeout = 300; # 5min + # on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. + # on-resume = "brightnessctl -r"; # monitor backlight restore. + # } + { + timeout = cfg.hypridle.lockScreenTimer; + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed + } + { + timeout = cfg.hypridle.screenOffTimer; + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + } + { + timeout = cfg.hypridle.suspendTimer; + on-timeout = "systemctl suspend"; # suspend pc + } + ]; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/services/hyprlock/default.nix b/modules/home/desktop/hyprland/services/hyprlock/default.nix new file mode 100644 index 0000000..1676dfa --- /dev/null +++ b/modules/home/desktop/hyprland/services/hyprlock/default.nix @@ -0,0 +1,47 @@ +{ config, lib, namespace, ... }: +let + cfg = config.${namespace}.desktop.hyprland; +in +{ + imports = [ ../../options.nix ]; + + config = lib.mkIf cfg.enable { + programs.hyprlock = { + enable = true; + settings = { + background = [ + { + monitor = ""; + path = cfg.wallpaper; # supports png, jpg, webp (no animations, though) + color = "rgba(25, 20, 20, 1.0)"; + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_passes = "3"; # 0 disables blurring + blur_size = "7"; + noise = "0.0117"; + contrast = "0.8916"; + brightness = "0.8172"; + vibrancy = "0.1696"; + vibrancy_darkness = "0.0"; + } + ]; + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = cfg.primaryDisplay; + dots_center = true; + fade_on_empty = true; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + bothlock_color = -1; + outline_thickness = 5; + placeholder_text = ''Password...''; + shadow_passes = 2; + } + ]; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/services/hyprpaper/default.nix b/modules/home/desktop/hyprland/services/hyprpaper/default.nix new file mode 100644 index 0000000..71b0f3a --- /dev/null +++ b/modules/home/desktop/hyprland/services/hyprpaper/default.nix @@ -0,0 +1,18 @@ +{ config, lib, namespace, ... }: +let + cfg = config.${namespace}.desktop.hyprland; +in +{ + imports = [ ../../options.nix ]; + + config = lib.mkIf cfg.enable { + services.hyprpaper = { + enable = true; + settings = { + preload = [ "/run/wallpaper.jpg" ]; + wallpaper = "/run/wallpaper.jpg"; + splash = false; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/theme.nix b/modules/home/desktop/hyprland/theme.nix new file mode 100644 index 0000000..8a00c91 --- /dev/null +++ b/modules/home/desktop/hyprland/theme.nix @@ -0,0 +1,93 @@ +{ pkgs, ... }: +let + themeSize = "compact"; # [ "standard" "compact" ] + themeAccent = "all"; # [ "default" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" "all" ] + themeVariant = "nord"; # [ "nord" "dracula" "gruvbox" "everforest" "catppuccin" "all" "black" "rimless" "normal" "float" ] + themeColor = "dark"; # [ "standard" "light" "dark" ] + iconThemeVariant = "all"; # [ "default" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" "all" ] + iconScheme = "nord"; # [ "default" "nord" "dracula" "gruvbox" "everforest" "catppuccin" "all" ] + + # Cursor + cursorTheme = "macOS"; + cursorThemePkg = pkgs.apple-cursor; + cursorSize = 24; + + # GTK + gtkThemeSize = themeSize; + gtkThemeAccent = themeAccent; + gtkThemeVariant = themeVariant; + gtkThemeColor = themeColor; + gtkTheme = "Colloid-Dark-Compact-Nord"; + gtkThemePkg = pkgs.colloid-gtk-theme.override { + sizeVariants = [ themeSize ]; + colorVariants = [ themeColor ]; + themeVariants = [ themeAccent ]; + tweaks = [ themeVariant ]; + }; + + # Icons + iconThemeScheme = iconScheme; + iconTheme = "Colloid-Nord-Dark"; + iconThemePkg = pkgs.colloid-icon-theme.override { + schemeVariants = [ iconScheme ]; + colorVariants = [ iconThemeVariant ]; + }; + + # Fonts + fontName = "JetBrainsMono NFM"; + fontPackage = pkgs.nerd-fonts.jetbrains-mono; + fontSize = 12; +in +{ + home = { + pointerCursor = { + gtk.enable = true; + package = cursorThemePkg; + name = cursorTheme; + size = cursorSize; + }; + }; + + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + "org/gnome/desktop/interface".cursor-theme = cursorTheme; + "org/gnome/desktop/interface".gtk-theme = gtkTheme; + "org/gnome/desktop/interface".icon-theme = iconTheme; + }; + }; + + gtk = { + enable = true; + + cursorTheme = { + name = cursorTheme; + package = cursorThemePkg; + }; + + theme = { + name = gtkTheme; + package = gtkThemePkg; + }; + + iconTheme = { + name = iconTheme; + package = iconThemePkg; + }; + + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + + font = { + name = fontName; + package = fontPackage; + size = fontSize; + }; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/hyprland/variables.nix b/modules/home/desktop/hyprland/variables.nix new file mode 100644 index 0000000..3844c61 --- /dev/null +++ b/modules/home/desktop/hyprland/variables.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: +with lib; +let + cfg = config.desktop.hyprland; +in +{ + sessionVariables = { + BROWSER = "${cfg.defaultApps.browser.pname}"; + CLUTTER_BACKEND = "wayland"; + EDITOR = "${cfg.defaultApps.editor.pname}"; + VISUAL = "${cfg.defaultApps.visual.pname}"; + ICON_THEME = settings.iconTheme; + GTK_CSD = "0"; + GTK_THEME = settings.gtkTheme; + GTK_USE_PORTAL = "1"; + HYPRCURSOR_THEME = config.home-manager.users.matt.pointerCursor.name; + HYPRCURSOR_SIZE = config.home-manager.users.matt.pointerCursor.size; + MOZ_ENABLE_WAYLAND = "1"; + NIXOS_OZONE_WL = "1"; + NIXOS_XDG_OPEN_USE_PORTAL = "1"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland-egl"; + QT_QPA_PLATFORMTHEME = "gtk3"; + QT_SCALE_FACTOR = "1"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + SDL_VIDEODRIVER = "wayland"; + TERMINAL = "${cfg.defaultApps.terminal.pname}"; + XCURSOR_THEME = config.home-manager.users.matt.pointerCursor.name; + XCURSOR_SIZE = config.home-manager.users.matt.pointerCursor.size; + XDG_CACHE_HOME = "\${HOME}/.cache"; + XDG_CONFIG_HOME = "\${HOME}/.config"; + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_DATA_HOME = "\${HOME}/.local/share"; + XDG_SESSION_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + }; +} \ No newline at end of file diff --git a/modules/home/desktop/theme/nord.nix b/modules/home/desktop/theme/nord.nix new file mode 100644 index 0000000..c9f65d8 --- /dev/null +++ b/modules/home/desktop/theme/nord.nix @@ -0,0 +1,34 @@ +{ + # Nord colors + # Opacity Hex alpha + # 100% FF + # 75% BF + # 50% 80 + # 25% 40 + # 10% 1A + # 0% 00 + polarNight = { + nord0 = "#2e3440"; + nord1 = "#3b4252"; + nord2 = "#434c5e"; + nord3 = "#4c566a"; + }; + snowStorm = { + nord4 = "#d8dee9"; + nord5 = "#e5e9f0"; + nord6 = "#eceff4"; + }; + frost = { + nord7 = "#8fbcbb"; + nord8 = "#88c0d0"; + nord9 = "#81a1c1"; + nord10 = "#5e81ac"; + }; + aurora = { + nord11 = "#bf616a"; + nord12 = "#d08770"; + nord13 = "#ebcb8b"; + nord14 = "#a3be8c"; + nord15 = "#b48ead"; + }; +} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/wallpapers/wall.png b/modules/home/desktop/theme/wallpapers/wall.png similarity index 100% rename from modules/nixos/hyprland/config/wallpapers/wall.png rename to modules/home/desktop/theme/wallpapers/wall.png diff --git a/modules/home/gnome.nix b/modules/home/gnome.nix deleted file mode 100644 index 607fd64..0000000 --- a/modules/home/gnome.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ lib, pkgs, ... }: -{ - home.packages = with pkgs; [ - apple-cursor - colloid-icon-theme - colloid-gtk-theme - gnome-tweaks - gnomeExtensions.allow-locked-remote-desktop - gnomeExtensions.appindicator - gnomeExtensions.arcmenu - gnomeExtensions.bing-wallpaper-changer - gnomeExtensions.dash-to-dock - gnomeExtensions.dash-to-panel - gnomeExtensions.gsconnect - gnomeExtensions.random-wallpaper - gnomeExtensions.tiling-assistant - gnomeExtensions.user-themes - gnomeExtensions.wikiart-wallpaper - papirus-icon-theme - pop-gtk-theme - ]; - - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface".clock-format = "12h"; - "org/gnome/desktop/interface".color-scheme = "prefer-dark"; - "org/gnome/desktop/interface".cursor-theme = lib.mkDefault "macOS"; - "org/gnome/desktop/interface".enable-hot-corners = false; - "org/gnome/desktop/interface".font-antialiasing = "grayscale"; - "org/gnome/desktop/interface".font-hinting = "slight"; - "org/gnome/desktop/interface".gtk-theme = lib.mkDefault "Colloid-Dark"; - "org/gnome/desktop/interface".icon-theme = lib.mkDefault "Colloid-Dark"; - "org/gnome/desktop/peripherals/mouse".accel-profile = "flat"; - "org/gnome/desktop/peripherals/touchpad".two-finger-scrolling-enabled = true; - "org/gnome/desktop/peripherals/touchpad".tap-to-click = true; - "org/gnome/mutter".experimental-features = [ - "scale-monitor-framebuffer" - "variable-refresh-rate" - ]; - "org/gnome/tweaks".show-extensions-notice = false; - "org/gnome/shell".enabled-extensions = [ - "allowlockedremotedesktop@kamens.us" - "appindicatorsupport@rgcjonas.gmail.com" - "user-theme@gnome-shell-extensions.gcampax.github.com" - "tiling-assistant@leleat-on-github" - "dash-to-dock@micxgx.gmail.com" - "BingWallpaper@ineffable-gmail.com" - "gsconnect@andyholmes.github.io" - ]; - "org/gnome/shell/extensions/bingwallpaper".override-lockscreen-blur = true; - "org/gnome/shell/extensions/bingwallpaper".random-mode-enabled = true; - "org/gnome/shell/extensions/bingwallpaper".revert-to-current-image = false; - "org/gnome/shell/extensions/dash-to-panel".primary-monitor = 1; - "org/gnome/shell/extensions/dash-to-panel".multi-monitors = false; - "org/gnome/shell/extensions/gsconnect".id = "4db35bd2-0dcd-42a3-9f77-ef3e8bb83182"; - "org/gnome/shell/extensions/gsconnect".name = "matt-nixos"; - "org/gnome/shell/extensions/user-theme".name = lib.mkDefault "Colloid-Dark"; - "org/gtk/settings/file-chooser".clock-format = "12h"; - }; - }; -} \ No newline at end of file diff --git a/modules/home/defaults.nix b/modules/home/home/default.nix similarity index 100% rename from modules/home/defaults.nix rename to modules/home/home/default.nix diff --git a/modules/home/vscode.nix b/modules/home/programs/code/default.nix similarity index 100% rename from modules/home/vscode.nix rename to modules/home/programs/code/default.nix diff --git a/modules/home/git.nix b/modules/home/programs/git/default.nix similarity index 100% rename from modules/home/git.nix rename to modules/home/programs/git/default.nix diff --git a/modules/home/librewolf.nix b/modules/home/programs/librewolf/default.nix similarity index 99% rename from modules/home/librewolf.nix rename to modules/home/programs/librewolf/default.nix index 7fb6cbf..d13fe4b 100644 --- a/modules/home/librewolf.nix +++ b/modules/home/programs/librewolf/default.nix @@ -1,7 +1,7 @@ { ... }: { programs.librewolf = { - enable = true; + enable = false; settings = { "identity.fxaccounts.enabled" = true; # Enable Firefox Accounts "privacy.clearOnShutdown.history" = false; # Disable clearing history on shutdown diff --git a/modules/home/office.nix b/modules/home/programs/onlyoffice/default.nix similarity index 55% rename from modules/home/office.nix rename to modules/home/programs/onlyoffice/default.nix index 72bfe0a..0151e12 100644 --- a/modules/home/office.nix +++ b/modules/home/programs/onlyoffice/default.nix @@ -1,7 +1,10 @@ -{ ... }: +{ lib, system, ... }: +let + isArm = builtins.match "aarch64*" system != null; +in { programs.onlyoffice = { - enable = true; + enable = lib.mkDefault (!isArm); settings = { UITheme = "theme-contrast-dark"; forcedRtl = false; diff --git a/modules/home/shell.nix b/modules/home/programs/zsh/default.nix similarity index 100% rename from modules/home/shell.nix rename to modules/home/programs/zsh/default.nix diff --git a/hosts/base/base-nogui/boot.nix b/modules/nixos/appimage/default.nix similarity index 100% rename from hosts/base/base-nogui/boot.nix rename to modules/nixos/appimage/default.nix diff --git a/modules/nixos/boot/lanzaboote/default.nix b/modules/nixos/boot/lanzaboote/default.nix new file mode 100644 index 0000000..fe9726d --- /dev/null +++ b/modules/nixos/boot/lanzaboote/default.nix @@ -0,0 +1,18 @@ +{ config, lib, namespace, inputs, ... }: +with lib; +let + cfg = config.${namespace}.bootloader.lanzaboote; +in +{ + imports = [ ./options.nix ]; + config = mkIf cfg.enable { + boot.lanzaboote = { + enable = cfg.enable; + pkiBundle = "/etc/secureboot"; + settings = { + console-mode = "max"; + }; + configurationLimit = cfg.configLimit; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/boot/lanzaboote/options.nix b/modules/nixos/boot/lanzaboote/options.nix new file mode 100644 index 0000000..dc556f6 --- /dev/null +++ b/modules/nixos/boot/lanzaboote/options.nix @@ -0,0 +1,12 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.bootloader.lanzaboote = { + enable = mkEnableOption "enable lanzaboote"; + + configLimit = mkOption { + type = with types; int; + default = 10; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/desktop-environments/cosmic/default.nix b/modules/nixos/desktop-environments/cosmic/default.nix deleted file mode 100755 index 6fb2263..0000000 --- a/modules/nixos/desktop-environments/cosmic/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - services = { - desktopManager.cosmic.enable = true; - displayManager.cosmic-greeter.enable = true; - }; -} diff --git a/modules/nixos/desktop-environments/cosmic/specialisation.nix b/modules/nixos/desktop-environments/cosmic/specialisation.nix deleted file mode 100755 index 0d9af87..0000000 --- a/modules/nixos/desktop-environments/cosmic/specialisation.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - specialisation.cosmic.configuration = { - imports = [ ./default.nix ]; - environment.etc."specialisation".text = "cosmic"; - }; -} diff --git a/modules/nixos/desktop-environments/gnome/default.nix b/modules/nixos/desktop-environments/gnome/default.nix deleted file mode 100644 index 46f42d4..0000000 --- a/modules/nixos/desktop-environments/gnome/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, pkgs, ... }: -{ - services = { - # Enable Desktop Environment. - desktopManager.gnome.enable = true; - # Enable Desktop Environment. - displayManager = { - gdm.enable = lib.mkDefault true; - gdm.wayland = lib.mkDefault true; - }; - - gnome.gnome-remote-desktop.enable = true; - }; - - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - - programs = { - kdeconnect = { - enable = true; - package = pkgs.gnomeExtensions.gsconnect; - }; - }; -} \ No newline at end of file diff --git a/modules/nixos/desktop/cosmic/default.nix b/modules/nixos/desktop/cosmic/default.nix new file mode 100755 index 0000000..7fa4a95 --- /dev/null +++ b/modules/nixos/desktop/cosmic/default.nix @@ -0,0 +1,13 @@ +{ config, lib, namespace, ... }: +let + cfg = config.${namespace}.desktop.cosmic; +in +{ + imports = [ ./options.nix ]; + config = lib.mkIf cfg.enable { + services = { + desktopManager.cosmic.enable = true; + displayManager.cosmic-greeter.enable = true; + }; + }; +} diff --git a/modules/nixos/desktop/cosmic/options.nix b/modules/nixos/desktop/cosmic/options.nix new file mode 100644 index 0000000..faa07e6 --- /dev/null +++ b/modules/nixos/desktop/cosmic/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.desktop.cosmic = { + enable = mkEnableOption "enable cosmic settings"; + }; +} \ No newline at end of file diff --git a/modules/nixos/desktop/gnome/default.nix b/modules/nixos/desktop/gnome/default.nix new file mode 100644 index 0000000..f3cb352 --- /dev/null +++ b/modules/nixos/desktop/gnome/default.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, namespace, ... }: +let + cfg = config.${namespace}.desktop.gnome; +in +{ + imports = [ ../../../home/desktop/gnome/options.nix ]; + + config = lib.mkIf cfg.enable { + services = { + # Enable Desktop Environment. + desktopManager.gnome.enable = true; + # Enable Desktop Environment. + displayManager = { + gdm.enable = lib.mkDefault true; + gdm.wayland = lib.mkDefault true; + }; + + gnome.gnome-remote-desktop.enable = true; + }; + + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + + programs = { + kdeconnect = { + enable = true; + package = pkgs.gnomeExtensions.gsconnect; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/desktop/hyprland/default.nix b/modules/nixos/desktop/hyprland/default.nix new file mode 100755 index 0000000..0f659f7 --- /dev/null +++ b/modules/nixos/desktop/hyprland/default.nix @@ -0,0 +1,171 @@ +{ config, pkgs, lib, namespace, ... }: +let + cfg = config.${namespace}.desktop.hyprland; + + bing-wallpaper = pkgs.writeScriptBin "bing-wallpaper" '' + # Directory to store wallpapers + IMG_PATH="/run/wallpaper.jpg" + + # Download if not already downloaded + URL=$(curl -s "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1" | \ + jq -r '.images[0].url') + FULL_URL="https://www.bing.com$URL" + curl -s -o "$IMG_PATH" "$FULL_URL" + echo "Downloaded $FULL_URL to $IMG_PATH successfully" + ''; + + sddmThemeName = "sddm-astronaut-theme"; + sddmThemePkg = pkgs.sddm-astronaut.override { + embeddedTheme = "astronaut"; + themeConfig = { + Background = "/run/wallpaper.jpg"; + }; + }; +in +{ + imports = [ ../../../home/desktop/hyprland/options.nix ]; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ bing-wallpaper pkgs.jq ]; + + services = { + displayManager = { + sddm = { + enable = true; + package = pkgs.kdePackages.sddm; + extraPackages = [ sddmThemePkg ]; + theme = sddmThemeName; + wayland.enable = true; + settings = { + Theme = { + ThemeDir = "${sddmThemePkg}/share/sddm/themes"; + }; + }; + }; + # Disable gdm + gdm.enable = lib.mkForce false; + defaultSession = "hyprland"; + }; + + # disable other desktops + desktopManager = { + plasma6.enable = lib.mkForce false; + gnome.enable = lib.mkForce false; + }; + + dbus.enable = true; + + ddccontrol.enable = false; + + blueman.enable = true; + }; + + programs = { + hyprland = { + enable = true; + xwayland.enable = true; + portalPackage = pkgs.xdg-desktop-portal-hyprland; + }; + + nm-applet.enable = true; + }; + + systemd = { + services = { + preload-bing-wallpaper = { + enable = true; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + before = [ "display-manager.service" ]; + requiredBy = [ + "plymouth-quit-wait.service" + "display-manager.service" + ]; + wantedBy = [ "display-manager.service" ]; + path = [ + pkgs.bash + pkgs.jq + pkgs.curl + bing-wallpaper + ]; + script = '' + bing-wallpaper + ''; + serviceConfig = { + Type = "oneshot"; + }; + }; + }; + user = { + services = { + reload-bing-wallpaper = { + enable = true; + path = [ + pkgs.bash + pkgs.jq + pkgs.curl + pkgs.hyprland + bing-wallpaper + ]; + script = '' + bing-wallpaper + ${pkgs.hyprland}/bin/hyprctl hyprpaper reload ,/run/wallpaper + ''; + serviceConfig = { + Type = "oneshot"; + }; + }; + }; + # Create a timer to run the service periodically + timers = { + reload-bing-wallpaper = { + description = "Timer for reload-bing-wallpaper"; + wantedBy = [ "timers.target" ]; + + # Timer configuration + timerConfig = { + OnCalendar = "daily"; # Check every day + Persistent = true; # Run immediately if last run was missed + Unit = "reload-bing-wallpaper.service"; + }; + }; + }; + }; + extraConfig = '' + DefaultTimeoutStopSec=10s + ''; + }; + + security = { + polkit.enable = true; + + # configure sudo + sudo.extraRules = [ + { + commands = [ + { + command = "/run/current-system/sw/bin/waybar-weather"; + options = [ "NOPASSWD" ]; + } + { + command = "/run/current-system/sw/bin/waybar-updates"; + options = [ "NOPASSWD" ]; + } + ]; + groups = [ "wheel" ]; + } + ]; + }; + + xdg.portal = { + enable = true; + wlr.enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-gnome + pkgs.xdg-desktop-portal-gtk + ]; + }; + }; +} diff --git a/modules/nixos/hyprland/settings.nix b/modules/nixos/desktop/hyprland/settings.nix similarity index 100% rename from modules/nixos/hyprland/settings.nix rename to modules/nixos/desktop/hyprland/settings.nix diff --git a/modules/nixos/fonts/default.nix b/modules/nixos/fonts/default.nix new file mode 100644 index 0000000..6750b14 --- /dev/null +++ b/modules/nixos/fonts/default.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, ... }: +{ + fonts.packages = with pkgs; [ + font-awesome + noto-fonts + noto-fonts-color-emoji + meslo-lgs-nf + ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); + + fonts.fontconfig.defaultFonts = { + emoji = [ + "Noto Color Emoji" + ]; + }; +} diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix new file mode 100644 index 0000000..dd951a8 --- /dev/null +++ b/modules/nixos/hardware/default.nix @@ -0,0 +1,21 @@ +{ lib, system, ... }: +let + isArm = builtins.match "aarch64*" system != null; +in +{ + hardware = { + # Bluetooth + bluetooth.enable = lib.mkDefault true; + + i2c.enable = lib.mkDefault true; + + # Enable all firmware + enableAllFirmware = lib.mkForce true; + + # Enable graphics + graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault (!isArm); + }; + }; +} diff --git a/modules/nixos/homeassistant/automations.yaml b/modules/nixos/homeassistant/automations.yaml deleted file mode 100755 index 3c125bf..0000000 --- a/modules/nixos/homeassistant/automations.yaml +++ /dev/null @@ -1,236 +0,0 @@ -- id: '1740678838632' - alias: Bedroom Light Switch - description: '' - triggers: - - domain: mqtt - device_id: 8b3a5a5b6faaba744c70ee940446a8af - type: action - subtype: on-press - trigger: device - id: on press - - domain: mqtt - device_id: 8b3a5a5b6faaba744c70ee940446a8af - type: action - subtype: off-press - trigger: device - id: off press - - domain: mqtt - device_id: 8b3a5a5b6faaba744c70ee940446a8af - type: action - subtype: up-press - trigger: device - id: up press - - domain: mqtt - device_id: 8b3a5a5b6faaba744c70ee940446a8af - type: action - subtype: down-press - trigger: device - id: down press - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - on press - sequence: - - action: light.turn_on - metadata: {} - data: - transition: 2 - brightness_pct: 100 - kelvin: 6004 - target: - entity_id: light.bedroom_lights - - conditions: - - condition: trigger - id: - - off press - sequence: - - action: light.turn_off - metadata: {} - data: - transition: 2 - target: - entity_id: light.bedroom_lights - - conditions: - - condition: trigger - id: - - up press - sequence: - - action: light.turn_on - metadata: {} - data: - brightness_step_pct: 10 - target: - entity_id: light.bedroom_lights - - conditions: - - condition: trigger - id: - - down press - sequence: - - action: light.turn_on - metadata: {} - data: - brightness_step_pct: -10 - target: - entity_id: light.bedroom_lights - mode: single -- id: '1740697291423' - alias: Living Rooom Lights - description: '' - triggers: - - domain: mqtt - device_id: b4fb325dfe68d4f80391417998f35843 - type: action - subtype: on-press - trigger: device - id: on press - - domain: mqtt - device_id: b4fb325dfe68d4f80391417998f35843 - type: action - subtype: off-press - trigger: device - id: off press - - domain: mqtt - device_id: b4fb325dfe68d4f80391417998f35843 - type: action - subtype: up-press - trigger: device - id: up press - - domain: mqtt - device_id: b4fb325dfe68d4f80391417998f35843 - type: action - subtype: down-press - trigger: device - id: down press - - domain: mqtt - device_id: b4fb325dfe68d4f80391417998f35843 - type: action - subtype: on-hold - trigger: device - id: on-hold - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - on press - sequence: - - action: light.turn_on - metadata: {} - data: - transition: 2 - brightness_pct: 100 - kelvin: 6004 - target: - entity_id: - - light.living_room_lights - - conditions: - - condition: trigger - id: - - off press - sequence: - - action: light.turn_off - metadata: {} - data: - transition: 2 - target: - entity_id: - - light.living_room_lights - - conditions: - - condition: trigger - id: - - up press - sequence: - - action: light.turn_on - metadata: {} - data: - brightness_step_pct: 10 - target: - entity_id: light.living_room_lights - - conditions: - - condition: trigger - id: - - down press - sequence: - - action: light.turn_on - metadata: {} - data: - brightness_step_pct: -10 - target: - entity_id: light.living_room_light_1 - - conditions: - - condition: trigger - id: - - on-hold - sequence: - - action: light.turn_on - metadata: {} - data: - transition: 0 - brightness_pct: 100 - rgb_color: - - 224 - - 27 - - 36 - target: - entity_id: light.living_room_lights - mode: single -- id: '1741048414771' - alias: Front Closet - description: '' - triggers: - - type: present - device_id: c6519ea1e715f397dbbf7b73452f9e49 - entity_id: c3a7b8892b8b372d2c40556e770ddc68 - domain: binary_sensor - trigger: device - for: - hours: 0 - minutes: 0 - seconds: 0 - id: present - - type: not_present - device_id: c6519ea1e715f397dbbf7b73452f9e49 - entity_id: c3a7b8892b8b372d2c40556e770ddc68 - domain: binary_sensor - trigger: device - for: - hours: 0 - minutes: 0 - seconds: 5 - id: not - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - present - sequence: - - action: light.turn_on - metadata: {} - data: - transition: 2 - brightness_pct: 100 - kelvin: 6010 - target: - entity_id: - - light.front_closet_light_1 - - light.front_closet_light_2 - - conditions: - - condition: trigger - id: - - not - sequence: - - action: light.turn_off - metadata: {} - data: - transition: 2 - target: - entity_id: - - light.front_closet_light_1 - - light.front_closet_light_2 - mode: single diff --git a/modules/nixos/homeassistant/automations.yaml.ori b/modules/nixos/homeassistant/automations.yaml.ori deleted file mode 100755 index 64b436c..0000000 --- a/modules/nixos/homeassistant/automations.yaml.ori +++ /dev/null @@ -1,576 +0,0 @@ -- id: '1692388103102' - alias: Weekly Backup - description: Create a full backup every Sunday at 3 am and store it on the NAS - trigger: - - platform: time - at: 03:00:00 - condition: - - condition: time - weekday: - - sun - action: - - service: hassio.backup_full - data: - compressed: true - mode: single -- id: '1692389901297' - alias: Livingroom Lights - description: '' - trigger: - - platform: device - domain: mqtt - device_id: 37d42431de65199af00220b43dae04c1 - type: action - subtype: on_press - id: 'on' - - platform: device - domain: mqtt - device_id: 37d42431de65199af00220b43dae04c1 - type: action - subtype: off_press - id: 'off' - - platform: device - domain: mqtt - device_id: 37d42431de65199af00220b43dae04c1 - type: action - subtype: up_press - id: up - - platform: device - domain: mqtt - device_id: 37d42431de65199af00220b43dae04c1 - type: action - subtype: down_press - id: down - - platform: device - domain: mqtt - device_id: 37d42431de65199af00220b43dae04c1 - type: action - subtype: on_hold - id: hold - condition: [] - action: - - choose: - - conditions: - - condition: trigger - id: - - 'on' - sequence: - - data: - brightness_pct: 100 - color_temp_kelvin: 5000 - transition: 1 - target: - entity_id: light.livingroom_lights - action: light.turn_on - - conditions: - - condition: trigger - id: - - 'off' - sequence: - - data: - transition: 1 - target: - entity_id: light.livingroom_lights - action: light.turn_off - - conditions: - - condition: trigger - id: - - hold - sequence: - - data: - brightness_pct: 100 - rgb_color: - - 255 - - 38 - - 0 - transition: 1 - target: - entity_id: light.livingroom_lights - action: light.turn_on - - conditions: - - condition: trigger - id: - - dim up - sequence: - - data: - brightness_step_pct: 20 - target: - entity_id: light.livingroom_lights - action: light.turn_on - - conditions: - - condition: trigger - id: - - dim down - sequence: - - data: - brightness_step_pct: -20 - target: - entity_id: light.livingroom_lights - action: light.turn_on - mode: single -- id: '1692390365798' - alias: Bedroom Lights - description: '' - triggers: - - domain: mqtt - device_id: a492c0abb8f14e0888df08101f77f484 - type: action - subtype: off_press - id: 'off' - trigger: device - - domain: mqtt - device_id: a492c0abb8f14e0888df08101f77f484 - type: action - subtype: on_press - id: 'on' - trigger: device - - domain: mqtt - device_id: a492c0abb8f14e0888df08101f77f484 - type: action - subtype: up_press - id: up - trigger: device - - domain: mqtt - device_id: a492c0abb8f14e0888df08101f77f484 - type: action - subtype: down_press - id: down - trigger: device - - domain: mqtt - device_id: a492c0abb8f14e0888df08101f77f484 - type: action - subtype: on_hold - id: hold on - trigger: device - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - 'on' - sequence: - - data: - brightness_pct: 100 - color_temp_kelvin: 5000 - transition: 1 - target: - entity_id: light.bedroom_lights - action: light.turn_on - - conditions: - - condition: trigger - id: - - 'off' - sequence: - - data: - transition: 1 - target: - entity_id: - - light.bedroom_lights - action: light.turn_off - - conditions: - - condition: trigger - id: - - up - sequence: - - device_id: 171fa001578683249ff26f2d85817fef - domain: light - entity_id: 55d41329665f60a55a732c5bbececd22 - type: brightness_increase - - device_id: c92fea3d569ca668e6617a189f917a28 - domain: light - entity_id: 0c8630c2b37ae9615f9cf815aaebf40f - type: brightness_increase - - conditions: - - condition: trigger - id: - - down - sequence: - - device_id: 171fa001578683249ff26f2d85817fef - domain: light - entity_id: 55d41329665f60a55a732c5bbececd22 - type: brightness_decrease - - device_id: c92fea3d569ca668e6617a189f917a28 - domain: light - entity_id: 0c8630c2b37ae9615f9cf815aaebf40f - type: brightness_decrease - - conditions: - - condition: trigger - id: - - hold on - sequence: - - metadata: {} - data: - rgb_color: - - 255 - - 0 - - 0 - brightness_pct: 100 - target: - entity_id: light.bedroom_lights - action: light.turn_on - mode: single -- id: '1694441037420' - alias: Air Purifier Schedule - description: '' - trigger: - - platform: time - at: 07:00:00 - id: fan off - - platform: time - at: '23:00:00' - id: fan on - condition: [] - action: - - choose: - - conditions: - - condition: trigger - id: - - fan on - sequence: - - service: fan.set_percentage - data: - percentage: 100 - target: - entity_id: fan.bedroom_air_purifier - - conditions: - - condition: trigger - id: - - fan off - sequence: - - service: fan.set_preset_mode - data: - preset_mode: auto - target: - entity_id: fan.bedroom_air_purifier - mode: single -- id: '1705949582146' - alias: Ice Maker Power Schedule - description: '' - trigger: - - platform: time_pattern - hours: '*' - minutes: '0' - seconds: '0' - condition: [] - action: - - type: toggle - device_id: 41c66532e23aadc4c6ac95e520e5d345 - entity_id: bd17ac75a91e62ed7e6b148cfe33d43d - domain: switch - - alias: Set Ice Maker Light to Dim - device_id: 41c66532e23aadc4c6ac95e520e5d345 - domain: select - entity_id: 8f4f90c62b00df9008d14f7ce8967199 - type: select_option - option: 'On' - mode: single -- id: '1708978401738' - alias: Soundbar - description: '' - trigger: [] - condition: [] - action: - - service: media_player.turn_on - metadata: {} - data: {} - target: - entity_id: media_player.soundbar - - service: media_player.select_source - metadata: {} - data: - source: wifi - target: - entity_id: media_player.soundbar - - service: media_player.play_media - metadata: {} - data: - media_content_id: media-source://radio_browser/2eff3a1f-b821-4267-9f37-f8d7e72061e4 - media_content_type: audio/mpeg - target: - entity_id: media_player.soundbar - mode: single -- id: '1711147285926' - alias: Grow Light Schedule - description: '' - trigger: - - platform: time - at: 07:00:00 - id: day - - platform: time - at: '20:00:00' - id: night - condition: [] - action: - - choose: - - conditions: - - condition: trigger - id: - - day - sequence: - - service: switch.turn_on - metadata: {} - data: {} - target: - entity_id: switch.grow_lights - - conditions: - - condition: trigger - id: - - night - sequence: - - service: switch.turn_off - metadata: {} - data: {} - target: - entity_id: switch.grow_lights - mode: single -- id: '1723142554607' - alias: Restart Luci's Box - description: for some reason this box sucks and needs to get reboot periodically - trigger: - - platform: time_pattern - hours: '*' - condition: [] - action: - - type: turn_off - device_id: e7f8974c31567dddbbffb036fe8381bc - entity_id: e1e71e4acdfcbb6c4afdc174807ad8be - domain: switch - - delay: - hours: 0 - minutes: 0 - seconds: 1 - milliseconds: 0 - - type: turn_on - device_id: e7f8974c31567dddbbffb036fe8381bc - entity_id: e1e71e4acdfcbb6c4afdc174807ad8be - domain: switch - - type: turn_on - device_id: d5eb3c182a1ef2a231b94b09c26aed45 - entity_id: 7106df7ebde274ac4bc2b197d5c45bea - domain: fan - - device_id: d5eb3c182a1ef2a231b94b09c26aed45 - domain: number - entity_id: 59a7cd3cb2883bf6002f789c2ff4824c - type: set_value - value: 3 - mode: single -- id: '1724707092916' - alias: HASS Updates - description: '' - use_blueprint: - path: edwardtfn/auto_update_scheduled.yaml - input: - schedule_entity: schedule.updates - restart_bool: true -- id: '1724707291994' - alias: IOT Battery Checker - description: '' - use_blueprint: - path: sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml - input: - exclude: - entity_id: [] - device_id: - - 66e9cee67a740e8925dae5fc9ce940f0 - - df76e3a3e48b49e13bd3006350826740 - actions: - - action: notify.persistent_notification - metadata: {} - data: - message: Device Battery Low -- id: '1729708621620' - alias: Closet Lights - description: '' - triggers: - - type: present - device_id: 0924cbdcd24416e768caa52301db59f7 - entity_id: e9f0acef50550033cd96155bd501b7c3 - domain: binary_sensor - trigger: device - for: - hours: 0 - minutes: 0 - seconds: 0 - id: Present - - type: not_present - device_id: 0924cbdcd24416e768caa52301db59f7 - entity_id: e9f0acef50550033cd96155bd501b7c3 - domain: binary_sensor - trigger: device - for: - hours: 0 - minutes: 0 - seconds: 0 - id: empty - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - Present - sequence: - - action: light.turn_on - metadata: {} - data: - transition: 3 - brightness_pct: 100 - kelvin: 5008 - target: - device_id: - - e25128ac8fcf62af66a039cde3104760 - - ddcfd5ea4fc5f5a88e18325b01c615db - - conditions: - - condition: trigger - id: - - empty - sequence: - - action: light.turn_off - metadata: {} - data: - transition: 3 - target: - device_id: - - e25128ac8fcf62af66a039cde3104760 - - ddcfd5ea4fc5f5a88e18325b01c615db - mode: single -- id: '1729881464325' - alias: Bedroom Closet - description: '' - triggers: - - type: present - device_id: 28e7f211c72409fe244183219abf6ffa - entity_id: aa474f323868586cef62070654f36936 - domain: binary_sensor - trigger: device - id: Present - - type: not_present - device_id: 28e7f211c72409fe244183219abf6ffa - entity_id: aa474f323868586cef62070654f36936 - domain: binary_sensor - trigger: device - id: empty - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - Present - sequence: - - type: turn_on - device_id: f5936d6143b7927433e9c0430c79acab - entity_id: f6ec42c9db2c191866a335a346b1ec44 - domain: switch - - conditions: - - condition: trigger - id: - - empty - sequence: - - type: turn_off - device_id: f5936d6143b7927433e9c0430c79acab - entity_id: f6ec42c9db2c191866a335a346b1ec44 - domain: switch - mode: single -- id: '1740179328446' - alias: Living Room Lights - description: '' - triggers: - - domain: mqtt - device_id: f7482a462dc7cc05b4ceaa0d882dc469 - type: action - subtype: off_press - trigger: device - id: 'off' - - domain: mqtt - device_id: f7482a462dc7cc05b4ceaa0d882dc469 - type: action - subtype: on_press - trigger: device - id: 'on' - - domain: mqtt - device_id: f7482a462dc7cc05b4ceaa0d882dc469 - type: action - subtype: up_press - trigger: device - id: up - - domain: mqtt - device_id: f7482a462dc7cc05b4ceaa0d882dc469 - type: action - subtype: down_press - trigger: device - id: down - - domain: mqtt - device_id: f7482a462dc7cc05b4ceaa0d882dc469 - type: action - subtype: on_hold - trigger: device - id: hold on - conditions: [] - actions: - - choose: - - conditions: - - condition: trigger - id: - - 'on' - sequence: - - data: - brightness_pct: 100 - color_temp_kelvin: 5000 - transition: 1 - action: light.turn_on - target: - entity_id: light.livingroom_lights - - conditions: - - condition: trigger - id: - - 'off' - sequence: - - data: - transition: 1 - action: light.turn_off - target: - entity_id: light.livingroom_lights - - conditions: - - condition: trigger - id: - - up - sequence: - - device_id: 8bc2033b03d5a474ca3204c5ca53e308 - domain: light - entity_id: 4a3cc9043ff985e9271683e1916bd9e1 - type: brightness_increase - - device_id: 8f4f51aed9b3b4284f520af25358efd9 - domain: light - entity_id: f45e74498c4b6bae65aaf5adf67e29d6 - type: brightness_increase - - conditions: - - condition: trigger - id: - - down - sequence: - - device_id: 8bc2033b03d5a474ca3204c5ca53e308 - domain: light - entity_id: 4a3cc9043ff985e9271683e1916bd9e1 - type: brightness_decrease - - device_id: 8bc2033b03d5a474ca3204c5ca53e308 - domain: light - entity_id: 4a3cc9043ff985e9271683e1916bd9e1 - type: brightness_decrease - - conditions: - - condition: trigger - id: - - hold on - sequence: - - metadata: {} - data: - rgb_color: - - 255 - - 0 - - 0 - brightness_pct: 100 - action: light.turn_on - target: - entity_id: light.livingroom_lights - mode: single diff --git a/modules/nixos/homeassistant/default.nix b/modules/nixos/homeassistant/default.nix new file mode 100755 index 0000000..c505a96 --- /dev/null +++ b/modules/nixos/homeassistant/default.nix @@ -0,0 +1,399 @@ +{ config, lib, pkgs, namespace, ... }: +let + cfg = config.${namespace}.services.home-assistant; + mosquittoPort = 1883; + zigbee2mqttPort = 8080; + + # In configuration.nix or a separate file + python-steam = pkgs.python3Packages.buildPythonPackage rec { + pname = "steam"; + version = "1.4.4"; + pyproject = false; + src = pkgs.fetchPypi { + inherit pname version; + sha256 = "sha256-K1vWkRwNSnMS9EG40WK52NR8i+u478bIhnOTsDI/pS4="; + }; + + buildInputs = with pkgs.python3Packages; [ setuptools ]; + + doCheck = false; # no tests in the PyPI tarball + }; +in +{ + imports = [ ./options.nix ]; + + config = lib.mkIf cfg.enable { + # imports = [ ./hacs ]; + + services.home-assistant = { + enable = true; + openFirewall = true; + configDir = "/var/lib/homeassistant"; + configWritable = true; # todo + extraComponents = [ + "adguard" + "apple_tv" + "analytics" + "bluetooth" + "bluetooth_adapters" + "bluetooth_le_tracker" + "bluetooth_tracker" + "brother" + "caldav" + "calendar" + "cloudflare" + "co2signal" + "color_extractor" + "holiday" + "jellyfin" + "music_assistant" + "nut" + "nextcloud" + "nws" + "ollama" + "onedrive" + "ping" + "samsungtv" + "season" + "simplefin" + "smartthings" + "upnp" + "workday" + "wyoming" + + "google_translate" + "met" + "radio_browser" + "shopping_list" + "esphome" + # Recommended for fast zlib compression + # https://www.home-assistant.io/integrations/isal + "isal" + "subaru" + "vesync" + "mqtt" # Enables MQTT integration in HA + "ffmpeg" # Enables camera streams + "zha" # Enables Zigbee integration + "homekit" + "music_assistant" + ]; + customComponents = with pkgs.home-assistant-custom-components; [ + auth-header + localtuya + ]; + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ + atomic-calendar-revive + bubble-card + button-card + hourly-weather + mini-graph-card + mini-media-player + multiple-entity-row + mushroom + vacuum-card + weather-chart-card + zigbee2mqtt-networkmap + ]; + # use postgresql instead of sqlite + extraPackages = ps: with ps; [ + # Core functionality + aiohttp + aiodns + paho-mqtt + pillow + pytz + pyyaml + sqlalchemy + + # Discovery & networking + zeroconf + netdisco + ifaddr + ssdp + + # Device protocols + pyserial # Serial communications + bluepy # Bluetooth LE + + # Smart home ecosystems + mutagen # Media file metadata + pysonos # Sonos + pywemo # Belkin WeMo + python-miio # Xiaomi devices + python-kasa # TP-Link + + # Sensors & monitoring + meteocalc # Weather calculations + speedtest-cli # Internet speed + + # Visualization & UI + matplotlib # Graphing + + # Security + bcrypt + cryptography + pyjwt + + # Media + ha-ffmpeg # Camera streams + + # Specialized integrations + python-matter-server # Matter protocol + + # System integrations + psutil # System monitoring + + psycopg2 + numpy + hassil + pyturbojpeg + paho-mqtt + pychromecast + pyatv + python-otbr-api + brother + pyipp + govee-ble + adguardhome + nextcord + aiogithubapi + jellyfin-apiclient-python + pylitterbot + dateparser + aionut + nextcloudmonitor + ollama + pynecil + aiopyarr + pysabnzbd + getmac + zigpy + bellows # For Zigbee EmberZNet-based adapters + zigpy-xbee # For XBee adapters + zigpy-deconz # For ConBee/RaspBee adapters + pyicloud # iCloud + pyatv # Apple TV + opencv-python + face-recognition + ibeacon-ble + gehomesdk + onedrive-personal-sdk + python-roborock + python-steam + apple-weatherkit + + samsungctl + samsungtvws + + aiohomekit + + icmplib + aioelectricitymaps + wyoming + pysmartthings + wakeonlan + ephem + ]; + + config = { + # Includes dependencies for a basic setup + # https://www.home-assistant.io/integrations/default_config/ + default_config = {}; + + cloud = false; + + frontend = { + themes = "!include_dir_merge_named themes"; + }; + + "automation ui" = "!include automations.yaml"; + "scene ui" = "!include scenes.yaml"; + "script ui" = "!include scripts.yaml"; + + http = { + use_x_forwarded_for = true; + trusted_proxies = [ + "172.30.33.0/24" + "10.0.1.4" + "10.0.4.2" + "10.0.1.18" + "10.0.1.0/24" + ]; + }; + + recorder = { + db_url = "postgresql://@/hass"; + purge_keep_days = 180; + }; + + auth_header = { + debug = false; + username_header = "X-authentik-username"; + }; + + # https://www.home-assistant.io/integrations/ota_updater/ + zha.zigpy_config.ota.z2m_remote_index = "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json"; + }; + }; + + # https://www.home-assistant.io/integrations/automation/ + # systemd.tmpfiles.rules = [ + # "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass" + # ]; + + # This bypasses the component validation and places it directly in HA's data directory + system.activationScripts.installCustomComponents = '' + chown -R hass:hass ${config.services.home-assistant.configDir} + chmod -R 750 ${config.services.home-assistant.configDir} + ''; + + services = { + postgresql = { + enable = true; + ensureDatabases = [ "hass" ]; + ensureUsers = [{ + name = "hass"; + ensureDBOwnership = true; + }]; + }; + + # Enable and configure Mosquitto MQTT broker + mosquitto = { + enable = true; + listeners = [ + { + acl = [ "pattern readwrite #" ]; + omitPasswordAuth = true; + settings.allow_anonymous = true; + } + ]; + }; + + zigbee2mqtt = { + enable = true; + settings = { + homeassistant = { + enabled = config.services.home-assistant.enable; + # Optional: Home Assistant discovery topic (default: shown below) + # Note: should be different from [MQTT base topic](../mqtt.md) to prevent errors in HA software + discovery_topic = "homeassistant"; + # Optional: Home Assistant status topic (default: shown below) + status_topic = "homeassistant/status"; + # Optional: Experimental support for Home Assistant event entities, may break in the future (default: shown below) when enabled: + # - An `event` entity will be discovered for each 'action'. + # - The `event_type` attribute will contain the action itself, additional attributes like `button` will have further information. + experimental_event_entities = false; + # Optional: Home Assistant legacy action sensor (default: `false`), when enabled: + # - Zigbee2MQTT will send an empty 'action' after one has been send + # - A 'sensor_action' will be discovered + legacy_action_sensor = false; + }; + + permit_join = true; + # Web interface + frontend = { + port = zigbee2mqttPort; # Choose an available port + }; + # MQTT configuration + mqtt = { + base_topic = "zigbee2mqtt"; + server = "mqtt://localhost:1883"; + # If using authentication: + # user = "mqttuser"; + # password = "your-password"; + }; + serial = { + port = "/dev/ttyUSB0"; + }; + }; + }; + + music-assistant = { + enable = true; + providers = [ + # "airplay" # music-assistant: airplay support is missing libraop, a library we will not package because it depends on OpenSSL 1.1. + "apple_music" + "bluesound" + "builtin" + "chromecast" + "deezer" + "dlna" + "fanarttv" + "filesystem_local" + "filesystem_smb" + "fully_kiosk" + "hass" + "hass_players" + "jellyfin" + "musicbrainz" + "opensubsonic" + "player_group" + "plex" + "qobuz" + "radiobrowser" + "siriusxm" + "snapcast" + "sonos" + "sonos_s1" + "soundcloud" + "spotify" + "template_player_provider" + "test" + "theaudiodb" + "tidal" + "tunein" + "ytmusic" + ]; + }; + + # Enable AirPlay + pipewire = { + # opens UDP ports 6001-6002 + raopOpenFirewall = true; + + extraConfig.pipewire = { + "10-airplay" = { + "context.modules" = [ + { + name = "libpipewire-module-raop-discover"; + + # increase the buffer size if you get dropouts/glitches + # args = { + # "raop.latency.ms" = 500; + # }; + } + ]; + }; + }; + }; + }; + + # Enable required hardware support for the Zigbee adapter + hardware.bluetooth.enable = true; # Some adapters use Bluetooth + + # Ensure proper permissions for Zigbee USB devices + # services.udev.extraRules = '' + # # For CC2531, CC2530, CC1352P-2, CC2538 and similar adapters + # SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee", MODE="0666" + # SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666" + + # # For ConBee/RaspBee by Dresden Elektronik + # SUBSYSTEM=="tty", ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", SYMLINK+="zigbee", MODE="0666" + + # # For Electrolama zig-a-zig-ah (zzh!) + # SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666" + # ''; + + environment.systemPackages = with pkgs; [ + mosquitto # MQTT command-line tools + usbutils # For lsusb to help identify your adapter + ]; + + networking.firewall.allowedTCPPorts = [ + mosquittoPort + zigbee2mqttPort + 8095 + 8097 + ]; + }; +} diff --git a/modules/nixos/homeassistant/hacs/gehome.nix b/modules/nixos/homeassistant/hacs/gehome.nix index d6a9950..9fa8e97 100644 --- a/modules/nixos/homeassistant/hacs/gehome.nix +++ b/modules/nixos/homeassistant/hacs/gehome.nix @@ -1,21 +1,5 @@ { pkgs, ... }: let - magicattr_cust = pkgs.python3Packages.buildPythonPackage rec { - pname = "magicattr"; - version = "0.1.6"; - format = "setuptools"; - - src = pkgs.fetchFromGitHub { - owner = "frmdstryr"; - repo = pname; - rev = "master"; - sha256 = "sha256-FJtWU5AuunZbdlndGdfD1c9/0s7oRdoTi202pWjuAd8="; - }; - - buildInputs = with pkgs.python3Packages; [ setuptools ]; - doCheck = false; - }; - ha-gehome = pkgs.buildHomeAssistantComponent rec { owner = "simbaja"; domain = "ge_home"; @@ -30,7 +14,7 @@ let propagatedBuildInputs = with pkgs.python3Packages; [ gehomesdk - magicattr_cust + magicattr slixmpp ]; diff --git a/modules/nixos/homeassistant/homeassistant.nix b/modules/nixos/homeassistant/homeassistant.nix deleted file mode 100755 index 44ca0e6..0000000 --- a/modules/nixos/homeassistant/homeassistant.nix +++ /dev/null @@ -1,394 +0,0 @@ -{ config, lib, pkgs, ... }: -let - mosquittoPort = 1883; - zigbee2mqttPort = 8080; - - # In configuration.nix or a separate file - python-steam = pkgs.python3Packages.buildPythonPackage rec { - pname = "steam"; - version = "1.4.4"; - pyproject = false; - src = pkgs.fetchPypi { - inherit pname version; - sha256 = "sha256-K1vWkRwNSnMS9EG40WK52NR8i+u478bIhnOTsDI/pS4="; - }; - - buildInputs = with pkgs.python3Packages; [ setuptools ]; - - doCheck = false; # no tests in the PyPI tarball - }; -in -{ - imports = [ ./hacs ]; - - services.home-assistant = { - enable = true; - openFirewall = true; - configDir = "/var/lib/homeassistant"; - configWritable = true; # todo - extraComponents = [ - "adguard" - "apple_tv" - "analytics" - "bluetooth" - "bluetooth_adapters" - "bluetooth_le_tracker" - "bluetooth_tracker" - "brother" - "caldav" - "calendar" - "cloudflare" - "co2signal" - "color_extractor" - "holiday" - "jellyfin" - "music_assistant" - "nut" - "nextcloud" - "nws" - "ollama" - "onedrive" - "ping" - "samsungtv" - "season" - "simplefin" - "smartthings" - "upnp" - "workday" - "wyoming" - - "google_translate" - "met" - "radio_browser" - "shopping_list" - "esphome" - # Recommended for fast zlib compression - # https://www.home-assistant.io/integrations/isal - "isal" - "subaru" - "vesync" - "mqtt" # Enables MQTT integration in HA - "ffmpeg" # Enables camera streams - "zha" # Enables Zigbee integration - "homekit" - "music_assistant" - ]; - customComponents = with pkgs.home-assistant-custom-components; [ - auth-header - localtuya - ]; - customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ - atomic-calendar-revive - bubble-card - button-card - hourly-weather - mini-graph-card - mini-media-player - multiple-entity-row - mushroom - vacuum-card - weather-chart-card - zigbee2mqtt-networkmap - ]; - # use postgresql instead of sqlite - extraPackages = ps: with ps; [ - # Core functionality - aiohttp - aiodns - paho-mqtt - pillow - pytz - pyyaml - sqlalchemy - - # Discovery & networking - zeroconf - netdisco - ifaddr - ssdp - - # Device protocols - pyserial # Serial communications - bluepy # Bluetooth LE - - # Smart home ecosystems - mutagen # Media file metadata - pysonos # Sonos - pywemo # Belkin WeMo - python-miio # Xiaomi devices - python-kasa # TP-Link - - # Sensors & monitoring - meteocalc # Weather calculations - speedtest-cli # Internet speed - - # Visualization & UI - matplotlib # Graphing - - # Security - bcrypt - cryptography - pyjwt - - # Media - ha-ffmpeg # Camera streams - - # Specialized integrations - python-matter-server # Matter protocol - - # System integrations - psutil # System monitoring - - psycopg2 - numpy - hassil - pyturbojpeg - paho-mqtt - pychromecast - pyatv - python-otbr-api - brother - pyipp - govee-ble - adguardhome - nextcord - aiogithubapi - jellyfin-apiclient-python - pylitterbot - dateparser - aionut - nextcloudmonitor - ollama - pynecil - aiopyarr - pysabnzbd - getmac - zigpy - bellows # For Zigbee EmberZNet-based adapters - zigpy-xbee # For XBee adapters - zigpy-deconz # For ConBee/RaspBee adapters - pyicloud # iCloud - pyatv # Apple TV - opencv-python - face-recognition - ibeacon-ble - gehomesdk - onedrive-personal-sdk - python-roborock - python-steam - apple-weatherkit - - samsungctl - samsungtvws - - aiohomekit - - icmplib - aioelectricitymaps - wyoming - pysmartthings - wakeonlan - ephem - ]; - - config = { - # Includes dependencies for a basic setup - # https://www.home-assistant.io/integrations/default_config/ - default_config = {}; - - cloud = false; - - frontend = { - themes = "!include_dir_merge_named themes"; - }; - - "automation ui" = "!include automations.yaml"; - "scene ui" = "!include scenes.yaml"; - "script ui" = "!include scripts.yaml"; - - http = { - use_x_forwarded_for = true; - trusted_proxies = [ - "172.30.33.0/24" - "10.0.1.4" - "10.0.4.2" - "10.0.1.18" - "10.0.1.0/24" - ]; - }; - - recorder = { - db_url = "postgresql://@/hass"; - purge_keep_days = 180; - }; - - auth_header = { - debug = false; - username_header = "X-authentik-username"; - }; - - # https://www.home-assistant.io/integrations/ota_updater/ - zha.zigpy_config.ota.z2m_remote_index = "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json"; - }; - }; - - # https://www.home-assistant.io/integrations/automation/ - # systemd.tmpfiles.rules = [ - # "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass" - # ]; - - # This bypasses the component validation and places it directly in HA's data directory - system.activationScripts.installCustomComponents = '' - chown -R hass:hass ${config.services.home-assistant.configDir} - chmod -R 750 ${config.services.home-assistant.configDir} - ''; - - services = { - postgresql = { - enable = true; - ensureDatabases = [ "hass" ]; - ensureUsers = [{ - name = "hass"; - ensureDBOwnership = true; - }]; - }; - - # Enable and configure Mosquitto MQTT broker - mosquitto = { - enable = true; - listeners = [ - { - acl = [ "pattern readwrite #" ]; - omitPasswordAuth = true; - settings.allow_anonymous = true; - } - ]; - }; - - zigbee2mqtt = { - enable = true; - settings = { - homeassistant = { - enabled = config.services.home-assistant.enable; - # Optional: Home Assistant discovery topic (default: shown below) - # Note: should be different from [MQTT base topic](../mqtt.md) to prevent errors in HA software - discovery_topic = "homeassistant"; - # Optional: Home Assistant status topic (default: shown below) - status_topic = "homeassistant/status"; - # Optional: Experimental support for Home Assistant event entities, may break in the future (default: shown below) when enabled: - # - An `event` entity will be discovered for each 'action'. - # - The `event_type` attribute will contain the action itself, additional attributes like `button` will have further information. - experimental_event_entities = false; - # Optional: Home Assistant legacy action sensor (default: `false`), when enabled: - # - Zigbee2MQTT will send an empty 'action' after one has been send - # - A 'sensor_action' will be discovered - legacy_action_sensor = false; - }; - - permit_join = true; - # Web interface - frontend = { - port = zigbee2mqttPort; # Choose an available port - }; - # MQTT configuration - mqtt = { - base_topic = "zigbee2mqtt"; - server = "mqtt://localhost:1883"; - # If using authentication: - # user = "mqttuser"; - # password = "your-password"; - }; - serial = { - port = "/dev/ttyUSB0"; - }; - }; - }; - - music-assistant = { - enable = true; - providers = [ - # "airplay" # music-assistant: airplay support is missing libraop, a library we will not package because it depends on OpenSSL 1.1. - "apple_music" - "bluesound" - "builtin" - "chromecast" - "deezer" - "dlna" - "fanarttv" - "filesystem_local" - "filesystem_smb" - "fully_kiosk" - "hass" - "hass_players" - "jellyfin" - "musicbrainz" - "opensubsonic" - "player_group" - "plex" - "qobuz" - "radiobrowser" - "siriusxm" - "snapcast" - "sonos" - "sonos_s1" - "soundcloud" - "spotify" - "template_player_provider" - "test" - "theaudiodb" - "tidal" - "tunein" - "ytmusic" - ]; - }; - - # Enable AirPlay - pipewire = { - # opens UDP ports 6001-6002 - raopOpenFirewall = true; - - extraConfig.pipewire = { - "10-airplay" = { - "context.modules" = [ - { - name = "libpipewire-module-raop-discover"; - - # increase the buffer size if you get dropouts/glitches - # args = { - # "raop.latency.ms" = 500; - # }; - } - ]; - }; - }; - }; - }; - - # Enable required hardware support for the Zigbee adapter - hardware.bluetooth.enable = true; # Some adapters use Bluetooth - - # Ensure proper permissions for Zigbee USB devices - # services.udev.extraRules = '' - # # For CC2531, CC2530, CC1352P-2, CC2538 and similar adapters - # SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee", MODE="0666" - # SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666" - - # # For ConBee/RaspBee by Dresden Elektronik - # SUBSYSTEM=="tty", ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", SYMLINK+="zigbee", MODE="0666" - - # # For Electrolama zig-a-zig-ah (zzh!) - # SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666" - # ''; - - environment.systemPackages = with pkgs; [ - mosquitto # MQTT command-line tools - usbutils # For lsusb to help identify your adapter - ]; - - networking.firewall.allowedTCPPorts = [ - mosquittoPort - zigbee2mqttPort - 8095 - 8097 - ]; -} diff --git a/modules/nixos/homeassistant/options.nix b/modules/nixos/homeassistant/options.nix new file mode 100644 index 0000000..47b1f2b --- /dev/null +++ b/modules/nixos/homeassistant/options.nix @@ -0,0 +1,7 @@ +{ lib, namespace, ... }: +with lib; +{ + options.${namespace}.services.home-assistant = { + enable = mkEnableOption "enable home-assistant"; + }; +} \ No newline at end of file diff --git a/modules/nixos/homeassistant/scenes.yaml b/modules/nixos/homeassistant/scenes.yaml deleted file mode 100755 index e69de29..0000000 diff --git a/modules/nixos/homeassistant/scripts.yaml b/modules/nixos/homeassistant/scripts.yaml deleted file mode 100755 index e69de29..0000000 diff --git a/modules/nixos/hyprland/config.nix b/modules/nixos/hyprland/config.nix deleted file mode 100755 index 6fef823..0000000 --- a/modules/nixos/hyprland/config.nix +++ /dev/null @@ -1,14 +0,0 @@ -let configDir = ./config; -in -{ - imports = [ - ./config/nwg-dock - ./config/nwg-drawer - ./config/nwg-panel - ]; - home.file = { - ".config/wallpapers".source = "${configDir}/wallpapers"; - ".config/wlogout".source = "${configDir}/wlogout"; - ".config/waybar/scripts".source = "${configDir}/waybar/scripts"; - }; -} diff --git a/modules/nixos/hyprland/config/btop/default.nix b/modules/nixos/hyprland/config/btop/default.nix deleted file mode 100755 index 86071c9..0000000 --- a/modules/nixos/hyprland/config/btop/default.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - programs.btop = { - enable = true; - settings = { - color_theme = "nord"; - theme_background = true; - truecolor = true; - force_tty = false; - presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"; - vim_keys = true; - rounded_corners = true; - graph_symbol = "braille"; - graph_symbol_cpu = "default"; - graph_symbol_mem = "default"; - graph_symbol_net = "default"; - graph_symbol_proc = "default"; - shown_boxes = "cpu mem net proc"; - update_ms = 2000; - proc_sorting = "cpu lazy"; - proc_reversed = false; - proc_tree = false; - proc_colors = true; - proc_gradient = true; - proc_per_core = false; - proc_mem_bytes = true; - proc_cpu_graphs = true; - proc_info_smaps = false; - proc_left = false; - proc_filter_kernel = false; - cpu_graph_upper = "total"; - cpu_graph_lower = "total"; - cpu_invert_lower = true; - cpu_single_graph = false; - cpu_bottom = false; - show_uptime = true; - check_temp = true; - cpu_sensor = "Auto"; - show_coretemp = true; - cpu_core_map = ""; - temp_scale = "celsius"; - base_10_sizes = false; - show_cpu_freq = true; - clock_format = "%X"; - background_update = true; - custom_cpu_name = ""; - disks_filter = ""; - mem_graphs = true; - mem_below_net = false; - zfs_arc_cached = true; - show_swap = true; - swap_disk = true; - show_disks = true; - only_physical = true; - use_fstab = true; - zfs_hide_datasets = false; - disk_free_priv = false; - show_io_stat = true; - io_mode = false; - io_graph_combined = false; - io_graph_speeds = ""; - net_download = 100; - net_upload = 100; - net_auto = true; - net_sync = true; - net_iface = ""; - show_battery = true; - selected_battery = "Auto"; - log_level = "WARNING"; - }; - themes = { - nord = '' - theme[main_bg]="${settings.theme.nord.polarNight.nord0}" - theme[main_fg]="${settings.theme.nord.snowStorm.nord6}" - theme[title]="${settings.theme.nord.snowStorm.nord6}" - theme[hi_fg]="${settings.theme.nord.frost.nord7}" - theme[selected_bg]="${settings.theme.nord.polarNight.nord1}" - theme[selected_fg]="${settings.theme.nord.frost.nord7}" - theme[inactive_fg]="${settings.theme.nord.polarNight.nord2}" - theme[graph_text]="${settings.theme.nord.snowStorm.nord6}" - theme[meter_bg]="${settings.theme.nord.polarNight.nord1}" - theme[proc_misc]="${settings.theme.nord.snowStorm.nord6}" - theme[cpu_box]="${settings.theme.nord.aurora.nord15}" - theme[mem_box]="${settings.theme.nord.aurora.nord14}" - theme[net_box]="${settings.theme.nord.aurora.nord12}" - theme[proc_box]="${settings.theme.nord.aurora.nord11}" - theme[div_line]="${settings.theme.nord.polarNight.nord1}" - theme[temp_start]="${settings.theme.nord.aurora.nord14}" - theme[temp_mid]="${settings.theme.nord.aurora.nord13}" - theme[temp_end]="${settings.theme.nord.aurora.nord11}" - theme[cpu_start]="${settings.theme.nord.aurora.nord15}" - theme[cpu_mid]="${settings.theme.nord.aurora.nord12}" - theme[cpu_end]="${settings.theme.nord.aurora.nord11}" - theme[free_start]="${settings.theme.nord.aurora.nord14}" - theme[free_mid]="${settings.theme.nord.aurora.nord13}" - theme[free_end]="${settings.theme.nord.aurora.nord12}" - theme[cached_start]="${settings.theme.nord.aurora.nord14}" - theme[cached_mid]="${settings.theme.nord.aurora.nord13}" - theme[cached_end]="${settings.theme.nord.aurora.nord12}" - theme[available_start]="${settings.theme.nord.snowStorm.nord6}" - theme[available_mid]="${settings.theme.nord.aurora.nord11}" - theme[available_end]="${settings.theme.nord.aurora.nord11}" - theme[used_start]="${settings.theme.nord.aurora.nord14}" - theme[used_mid]="${settings.theme.nord.aurora.nord13}" - theme[used_end]="${settings.theme.nord.aurora.nord11}" - theme[download_start]="${settings.theme.nord.frost.nord8}" - theme[download_mid]="${settings.theme.nord.frost.nord8}" - theme[download_end]="${settings.theme.nord.aurora.nord12}" - theme[upload_start]="${settings.theme.nord.frost.nord7}" - theme[upload_mid]="${settings.theme.nord.frost.nord7}" - theme[upload_end]="${settings.theme.nord.aurora.nord12}" - theme[process_start]="${settings.theme.nord.aurora.nord15}" - theme[process_mid]="${settings.theme.nord.aurora.nord12}" - theme[process_end]="${settings.theme.nord.aurora.nord11}" - ''; - }; - }; - -} diff --git a/modules/nixos/hyprland/config/hypr/default.nix b/modules/nixos/hyprland/config/hypr/default.nix deleted file mode 100755 index 86171aa..0000000 --- a/modules/nixos/hyprland/config/hypr/default.nix +++ /dev/null @@ -1,314 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; - drawer = "nwg-drawer -fm nautilus -term kitty -mb 10 -mt 10 -ml 10 -mr 10 -pbuseicontheme -i ${settings.iconTheme}"; -in -{ - wayland.windowManager.hyprland = { - enable = true; - xwayland.enable = true; - systemd.enable = true; - - settings = { - "$mod" = "SUPER"; - - # Mouse - # mouse_[up|down] - scroll wheel - # middle_mouse - 274 - # thumb_up - 276 - # thumb_down - 275 - - # l -> locked, will also work when an input inhibitor (e.g. a lockscreen) is active. - # r -> release, will trigger on release of a key. - # e -> repeat, will repeat when held. - # n -> non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher. - # m -> mouse, see below. - # t -> transparent, cannot be shadowed by other binds. - # i -> ignore mods, will ignore modifiers. - # s -> separate, will arbitrarily combine keys between each mod/key, see [Keysym combos](#keysym-combos) above. - # d -> has description, will allow you to write a description for your bind. - # p -> bypasses the app's requests to inhibit keybinds. - - # https://wiki.hyprland.org/Configuring/Binds/ - # https://wiki.hyprland.org/Configuring/Binds/#mouse-buttons - - bind = [ - "$mod, Return, exec, ${settings.defaultApps.terminal.pname}" - "$mod, SPACE, exec, wofi --show drun" - ", xf86Search, exec, wofi --show drun" - "$mod, Q, killactive, " - "$mod, M, exec, wlogout --protocol layer-shell" - "$mod, E, exec, ${settings.defaultApps.fileExplorer.pname}" - "$mod, V, togglefloating, " - "$mod, D, exec, ${drawer}" - "$mod, P, pseudo, " # dwindle - "$mod, S, togglesplit, " # dwindle - "$mod SHIFT, Q, exec, hyprlock" - "$mod SHIFT, 4, exec, hyprshot -m region --clipboard-only" - "$mod, F, fullscreen, 1" - "$mod SHIFT, F, fullscreen, 0" - "$mod SHIFT, E, exec, smile" - - "$mod, mouse:276, movecurrentworkspacetomonitor, ${settings.displayLeft.input}" - "$mod, mouse:275, movecurrentworkspacetomonitor, ${settings.displayRight.input}" - - # alt-tab between workspaces on active monitor - "$mod, Tab, workspace, m+1" - "$mod SHIFT, Tab, workspace, m-1" - - "$mod, h, movefocus, l" - "$mod, l, movefocus, r" - "$mod, k, movefocus, u" - "$mod, j, movefocus, d" - - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - "$mod ALT, 1, movetoworkspace, 1" - "$mod ALT, 2, movetoworkspace, 2" - "$mod ALT, 3, movetoworkspace, 3" - "$mod ALT, 4, movetoworkspace, 4" - "$mod ALT, 5, movetoworkspace, 5" - "$mod ALT, 6, movetoworkspace, 6" - "$mod ALT, 7, movetoworkspace, 7" - "$mod ALT, 8, movetoworkspace, 8" - "$mod ALT, 9, movetoworkspace, 9" - "$mod ALT, 0, movetoworkspace, discord" - - "$mod CTRL, l, resizeactive, 10 0" - "$mod CTRL, h, resizeactive, -10 0" - "$mod CTRL, k, resizeactive, 0 -10" - "$mod CTRL, j, resizeactive, 0 10" - - "$mod SHIFT, l, movewindow, r" - "$mod SHIFT, h, movewindow, l" - "$mod SHIFT, k, movewindow, u" - "$mod SHIFT, j, movewindow, d" - - "$mod, b, exec, ${settings.defaultApps.browser.pname}" - ]; - - bindm = [ - # Move/resize windows with mod + LMB/RMB and dragging - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - # middle mouse will grab a window, mod + middle mouse will close it - "$mod SHIFT, mouse:274, movewindow" - ]; - - bindel = [ - ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ]; - - bindl = [ - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - - ", XF86MonBrightnessUp, exec, brightnessctl set +5%" - ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" - - "$mod, XF86MonBrightnessUp, exec, brightnessctl -d kbd_backlight set +10%" - "$mod, XF86MonBrightnessDown, exec, brightnessctl -d kbd_backlight set 10%-" - ]; - - monitor = hyprlandSettings.monitor or [ ]; - monitorv2 = hyprlandSettings.monitorv2 or { }; - - render = { - cm_fs_passthrough = 1; - }; - - misc = { - vrr = 1; - }; - - general = { - gaps_in = 5; - gaps_out = 10; - border_size = 1; - "col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg"; - "col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg"; - layout = "dwindle"; - allow_tearing = true; - }; - - decoration = { - rounding = 10; - blur = { - enabled = true; - size = 2; - passes = 2; - new_optimizations = true; - xray = false; - }; - # drop_shadow = "yes"; - # shadow_range = 4; - # shadow_render_power = "3"; - # "col.shadow" = "rgba(1a1a1aee)"; - }; - - animations = { - enabled = "yes"; - bezier = [ - "overshot, 0.05, 0.9, 0.1, 1.05" - "smoothOut, 0.36, 0, 0.66, -0.56" - "smoothIn, 0.25, 1, 0.5, 1" - ]; - animation = [ - "windows, 1, 5, overshot, slide" - "windowsOut, 1, 4, smoothOut, slide" - "windowsMove, 1, 4, default" - "border, 1, 10, default" - "fade, 1, 10, smoothIn" - "fadeDim, 1, 10, smoothIn" - "workspaces, 1, 6, default" - ]; - }; - - dwindle = { - pseudotile = "yes"; - preserve_split = "yes"; - }; - - gestures = { - workspace_swipe = "off"; - }; - - misc = { - force_default_wallpaper = 0; - }; - - workspace = hyprlandSettings.workspace; - - windowrule = [ - "float, title:(file_progress)" - "float, title:(.*[Cc]onfirm.*)" - "float, title:(.*[Dd]ialog.*)" - "float, title:(.*[Dd]ownload.*)" - "float, title:(.*[Nn]otification.*)" - "float, title:(.*[Ee]rror.*)" - "float, title:(.*[Ss]plash.*)" - "float, title:(.*[Cc]onfirmreset.*)" - "float, title:(.*[Ss]ign [Ii]n - .*)" - "float, title:(.*[Oo]pen [Ff]ile.*)" - "float, title:(.*branchdialog.*)" - "float, class:(.*pavucontrol.*)" - "move onscreen cursor 0% 0%, class:(.*pavucontrol.*)" - "float, class:(.*[Oo]verskride.*)" - "float, class:(.*FileRoller.*)" - "float, class:(.*wlogout.*)" - "idleinhibit stayfocused, title:(.*mpv.*)" - - "float, class:(.*nm-connection-editor.*)" - "move onscreen cursor 0% 0%, class:(.*nm-connection-editor.*)" - - "float, title:(Media viewer)" - "float, class:(it.mijorus.smile),title:(Smile)" - "float, class:(.blueman-manager-wrapped)$,title:(Bluetooth Devices)" - # Picture in picture windows - "float, title:(.*Picture-in-Picture.*)" - "pin, title::(.*Picture-in-Picture.*)" - - # discord/vesktop - "workspace: name:discord, class:(.*vesktop)" - "float, class:(.*vesktop),title:(.*Discord Popout.*)" - "pin, class:(.*vesktop),title:(.*Discord Popout.*)" - - # Music - "workspace: name:discord, class:(Apple Music.*)" - - # Steam - "float, class:(.*[Ss]team), title:(.*[Ss]team.*)$" - "workspace name:steam silent, class:(.*[Ss]team), title:(.*[Ss]team.*)$" - "tile, class:(.*[Ss]team), title:(.*[Ss]team.*)$" - "float, class:(.*steam),title:(.*Friends List.*)" - - # Code - "pin, class:(.*codium.*),title:(Save As)" - "float, class:(.*codium.*),title:(Save As)" - "float, class:(xdg-desktop-portal-gtk),title:(Open Workspace from File)" - - # Game Tearing??? https://wiki.hyprland.org/Configuring/Tearing/ - "immediate, class:(.*gamescope)" - - # vmware - # this tag will set the below options to the vdi window - # this will have it auto open as a 2160x7680 window - # and makes multi-monitor work - "tag +horizonrdp, class:(.*[Vv][Mm]ware-view),title:(USPS Next VDI)" - - "noanim, tag:horizonrdp" - "noblur, tag:horizonrdp" - "norounding, tag:horizonrdp" - "noshadow, tag:horizonrdp" - "immediate, tag:horizonrdp" - "allowsinput, tag:horizonrdp" - "noborder, tag:horizonrdp" - "nodim, tag:horizonrdp" - "nomaxsize, tag:horizonrdp" - "renderunfocused, tag:horizonrdp" - "idleinhibit, tag:horizonrdp" - "float, tag:horizonrdp" - # "size 2160 7680, tag:horizonrdp" - # "move onscreen 0 0, tag:horizonrdp" - # float the vmware window cause its annoying to use in fullscreen - "float, class:(.*[Vv][Mm]ware-view),title:([Vv][Mm]ware [Hh]orizon [Cc]lient)" - - "tag +waydroid, class:([Ww]aydroid.*)" - "float, tag:waydroid" - "pin, tag:waydroid" - ] ++ hyprlandSettings.windowRule; - - input = { - kb_layout = "us"; - - kb_variant = ""; - kb_model = ""; - kb_options = ""; - kb_rules = ""; - - numlock_by_default = true; - - follow_mouse = 1; - - touchpad = { - clickfinger_behavior = 1; - natural_scroll = "yes"; - }; - - sensitivity = 0; # -1.0 - 1.0, 0 means no modification. - }; - - experimental = { - xx_color_management_v4 = true; - }; - - debug = { - full_cm_proto = true; - disable_logs = true; - disable_scale_checks = true; - }; - }; - - extraConfig = '' - exec-once = dbus-update-activation-environment --systemd --all - exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP - exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 - exec-once = xhost +SI:localuser:root - exec-once = nwg-look -a - exec-once = nwg-dock-hyprland -d - '' + hyprlandSettings.extraConfig or ''''; - }; -} diff --git a/modules/nixos/hyprland/config/kitty/default.nix b/modules/nixos/hyprland/config/kitty/default.nix deleted file mode 100755 index 51a6596..0000000 --- a/modules/nixos/hyprland/config/kitty/default.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - programs.kitty = { - enable = true; - shellIntegration.enableZshIntegration = true; - - font = { - name = settings.fontName; - package = settings.fontPackage; - size = settings.fontSize; - }; - - settings = { - bold_font = "auto"; - italic_font = "auto"; - bold_italic_font = "auto"; - mouse_hide_wait = "2.0"; - cursor_shape = "block"; - url_style = "dotted"; - confirm_os_window_close = "0"; - background_opacity = "0.85"; - - # The basic colors - foreground = settings.theme.nord.snowStorm.nord6; - background = settings.theme.nord.polarNight.nord0; - selection_foreground = settings.theme.nord.polarNight.nord0; - selection_background = settings.theme.nord.aurora.nord15; - - # Cursor colors - cursor = settings.theme.nord.aurora.nord15; - cursor_text_color = settings.theme.nord.polarNight.nord0; - - # URL underline color when hovering with mouse - url_color = settings.theme.nord.aurora.nord15; - - # Kitty window border colors - active_border_color = settings.theme.nord.frost.nord10; - inactive_border_color = settings.theme.nord.polarNight.nord1; - bell_border_color = settings.theme.nord.aurora.nord13; - - # OS Window titlebar colors - wayland_titlebar_color = settings.theme.nord.polarNight.nord0; - macos_titlebar_color = settings.theme.nord.polarNight.nord0; - - # Tab bar colors - active_tab_foreground = settings.theme.nord.polarNight.nord3; - active_tab_background = settings.theme.nord.aurora.nord15; - inactive_tab_foreground = settings.theme.nord.snowStorm.nord6; - inactive_tab_background = settings.theme.nord.polarNight.nord1; - tab_bar_background = settings.theme.nord.polarNight.nord3; - - # Colors for marks (marked text in the terminal) - mark1_foreground = settings.theme.nord.polarNight.nord0; - mark1_background = settings.theme.nord.frost.nord10; - mark2_foreground = settings.theme.nord.polarNight.nord0; - mark2_background = settings.theme.nord.aurora.nord15; - mark3_foreground = settings.theme.nord.polarNight.nord0; - mark3_background = settings.theme.nord.frost.nord8; - - # The 16 terminal colors - - # black - color0 = settings.theme.nord.polarNight.nord0; - - # Autosuggestion - color8 = settings.theme.nord.frost.nord10; - - # red - color1 = settings.theme.nord.aurora.nord11; - color9 = settings.theme.nord.aurora.nord11; - - # green - color2 = settings.theme.nord.aurora.nord14; - color10 = settings.theme.nord.aurora.nord14; - - # yellow - color3 = settings.theme.nord.aurora.nord13; - color11 = settings.theme.nord.aurora.nord13; - - # blue - color4 = settings.theme.nord.frost.nord10; - color12 = settings.theme.nord.frost.nord10; - - # magenta - color5 = settings.theme.nord.aurora.nord15; - color13 = settings.theme.nord.aurora.nord15; - - # cyan - color6 = settings.theme.nord.frost.nord8; - color14 = settings.theme.nord.frost.nord8; - - # white - color7 = settings.theme.nord.snowStorm.nord5; - color15 = settings.theme.nord.snowStorm.nord4; - }; - }; -} diff --git a/modules/nixos/hyprland/config/mako/default.nix b/modules/nixos/hyprland/config/mako/default.nix deleted file mode 100755 index aeaf82a..0000000 --- a/modules/nixos/hyprland/config/mako/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - services.mako = { - enable = true; - settings = { - font = settings.fontName; - icons = true; - ignore-timeout = true; - sort = "-time"; - width = 500; - height = 110; - layer = "overlay"; - border-radius = 15; - border-size = 1; - max-icon-size = 64; - default-timeout = 5000; - - background-color = settings.theme.nord.polarNight.nord0; - text-color = settings.theme.nord.snowStorm.nord6; - border-color = settings.theme.nord.frost.nord10; - progress-color = "over ${settings.theme.nord.frost.nord8}"; - }; - }; -} diff --git a/modules/nixos/hyprland/config/nwg-dock/default.nix b/modules/nixos/hyprland/config/nwg-dock/default.nix deleted file mode 100644 index 24dfd3e..0000000 --- a/modules/nixos/hyprland/config/nwg-dock/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - home.file = { - ".config/nwg-dock-hyprland/drawer.css".text = '' - window { - background: ${settings.theme.nord.polarNight.nord0}; - border-radius: 10px; - border-style: none; - border-width: 1px; - border-color: ${settings.theme.nord.aurora.nord15}b0 - } - - #box { - /* Define attributes of the box surrounding icons here */ - padding: 10px - } - - active { - /* This is to underline the button representing the currently active window */ - border-bottom: solid 1px; - border-color: ${settings.theme.nord.aurora.nord14}1a - } - - button, image { - background: none; - border-style: none; - box-shadow: none; - color: ${settings.theme.nord.frost.nord10} - } - - button { - padding: 4px; - margin-left: 4px; - margin-right: 4px; - color: #eee; - font-size: 12px - } - - button:hover { - background-color: ${settings.theme.nord.polarNight.nord0}1a; - border-radius: 2px; - } - - button:focus { - box-shadow: none - } - ''; - }; -} diff --git a/modules/nixos/hyprland/config/nwg-drawer/default.nix b/modules/nixos/hyprland/config/nwg-drawer/default.nix deleted file mode 100644 index 26d1a91..0000000 --- a/modules/nixos/hyprland/config/nwg-drawer/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - home.file = { - ".config/nwg-drawer/drawer.css".text = '' - window { - background-color: ${settings.theme.nord.polarNight.nord0}bf; - color: ${settings.theme.nord.snowStorm.nord5}00 - } - - /* search entry */ - entry { - background-color: ${settings.theme.nord.polarNight.nord1}0f - } - - button, image { - background: none; - border: none - } - - button:hover { - background-color: ${settings.theme.nord.frost.nord10}1a - } - - /* in case you wanted to give category buttons a different look */ - #category-button { - margin: 0 10px 0 10px - } - - #pinned-box { - padding-bottom: 5px; - border-bottom: 1px dotted ${settings.theme.nord.polarNight.nord3} - } - - #files-box { - padding: 5px; - border: 1px dotted ${settings.theme.nord.polarNight.nord3}; - border-radius: 15px - } - ''; - }; -} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/nwg-panel/default.nix b/modules/nixos/hyprland/config/nwg-panel/default.nix deleted file mode 100644 index ab3fcc3..0000000 --- a/modules/nixos/hyprland/config/nwg-panel/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - home.file = { - ".config/nwg-panel/excluded-dirs".text = '' - - ''; - ".config/nwg-panel/preferred-apps.json".text = '' - { - "\\.pdf$": "${settings.defaultApps.browser.pname}", - "\\.svg$": "inkscape", - "\\.(jpg|png|tiff|gif)$": "${settings.defaultApps.imageViewer.pname}", - "\\.(mp3|ogg|flac|wav|wma)$": "audacious", - "\\.(avi|mp4|mkv|mov|wav)$": "${settings.defaultApps.video.pname}", - "\\.(doc|docx|xls|xlsx)$": "${settings.defaultApps.office.pname}" - } - ''; - }; -} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/waybar/default.nix b/modules/nixos/hyprland/config/waybar/default.nix deleted file mode 100755 index 6282966..0000000 --- a/modules/nixos/hyprland/config/waybar/default.nix +++ /dev/null @@ -1,505 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; - defaultOpacity = settings.theme.waybar.defaultOpacity; - defaultBorderRadius = settings.theme.waybar.defaultBorderRadius; - defaultCenterOptions = settings.theme.waybar.defaultCenterOptions; - borderLeft = settings.theme.waybar.borderLeft; - borderRight = settings.theme.waybar.borderRight; -in -{ - imports = [ - ./scripts/hass.nix - ./scripts/weather.nix - ]; - # https://github.com/Alexays/Waybar/wiki/Module:-Hyprland - # https://www.nerdfonts.com/cheat-sheet - - programs.waybar = { - enable = true; - systemd.enable = true; - settings = { - mainBar = { - layer = hyprlandSettings.waybar.layer; - position = "top"; - mod = "dock"; - exclusive = true; - passthrough = false; - gtk-layer-shell = true; - height = 0; - - # Module Layout - modules-left = [ "hyprland/workspaces" ]; - - modules-center = [ "hyprland/window" ]; - - modules-right = hyprlandSettings.waybar.modules-right; - - # Module Definitions - # Left - "hyprland/workspaces" = { - disable-scroll = true; - all-outputs = true; - on-click = "activate"; - persistent_workspaces = { - "*" = 1; - }; - }; - - # Center - "hyprland/window" = { - separate-outputs = true; - format = { }; - }; - - # Left - tray = { - icon-size = 16; - spacing = 10; - }; - - temperature = { - hwmon-path = "/sys/class/hwmon/hwmon4/temp1_input"; - critical-threshold = 110; - format-critical = "{temperatureC}°C "; - format = "{temperatureC}°C {icon}"; - format-icons = [ - "" # fa-temperature-empty - "" # fa-temperature-quarter - "" # fa-temperature-half - "" # fa-temperature-three-quarters - "" # fa-temperature-full - ]; - tooltip-format = "CPU: {temperatureC}°C"; - }; - - "temperature#gpu" = { - hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input"; - critical-threshold = 110; - format-critical = "{temperatureC}°C "; - format = "{temperatureC}°C {icon}"; - format-icons = [ - "" # fa-temperature-empty - "" # fa-temperature-quarter - "" # fa-temperature-half - "" # fa-temperature-three-quarters - "" # fa-temperature-full - ]; - on-click = "lact"; - tooltip-format = "GPU: {temperatureC}°C"; - }; - - "keyboard-state#capslock" = { - capslock = true; - format = "{icon}"; - tooltip-format = "Caps Lock {state}"; - format-icons = { - locked = "󰬶"; - unlocked = "󰬵"; - }; - }; - - "keyboard-state#numlock" = { - numlock = true; - format = "{icon}"; - tooltip-format = "Num Lock {state}"; - format-icons = { - locked = "󰎠"; - unlocked = "󱧓"; - }; - }; - - "wireplumber#sink" = { - format = "{icon} {volume}%"; - tooltip = false; - format-muted = "{icon} Muted"; - on-click = "wpctl set-mute @DEFAULT_SINK@ toggle"; - on-click-right = "pavucontrol -t 1"; - on-scroll-up = "wpctl set-volume @DEFAULT_SINK@ 5%+"; - on-scroll-down = "wpctl set-volume @DEFAULT_SINK@ 5%-"; - scroll-step = 5; - format-icons = { - headphone = "󰋋"; - headphone-muted = "󰟎"; - hands-free = "󰋋"; - headset = "󰋋"; - phone = ""; - portable = "󰋋"; - car = ""; - default = [ - "" - "" - "" - "" - ]; - }; - }; - - "wireplumber#source" = { - node-type = "Audio/Source"; - format = ""; - format-muted = ""; - tooltip = false; - # tooltip-format = "{source_desc} | {source_volume}%"; - on-click = "wpctl set-mute @DEFAULT_SOURCE@ toggle"; - on-click-right = "pavucontrol -t 2"; - on-scroll-up = "wpctl set-volume @DEFAULT_SOURCE@ 5%+"; - on-scroll-down = "wpctl set-volume @DEFAULT_SOURCE@ 5%-"; - scroll-step = 5; - }; - - "bluetooth" = { - on-click = "overskride"; - tooltip = true; - format = "{icon}"; - tooltip-format = "{status}"; - tooltip-format-disabled = "{status}"; - tooltip-format-off = "{status}"; - tooltip-format-on = "{status}"; - tooltip-format-connected = "{status}"; - tooltip-format-enumerate-connected = { }; - format-icons = { - disabled = "󰂲"; - off = "󰂲"; - on = "󰂯"; - connected = "󰂱"; - }; - }; - - network = { - interface = hyprlandSettings.networkInterface; - on-click = "nm-connection-editor"; - format = "{icon}"; - tooltip-format = "{ifname} via {gwaddr} 󰊗"; - tooltip-format-wifi = '' - {essid} ({signalStrength}%) {icon} -  {bandwidthDownBits}  {bandwidthUpBits} - ''; - tooltip-format-ethernet = "{ifname} "; - tooltip-format-disconnected = "Disconnected"; - max-length = 50; - format-icons = { - wifi = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - ethernet = "󰈀"; - linked = "󰤫"; - disconnected = "󰤫"; - }; - }; - - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = "󰐂"; - deactivated = "󱩜"; - }; - }; - - clock = { - format = "{:%I:%M %p}"; - tooltip-format = "{calendar}"; - calendar = { - mode = "month"; - format = { - months = "{}"; - days = "{}"; - weekdays = "{}"; - today = "{}"; - }; - }; - }; - - battery = { - # bat = "macsmc-battery"; - interval = 60; - # statuses: 'Charging', 'Discharging' - states = { - warning = 30; - critical = 15; - }; - format = "{capacity}% {icon}"; - format-icons = { - default = [ - "󰂃" # critical - "󰁺" # 10% - "󰁻" # 20% - "󰁼" # 30% - "󰁽" # 40% - "󰁾" # 50% - "󰁿" # 60% - "󰂀" # 70% - "󰂁" # 80% - "󰂂" # 90% - "󰁹" # 100% - ]; - charging = [ - "󰢟" # critical - "󰢜" # 10% - "󰂆" # 20% - "󰂇" # 30% - "󰂈" # 40% - "󰢝" # 50% - "󰂉" # 60% - "󰢞" # 70% - "󰂊" # 80% - "󰂋" # 90% - "󰂅" # 100% - ]; - }; - max-length = 25; - }; - - "custom/weather" = { - tooltip = true; - format = { }; - interval = 30; - exec = "waybar-weather"; - return-type = "json"; - markup = "pango"; - }; - } // hyprlandSettings.waybar.extraModules or { }; - }; - - # * { font-size: 13px; } - # window.eDP-1 * { font-size: 10px; } - - style = '' - .blink_me { - animation: blinker 1s linear infinite; - } - - @keyframes blinker { - 50% { - color: ${settings.theme.nord.aurora.nord11}; - } - } - - * { - font-family: - Jetbrains Mono Nerd Font, - monospace; - font-size: 14px; - min-height: 0; - } - - #waybar { - background: transparent; - color: ${settings.theme.nord.snowStorm.nord6}; - margin: 5px 5px; - } - - #workspaces { - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultBorderRadius} - ${defaultOpacity} - ${defaultCenterOptions} - margin-left: 0.6rem; - } - - #workspaces button { - color: ${settings.theme.nord.frost.nord10}; - ${defaultBorderRadius} - padding: 0.4rem; - } - - #workspaces button.active { - color: ${settings.theme.nord.frost.nord8}; - ${defaultBorderRadius} - } - - #workspaces button:hover { - color: ${settings.theme.nord.frost.nord7}; - ${defaultBorderRadius} - } - - #workspaces button.focused { - color: ${settings.theme.nord.snowStorm.nord6}; - background: ${settings.theme.nord.aurora.nord13}; - ${defaultBorderRadius} - } - - #workspaces button.urgent { - color: ${settings.theme.nord.polarNight.nord0}; - background: ${settings.theme.nord.snowStorm.nord6}; - ${defaultBorderRadius} - } - - #tooltip { - background: ${settings.theme.nord.polarNight.nord0}; - border-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultBorderRadius} - border-width: 1rem; - border-style: solid; - } - - #window { - color: ${settings.theme.nord.aurora.nord15}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultBorderRadius} - ${defaultCenterOptions} - margin-left: ${hyprlandSettings.waybar.moduleStyle.window.margin-left or "4rem"}; - margin-right: ${hyprlandSettings.waybar.moduleStyle.window.margin-right or "4rem"}; - } - - /* make window module transparent when no windows present */ - #window.empty { - background-color: transparent; - } - - #custom-weather { - color: ${settings.theme.nord.frost.nord10}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${borderRight} - } - - #battery { - color: ${settings.theme.nord.aurora.nord15}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - min-width: 3rem; - } - - #clock { - color: ${settings.theme.nord.frost.nord9}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${borderLeft} - } - - /* ------------- */ - - #idle_inhibitor { - color: ${settings.theme.nord.frost.nord10}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${borderRight} - padding-right: 1rem; - } - - #idle_inhibitor:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #network { - color: ${settings.theme.nord.aurora.nord15}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - padding-right: 15px; - } - - #network:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #bluetooth { - color: ${settings.theme.nord.frost.nord9}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #bluetooth:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #wireplumber.source { - color: ${settings.theme.nord.frost.nord8}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #wireplumber.source.muted { - animation-name: blinker; - animation-duration: 2s; - animation-timing-function: linear; - animation-iteration-count: infinite; - padding-right: 1rem; - } - - #wireplumber.source:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #wireplumber.sink { - color: ${settings.theme.nord.frost.nord7}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #wireplumber.sink.muted { - animation-name: blinker; - animation-duration: 5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - } - - #wireplumber.sink:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #keyboard-state.numlock { - color: ${settings.theme.nord.frost.nord8}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #keyboard-state.capslock { - color: ${settings.theme.nord.frost.nord9}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #temperature.gpu { - color: ${settings.theme.nord.frost.nord10}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - border-radius: 0; - } - - #temperature.gpu:hover { - background: ${settings.theme.nord.polarNight.nord3}; - } - - #temperature { - color: ${settings.theme.nord.frost.nord9}; - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${hyprlandSettings.waybar.moduleStyle.temperature.location or defaultCenterOptions} - border-radius: ${hyprlandSettings.waybar.moduleStyle.temperature.border-radius or "0"} - } - - /* ------------- */ - - #tray { - background-color: ${settings.theme.nord.polarNight.nord0}; - ${defaultOpacity} - ${defaultCenterOptions} - ${defaultBorderRadius} - margin-right: 0.6rem; - } - - /* ------------- */ - '' + hyprlandSettings.waybar.extraModulesStyle or ''''; - }; -} diff --git a/modules/nixos/hyprland/config/wlogout/default.nix b/modules/nixos/hyprland/config/wlogout/default.nix deleted file mode 100644 index 38c56fa..0000000 --- a/modules/nixos/hyprland/config/wlogout/default.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - programs.wlogout = { - enable = true; - layout = { - lock = { - label = "lock"; - action = "hyprlock --immediate"; - text = "Lock"; - keybind = "l"; - }; - hibernate = { - label = "hibernate"; - action = "systemctl hibernate"; - text = "Hibernate"; - keybind = "h"; - }; - logout = { - label = "logout"; - action = "sleep 1; hyprctl dispatch exit"; - text = "Logout"; - keybind = "e"; - }; - shutdown = { - label = "shutdown"; - action = "systemctl poweroff"; - text = "Shutdown"; - keybind = "s"; - }; - suspend = { - label = "suspend"; - action = "systemctl suspend"; - text = "Suspend"; - keybind = "u"; - }; - reboot = { - label = "reboot"; - action = "reboot"; - text = "Reboot"; - keybind = "r"; - }; - }; - style = '' - * { - background-image: none; - } - - window { - background-color: ${settings.theme.nord.polarNight.nord0}f0 - } - - button { - margin: 8px; - color: ${settings.theme.nord.frost.nord7}; - background-color: ${settings.theme.nord.polarNight.nord1}; - border-style: solid; - border-width: 2px; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; - } - - button:active, - button:focus, - button:hover { - color: ${settings.theme.nord.frost.nord8}; - background-color: ${settings.theme.nord.polarNight.nord2}; - outline-style: none; - } - - #lock { - background-image: image(url("icons/lock.png")); - } - - #logout { - background-image: image(url("icons/logout.png")); - } - - #suspend { - background-image: image(url("icons/suspend.png")); - } - - #hibernate { - background-image: image(url("icons/hibernate.png")); - } - - #shutdown { - background-image: image(url("icons/shutdown.png")); - } - - #reboot { - background-image: image(url("icons/reboot.png")); - } - ''; - }; -} \ No newline at end of file diff --git a/modules/nixos/hyprland/config/wofi/default.nix b/modules/nixos/hyprland/config/wofi/default.nix deleted file mode 100755 index b11e6c42..0000000 --- a/modules/nixos/hyprland/config/wofi/default.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ pkgs, hyprlandSettings, ... }: -let - settings = import ../../settings.nix { inherit pkgs; }; -in -{ - programs.wofi = { - enable = true; - style = '' - * { - font-family: "${settings.fontName}", monospace; - font-size: 14px; - } - - /* Window */ - window { - margin: 0px; - padding: 10px; - border: 0.16em solid ${settings.theme.nord.aurora.nord15}; - border-radius: 0.1em; - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - /* Inner Box */ - #inner-box { - margin: 5px; - padding: 10px; - border: none; - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - /* Outer Box */ - #outer-box { - margin: 5px; - padding: 10px; - border: none; - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - /* Scroll */ - #scroll { - margin: 0px; - padding: 10px; - border: none; - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - /* Input */ - #input { - margin: 5px 20px; - padding: 10px; - border: none; - border-radius: 0.1em; - color: ${settings.theme.nord.snowStorm.nord6}; - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - #input image { - border: none; - color: ${settings.theme.nord.aurora.nord11}; - } - - #input * { - outline: 4px solid ${settings.theme.nord.aurora.nord11}!important; - } - - /* Text */ - #text { - margin: 5px; - border: none; - color: ${settings.theme.nord.snowStorm.nord6}; - } - - #entry { - background-color: ${settings.theme.nord.polarNight.nord0}; - } - - #entry arrow { - border: none; - color: ${settings.theme.nord.aurora.nord15}; - } - - /* Selected Entry */ - #entry:selected { - border: 0.11em solid ${settings.theme.nord.aurora.nord15}; - } - - #entry:selected #text { - color: ${settings.theme.nord.frost.nord7}; - } - - #entry:drop(active) { - background-color: ${settings.theme.nord.aurora.nord15}!important; - } - ''; - }; -} diff --git a/modules/nixos/hyprland/default.nix b/modules/nixos/hyprland/default.nix deleted file mode 100755 index bf7abdd..0000000 --- a/modules/nixos/hyprland/default.nix +++ /dev/null @@ -1,173 +0,0 @@ -{ config, pkgs, lib, hyprlandSettings, ... }: -let - settings = import ./settings.nix { inherit pkgs; }; - - bing-wallpaper = pkgs.writeScriptBin "bing-wallpaper" '' - # Directory to store wallpapers - IMG_PATH="/run/wallpaper.jpg" - - # Download if not already downloaded - URL=$(curl -s "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1" | \ - jq -r '.images[0].url') - FULL_URL="https://www.bing.com$URL" - curl -s -o "$IMG_PATH" "$FULL_URL" - echo "Downloaded $FULL_URL to $IMG_PATH successfully" - ''; -in -{ - imports = [ - ./environment.nix - ]; - - environment.systemPackages = [ bing-wallpaper pkgs.jq ]; - - home-manager.users."${settings.user}" = (import ./home.nix {inherit lib pkgs hyprlandSettings;}); - - services = { - displayManager = { - sddm = { - enable = true; - package = pkgs.kdePackages.sddm; - extraPackages = [ settings.sddm.package ]; - theme = settings.sddm.themeName; - wayland.enable = true; - settings = { - Theme = { - ThemeDir = "${settings.sddm.package}/share/sddm/themes"; - }; - }; - }; - # Disable gdm - gdm.enable = lib.mkForce false; - defaultSession = "hyprland"; - }; - - # disable other desktops - desktopManager = { - plasma6.enable = lib.mkForce false; - gnome.enable = lib.mkForce false; - }; - - dbus.enable = true; - - ddccontrol.enable = true; - - blueman.enable = true; - }; - - programs = { - hyprland = { - enable = true; - xwayland.enable = true; - portalPackage = pkgs.xdg-desktop-portal-hyprland; - }; - - nm-applet.enable = true; - }; - - systemd = { - services = { - preload-bing-wallpaper = { - enable = true; - wants = [ "network-online.target" ]; - after = [ "network-online.target" ]; - before = [ "display-manager.service" ]; - requiredBy = [ - "plymouth-quit-wait.service" - "display-manager.service" - ]; - wantedBy = [ "display-manager.service" ]; - path = [ - pkgs.bash - pkgs.jq - pkgs.curl - bing-wallpaper - ]; - script = '' - bing-wallpaper - ''; - serviceConfig = { - Type = "oneshot"; - }; - }; - }; - user = { - services = { - reload-bing-wallpaper = { - enable = true; - path = [ - pkgs.bash - pkgs.jq - pkgs.curl - pkgs.hyprland - bing-wallpaper - ]; - script = '' - bing-wallpaper - ${pkgs.hyprland}/bin/hyprctl hyprpaper reload ,/run/wallpaper - ''; - serviceConfig = { - Type = "oneshot"; - }; - }; - }; - # Create a timer to run the service periodically - timers = { - reload-bing-wallpaper = { - description = "Timer for reload-bing-wallpaper"; - wantedBy = [ "timers.target" ]; - - # Timer configuration - timerConfig = { - OnCalendar = "daily"; # Check every day - Persistent = true; # Run immediately if last run was missed - Unit = "reload-bing-wallpaper.service"; - }; - }; - }; - }; - extraConfig = '' - DefaultTimeoutStopSec=10s - ''; - }; - - security = { - polkit.enable = true; - - # configure sudo - sudo.extraRules = [ - { - commands = [ - { - command = "/run/current-system/sw/bin/waybar-weather"; - options = [ "NOPASSWD" ]; - } - { - command = "/run/current-system/sw/bin/waybar-updates"; - options = [ "NOPASSWD" ]; - } - ]; - groups = [ "wheel" ]; - } - ]; - }; - - xdg.portal = { - enable = true; - wlr.enable = true; - xdgOpenUsePortal = true; - extraPortals = [ - pkgs.xdg-desktop-portal-hyprland - pkgs.xdg-desktop-portal-gnome - pkgs.xdg-desktop-portal-gtk - ]; - }; - - nixpkgs.overlays = [ - (self: super: { - waybar = super.waybar.overrideAttrs (oldAttrs: { - mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; - }); - }) - ]; -} diff --git a/modules/nixos/hyprland/home.nix b/modules/nixos/hyprland/home.nix deleted file mode 100755 index 1fec878..0000000 --- a/modules/nixos/hyprland/home.nix +++ /dev/null @@ -1,283 +0,0 @@ -{ lib, pkgs, hyprlandSettings, ... }: -let - settings = import ./settings.nix { inherit pkgs hyprlandSettings; }; - wallpaper = "/run/wallpaper.jpg"; - jiggler = pkgs.python3.pkgs.buildPythonPackage rec { - pname = "jiggler"; - version = "0.0.3"; - format = "pyproject"; - src = pkgs.fetchPypi { - inherit pname version; - sha256 = "sha256-6M4CbwxajYaQ5s73y+arKewLgu/pjfCay2giVVGYjhM="; - }; - - # do not run tests - doCheck = false; - nativeBuildInputs = with pkgs.python3.pkgs; [ setuptools ]; - propagatedBuildInputs = with pkgs.python3.pkgs; [ - click - pynput - ]; - }; -in -{ - imports = [ - ./config.nix - ./config/btop - (import ./config/hypr {inherit pkgs hyprlandSettings;}) - ./config/kitty - ./config/mako - (import ./config/waybar {inherit pkgs hyprlandSettings;}) - ./config/wofi - ]; - - wayland.windowManager.hyprland = { - enable = true; - plugins = with pkgs.hyprlandPlugins; [ - hyprgrass - ]; - settings = { - plugin = { - touch_gestures = { - # The default sensitivity is probably too low on tablet screens, - # I recommend turning it up to 4.0 - sensitivity = "4.0"; - - # must be >= 3 - workspace_swipe_fingers = "3"; - - # switching workspaces by swiping from an edge, this is separate from workspace_swipe_fingers - # and can be used at the same time - # possible values: l, r, u, or d - # to disable it set it to anything else - workspace_swipe_edge = "d"; - - # in milliseconds - long_press_delay = "400"; - - # resize windows by long-pressing on window borders and gaps. - # If general:resize_on_border is enabled, general:extend_border_grab_area is used for floating - # windows - resize_on_border_long_press = true; - - # in pixels, the distance from the edge that is considered an edge - edge_margin = "10"; - - # emulates touchpad swipes when swiping in a direction that does not trigger workspace swipe. - # ONLY triggers when finger count is equal to workspace_swipe_fingers - # - # might be removed in the future in favor of event hooks - emulate_touchpad_swipe = false; - - experimental = { - # send proper cancel events to windows instead of hacky touch_up events, - # NOT recommended as it crashed a few times, once it's stabilized I'll make it the default - send_cancel = "0"; - }; - - hyprgrass-bind = [ - # swipe left from right edge - ", edge:r:l, workspace, +1" - - # swipe up from bottom edge - ", edge:d:u, exec, ${settings.defaultApps.browser.pname}" - - # swipe down from left edge - ", edge:l:d, exec, pactl set-sink-volume @DEFAULT_SINK@ -4%" - - # swipe down with 4 fingers - ", swipe:4:d, killactive" - - # swipe diagonally left and down with 3 fingers - # l (or r) must come before d and u - ", swipe:3:ld, exec, foot" - - # tap with 3 fingers - ", tap:3, exec, foot" - - # longpress can trigger mouse binds: - ", longpress:2, movewindow" - ", longpress:3, resizewindow" - ]; - }; - }; - - gestures = { - workspace_swipe = lib.mkForce true; - workspace_swipe_cancel_ratio = "0.15"; - }; - }; - }; - - services = { - hyprpolkitagent.enable = true; - hyprpaper = { - enable = true; - settings = { - preload = [ "/run/wallpaper.jpg" wallpaper ]; - wallpaper = hyprlandSettings.wallpaper; - splash = false; - }; - }; - - hypridle = { - enable = true; - settings = { - general = { - before_sleep_cmd = "loginctl lock-session"; # lock before suspend. - after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. - ignore_dbus_inhibit = false; - lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. - }; - listener = [ - # { - # timeout = 300; # 5min - # on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. - # on-resume = "brightnessctl -r"; # monitor backlight restore. - # } - { - timeout = settings.lockScreenTimer; - on-timeout = "loginctl lock-session"; # lock screen when timeout has passed - } - { - timeout = settings.screenOffTimer; - on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed - on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. - } - { - timeout = settings.suspendTimer; - on-timeout = "systemctl suspend"; # suspend pc - } - ]; - }; - }; - }; - - programs = { - hyprlock = { - enable = true; - settings = { - background = [ - { - monitor = ""; - path = wallpaper; # supports png, jpg, webp (no animations, though) - color = "rgba(25, 20, 20, 1.0)"; - - # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations - blur_passes = "3"; # 0 disables blurring - blur_size = "7"; - noise = "0.0117"; - contrast = "0.8916"; - brightness = "0.8172"; - vibrancy = "0.1696"; - vibrancy_darkness = "0.0"; - } - ]; - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = hyprlandSettings.primaryDisplay.input; - dots_center = true; - fade_on_empty = true; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - bothlock_color = -1; - outline_thickness = 5; - placeholder_text = ''Password...''; - shadow_passes = 2; - } - ]; - }; - }; - vscode.profiles.default.userSettings."window"."titleBarStyle" = "custom"; - }; - - home = { - sessionVariables = { - BROWSER = "${settings.defaultApps.browser.pname}"; - CLUTTER_BACKEND = "wayland"; - EDITOR = "${settings.defaultApps.editor.pname}"; - VISUAL = "${settings.defaultApps.visual.pname}"; - ICON_THEME = settings.iconTheme; - GTK_CSD = "0"; - GTK_THEME = settings.gtkTheme; - GTK_USE_PORTAL = "1"; - HYPRCURSOR_THEME = settings.cursorTheme; - HYPRCURSOR_SIZE = settings.cursorSize; - MOZ_ENABLE_WAYLAND = "1"; - NIXOS_OZONE_WL = "1"; - NIXOS_XDG_OPEN_USE_PORTAL = "1"; - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_QPA_PLATFORM = "wayland-egl"; - QT_QPA_PLATFORMTHEME = "gtk3"; - QT_SCALE_FACTOR = "1"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - SDL_VIDEODRIVER = "wayland"; - TERMINAL = "${settings.defaultApps.terminal.pname}"; - XCURSOR_THEME = settings.cursorTheme; - XCURSOR_SIZE = settings.cursorSize; - XDG_CACHE_HOME = "\${HOME}/.cache"; - XDG_CONFIG_HOME = "\${HOME}/.config"; - XDG_CURRENT_DESKTOP = "Hyprland"; - XDG_DATA_HOME = "\${HOME}/.local/share"; - XDG_SESSION_DESKTOP = "Hyprland"; - XDG_SESSION_TYPE = "wayland"; - }; - - pointerCursor = { - gtk.enable = true; - package = settings.cursorThemePkg; - name = settings.cursorTheme; - size = settings.cursorSize; - }; - - packages = [ - jiggler - ] ++ settings.requiredPkgs; - }; - - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface".color-scheme = "prefer-dark"; - "org/gnome/desktop/interface".cursor-theme = settings.cursorTheme; - "org/gnome/desktop/interface".gtk-theme = settings.gtkTheme; - "org/gnome/desktop/interface".icon-theme = settings.iconTheme; - }; - }; - - gtk = { - enable = true; - - cursorTheme = { - name = settings.cursorTheme; - package = settings.cursorThemePkg; - }; - - theme = { - name = settings.gtkTheme; - package = settings.gtkThemePkg; - }; - - iconTheme = { - name = settings.iconTheme; - package = settings.iconThemePkg; - }; - - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = true; - }; - - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = true; - }; - - font = { - name = settings.fontName; - package = settings.fontPackage; - size = settings.fontSize; - }; - }; -} diff --git a/modules/nixos/hyprland/specialisation.nix b/modules/nixos/hyprland/specialisation.nix deleted file mode 100755 index 2637740..0000000 --- a/modules/nixos/hyprland/specialisation.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - specialisation.hyprland.configuration = { - imports = [ ./default.nix ]; - environment.etc."specialisation".text = "hyprland"; - }; -} diff --git a/modules/nixos/hyprland/theme.nix b/modules/nixos/hyprland/theme.nix deleted file mode 100644 index 7e27336..0000000 --- a/modules/nixos/hyprland/theme.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - # Nord colors - # Opacity Hex alpha - # 100% FF - # 75% BF - # 50% 80 - # 25% 40 - # 10% 1A - # 0% 00 - nord = { - polarNight = { - nord0 = "#2e3440"; - nord1 = "#3b4252"; - nord2 = "#434c5e"; - nord3 = "#4c566a"; - }; - snowStorm = { - nord4 = "#d8dee9"; - nord5 = "#e5e9f0"; - nord6 = "#eceff4"; - }; - frost = { - nord7 = "#8fbcbb"; - nord8 = "#88c0d0"; - nord9 = "#81a1c1"; - nord10 = "#5e81ac"; - }; - aurora = { - nord11 = "#bf616a"; - nord12 = "#d08770"; - nord13 = "#ebcb8b"; - nord14 = "#a3be8c"; - nord15 = "#b48ead"; - }; - }; - - waybar = { - defaultOpacity = "opacity: 0.85;"; - defaultBorderRadius = "border-radius: 1rem;"; - defaultCenterOptions = '' - padding-top: 0.2rem; - padding-bottom: 0.2rem; - padding-left: 0.5rem; - padding-right: 0.5rem; - margin: 3px 0; - ''; - borderRight = '' - padding-top: 0.2rem; - padding-bottom: 0.2rem; - padding-left: 0.5rem; - padding-right: 0.5rem; - margin: 3px 0; - border-radius: 0rem 1rem 1rem 0rem; - margin-right: 0.5rem; - ''; - borderLeft = '' - padding-top: 0.2rem; - padding-bottom: 0.2rem; - padding-left: 0.5rem; - padding-right: 0.5rem; - margin: 3px 0; - border-radius: 1rem 0rem 0rem 1rem; - margin-left: 0.5rem; - ''; - }; -} \ No newline at end of file diff --git a/hosts/base/base-nogui/nix-settings.nix b/modules/nixos/nix/default.nix similarity index 80% rename from hosts/base/base-nogui/nix-settings.nix rename to modules/nixos/nix/default.nix index f499eef..bd28867 100644 --- a/hosts/base/base-nogui/nix-settings.nix +++ b/modules/nixos/nix/default.nix @@ -1,4 +1,4 @@ -{ lib, outputs, ... }: +{ lib, ... }: { nix = { settings = { @@ -24,15 +24,10 @@ optimise.automatic = lib.mkDefault true; }; - # Nixpkgs configuration nixpkgs = { - # add unstable and stable overlays - overlays = [ - outputs.overlays.nixpkgs-unstable - outputs.overlays.nixpkgs-stable - ]; config = { allowUnfree = lib.mkForce true; + allowUnsupportedSystem = true; permittedInsecurePackages = [ # ... ]; diff --git a/hosts/base/base-gui/programs.nix b/modules/nixos/programs/default.nix similarity index 50% rename from hosts/base/base-gui/programs.nix rename to modules/nixos/programs/default.nix index 7d01242..fab8dfc 100644 --- a/hosts/base/base-gui/programs.nix +++ b/modules/nixos/programs/default.nix @@ -1,6 +1,17 @@ -{ lib, pkgs, ... }: +{ pkgs, lib, ... }: { programs = { + zsh.enable = lib.mkDefault true; + gnupg.agent = { + enable = lib.mkDefault true; + enableSSHSupport = lib.mkDefault true; + }; + nix-index = { + enable = lib.mkDefault true; + enableBashIntegration = lib.mkDefault false; + enableZshIntegration = lib.mkDefault true; + }; + nix-ld = { enable = lib.mkDefault true; libraries = with pkgs; [ @@ -28,4 +39,15 @@ ]; }; seahorse.enable = lib.mkDefault true; - };} \ No newline at end of file + }; + environment = { + systemPackages = with pkgs; [ + attic-client + uutils-coreutils + uutils-diffutils + uutils-findutils + coreutils + nixd + ]; + }; +} \ No newline at end of file diff --git a/hosts/base/base-nogui/security.nix b/modules/nixos/security/default.nix similarity index 100% rename from hosts/base/base-nogui/security.nix rename to modules/nixos/security/default.nix diff --git a/hosts/base/base-nogui/services.nix b/modules/nixos/services/services.nix similarity index 72% rename from hosts/base/base-nogui/services.nix rename to modules/nixos/services/services.nix index c7dbb2d..29c25f1 100644 --- a/hosts/base/base-nogui/services.nix +++ b/modules/nixos/services/services.nix @@ -3,7 +3,7 @@ services = { kmscon = { - enable = lib.mkDefault true; + enable = lib.mkDefault false; hwRender = true; fonts = [ { @@ -31,6 +31,7 @@ avahi = { enable = lib.mkDefault true; nssmdns4 = lib.mkDefault true; # For modern systems, use nssmdns4 instead of nssmdns + openFirewall = lib.mkDefault true; publish = { enable = lib.mkDefault true; addresses = lib.mkDefault true; @@ -38,5 +39,16 @@ workstation = lib.mkDefault true; }; }; + + # configure pipewire + pipewire = { + enable = lib.mkDefault true; + alsa.enable = lib.mkDefault true; + alsa.support32Bit = lib.mkDefault true; + pulse.enable = lib.mkDefault true; + }; + + # Enable CUPS to print documents. + printing.enable = lib.mkDefault true; }; } diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix new file mode 100644 index 0000000..7e71760 --- /dev/null +++ b/modules/nixos/system/default.nix @@ -0,0 +1,13 @@ +{ ... }: +let + timezone = "America/Chicago"; +in +{ + # Time config + time = { + # Set your time zone. + timeZone = timezone; + }; + + system.stateVersion = "23.11"; +} diff --git a/overlays/waybar.nix b/overlays/waybar.nix new file mode 100644 index 0000000..19e3c3d --- /dev/null +++ b/overlays/waybar.nix @@ -0,0 +1,6 @@ +{ ... }: +final: prev: { + waybar = prev.waybar.overrideAttrs (old: { + mesonFlags = (old.mesonFlags or []) ++ [ "-Dexperimental=true" ]; + }); +} diff --git a/packages/magicattr/default.nix b/packages/magicattr/default.nix new file mode 100644 index 0000000..1f539fc --- /dev/null +++ b/packages/magicattr/default.nix @@ -0,0 +1,17 @@ +{ lib, python3Packages, fetchFromGitHub, ... }: + +python3Packages.buildPythonPackage rec { + pname = "magicattr"; + version = "0.1.6"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "frmdstryr"; + repo = pname; + rev = "master"; + sha256 = "sha256-FJtWU5AuunZbdlndGdfD1c9/0s7oRdoTi202pWjuAd8="; + }; + + buildInputs = with python3Packages; [ setuptools ]; + doCheck = false; +} \ No newline at end of file diff --git a/hosts/mac/configuration.nix b/systems/aarch64-darwin/mac/configuration.nix similarity index 100% rename from hosts/mac/configuration.nix rename to systems/aarch64-darwin/mac/configuration.nix diff --git a/hosts/mac/home.nix b/systems/aarch64-darwin/mac/home.nix similarity index 100% rename from hosts/mac/home.nix rename to systems/aarch64-darwin/mac/home.nix diff --git a/hosts/mac/homebrew.nix b/systems/aarch64-darwin/mac/homebrew.nix similarity index 100% rename from hosts/mac/homebrew.nix rename to systems/aarch64-darwin/mac/homebrew.nix diff --git a/hosts/mac/nix.nix b/systems/aarch64-darwin/mac/nix.nix similarity index 100% rename from hosts/mac/nix.nix rename to systems/aarch64-darwin/mac/nix.nix diff --git a/hosts/mac/programs.nix b/systems/aarch64-darwin/mac/programs.nix similarity index 100% rename from hosts/mac/programs.nix rename to systems/aarch64-darwin/mac/programs.nix diff --git a/hosts/mac/system.nix b/systems/aarch64-darwin/mac/system.nix similarity index 100% rename from hosts/mac/system.nix rename to systems/aarch64-darwin/mac/system.nix diff --git a/hosts/mac/trampoline-apps/default.nix b/systems/aarch64-darwin/mac/trampoline-apps/default.nix similarity index 100% rename from hosts/mac/trampoline-apps/default.nix rename to systems/aarch64-darwin/mac/trampoline-apps/default.nix diff --git a/hosts/mac/trampoline-apps/lib-bash/trampoline-apps.sh b/systems/aarch64-darwin/mac/trampoline-apps/lib-bash/trampoline-apps.sh similarity index 100% rename from hosts/mac/trampoline-apps/lib-bash/trampoline-apps.sh rename to systems/aarch64-darwin/mac/trampoline-apps/lib-bash/trampoline-apps.sh diff --git a/hosts/mac-nixos/apple-silicon-support/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/boot-m1n1/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/boot-m1n1/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/boot-m1n1/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/boot-m1n1/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/kernel/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/kernel/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/kernel/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/kernel/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/mesa/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/mesa/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/mesa/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/mesa/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/peripheral-firmware/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/peripheral-firmware/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/peripheral-firmware/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/peripheral-firmware/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/modules/sound/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/sound/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/modules/sound/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/modules/sound/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/alsa-ucm-conf-asahi/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/alsa-ucm-conf-asahi/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/alsa-ucm-conf-asahi/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/alsa-ucm-conf-asahi/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/asahi-audio/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/asahi-audio/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/asahi-audio/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/asahi-audio/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/asahi-fwextract/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/asahi-fwextract/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/asahi-fwextract/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/asahi-fwextract/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/linux-asahi/config b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/linux-asahi/config similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/linux-asahi/config rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/linux-asahi/config diff --git a/hosts/mac-nixos/apple-silicon-support/packages/linux-asahi/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/linux-asahi/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/linux-asahi/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/linux-asahi/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/m1n1/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/m1n1/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/m1n1/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/m1n1/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/default.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/opencl.patch b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/opencl.patch similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/opencl.patch rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/mesa-asahi-edge/opencl.patch diff --git a/hosts/mac-nixos/apple-silicon-support/packages/overlay.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/overlay.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/overlay.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/overlay.nix diff --git a/hosts/mac-nixos/apple-silicon-support/packages/uboot-asahi/default.nix b/systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/uboot-asahi/default.nix similarity index 100% rename from hosts/mac-nixos/apple-silicon-support/packages/uboot-asahi/default.nix rename to systems/aarch64-linux/mac-nixos/apple-silicon-support/packages/uboot-asahi/default.nix diff --git a/hosts/mac-nixos/boot.nix b/systems/aarch64-linux/mac-nixos/boot.nix similarity index 100% rename from hosts/mac-nixos/boot.nix rename to systems/aarch64-linux/mac-nixos/boot.nix diff --git a/hosts/mac-nixos/configuration.nix b/systems/aarch64-linux/mac-nixos/configuration.nix similarity index 100% rename from hosts/mac-nixos/configuration.nix rename to systems/aarch64-linux/mac-nixos/configuration.nix diff --git a/hosts/mac-nixos/firmware/all_firmware.tar.gz b/systems/aarch64-linux/mac-nixos/firmware/all_firmware.tar.gz similarity index 100% rename from hosts/mac-nixos/firmware/all_firmware.tar.gz rename to systems/aarch64-linux/mac-nixos/firmware/all_firmware.tar.gz diff --git a/hosts/mac-nixos/firmware/kernelcache.release.mac14j b/systems/aarch64-linux/mac-nixos/firmware/kernelcache.release.mac14j similarity index 100% rename from hosts/mac-nixos/firmware/kernelcache.release.mac14j rename to systems/aarch64-linux/mac-nixos/firmware/kernelcache.release.mac14j diff --git a/hosts/mac-nixos/hardware-configuration.nix b/systems/aarch64-linux/mac-nixos/hardware-configuration.nix similarity index 100% rename from hosts/mac-nixos/hardware-configuration.nix rename to systems/aarch64-linux/mac-nixos/hardware-configuration.nix diff --git a/hosts/mac-nixos/home.nix b/systems/aarch64-linux/mac-nixos/home.nix similarity index 100% rename from hosts/mac-nixos/home.nix rename to systems/aarch64-linux/mac-nixos/home.nix diff --git a/hosts/mac-nixos/hyprland-settings.nix b/systems/aarch64-linux/mac-nixos/hyprland-settings.nix similarity index 100% rename from hosts/mac-nixos/hyprland-settings.nix rename to systems/aarch64-linux/mac-nixos/hyprland-settings.nix diff --git a/hosts/mac-nixos/networking.nix b/systems/aarch64-linux/mac-nixos/networking.nix similarity index 100% rename from hosts/mac-nixos/networking.nix rename to systems/aarch64-linux/mac-nixos/networking.nix diff --git a/hosts/mac-nixos/omnissa.nix b/systems/aarch64-linux/mac-nixos/omnissa.nix similarity index 100% rename from hosts/mac-nixos/omnissa.nix rename to systems/aarch64-linux/mac-nixos/omnissa.nix diff --git a/hosts/mac-nixos/services.nix b/systems/aarch64-linux/mac-nixos/services.nix similarity index 100% rename from hosts/mac-nixos/services.nix rename to systems/aarch64-linux/mac-nixos/services.nix diff --git a/hosts/mac-nixos/sops.nix b/systems/aarch64-linux/mac-nixos/sops.nix similarity index 100% rename from hosts/mac-nixos/sops.nix rename to systems/aarch64-linux/mac-nixos/sops.nix diff --git a/hosts/pi4/adguard.nix b/systems/aarch64-linux/pi4/adguard.nix similarity index 100% rename from hosts/pi4/adguard.nix rename to systems/aarch64-linux/pi4/adguard.nix diff --git a/hosts/pi4/argononed.nix b/systems/aarch64-linux/pi4/argononed.nix similarity index 100% rename from hosts/pi4/argononed.nix rename to systems/aarch64-linux/pi4/argononed.nix diff --git a/hosts/pi4/boot.nix b/systems/aarch64-linux/pi4/boot.nix similarity index 100% rename from hosts/pi4/boot.nix rename to systems/aarch64-linux/pi4/boot.nix diff --git a/hosts/pi4/configuration.nix b/systems/aarch64-linux/pi4/configuration.nix similarity index 100% rename from hosts/pi4/configuration.nix rename to systems/aarch64-linux/pi4/configuration.nix diff --git a/hosts/pi4/home.nix b/systems/aarch64-linux/pi4/home.nix similarity index 100% rename from hosts/pi4/home.nix rename to systems/aarch64-linux/pi4/home.nix diff --git a/hosts/pi4/impermanence.nix b/systems/aarch64-linux/pi4/impermanence.nix similarity index 100% rename from hosts/pi4/impermanence.nix rename to systems/aarch64-linux/pi4/impermanence.nix diff --git a/hosts/pi4/networking.nix b/systems/aarch64-linux/pi4/networking.nix similarity index 100% rename from hosts/pi4/networking.nix rename to systems/aarch64-linux/pi4/networking.nix diff --git a/hosts/pi4/pi4-hw.nix b/systems/aarch64-linux/pi4/pi4-hw.nix similarity index 100% rename from hosts/pi4/pi4-hw.nix rename to systems/aarch64-linux/pi4/pi4-hw.nix diff --git a/hosts/pi4/pi4-uefi.nix b/systems/aarch64-linux/pi4/pi4-uefi.nix similarity index 100% rename from hosts/pi4/pi4-uefi.nix rename to systems/aarch64-linux/pi4/pi4-uefi.nix diff --git a/hosts/pi4/pkg.nix b/systems/aarch64-linux/pi4/pkg.nix similarity index 100% rename from hosts/pi4/pkg.nix rename to systems/aarch64-linux/pi4/pkg.nix diff --git a/hosts/pi4/sops.nix b/systems/aarch64-linux/pi4/sops.nix similarity index 100% rename from hosts/pi4/sops.nix rename to systems/aarch64-linux/pi4/sops.nix diff --git a/hosts/pi5/boot.nix b/systems/aarch64-linux/pi5/boot.nix similarity index 100% rename from hosts/pi5/boot.nix rename to systems/aarch64-linux/pi5/boot.nix diff --git a/hosts/pi5/configuration.nix b/systems/aarch64-linux/pi5/configuration.nix similarity index 100% rename from hosts/pi5/configuration.nix rename to systems/aarch64-linux/pi5/configuration.nix diff --git a/hosts/pi5/disko.nix b/systems/aarch64-linux/pi5/disko.nix similarity index 100% rename from hosts/pi5/disko.nix rename to systems/aarch64-linux/pi5/disko.nix diff --git a/hosts/pi5/hardware-configuration.nix b/systems/aarch64-linux/pi5/hardware-configuration.nix similarity index 100% rename from hosts/pi5/hardware-configuration.nix rename to systems/aarch64-linux/pi5/hardware-configuration.nix diff --git a/hosts/pi5/home.nix b/systems/aarch64-linux/pi5/home.nix similarity index 100% rename from hosts/pi5/home.nix rename to systems/aarch64-linux/pi5/home.nix diff --git a/hosts/pi5/impermanence.nix b/systems/aarch64-linux/pi5/impermanence.nix similarity index 100% rename from hosts/pi5/impermanence.nix rename to systems/aarch64-linux/pi5/impermanence.nix diff --git a/hosts/pi5/networking.nix b/systems/aarch64-linux/pi5/networking.nix similarity index 100% rename from hosts/pi5/networking.nix rename to systems/aarch64-linux/pi5/networking.nix diff --git a/hosts/pi5/services.nix b/systems/aarch64-linux/pi5/services.nix similarity index 100% rename from hosts/pi5/services.nix rename to systems/aarch64-linux/pi5/services.nix diff --git a/hosts/pi5/sops.nix b/systems/aarch64-linux/pi5/sops.nix similarity index 100% rename from hosts/pi5/sops.nix rename to systems/aarch64-linux/pi5/sops.nix diff --git a/hosts/deck/boot.nix b/systems/x86_64-linux/deck/boot.nix similarity index 100% rename from hosts/deck/boot.nix rename to systems/x86_64-linux/deck/boot.nix diff --git a/hosts/deck/configuration.nix b/systems/x86_64-linux/deck/configuration.nix similarity index 100% rename from hosts/deck/configuration.nix rename to systems/x86_64-linux/deck/configuration.nix diff --git a/hosts/deck/home.nix b/systems/x86_64-linux/deck/home.nix similarity index 100% rename from hosts/deck/home.nix rename to systems/x86_64-linux/deck/home.nix diff --git a/hosts/deck/jovian.nix b/systems/x86_64-linux/deck/jovian.nix similarity index 100% rename from hosts/deck/jovian.nix rename to systems/x86_64-linux/deck/jovian.nix diff --git a/hosts/deck/networking.nix b/systems/x86_64-linux/deck/networking.nix similarity index 100% rename from hosts/deck/networking.nix rename to systems/x86_64-linux/deck/networking.nix diff --git a/hosts/deck/sops.nix b/systems/x86_64-linux/deck/sops.nix similarity index 100% rename from hosts/deck/sops.nix rename to systems/x86_64-linux/deck/sops.nix diff --git a/systems/x86_64-linux/desktop/boot.nix b/systems/x86_64-linux/desktop/boot.nix index d85dc9f..b61978a 100755 --- a/systems/x86_64-linux/desktop/boot.nix +++ b/systems/x86_64-linux/desktop/boot.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, namespace, ... }: let configLimit = 5; # default = "@saved"; @@ -40,16 +40,6 @@ in enable = true; }; - lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - settings = { - # default = default; - console-mode = "max"; - }; - configurationLimit = configLimit; - }; - kernelPackages = kernel; kernelParams = [ diff --git a/systems/x86_64-linux/desktop/configuration.nix b/systems/x86_64-linux/desktop/configuration.nix index 6ee35e8..04f9462 100755 --- a/systems/x86_64-linux/desktop/configuration.nix +++ b/systems/x86_64-linux/desktop/configuration.nix @@ -28,15 +28,15 @@ let # brscan5 ddcui ddcutil - ddccontrol - ddccontrol-db + # ddccontrol + # ddccontrol-db efibootmgr kdePackages.ksvg memtest86-efi memtest86plus os-prober nil - qemu_full + qemu rclone rclone-browser restic @@ -49,8 +49,6 @@ let udisks2 unzip winetricks - - inputs.desktop-lsfg.packages."x86_64-linux".default ]; in { diff --git a/systems/x86_64-linux/desktop/default.nix b/systems/x86_64-linux/desktop/default.nix index bfe7cbc..f7f1ed4 100644 --- a/systems/x86_64-linux/desktop/default.nix +++ b/systems/x86_64-linux/desktop/default.nix @@ -21,16 +21,17 @@ { imports = [ ./boot.nix + ./configuration.nix ./filesystems.nix ./hardware-configuration.nix ./networking.nix ./nix.nix - ./services.nix ./sops.nix ./users.nix - - ({ ... }: { - _module.args.hyprlandSettings = import ./hyprland-settings.nix; - }) ]; + + ${namespace} = { + bootloader.lanzaboote.enable = true; + desktop.gnome.enable = true; + }; } \ No newline at end of file diff --git a/systems/x86_64-linux/desktop/services.nix b/systems/x86_64-linux/desktop/services.nix deleted file mode 100755 index dffc576..0000000 --- a/systems/x86_64-linux/desktop/services.nix +++ /dev/null @@ -1,155 +0,0 @@ -{ config, lib, pkgs, ... }: -let - pkgsVersion = pkgs; #.unstable; -in -{ - services = { - # Enable Flatpak - flatpak.enable = lib.mkDefault false; - - # enable auto discovery of printers - avahi = { - enable = lib.mkDefault true; - nssmdns4 = lib.mkDefault true; - openFirewall = lib.mkDefault true; - }; - - restic.backups = { - jallen-nas = { - initialize = true; - createWrapper = true; - inhibitsSleep = true; - environmentFile = config.sops.templates."restic.env".path; - passwordFile = config.sops.secrets."desktop/restic/password".path; - repositoryFile = config.sops.secrets."desktop/restic/repo".path; - paths = [ - "/home/matt" - ]; - exclude = [ - "/home/matt/Steam" - "/home/matt/Heroic" - "/home/matt/1TB" - "/home/matt/Downloads" - "/home/matt/Nextcloud" - "/home/matt/.cache" - "/home/matt/.local/share/Steam" - "/home/matt/.var/app/com.valvesoftware.Steam" - "/home/matt/.tmp" - "/home/matt/.thumbnails" - "/home/matt/.compose-cache" - ]; - }; - proton-drive = { - initialize = true; - createWrapper = true; - inhibitsSleep = true; - passwordFile = config.sops.secrets."desktop/restic/password".path; - rcloneConfigFile = "/home/matt/.config/rclone/rclone.conf"; - repository = "rclone:proton-drive:backup-nix"; - paths = [ - "/home/matt" - ]; - exclude = [ - "/home/matt/Steam" - "/home/matt/Heroic" - "/home/matt/1TB" - "/home/matt/Downloads" - "/home/matt/Nextcloud" - "/home/matt/.cache" - "/home/matt/.local/share/Steam" - "/home/matt/.var/app/com.valvesoftware.Steam" - "/home/matt/.tmp" - "/home/matt/.thumbnails" - "/home/matt/.compose-cache" - ]; - }; - }; - - btrfs = { - autoScrub.enable = lib.mkDefault true; - autoScrub.fileSystems = lib.mkDefault [ - "/nix" - "/root" - "/etc" - "/var/log" - "/home" - ]; - }; - - ratbagd.enable = lib.mkDefault true; - - keyd = { - enable = false; - keyboards = { - default = { - ids = [ "*" ]; - settings = { - main = { - # Use ⌘ key (leftmeta) to activate macOS-like layer - leftmeta = "layer(meta_mac)"; - }; - - meta_mac = { - # Tab switching - tab = "swapm(app_switch_state, M-tab)"; - "`" = "A-f6"; - - # App shortcuts - c = "C-insert"; # Copy - v = "S-insert"; # Paste - x = "S-delete"; # Cut - - "1" = "A-1"; - "2" = "A-2"; - "3" = "A-3"; - "4" = "A-4"; - "5" = "A-5"; - "6" = "A-6"; - "7" = "A-7"; - "8" = "A-8"; - "9" = "A-9"; - - # Move to line start/end - left = "home"; - right = "end"; - }; - - app_switch_state = { - tab = "M-tab"; - right = "M-tab"; - "`" = "M-S-tab"; - left = "M-S-tab"; - }; - }; - }; - }; - }; - }; - - systemd = { - user.services = { - rclone-home-proton = { - enable = lib.mkDefault false; - path = with pkgsVersion; [ - bash - pkgs.rclone - ]; - script = '' - rclone sync /home/matt proton-drive:backup-nix --exclude '/home/matt/Games/**' --exclude '/home/matt/1TB/**' --exclude '/home/matt/Downloads/**' - ''; - }; - - rsync-home = { - enable = lib.mkDefault false; - path = with pkgsVersion; [ - bash - rsync - openssh - ]; - script = '' - rsync -rtpogvPlHzs --ignore-existing --exclude={'/home/matt/Games', '/home/matt/1TB', '/home/matt/Downloads/*', '/home/matt/.cache'} -e ssh /home/matt admin@10.0.1.3:/media/nas/main/backup/desktop-nix/home - ''; - }; - }; - }; -} diff --git a/systems/x86_64-linux/desktop/services/btrfs/default.nix b/systems/x86_64-linux/desktop/services/btrfs/default.nix new file mode 100644 index 0000000..6790088 --- /dev/null +++ b/systems/x86_64-linux/desktop/services/btrfs/default.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +{ + services.btrfs = { + autoScrub.enable = lib.mkDefault true; + autoScrub.fileSystems = lib.mkDefault [ + "/nix" + "/root" + "/etc" + "/var/log" + "/home" + ]; + }; +} \ No newline at end of file diff --git a/systems/x86_64-linux/desktop/services/keyd/default.nix b/systems/x86_64-linux/desktop/services/keyd/default.nix new file mode 100644 index 0000000..be809d4 --- /dev/null +++ b/systems/x86_64-linux/desktop/services/keyd/default.nix @@ -0,0 +1,49 @@ +{ ... }: +{ + services.keyd = { + enable = false; + keyboards = { + default = { + ids = [ "*" ]; + settings = { + main = { + # Use ⌘ key (leftmeta) to activate macOS-like layer + leftmeta = "layer(meta_mac)"; + }; + + meta_mac = { + # Tab switching + tab = "swapm(app_switch_state, M-tab)"; + "`" = "A-f6"; + + # App shortcuts + c = "C-insert"; # Copy + v = "S-insert"; # Paste + x = "S-delete"; # Cut + + "1" = "A-1"; + "2" = "A-2"; + "3" = "A-3"; + "4" = "A-4"; + "5" = "A-5"; + "6" = "A-6"; + "7" = "A-7"; + "8" = "A-8"; + "9" = "A-9"; + + # Move to line start/end + left = "home"; + right = "end"; + }; + + app_switch_state = { + tab = "M-tab"; + right = "M-tab"; + "`" = "M-S-tab"; + left = "M-S-tab"; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/systems/x86_64-linux/desktop/services/ratbagd/default.nix b/systems/x86_64-linux/desktop/services/ratbagd/default.nix new file mode 100644 index 0000000..c2d53a6 --- /dev/null +++ b/systems/x86_64-linux/desktop/services/ratbagd/default.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + services.ratbagd.enable = lib.mkDefault true; +} \ No newline at end of file diff --git a/systems/x86_64-linux/desktop/services/restic/default.nix b/systems/x86_64-linux/desktop/services/restic/default.nix new file mode 100644 index 0000000..fe7670a --- /dev/null +++ b/systems/x86_64-linux/desktop/services/restic/default.nix @@ -0,0 +1,53 @@ +{ config, ... }: +{ + services.restic.backups = { + jallen-nas = { + initialize = true; + createWrapper = true; + inhibitsSleep = true; + environmentFile = config.sops.templates."restic.env".path; + passwordFile = config.sops.secrets."desktop/restic/password".path; + repositoryFile = config.sops.secrets."desktop/restic/repo".path; + paths = [ + "/home/matt" + ]; + exclude = [ + "/home/matt/Steam" + "/home/matt/Heroic" + "/home/matt/1TB" + "/home/matt/Downloads" + "/home/matt/Nextcloud" + "/home/matt/.cache" + "/home/matt/.local/share/Steam" + "/home/matt/.var/app/com.valvesoftware.Steam" + "/home/matt/.tmp" + "/home/matt/.thumbnails" + "/home/matt/.compose-cache" + ]; + }; + proton-drive = { + initialize = true; + createWrapper = true; + inhibitsSleep = true; + passwordFile = config.sops.secrets."desktop/restic/password".path; + rcloneConfigFile = "/home/matt/.config/rclone/rclone.conf"; + repository = "rclone:proton-drive:backup-nix"; + paths = [ + "/home/matt" + ]; + exclude = [ + "/home/matt/Steam" + "/home/matt/Heroic" + "/home/matt/1TB" + "/home/matt/Downloads" + "/home/matt/Nextcloud" + "/home/matt/.cache" + "/home/matt/.local/share/Steam" + "/home/matt/.var/app/com.valvesoftware.Steam" + "/home/matt/.tmp" + "/home/matt/.thumbnails" + "/home/matt/.compose-cache" + ]; + }; + }; +} \ No newline at end of file diff --git a/systems/x86_64-linux/desktop/sops.nix b/systems/x86_64-linux/desktop/sops.nix index 1e77abe..7b63580 100755 --- a/systems/x86_64-linux/desktop/sops.nix +++ b/systems/x86_64-linux/desktop/sops.nix @@ -18,7 +18,7 @@ in # Either the group id or group name representation of the secret group # It is recommended to get the group name from `config.users.users..group` to avoid misconfiguration sops = { - defaultSopsFile = ../../secrets/desktop-secrets.yaml; + defaultSopsFile = ../../../secrets/desktop-secrets.yaml; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; # ------------------------------ @@ -44,34 +44,34 @@ in mode = "0600"; }; "wifi" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; }; # ------------------------------ # SSH keys # ------------------------------ "ssh-keys-public/desktop-nixos" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; mode = "0644"; owner = config.users.users."${user}".name; group = config.users.users."${user}".group; restartUnits = [ "sshd.service" ]; }; "ssh-keys-private/desktop-nixos" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; mode = "0600"; owner = config.users.users."${user}".name; group = config.users.users."${user}".group; restartUnits = [ "sshd.service" ]; }; "ssh-keys-public/desktop-nixos-root" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/root/.ssh/id_ed25519.pub"; mode = "0600"; restartUnits = [ "sshd.service" ]; }; "ssh-keys-private/desktop-nixos-root" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/root/.ssh/id_ed25519"; mode = "0600"; restartUnits = [ "sshd.service" ]; @@ -81,37 +81,37 @@ in # Secureboot keys # ------------------------------ "secureboot/GUID" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/GUID"; mode = "0600"; }; "secureboot/keys/db-key" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/db/db.key"; mode = "0600"; }; "secureboot/keys/db-pem" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/db/db.pem"; mode = "0600"; }; "secureboot/keys/KEK-key" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/KEK/KEK.key"; mode = "0600"; }; "secureboot/keys/KEK-pem" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/KEK/KEK.pem"; mode = "0600"; }; "secureboot/keys/PK-key" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/PK/PK.key"; mode = "0600"; }; "secureboot/keys/PK-pem" = { - sopsFile = ../../secrets/secrets.yaml; + sopsFile = ../../../secrets/secrets.yaml; path = "/etc/secureboot/keys/PK/PK.pem"; mode = "0600"; }; diff --git a/systems/x86_64-linux/desktop/specialisations/cosmic/default.nix b/systems/x86_64-linux/desktop/specialisations/cosmic/default.nix new file mode 100755 index 0000000..acd13ee --- /dev/null +++ b/systems/x86_64-linux/desktop/specialisations/cosmic/default.nix @@ -0,0 +1,12 @@ +{ namespace, ... }: +{ + specialisation.cosmic.configuration = { + ${namespace} = { + desktop = { + cosmic.enable = true; + gnome.enable = true; + }; + }; + environment.etc."specialisation".text = "cosmic"; + }; +} diff --git a/systems/x86_64-linux/desktop/specialisations/hyprland/default.nix b/systems/x86_64-linux/desktop/specialisations/hyprland/default.nix new file mode 100755 index 0000000..c70de82 --- /dev/null +++ b/systems/x86_64-linux/desktop/specialisations/hyprland/default.nix @@ -0,0 +1,12 @@ +{ namespace, ... }: +{ + specialisation.hyprland.configuration = { + ${namespace} = { + desktop = { + hyprland.enable = true; + gnome.enable = false; + }; + }; + environment.etc."specialisation".text = "hyprland"; + }; +} diff --git a/hosts/nas/apps.nix b/systems/x86_64-linux/nas/apps.nix similarity index 100% rename from hosts/nas/apps.nix rename to systems/x86_64-linux/nas/apps.nix diff --git a/hosts/nas/apps/actual/default.nix b/systems/x86_64-linux/nas/apps/actual/default.nix similarity index 100% rename from hosts/nas/apps/actual/default.nix rename to systems/x86_64-linux/nas/apps/actual/default.nix diff --git a/hosts/nas/apps/actual/options.nix b/systems/x86_64-linux/nas/apps/actual/options.nix similarity index 100% rename from hosts/nas/apps/actual/options.nix rename to systems/x86_64-linux/nas/apps/actual/options.nix diff --git a/hosts/nas/apps/arrs/default.nix b/systems/x86_64-linux/nas/apps/arrs/default.nix similarity index 100% rename from hosts/nas/apps/arrs/default.nix rename to systems/x86_64-linux/nas/apps/arrs/default.nix diff --git a/hosts/nas/apps/arrs/options.nix b/systems/x86_64-linux/nas/apps/arrs/options.nix similarity index 100% rename from hosts/nas/apps/arrs/options.nix rename to systems/x86_64-linux/nas/apps/arrs/options.nix diff --git a/hosts/nas/apps/crowdsec/default.nix b/systems/x86_64-linux/nas/apps/crowdsec/default.nix similarity index 100% rename from hosts/nas/apps/crowdsec/default.nix rename to systems/x86_64-linux/nas/apps/crowdsec/default.nix diff --git a/hosts/nas/apps/crowdsec/options.nix b/systems/x86_64-linux/nas/apps/crowdsec/options.nix similarity index 100% rename from hosts/nas/apps/crowdsec/options.nix rename to systems/x86_64-linux/nas/apps/crowdsec/options.nix diff --git a/hosts/nas/apps/excalidraw/default.nix b/systems/x86_64-linux/nas/apps/excalidraw/default.nix similarity index 100% rename from hosts/nas/apps/excalidraw/default.nix rename to systems/x86_64-linux/nas/apps/excalidraw/default.nix diff --git a/hosts/nas/apps/gitea/default.nix b/systems/x86_64-linux/nas/apps/gitea/default.nix similarity index 100% rename from hosts/nas/apps/gitea/default.nix rename to systems/x86_64-linux/nas/apps/gitea/default.nix diff --git a/hosts/nas/apps/gitea/options.nix b/systems/x86_64-linux/nas/apps/gitea/options.nix similarity index 100% rename from hosts/nas/apps/gitea/options.nix rename to systems/x86_64-linux/nas/apps/gitea/options.nix diff --git a/hosts/nas/apps/immich/default.nix b/systems/x86_64-linux/nas/apps/immich/default.nix similarity index 100% rename from hosts/nas/apps/immich/default.nix rename to systems/x86_64-linux/nas/apps/immich/default.nix diff --git a/hosts/nas/apps/jellyfin/default.nix b/systems/x86_64-linux/nas/apps/jellyfin/default.nix similarity index 100% rename from hosts/nas/apps/jellyfin/default.nix rename to systems/x86_64-linux/nas/apps/jellyfin/default.nix diff --git a/hosts/nas/apps/jellyseerr/default.nix b/systems/x86_64-linux/nas/apps/jellyseerr/default.nix similarity index 100% rename from hosts/nas/apps/jellyseerr/default.nix rename to systems/x86_64-linux/nas/apps/jellyseerr/default.nix diff --git a/hosts/nas/apps/lubelogger/default.nix b/systems/x86_64-linux/nas/apps/lubelogger/default.nix similarity index 100% rename from hosts/nas/apps/lubelogger/default.nix rename to systems/x86_64-linux/nas/apps/lubelogger/default.nix diff --git a/hosts/nas/apps/nextcloud/default.nix b/systems/x86_64-linux/nas/apps/nextcloud/default.nix similarity index 100% rename from hosts/nas/apps/nextcloud/default.nix rename to systems/x86_64-linux/nas/apps/nextcloud/default.nix diff --git a/hosts/nas/apps/ollama/default.nix b/systems/x86_64-linux/nas/apps/ollama/default.nix similarity index 100% rename from hosts/nas/apps/ollama/default.nix rename to systems/x86_64-linux/nas/apps/ollama/default.nix diff --git a/hosts/nas/apps/options.nix b/systems/x86_64-linux/nas/apps/options.nix similarity index 100% rename from hosts/nas/apps/options.nix rename to systems/x86_64-linux/nas/apps/options.nix diff --git a/hosts/nas/apps/orca/default.nix b/systems/x86_64-linux/nas/apps/orca/default.nix similarity index 100% rename from hosts/nas/apps/orca/default.nix rename to systems/x86_64-linux/nas/apps/orca/default.nix diff --git a/hosts/nas/apps/orca/options.nix b/systems/x86_64-linux/nas/apps/orca/options.nix similarity index 100% rename from hosts/nas/apps/orca/options.nix rename to systems/x86_64-linux/nas/apps/orca/options.nix diff --git a/hosts/nas/apps/paperless/default.nix b/systems/x86_64-linux/nas/apps/paperless/default.nix similarity index 100% rename from hosts/nas/apps/paperless/default.nix rename to systems/x86_64-linux/nas/apps/paperless/default.nix diff --git a/hosts/nas/apps/traefik/default.nix b/systems/x86_64-linux/nas/apps/traefik/default.nix similarity index 100% rename from hosts/nas/apps/traefik/default.nix rename to systems/x86_64-linux/nas/apps/traefik/default.nix diff --git a/hosts/nas/apps/wyoming/default.nix b/systems/x86_64-linux/nas/apps/wyoming/default.nix similarity index 100% rename from hosts/nas/apps/wyoming/default.nix rename to systems/x86_64-linux/nas/apps/wyoming/default.nix diff --git a/hosts/nas/boot.nix b/systems/x86_64-linux/nas/boot.nix similarity index 100% rename from hosts/nas/boot.nix rename to systems/x86_64-linux/nas/boot.nix diff --git a/hosts/nas/configuration.nix b/systems/x86_64-linux/nas/configuration.nix similarity index 100% rename from hosts/nas/configuration.nix rename to systems/x86_64-linux/nas/configuration.nix diff --git a/hosts/nas/filesystems.nix b/systems/x86_64-linux/nas/filesystems.nix similarity index 100% rename from hosts/nas/filesystems.nix rename to systems/x86_64-linux/nas/filesystems.nix diff --git a/hosts/nas/grafana.nix b/systems/x86_64-linux/nas/grafana.nix similarity index 100% rename from hosts/nas/grafana.nix rename to systems/x86_64-linux/nas/grafana.nix diff --git a/hosts/nas/hardware-configuration.nix b/systems/x86_64-linux/nas/hardware-configuration.nix similarity index 100% rename from hosts/nas/hardware-configuration.nix rename to systems/x86_64-linux/nas/hardware-configuration.nix diff --git a/hosts/nas/home.nix b/systems/x86_64-linux/nas/home.nix similarity index 100% rename from hosts/nas/home.nix rename to systems/x86_64-linux/nas/home.nix diff --git a/hosts/nas/impermanence.nix b/systems/x86_64-linux/nas/impermanence.nix similarity index 100% rename from hosts/nas/impermanence.nix rename to systems/x86_64-linux/nas/impermanence.nix diff --git a/hosts/nas/networking.nix b/systems/x86_64-linux/nas/networking.nix similarity index 100% rename from hosts/nas/networking.nix rename to systems/x86_64-linux/nas/networking.nix diff --git a/hosts/nas/nix-serve.nix b/systems/x86_64-linux/nas/nix-serve.nix similarity index 100% rename from hosts/nas/nix-serve.nix rename to systems/x86_64-linux/nas/nix-serve.nix diff --git a/hosts/nas/nixpkgs.nix b/systems/x86_64-linux/nas/nixpkgs.nix similarity index 100% rename from hosts/nas/nixpkgs.nix rename to systems/x86_64-linux/nas/nixpkgs.nix diff --git a/hosts/nas/samba.nix b/systems/x86_64-linux/nas/samba.nix similarity index 100% rename from hosts/nas/samba.nix rename to systems/x86_64-linux/nas/samba.nix diff --git a/hosts/nas/sensors.txt b/systems/x86_64-linux/nas/sensors.txt similarity index 100% rename from hosts/nas/sensors.txt rename to systems/x86_64-linux/nas/sensors.txt diff --git a/hosts/nas/services.nix b/systems/x86_64-linux/nas/services.nix similarity index 100% rename from hosts/nas/services.nix rename to systems/x86_64-linux/nas/services.nix diff --git a/hosts/nas/settings.nix b/systems/x86_64-linux/nas/settings.nix similarity index 100% rename from hosts/nas/settings.nix rename to systems/x86_64-linux/nas/settings.nix diff --git a/hosts/nas/sops.nix b/systems/x86_64-linux/nas/sops.nix similarity index 100% rename from hosts/nas/sops.nix rename to systems/x86_64-linux/nas/sops.nix diff --git a/hosts/nas/ups.nix b/systems/x86_64-linux/nas/ups.nix similarity index 100% rename from hosts/nas/ups.nix rename to systems/x86_64-linux/nas/ups.nix diff --git a/hosts/nas/users.nix b/systems/x86_64-linux/nas/users.nix similarity index 100% rename from hosts/nas/users.nix rename to systems/x86_64-linux/nas/users.nix diff --git a/hosts/nuc/boot.nix b/systems/x86_64-linux/nuc/boot.nix similarity index 100% rename from hosts/nuc/boot.nix rename to systems/x86_64-linux/nuc/boot.nix diff --git a/hosts/nuc/configuration.nix b/systems/x86_64-linux/nuc/configuration.nix similarity index 100% rename from hosts/nuc/configuration.nix rename to systems/x86_64-linux/nuc/configuration.nix diff --git a/hosts/nuc/home.nix b/systems/x86_64-linux/nuc/home.nix similarity index 100% rename from hosts/nuc/home.nix rename to systems/x86_64-linux/nuc/home.nix diff --git a/hosts/nuc/impermanence.nix b/systems/x86_64-linux/nuc/impermanence.nix similarity index 100% rename from hosts/nuc/impermanence.nix rename to systems/x86_64-linux/nuc/impermanence.nix diff --git a/hosts/nuc/networking.nix b/systems/x86_64-linux/nuc/networking.nix similarity index 100% rename from hosts/nuc/networking.nix rename to systems/x86_64-linux/nuc/networking.nix diff --git a/hosts/nuc/sops.nix b/systems/x86_64-linux/nuc/sops.nix similarity index 100% rename from hosts/nuc/sops.nix rename to systems/x86_64-linux/nuc/sops.nix diff --git a/hosts/nuc/users.nix b/systems/x86_64-linux/nuc/users.nix similarity index 100% rename from hosts/nuc/users.nix rename to systems/x86_64-linux/nuc/users.nix diff --git a/templates/checks/pre-commit-hooks/default.nix b/templates/checks/pre-commit-hooks/default.nix new file mode 100644 index 0000000..e653756 --- /dev/null +++ b/templates/checks/pre-commit-hooks/default.nix @@ -0,0 +1,49 @@ +{ + inputs, + lib, + namespace, + pkgs, + ... +}: +let + inherit (inputs) pre-commit-hooks-nix; +in +pre-commit-hooks-nix.lib.${pkgs.system}.run { + src = ./.; + hooks = + let + excludes = [ + "flake.lock" + "*.md" + ]; + fail_fast = true; + verbose = true; + in + { + deadnix = { + enable = true; + + settings = { + edit = true; + }; + }; + + nixfmt = { + enable = true; + package = pkgs.nixfmt-rfc-style; + }; + + pre-commit-hook-ensure-sops.enable = true; + + prettier = { + enable = true; + inherit excludes fail_fast verbose; + + description = "pre-commit hook for prettier"; + settings = { + binPath = "${lib.getExe pkgs.prettierd}"; + write = true; + }; + }; + }; +} \ No newline at end of file