Skip to content

Commit

Permalink
feat(pops/haumea): update flops and use mkModulePath instead
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Nov 26, 2023
1 parent cb22a71 commit 51504c6
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 38 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions local/lock/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions local/lock/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@

navi-tldr-pages.url = "github:denisidoro/navi-tldr-pages";
navi-tldr-pages.flake = false;

catppuccin-foliate.url = "github:catppuccin/foliate";
catppuccin-foliate.flake = false;
};
outputs = _: { };
}
7 changes: 5 additions & 2 deletions src/pops/homeModules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
inputs,
lib,
haumea,
super,
}:
(flops.haumea.pops.default.setInit {
((flops.haumea.pops.default.setInit {
src = projectDir + "/units/nixos/homeModules";
type = "nixosModules";
inputs = root.lib.loaderInputs;
}).addExporters
}).addLoadExtender
{ load.inputs.inputs = super.flake.inputs; }
).addExporters
[
(POP.extendPop flops.haumea.pops.exporter (
self: _super: {
Expand Down
4 changes: 2 additions & 2 deletions tests/nixos/__fixture/pops/nixosModules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ in
]
)
{
config.boot.contents = update [ 0 ] [
config.contents = update [ 0 ] [
{
content = {
loader.timeout.content = 10;
boot.loader.timeout.content = 10;
# loader.efi.canTouchEfiVariables = false;
};
}
Expand Down
1 change: 1 addition & 0 deletions tests/nixos/expr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ in
(extraHomeModule [
out.outputs.homeProfiles.customProfiles.presets.hyprland.default
out.outputs.homeProfiles.default.presets.firefox
out.outputs.homeProfiles.default.presets.foliate
])
]).config.home-manager.users.admin;
}
42 changes: 25 additions & 17 deletions units/nixos/darwinModules/homebrew/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ let
])
);
brews = lib.subtractLists cfg.__profiles__.brews.removePackagesFromProfiles (
lib.optionals cfg.__profiles__.emacs [ "emacs-plus@29" ]
++ (lib.optionals cfg.__profiles__.fonts [
lib.optionals cfg.__profiles__.enableEmacs [ "emacs-plus@29" ]
++ (lib.optionals cfg.__profiles__.enableFonts [
"fontconfig"
"rxvt-unicode"
])
Expand Down Expand Up @@ -78,20 +78,28 @@ in
config =
with lib;
mkMerge [
{ inherit casks brews; }
(mkIf cfg.__profiles__.default {
taps = [
"homebrew/bundle"
"homebrew/core"
];
})
(mkIf (cfg.casks != [ ]) {
taps = [
"homebrew/cask"
"homebrew/cask-versions"
];
})
(mkIf cfg.__profiles__.fonts { taps = [ "homebrew/cask-fonts" ]; })
(mkIf cfg.__profiles__.emacs { taps = [ "d12frosted/emacs-plus" ]; })
(mkModulePath { inherit casks brews; })
(mkIf cfg.__profiles__.default (
mkModulePath {
taps = [
"homebrew/bundle"
"homebrew/core"
];
}
))
(mkIf (cfg.casks != [ ]) (
mkModulePath {
taps = [
"homebrew/cask"
"homebrew/cask-versions"
];
}
))
(mkIf cfg.__profiles__.fonts (
mkModulePath { taps = [ "homebrew/cask-fonts" ]; }
))
(mkIf cfg.__profiles__.emacs (
mkModulePath { taps = [ "d12frosted/emacs-plus" ]; }
))
];
}
31 changes: 31 additions & 0 deletions units/nixos/homeModules/_common/themes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ lib, inputs }:
with lib; {
themes = mkOption {
default = { };
type = types.attrsOf (
types.submodule (
{
config,
options,
name,
...
}:
{
options = {
enable = mkEnableOption (
lib.mdDoc "Whether to enable ${name}-catppuccin theme"
);
src = mkOption {
type = types.str;
default = "";
description = "The package to use for ${name}-catppuccin theme";
};
};
config = mkMerge [
(mkIf (hasAttr name inputs) { src = inputs.${name}.outPath or inputs.${name}; })
];
}
)
);
};
}
6 changes: 2 additions & 4 deletions units/nixos/homeModules/programs/alacritty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ in
};
config = mkMerge [
(mkIf (cfg.enable && pkgs.stdenv.isLinux) {
programs.alacritty = {
settings = {
key_bindings = mkIf cfg.CSIuSupport CSIuKeyBindings;
};
settings = {
key_bindings = mkIf cfg.CSIuSupport CSIuKeyBindings;
};
})
];
Expand Down
2 changes: 1 addition & 1 deletion units/nixos/homeModules/programs/bat.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2023 The omnibus Authors
#
# SPDX-License-Identifier: MIT
# SPDX-License-Identifier: MIT'

{
config =
Expand Down
29 changes: 29 additions & 0 deletions units/nixos/homeModules/programs/foliate/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
loadSrc,
cfg,
inputs,
config,
}:
with lib; {
options = {
enable = mkEnableOption (lib.mdDoc "Whether to enable foliate");
__profiles__ = {
themes =
(import (loadSrc + "/_common/themes.nix") { inherit lib inputs; }).themes;
};
};
config = mkMerge [
(mkIf cfg.enable { home.packages = [ pkgs.foliate ]; })
(mkIf
(
hasAttr "catppuccin-foliate" cfg.__profiles__.themes
&& cfg.__profiles__.themes.catppuccin-foliate.enable
)
{
xdg.configFile."com.github.johnfactotum.Foliate/themes.json".source =
cfg.__profiles__.themes.catppuccin-foliate.src + "/themes.json";
}
)
];
}
4 changes: 2 additions & 2 deletions units/nixos/homeModules/programs/navi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
config =
with lib;
mkMerge [
{
(mkModulePath {
settings = {
cheats = {
paths = config.programs.navi.__profiles__.navi-tldr-pages.paths;
};
};
}
})
];
}
11 changes: 11 additions & 0 deletions units/nixos/homeProfiles/presets/foliate.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
imports = [ omnibus.homeModules.programs.foliate ];
programs.foliate = {
enable = true;
__profiles__.themes = {
catppuccin-foliate = {
enable = true;
};
};
};
}
16 changes: 9 additions & 7 deletions units/nixos/nixosModules/boot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ with lib; {
];

config = mkMerge [
(mkIf cfg.__profiles__.systemd-boot.enable {
loader = {
timeout = mkIf cfg.__profiles__.speedup 0;
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
})
(mkIf cfg.__profiles__.systemd-boot.enable (
mkModulePath {
loader = {
timeout = mkIf cfg.__profiles__.speedup 0;
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
}
))
];

# config.loader.timeout = 1;
Expand Down

0 comments on commit 51504c6

Please sign in to comment.