refactor: pkgs.<program> -> config.programs.<program>.package

This commit is contained in:
punkfairie 2025-01-12 13:34:02 -08:00
parent 5d72a546ab
commit f5ce6d6493
No known key found for this signature in database
GPG key ID: B3C5488E9A1A7CA6
7 changed files with 26 additions and 32 deletions

View file

@ -1,15 +1,12 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: }: let
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.marleyos.programs.fish; cfg = config.marleyos.programs.fish;
in in {
{
options.marleyos.programs.fish.enable = mkEnableOption "fish"; options.marleyos.programs.fish.enable = mkEnableOption "fish";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -19,6 +16,6 @@ in
useBabelfish = true; useBabelfish = true;
}; };
environment.shells = [ pkgs.fish ]; environment.shells = [config.programs.fish.package];
}; };
} }

View file

@ -27,13 +27,13 @@ in {
terminal = lib.mkOption { terminal = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = pkgs.wezterm; default = config.programs.wezterm.package;
description = "The terminal emulator to use."; description = "The terminal emulator to use.";
}; };
browser = lib.mkOption { browser = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = pkgs.floorp; default = config.programs.floorp.package;
description = "The browser to use."; description = "The browser to use.";
}; };
@ -44,8 +44,8 @@ in {
type = lib.types.package; type = lib.types.package;
default = default =
if config.marleyos.wayland.hyprland.enable if config.marleyos.wayland.hyprland.enable
then pkgs.wofi then config.programs.wofi.package
else pkgs.rofi; else config.programs.rofi.package;
description = "The launcher to use."; description = "The launcher to use.";
}; };
command = lib.mkOption { command = lib.mkOption {

View file

@ -3,16 +3,12 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
inherit (lib) mkEnableOption mkIf getExe;
cfg = config.marleyos.programs.pidgin; cfg = config.marleyos.programs.pidgin;
in in {
{ options.marleyos.programs.pidgin.enable = lib.mkEnableOption "pidgin";
options.marleyos.programs.pidgin.enable = mkEnableOption "pidgin";
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.pidgin = { programs.pidgin = {
enable = true; enable = true;
@ -27,9 +23,14 @@ in
".purple/themes/hearty".source = ./hearty; ".purple/themes/hearty".source = ./hearty;
}; };
xsession.initExtra = # sh xsession.initExtra =
# sh
'' ''
${getExe pkgs.pidgin} & ${lib.getExe config.programs.pidgin.package} &
''; '';
wayland.windowManager.hyprland.settings.exec-once = [
(lib.getExe config.programs.pidgin.package)
];
}; };
} }

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
@ -12,7 +11,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
marleyos.apps.launcher = { marleyos.apps.launcher = {
package = pkgs.wofi; inherit (config.programs.wofi) package;
command = "--show drun"; command = "--show drun";
}; };

View file

@ -123,7 +123,7 @@ in {
then wsPerMonitor + 1 then wsPerMonitor + 1
else 2; else 2;
in [ in [
(lib.getExe pkgs.waybar) (lib.getExe config.programs.waybar.package)
"[workspace 1 silent] $terminal" "[workspace 1 silent] $terminal"
"[workspace ${toString browserWs} silent] $browser" "[workspace ${toString browserWs} silent] $browser"
]; ];

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
@ -16,6 +15,6 @@ in {
useBabelfish = true; useBabelfish = true;
}; };
users.defaultUserShell = pkgs.fish; users.defaultUserShell = config.programs.fish.package;
}; };
} }

View file

@ -1,12 +1,10 @@
{ {
lib, lib,
pkgs, config,
... ...
}: }: let
let
inherit (lib.marleyos) enabled; inherit (lib.marleyos) enabled;
in in {
{
networking = { networking = {
computerName = "mairley"; computerName = "mairley";
hostName = "mairley"; hostName = "mairley";
@ -24,12 +22,12 @@ in
}; };
users = { users = {
knownUsers = [ "marley" ]; knownUsers = ["marley"];
users."marley" = { users."marley" = {
# This is required for some reason. # This is required for some reason.
uid = 501; uid = 501;
shell = pkgs.fish; shell = config.programs.fish.package;
}; };
}; };