-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(modules)!: auto import modules & improve passing of arguments (
#60)
- Loading branch information
Showing
9 changed files
with
55 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,4 @@ | ||
{ inputs, ... }@flakeArgs: { lib, pkgs, ... }@systemArgs: | ||
let | ||
extendedLib = import ../lib/mkExtLib.nix inputs.nixpkgs.lib (flakeArgs // systemArgs); | ||
inherit (extendedLib) ctp; | ||
in | ||
{ lib, pkgs, ... }@args: | ||
{ | ||
imports = | ||
let | ||
files = [ | ||
./alacritty.nix | ||
./bat.nix | ||
./bottom.nix | ||
./btop.nix | ||
./fish.nix | ||
./kitty.nix | ||
./lazygit.nix | ||
./starship.nix | ||
./helix.nix | ||
./hyprland.nix | ||
./glamour.nix | ||
./gtk.nix | ||
./mako.nix | ||
./neovim.nix | ||
./micro.nix | ||
./polybar.nix | ||
./sway.nix | ||
./tmux.nix | ||
./zathura.nix | ||
]; | ||
in | ||
extendedLib.ctp.mapModules extendedLib files; | ||
|
||
options.catppuccin = { | ||
flavour = lib.mkOption { | ||
type = ctp.types.flavourOption; | ||
default = "latte"; | ||
description = "Global Catppuccin flavour"; | ||
}; | ||
accent = lib.mkOption { | ||
type = ctp.types.accentOption; | ||
default = "teal"; | ||
description = "Global Catppuccin accent"; | ||
}; | ||
}; | ||
imports = import ../lib/mkImports.nix args ./.; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ lib, ... }: { | ||
options.catppuccin = { | ||
flavour = lib.mkOption { | ||
type = lib.ctp.types.flavourOption; | ||
default = "latte"; | ||
description = "Global Catppuccin flavour"; | ||
}; | ||
|
||
accent = lib.mkOption { | ||
type = lib.ctp.types.accentOption; | ||
default = "teal"; | ||
description = "Global Catppuccin accent"; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
, pkgs | ||
, lib | ||
, sources | ||
, ... | ||
}: | ||
let | ||
cfg = config.programs.zathura.catppuccin; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# this imports all files in a directory (besides default.nix) | ||
# with our modified arguments | ||
{ lib, pkgs, ... }@args: | ||
dir: | ||
let | ||
generated = pkgs.callPackage ../../_sources/generated.nix { }; | ||
in | ||
lib.pipe dir [ | ||
builtins.readDir | ||
builtins.attrNames | ||
|
||
(builtins.filter ( | ||
n: !(builtins.elem n [ "default.nix" ]) | ||
)) | ||
|
||
(map ( | ||
f: _: import "${dir}/${f}" (args // { | ||
sources = builtins.mapAttrs (_: p: p.src) generated; | ||
lib = lib.extend (_: _: { ctp = import ./. args; }); | ||
}) | ||
)) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,4 @@ | ||
{ inputs, ... }@flakeArgs: { lib, pkgs, ... }@systemArgs: | ||
let | ||
extendedLib = import ../lib/mkExtLib.nix inputs.nixpkgs.lib (systemArgs // flakeArgs); | ||
in | ||
{ lib, pkgs, ... }@args: | ||
{ | ||
imports = | ||
let | ||
files = [ | ||
./grub.nix | ||
]; | ||
in | ||
extendedLib.ctp.mapModules extendedLib files; | ||
|
||
|
||
options.catppuccin = with extendedLib; { | ||
flavour = mkOption { | ||
type = ctp.types.flavourOption; | ||
default = "latte"; | ||
description = "Global Catppuccin flavour"; | ||
}; | ||
}; | ||
imports = import ../lib/mkImports.nix args ./.; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ lib, ... }: { | ||
options.catppuccin = { | ||
flavour = lib.mkOption { | ||
type = lib.ctp.types.flavourOption; | ||
default = "latte"; | ||
description = "Global Catppuccin flavour"; | ||
}; | ||
}; | ||
} |