refactor(nixos): Use new helpers; formatting
Some checks are pending
CI / Format Nix files (push) Waiting to run
CI / Test Modules (push) Waiting to run
CI / Validate sources (push) Waiting to run
Release / Make release (push) Waiting to run
Release / Publish to Flake registries (push) Blocked by required conditions
Build & deploy website / Build site (push) Waiting to run
Build & deploy website / Deploy website (push) Blocked by required conditions

This commit is contained in:
punkfairie 2024-11-04 20:56:04 -08:00
parent ebc1dbcd69
commit f26b1be83f
Signed by: punkfairie
GPG key ID: 01823C057725C266
4 changed files with 24 additions and 15 deletions

View file

@ -2,15 +2,17 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (config.rose-pine) sources; inherit (config.rose-pine) sources;
cfg = config.console.rose-pine; cfg = config.console.rose-pine;
enable = cfg.enable && config.console.enable; enable = cfg.enable && config.console.enable;
palette = (lib.importJSON "${sources.rose-pine-palette}/palette.json").${cfg.flavor}.colors; palette = (lib.importJSON "${sources.rose-pine-palette}/palette.json").${cfg.flavor}.colors;
in { in
options.console.rose-pine = lib.rp.mkRosePineOpt {name = "console";}; {
options.console.rose-pine = lib.rp.mkRosePineOpt { name = "console"; };
config.console.colors = lib.mkIf enable ( config.console.colors = lib.mkIf enable (
# Manually populate with colors from rose-pine/linux-tty # Manually populate with colors from rose-pine/linux-tty

View file

@ -1,6 +1,7 @@
{lib, ...}: { { lib, ... }:
{
config = { config = {
assertions = [(lib.rp.assertMinimumVersion "24.05")]; assertions = [ (lib.rp.assertMinimumVersion "24.05") ];
}; };
options.rose-pine = { options.rose-pine = {
@ -18,9 +19,10 @@
description = "Global Rosé Pine accent"; description = "Global Rosé Pine accent";
}; };
sources = let sources =
defaultSources = import ../../.sources; let
in defaultSources = import ../../.sources;
in
lib.mkOption { lib.mkOption {
type = lib.types.lazyAttrsOf lib.types.raw; type = lib.types.lazyAttrsOf lib.types.raw;
default = defaultSources; default = defaultSources;

View file

@ -2,13 +2,15 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (config.rose-pine) sources; inherit (config.rose-pine) sources;
cfg = config.boot.loader.grub.rose-pine; cfg = config.boot.loader.grub.rose-pine;
enable = cfg.enable && config.boot.loader.grub.enable; enable = cfg.enable && config.boot.loader.grub.enable;
in { in
options.boot.loader.grub.rose-pine = lib.rp.mkRosePineOpt {name = "grub";}; {
options.boot.loader.grub.rose-pine = lib.rp.mkRosePineOpt { name = "grub"; };
config.boot.loader.grub = lib.mkIf enable { config.boot.loader.grub = lib.mkIf enable {
theme = sources.grub; theme = sources.grub;

View file

@ -3,18 +3,21 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
inherit (config.rose-pine) sources; inherit (config.rose-pine) sources;
cfg = config.services.displayManager.sddm.rose-pine; cfg = config.services.displayManager.sddm.rose-pine;
enable = cfg.enable && config.services.displayManager.sddm.enable; enable = cfg.enable && config.services.displayManager.sddm.enable;
in { in
options.services.displayManager.sddm.rose-pine = lib.rp.mkRosePineOpt {name = "sddm";}; {
options.services.displayManager.sddm.rose-pine = lib.rp.mkRosePineOpt { name = "sddm"; };
config = lib.mkIf enable { config = lib.mkIf enable {
services.displayManager.sddm.theme = "rose-pine"; services.displayManager.sddm.theme = "rose-pine";
environment.systemPackages = [ environment.systemPackages = [
(pkgs.callPackage ./sddm-rose-pine-pkg.nix {inherit sources;}) (pkgs.callPackage ./sddm-rose-pine-pkg.nix { inherit sources; })
]; ];
}; };
} }