From abc725a22d86b0d226589ca86a0f1b0ca42eb42a Mon Sep 17 00:00:00 2001 From: wayne <...> Date: Mon, 14 Oct 2024 16:37:56 -0700 Subject: [PATCH] Second Build - Full Boat --- configuration.nix | 1 + flake.nix | 6 ----- hm/home.nix | 5 ++-- hm/wayland.nix | 62 +++++++++++++++++++++++++++++++++++++++----- hm/xdg.nix | 45 ++++++++++---------------------- modules/security.nix | 34 ++++++++++++------------ modules/wm.nix | 8 +----- modules/xdg.nix | 18 +++++++++++++ 8 files changed, 108 insertions(+), 71 deletions(-) create mode 100644 modules/xdg.nix diff --git a/configuration.nix b/configuration.nix index 7da815c..cf771a6 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,6 +18,7 @@ in ./modules/security.nix ./modules/users.nix ./modules/wm.nix + ./modules/xdg.nix ]; programs.hyprland = { diff --git a/flake.nix b/flake.nix index 5352dfe..e27af70 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,6 @@ # GnuCobal.url="/home/wayne/Flakes/derivations/GnuCobal/"; - # pentablet-flake.url = "/home/wayne/Flakes/derivations/xpen/"; # Replace with actual path or Git URL # kmonad = { # url = "git+https://github.com/kmonad/kmonad?submodules=1&dir=nix"; @@ -72,11 +71,7 @@ dotfilesDir = "~/.dotfiles"; term = "tmux"; font = "JetBrainsMono Nerd Font"; - # fontPkg = pkgs.nerdfonts; editor = "lvim"; # Default editor; - spawnEditor = if ((userSettings.editor == "vim") || (userSettings.editor == "nvim") || (userSettings.editor == "lvim") || (userSettings.editor == "nano")) - then "exec " + userSettings.term + " -e " + userSettings.editor - else userSettings.editor; }; forAllSystems = nixpkgs.lib.genAttrs systems; in { @@ -89,7 +84,6 @@ modules = [ # kmonad.nixosModules.default ./configuration.nix - # pentablet-flake.nixosModules.pentablet ]; }; }; diff --git a/hm/home.nix b/hm/home.nix index 2ab4b88..8bd47d6 100644 --- a/hm/home.nix +++ b/hm/home.nix @@ -26,8 +26,8 @@ let nixUpdate="nix-env -u \\'*\\'"; updateChannel="nix-channel --update nixos"; nixOptimize="nix-store --optimise"; - mkhome="cd ~/Flakes && home-manager switch --flake ."; - buildsys="cd ~/Flakes && sudo nixos-rebuild switch --flake '.#'"; + mkhome="cd ~/system && home-manager switch --flake ."; + buildsys="cd ~/system && sudo nixos-rebuild switch --flake '.#'"; # Zoxide # cd="z"; @@ -212,7 +212,6 @@ in home.sessionVariables = { EDITOR = userSettings.editor; - SPAWNEDITOR = userSettings.spawnEditor; TERM = userSettings.term; }; diff --git a/hm/wayland.nix b/hm/wayland.nix index bb93178..18cf064 100644 --- a/hm/wayland.nix +++ b/hm/wayland.nix @@ -1,17 +1,65 @@ -{ ... }: +{ pkgs, ... }: { # wayland.windowManager.hyprland.enable = true; wayland.windowManager = { hyprland = { + enable = true; + systemd ={ enable = true; -# # systemd ={ -# # enable = true; -# # enableXdgAutostart = true; -# # variables = [ "--all" ]; -# # }; -# package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + enableXdgAutostart = true; + variables = [ "--all" ]; + }; + package = pkgs.hyprland; xwayland.enable = true; }; }; + # systemd.user.services.keybase-kwallet = { + # # Move the description inside `Unit` to make it more explicit + # Unit = { + # Description = "Keybase startup after kwallet is open"; + # After = [ "graphical-session.target" ]; + # }; + + # # Define how the service should behave + # Service = { + # ExecStart = '' + # while ! dbus-send --session --type=method_call --dest=org.kde.KWallet /KWallet org.kde.KWallet.isOpen; do + # sleep 2 + # done + # # Run Keybase and other related services + # keybase unlock --no-prompt || keybase login + # kbfsfuse & + # keybase-gui & + # ''; + # Restart = "on-failure"; + # }; + + # # Make the service start on login + # Install = { + # WantedBy = [ "default.target" ]; + # }; + # }; + # systemd.user.services.input-remapper = { + # Unit = { + # description = "Custom Input Remapper Service"; + # }; + + # serviceConfig = { + # ExecStart = "${pkgs.input-remapper}/bin/input-remapper-control --config-dir /home/wayne/.config/input-remapper-2/ --device 'Hanvon Ugee Shortcut Remote' --preset 'Browsers' && ${pkgs.input-remapper}/bin/input-remapper-control --config-dir /home/wayne/.config/input-remapper-2/ --device 'MX MCHNCL Keyboard' --preset 'Layer_1' && ${pkgs.input-remapper}/bin/input-remapper-control --config-dir /home/wayne/.config/input-remapper-2/ --device 'SINO WEALTH Bluetooth Keyboard' --preset 'Layer_1'"; + # Restart = "on-failure"; + # }; + + # Install = { + # wantedBy = [ "graphical.target" ]; + # }; + # }; + + # home.file.".config/hypr/autostart-input-remapper.sh" = { + # text = '' + # #!/bin/sh + # sudo ${pkgs.input-remapper}/bin/input-remapper-service -d + # ''; + # executable = true; + # }; } \ No newline at end of file diff --git a/hm/xdg.nix b/hm/xdg.nix index a105c04..16252d3 100644 --- a/hm/xdg.nix +++ b/hm/xdg.nix @@ -1,35 +1,18 @@ { config, pkgs, ... }: { - # xdg = { - # enable = true; - # userDirs = { - # enable = true; -# createDirectories = true; -# documents = "${config.home.homeDirectory}/Documents"; -# music = "${config.home.homeDirectory}/Music"; -# videos = "${config.home.homeDirectory}/Videos"; -# desktop = "${config.home.homeDirectory}/Desktop"; -# download = "${config.home.homeDirectory}/Downloads"; -# pictures = "${config.home.homeDirectory}/Pictures"; -# templates = "${config.home.homeDirectory}/Templates"; -# publicShare = "${config.home.homeDirectory}/Public"; + xdg = { + enable = true; + # userDirs = { + # enable = true; + # createDirectories = false; + # documents = "${config.home.homeDirectory}/Documents"; + # music = "${config.home.homeDirectory}/Music"; + # videos = "${config.home.homeDirectory}/Videos"; + # desktop = "${config.home.homeDirectory}/Desktop"; + # download = "${config.home.homeDirectory}/Downloads"; + # pictures = "${config.home.homeDirectory}/Pictures"; + # templates = "${config.home.homeDirectory}/Templates"; + # publicShare = "${config.home.homeDirectory}/Public"; # }; -# mimeApps.enable = true; -# portal = { -# enable = true; -# configPackages = [ pkgs.xdg-desktop-portal-hyprland ]; -# extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.kdePackages.xdg-desktop-portal-kde ]; -# xdgOpenUsePortal = true; -# # wlr.enable = true; -# }; -# configHome = "~/.config"; -# dataHome = "~/.local/share"; -# stateHome = "~/.local/state"; -# cacheHome = "~/.cache"; - -# systemDirs = { -# config = [ "/etc/xdg" ]; -# data = [ "/usr/share" "/usr/local/share" ]; -# }; - # }; + }; } \ No newline at end of file diff --git a/modules/security.nix b/modules/security.nix index a891347..c136942 100644 --- a/modules/security.nix +++ b/modules/security.nix @@ -44,23 +44,23 @@ ''; }; - # security.pam.services = { -# login.enableKwallet = false; -# login.kwallet = { -# enable = true; -# package = pkgs.plasma5Packages.kwallet-pam; -# }; - # sddm = { - # enableKwallet = true; - # text = '' - # # Enable pam_kwallet5 for sddm - # auth optional pam_kwallet5.so - # session optional pam_kwallet5.so auto_start - # ''; - # }; - # }; -# security.pam.services.wayne.kwallet.enable = true; -# security.pam.services.wayne.kwallet.package = pkgs.plasma5Packages.kwallet-pam; + security.pam.services = { + login.enableKwallet = true; + login.kwallet = { + enable = true; + package = pkgs.plasma5Packages.kwallet-pam; + }; + sddm = { + enableKwallet = true; + text = '' + # Enable pam_kwallet5 for sddm + auth optional pam_kwallet5.so + session optional pam_kwallet5.so auto_start + ''; + }; + }; + security.pam.services.wayne.kwallet.enable = true; + security.pam.services.wayne.kwallet.package = pkgs.plasma5Packages.kwallet-pam; security.rtkit.enable = true; diff --git a/modules/wm.nix b/modules/wm.nix index 3393273..b2d4214 100644 --- a/modules/wm.nix +++ b/modules/wm.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { services.desktopManager.plasma6.enable = false; @@ -25,10 +25,4 @@ enable = true; }; }; - - # xdg.portal = { - # enable = false; - # xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - # extraPortals = [ inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland pkgs.kdePackages.xdg-desktop-portal-kde ]; - # }; } \ No newline at end of file diff --git a/modules/xdg.nix b/modules/xdg.nix new file mode 100644 index 0000000..131d06e --- /dev/null +++ b/modules/xdg.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + xdg = { + autostart.enable = true; + portal = { + enable = true; + configPackages = [ pkgs.xdg-desktop-portal-hyprland ]; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-wlr ]; + xdgOpenUsePortal = true; + wlr.enable = true; + }; +# systemDirs = { +# config = [ "/etc/xdg" ]; +# data = [ "/usr/share" "/usr/local/share" ]; +# }; + }; +} \ No newline at end of file