From 4c9adeb9afc19159e38fe17cafcd7c5555e06e0c Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Sat, 3 Oct 2026 20:29:17 -0500 Subject: [PATCH] hyprland in homemanager + cleanup --- flake.nix | 15 +++++++++++---- hosts/apollo/default.nix | 11 +---------- hosts/apollo/hyprland.nix | 19 +++++++++++++++++++ modules/home/default.nix | 14 ++++---------- modules/home/nyxerinys/default.nix | 11 ++++++++--- modules/home/nyxerinys/linux/default.nix | 6 ++++++ modules/home/nyxerinys/linux/hyprland.nix | 11 +++++++++++ modules/home/nyxerinys/mac/default.nix | 5 +++++ 8 files changed, 65 insertions(+), 27 deletions(-) create mode 100644 hosts/apollo/hyprland.nix create mode 100644 modules/home/nyxerinys/linux/default.nix create mode 100644 modules/home/nyxerinys/linux/hyprland.nix create mode 100644 modules/home/nyxerinys/mac/default.nix diff --git a/flake.nix b/flake.nix index 26b865c..d576a60 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "Nyx's Nix/Nixos configs"; inputs = { + # Nix main stuff nixpkgs = { url = "github:nixos/nixpkgs/nixos-26.05"; }; nur = { url = "github:nix-community/NUR"; @@ -11,6 +12,8 @@ url = "github:nix-darwin/nix-darwin/nix-darwin-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # Macos stuff nix-homebrew = { url = "github:zhaofengli/nix-homebrew"; }; @@ -26,18 +29,22 @@ url = "github:Sikarugir-App/homebrew-sikarugir"; flake = false; }; + + # Misc home-manager = { url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; steam-config-nix = { url = "github:different-name/steam-config-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # secrets + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; secrets ={ url = "git+ssh://git@git.nyxerinys.dev:222/nyxerinys/nix-secrets"; flake = false; diff --git a/hosts/apollo/default.nix b/hosts/apollo/default.nix index 5e86269..d1931f5 100644 --- a/hosts/apollo/default.nix +++ b/hosts/apollo/default.nix @@ -6,19 +6,10 @@ ./hardware.nix ./autologin.nix ./steam.nix + ./hyprland.nix ]; networking.hostName = "apollo"; networking.hostId = "40ced703"; networking.networkmanager.insertNameservers = [ "10.5.0.1" "1.1.1.1" ]; - - programs.hyprland = { - enable = true; - withUWSM = true; - xwayland.enable = true; - }; - - environment.systemPackages = with pkgs; [ - kitty - ]; } \ No newline at end of file diff --git a/hosts/apollo/hyprland.nix b/hosts/apollo/hyprland.nix new file mode 100644 index 0000000..87cbb58 --- /dev/null +++ b/hosts/apollo/hyprland.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: + +{ + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + + programs.hyprland = { + enable = true; + withUWSM = true; + xwayland.enable = true; + }; + + environment.systemPackages = with pkgs; [ + kitty + ]; +} \ No newline at end of file diff --git a/modules/home/default.nix b/modules/home/default.nix index 3eebe3f..f38d21a 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -3,18 +3,12 @@ with lib; let cfg = config.nyxs-nix.services.home; in { - imports = [ - inputs.home-manager.darwinModules.home-manager - ]; + imports = if pkgs.stdenv.pkgs.stdenv.isLinux + then [ inputs.home-manager.nixosModules.home-manager ] + else [ inputs.home-manager.darwinModules.home-manager ]; options.nyxs-nix.services.home = with types; { - enable = mkEnableOption "Enable the vrrp quotes service"; - - isMacOS = mkOption { - type = bool; - default = false; - description = "is this device running on macos"; - }; + enable = mkEnableOption "Enable Home Manager"; }; config = mkIf cfg.enable { diff --git a/modules/home/nyxerinys/default.nix b/modules/home/nyxerinys/default.nix index 5f4a93c..536f3b4 100644 --- a/modules/home/nyxerinys/default.nix +++ b/modules/home/nyxerinys/default.nix @@ -1,15 +1,20 @@ { config, pkgs, lib, osConfig, ... }: { + imports = if pkgs.stdenv.pkgs.stdenv.isLinux + then [ ./linux ] + else [ ./mac ]; + + # Home Manager needs a bit of information about you and the # paths it should manage. home = { username = "nyxerinys"; homeDirectory = ( - if osConfig.nyxs-nix.services.home.isMacOS then - "/Users/nyxerinys" - else + if pkgs.stdenv.isLinux then "/home/nyxerinys" + else + "/Users/nyxerinys" ); packages = with pkgs; [ prismlauncher diff --git a/modules/home/nyxerinys/linux/default.nix b/modules/home/nyxerinys/linux/default.nix new file mode 100644 index 0000000..335ade8 --- /dev/null +++ b/modules/home/nyxerinys/linux/default.nix @@ -0,0 +1,6 @@ +{ osConfig, lib, ... }: + +{ + imports = [] + ++ lib.optionals osConfig.programs.hyprland.enable osConfig.programs [ ./hyprland.nix ]; +} \ No newline at end of file diff --git a/modules/home/nyxerinys/linux/hyprland.nix b/modules/home/nyxerinys/linux/hyprland.nix new file mode 100644 index 0000000..9e54dea --- /dev/null +++ b/modules/home/nyxerinys/linux/hyprland.nix @@ -0,0 +1,11 @@ +{ inputs, ... }: + +{ + wayland.windowManager.hyprland = { + enable = true; + # set the Hyprland and XDPH packages to null to use the ones from the NixOS module + package = null; + portalPackage = null; + systemd.variables = ["--all"]; + }; +} \ No newline at end of file diff --git a/modules/home/nyxerinys/mac/default.nix b/modules/home/nyxerinys/mac/default.nix new file mode 100644 index 0000000..1ea63d5 --- /dev/null +++ b/modules/home/nyxerinys/mac/default.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + +} \ No newline at end of file