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,
config,
pkgs,
...
}:
let
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.marleyos.programs.fish;
in
{
in {
options.marleyos.programs.fish.enable = mkEnableOption "fish";
config = mkIf cfg.enable {
@ -19,6 +16,6 @@ in
useBabelfish = true;
};
environment.shells = [ pkgs.fish ];
environment.shells = [config.programs.fish.package];
};
}

View file

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

View file

@ -3,16 +3,12 @@
config,
pkgs,
...
}:
let
inherit (lib) mkEnableOption mkIf getExe;
}: let
cfg = config.marleyos.programs.pidgin;
in
{
options.marleyos.programs.pidgin.enable = mkEnableOption "pidgin";
in {
options.marleyos.programs.pidgin.enable = lib.mkEnableOption "pidgin";
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
programs.pidgin = {
enable = true;
@ -27,9 +23,14 @@ in
".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,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
@ -12,7 +11,7 @@ in {
config = mkIf cfg.enable {
marleyos.apps.launcher = {
package = pkgs.wofi;
inherit (config.programs.wofi) package;
command = "--show drun";
};

View file

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

View file

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

View file

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