From 0b9973653d741b4763465e3233dc205c03990db9 Mon Sep 17 00:00:00 2001 From: joy Date: Tue, 8 Oct 2024 14:47:39 +0200 Subject: [PATCH] mhm --- flake.nix | 1 - hosts/desktop/default.nix | 4 ++- modules/apps/norm/misc/default.nix | 2 -- modules/default.nix | 3 ++- modules/games/default.nix | 3 +-- modules/games/mics/default.nix | 9 ------- modules/games/norisk/default.nix | 40 +++++++++++++++++------------ modules/games/steam/default.nix | 29 +++++++++++++++------ modules/games/suyu/default.nix | 38 +++++++++++++++++---------- modules/system/xdg/default.nix | 5 ---- modules/wm/theme/stylix/default.nix | 8 ++++-- 11 files changed, 80 insertions(+), 62 deletions(-) delete mode 100644 modules/games/mics/default.nix diff --git a/flake.nix b/flake.nix index d2a8313..2666c80 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,5 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index a828883..709cc96 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -2,10 +2,12 @@ networking.hostName = "desktop"; openrgb.enable = true; + steam.enable = true; + suyu.enable = true; + norisk.enbale = true; imports = [ ./hardware.nix ../../modules - ../../modules/games ]; } diff --git a/modules/apps/norm/misc/default.nix b/modules/apps/norm/misc/default.nix index c00acaf..6abaa68 100644 --- a/modules/apps/norm/misc/default.nix +++ b/modules/apps/norm/misc/default.nix @@ -1,10 +1,8 @@ {pkgs, ...}: { environment.systemPackages = with pkgs; [ - uget keepassxc vesktop signal-desktop - upscayl bottles boxbuddy waydroid diff --git a/modules/default.nix b/modules/default.nix index 8d33567..cc9d1d3 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,8 @@ { imports = [ - ./apps ./wm + ./apps + ./games ./hardware ./services ./system diff --git a/modules/games/default.nix b/modules/games/default.nix index db54346..d7d7466 100644 --- a/modules/games/default.nix +++ b/modules/games/default.nix @@ -1,8 +1,7 @@ { imports = [ ./suyu - ./steam ./norisk - ./mics + ./steam ]; } diff --git a/modules/games/mics/default.nix b/modules/games/mics/default.nix deleted file mode 100644 index b22d050..0000000 --- a/modules/games/mics/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - prismlauncher - zulu17 - dolphin-emu - mangohud - lutris-free - ]; -} diff --git a/modules/games/norisk/default.nix b/modules/games/norisk/default.nix index 4d42ccf..2bf8541 100644 --- a/modules/games/norisk/default.nix +++ b/modules/games/norisk/default.nix @@ -1,5 +1,6 @@ { lib, + config, pkgs, ... }: let @@ -16,26 +17,31 @@ }; }; }; - backgroundUrl = "https://raw.githubusercontent.com/NoRiskClient/noriskclient-launcher/refs/heads/main/src/images/norisk_logo.png"; - backgroundSha256 = "sha256-VwWwShUrT055mcabS8QTqqb8INgRB/08U2qEEIVYHlg="; + logourl = "https://raw.githubusercontent.com/NoRiskClient/noriskclient-launcher/refs/heads/main/src/images/norisk_logo.png"; + logsha256 = "sha256-VwWwShUrT055mcabS8QTqqb8INgRB/08U2qEEIVYHlg="; in { - environment.systemPackages = [ - customPkgs.noriskclient - ]; + options = { + norisk.enable = lib.mkEnableOption ""; + }; + config = lib.mkIf config.norisk.enable { + environment.systemPackages = [ + customPkgs.noriskclient + ]; - home-manager.users.joy.xdg = { - desktopEntries = { - NoRiskClient = { - name = "NoRisk Client"; - exec = "noriskclient"; - icon = pkgs.fetchurl { - url = backgroundUrl; - sha256 = backgroundSha256; + home-manager.users.joy.xdg = { + desktopEntries = { + NoRiskClient = { + name = "NoRisk Client"; + exec = "noriskclient"; + icon = pkgs.fetchurl { + url = logourl; + sha256 = logsha256; + }; + terminal = false; + type = "Application"; + categories = ["Game"]; + mimeType = ["text/plain"]; }; - terminal = false; - type = "Application"; - categories = ["Game"]; - mimeType = ["text/plain"]; }; }; }; diff --git a/modules/games/steam/default.nix b/modules/games/steam/default.nix index 5a191a7..4d83d01 100644 --- a/modules/games/steam/default.nix +++ b/modules/games/steam/default.nix @@ -1,10 +1,23 @@ -{lib, ...}: { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "steam-original" - "steam" - "steam-run" +{ + lib, + pkgs, + config, + ... +}: { + options = { + steam.enable = lib.mkEnableOption ""; + }; + config = lib.mkIf config.norisk.enable { + programs.steam.enable = true; + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "steam-original" + "steam" + "steam-run" + ]; + environment.systemPackages = with pkgs; [ + mangohud + lutris-free ]; - programs.steam.enable = true; - services.joycond.enable = true; + }; } diff --git a/modules/games/suyu/default.nix b/modules/games/suyu/default.nix index 76936da..a6a49ad 100644 --- a/modules/games/suyu/default.nix +++ b/modules/games/suyu/default.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: let +{ + pkgs, + lib, + config, + ... +}: let customPkgs = pkgs // { @@ -13,20 +18,25 @@ }; }; in { - environment.systemPackages = [ - customPkgs.suyu - ]; + options = { + suyu.enable = lib.mkEnableOption ""; + }; + config = lib.mkIf config.suyu.enable { + environment.systemPackages = [ + customPkgs.suyu + ]; - home-manager.users.joy.xdg = { - desktopEntries = { - suyu = { - name = "Suyu"; - exec = "suyu"; - icon = "suyu"; - terminal = false; - type = "Application"; - categories = ["Game" "Emulator"]; - mimeType = ["text/plain"]; + home-manager.users.joy.xdg = { + desktopEntries = { + suyu = { + name = "Suyu"; + exec = "suyu"; + icon = "suyu"; + terminal = false; + type = "Application"; + categories = ["Game" "Emulator"]; + mimeType = ["text/plain"]; + }; }; }; }; diff --git a/modules/system/xdg/default.nix b/modules/system/xdg/default.nix index 53b4304..22ed0a1 100644 --- a/modules/system/xdg/default.nix +++ b/modules/system/xdg/default.nix @@ -19,10 +19,5 @@ "video/*" = ["mpv.desktop"]; }; }; - userDirs = { - enable = true; - desktop = "~/media/pic/screen"; - download = "~/dl"; - }; }; } diff --git a/modules/wm/theme/stylix/default.nix b/modules/wm/theme/stylix/default.nix index 9512e6a..c34fe06 100644 --- a/modules/wm/theme/stylix/default.nix +++ b/modules/wm/theme/stylix/default.nix @@ -1,8 +1,12 @@ -{pkgs,inputs, ...}: let +{ + pkgs, + inputs, + ... +}: let backgroundUrl = "https://wallpapers.joygnu.org/wallpapers/anime/ghibli-japanese-walled-garden.png"; backgroundSha256 = "sha256-10Lv25V0RG0mnw/O90DeVchCNWJbdktUADtuI+enEwM="; in { - imports = [inputs.stylix.nixosModules.stylix ]; + imports = [inputs.stylix.nixosModules.stylix]; stylix = { enable = true;