Converted swaylock to a home module
This commit is contained in:
		
							parent
							
								
									6cf34c66c8
								
							
						
					
					
						commit
						dae4076857
					
				
					 5 changed files with 30 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -19,6 +19,7 @@
 | 
			
		|||
      gpg.enable = true;
 | 
			
		||||
      kitty.enable = true;
 | 
			
		||||
      rofi.enable = true;
 | 
			
		||||
      swaylock.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    tools = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										24
									
								
								modules/home/programs/swaylock/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								modules/home/programs/swaylock/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  namespace,
 | 
			
		||||
  ...
 | 
			
		||||
}: let
 | 
			
		||||
  inherit (lib) mkEnableOption mkIf;
 | 
			
		||||
 | 
			
		||||
  cfg = config.${namespace}.programs.swaylock;
 | 
			
		||||
in {
 | 
			
		||||
  options.${namespace}.programs.swaylock = {
 | 
			
		||||
    enable = mkEnableOption "swaylock";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    programs.swaylock = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      settings = {
 | 
			
		||||
        # TODO: Set wallpaper
 | 
			
		||||
        # image = "${config.xdg.dataHome}/${config.${namespace}.desktop.sway.wallpaperPath}";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,29 +0,0 @@
 | 
			
		|||
{
 | 
			
		||||
  options,
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
with lib; let
 | 
			
		||||
  cfg = config.aa.desktop.addons.swaylock;
 | 
			
		||||
  user_cfg = config.home-manager.users.${config.aa.user.name};
 | 
			
		||||
in {
 | 
			
		||||
  options.aa.desktop.addons.swaylock = with types; {
 | 
			
		||||
    enable = mkEnableOption "swaylock";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    environment.systemPackages = with pkgs; [swaylock];
 | 
			
		||||
 | 
			
		||||
    aa.home.extraOptions = {
 | 
			
		||||
      programs.swaylock.settings = {
 | 
			
		||||
        image = "${user_cfg.xdg.dataHome}/${config.aa.desktop.sway.wallpaperPath}";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    # Workaround for https://github.com/NixOS/nixpkgs/issues/158025
 | 
			
		||||
    # This comment specifically: https://github.com/NixOS/nixpkgs/issues/158025#issuecomment-1344766809
 | 
			
		||||
    security.pam.services.swaylock = {};
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,6 @@ in {
 | 
			
		|||
      gammastep.enable = true;
 | 
			
		||||
      playerctl.enable = true;
 | 
			
		||||
      swayidle.enable = true;
 | 
			
		||||
      swaylock.enable = true;
 | 
			
		||||
 | 
			
		||||
      # TODO
 | 
			
		||||
      # light
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,5 +17,10 @@ in {
 | 
			
		|||
        sway.enable = true;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    # The following fixes an issue with using swaylcock as a home module
 | 
			
		||||
    # Workaround for https://github.com/NixOS/nixpkgs/issues/158025
 | 
			
		||||
    # This comment specifically: https://github.com/NixOS/nixpkgs/issues/158025#issuecomment-1344766809
 | 
			
		||||
    security.pam.services.swaylock = {};
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue