From 678d0e8959cf7adbc3825d578595e82305573991 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Tue, 21 May 2024 20:17:12 +0300 Subject: [PATCH] nix/hm-module: remove --- flake.nix | 2 +- nix/hm-module.nix | 102 ---------------------------------------------- 2 files changed, 1 insertion(+), 103 deletions(-) delete mode 100644 nix/hm-module.nix diff --git a/flake.nix b/flake.nix index c0984bf..50e0dc9 100644 --- a/flake.nix +++ b/flake.nix @@ -50,7 +50,7 @@ homeManagerModules = { default = self.homeManagerModules.hyprpaper; - hyprpaper = import ./nix/hm-module.nix self; + hyprpaper = builtins.throw "hyprpaper: the flake HM module has been removed. Use the module from Home Manager upstream."; }; formatter = eachSystem (system: pkgsFor.${system}.alejandra); diff --git a/nix/hm-module.nix b/nix/hm-module.nix deleted file mode 100644 index 500ff11..0000000 --- a/nix/hm-module.nix +++ /dev/null @@ -1,102 +0,0 @@ -self: { - config, - pkgs, - lib, - ... -}: let - inherit (builtins) toString; - inherit (lib.types) bool float listOf package str; - inherit (lib.modules) mkIf; - inherit (lib.options) mkOption mkEnableOption; - inherit (lib.meta) getExe; - - boolToString = x: - if x - then "true" - else "false"; - cfg = config.services.hyprpaper; -in { - options.services.hyprpaper = { - enable = mkEnableOption "Hyprpaper, Hyprland's wallpaper utility"; - - package = mkOption { - description = "The hyprpaper package"; - type = package; - default = self.packages.${pkgs.stdenv.hostPlatform.system}.hyprpaper; - }; - - ipc = mkOption { - description = "Whether to enable IPC"; - type = bool; - default = true; - }; - - splash = mkOption { - description = "Enable rendering of the hyprland splash over the wallpaper"; - type = bool; - default = false; - }; - - splash_offset = mkOption { - description = "How far (in % of height) up should the splash be displayed"; - type = float; - default = 2.0; - }; - - preloads = mkOption { - description = "List of paths to images that will be loaded into memory."; - type = listOf str; - example = [ - "~/Images/wallpapers/forest.png" - "~/Images/wallpapers/desert.png" - ]; - }; - - wallpapers = mkOption { - description = "The wallpapers"; - type = listOf str; - example = [ - "eDP-1,~/Images/wallpapers/forest.png" - "DP-7,~/Images/wallpapers/desert.png" - ]; - }; - }; - - config = mkIf cfg.enable { - xdg.configFile."hypr/hyprpaper.conf".text = '' - ipc = ${ - if cfg.ipc - then "on" - else "off" - } - splash = ${boolToString cfg.splash} - splash_offset = ${toString cfg.splash_offset} - - ${ - builtins.concatStringsSep "\n" - ( - map (preload: "preload = ${preload}") cfg.preloads - ) - } - ${ - builtins.concatStringsSep "\n" - ( - map (wallpaper: "wallpaper = ${wallpaper}") cfg.wallpapers - ) - } - ''; - - systemd.user.services.hyprpaper = { - Unit = { - Description = "Hyprland wallpaper daemon"; - PartOf = ["graphical-session.target"]; - }; - - Service = { - ExecStart = "${getExe cfg.package}"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; - }; -}