move options to separate modules, set up mkDocs generation
Build docs with nix and Material for mkDocs / build-docs (push) Successful in 1m33s
Build docs with nix and Material for mkDocs / build-docs (push) Successful in 1m33s
This commit is contained in:
33 files changed
+385
-276
No files matched your search
@@ -0,0 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.audio = { ... }: {
|
||||
imports = [ self.homeModules.audioOptions ];
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.gaming = { pkgs, config, lib, ... }: {
|
||||
flake.nixosModules.gaming = { ... }: {
|
||||
imports = [ self.nixosModules.gamingOptions ];
|
||||
|
||||
hardware.steam-hardware.enable = true;
|
||||
};
|
||||
|
||||
flake.homeModules.gaming = { ... }: {
|
||||
imports = [ self.homeModules.gamingOptions ];
|
||||
};
|
||||
}
|
||||
@@ -1,85 +1,52 @@
|
||||
{ inputs, self, ... }: let
|
||||
wm-option-type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers");
|
||||
shell-option-type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells");
|
||||
in {
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.components = {
|
||||
displayManager = lib.mkOption {
|
||||
# enum that dynamically populates itself with the contents of the display-managers directory
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/display-managers";
|
||||
default = "lightdm";
|
||||
};
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, ... }: {
|
||||
imports = [ self.nixosModules.graphicsOptions ];
|
||||
|
||||
windowManagers = lib.mkOption {
|
||||
type = wm-option-type;
|
||||
default = [];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
wayland-utils
|
||||
mesa-demos
|
||||
vulkan-tools
|
||||
];
|
||||
|
||||
shells = lib.mkOption {
|
||||
type = shell-option-type;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
wayland-utils
|
||||
mesa-demos
|
||||
vulkan-tools
|
||||
];
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
iosevka-comfy.comfy
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
};
|
||||
fonts.packages = with pkgs; [
|
||||
iosevka-comfy.comfy
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.components = {
|
||||
windowManagers = lib.mkOption {
|
||||
type = wm-option-type;
|
||||
default = [];
|
||||
};
|
||||
flake.homeModules.graphics = { config, pkgs, ... }: {
|
||||
imports = [ self.homeModules.graphicsOptions ];
|
||||
|
||||
shells = lib.mkOption {
|
||||
type = shell-option-type;
|
||||
default = [];
|
||||
home.packages = with pkgs; [
|
||||
bibata-cursors
|
||||
x264
|
||||
gparted
|
||||
vlc
|
||||
iosevka-comfy.comfy
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = with pkgs; [
|
||||
bibata-cursors
|
||||
x264
|
||||
gparted
|
||||
vlc
|
||||
iosevka-comfy.comfy
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 22;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
};
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
gtk = {
|
||||
enable = true;
|
||||
colorScheme = "dark";
|
||||
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 22;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
colorScheme = "dark";
|
||||
|
||||
gtk2.configLocation = "${config.xdg.configHome}/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config
|
||||
gtk2.force = true;
|
||||
};
|
||||
gtk2.configLocation = "${config.xdg.configHome}/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config
|
||||
gtk2.force = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{ inputs, self, ... }: let
|
||||
mkDocsDerivation = { pkgs, doBuild ? true }: let
|
||||
inherit (pkgs) lib stdenv mkdocs python314Packages;
|
||||
|
||||
mkOptionsDocFromModule = commandName: module: let
|
||||
eval = lib.evalModules {
|
||||
modules = [ module ];
|
||||
args = { inherit pkgs; };
|
||||
};
|
||||
|
||||
optionsDoc = pkgs.nixosOptionsDoc {
|
||||
inherit (eval) options;
|
||||
};
|
||||
in pkgs.runCommand commandName {} ''
|
||||
cat ${optionsDoc.optionsCommonMark} >> $out
|
||||
'';
|
||||
|
||||
indexMd = let
|
||||
rawText = ''
|
||||
## Hello world
|
||||
Welcome to the site!
|
||||
'';
|
||||
in pkgs.runCommand "index.md" {} ''
|
||||
echo "${rawText}" >> $out
|
||||
'';
|
||||
|
||||
nixosOptionsMd = mkOptionsDocFromModule "nixos-options.md" self.nixosModules.options;
|
||||
homeOptionsMd = mkOptionsDocFromModule "home-options.md" self.homeModules.options;
|
||||
|
||||
mkDocsConfig = ''
|
||||
site_name: greyweather's nix flake options
|
||||
nav:
|
||||
- Home: 'index.md'
|
||||
- Options:
|
||||
- NixOS: 'nixos-options.md'
|
||||
- Home Manager: 'home-options.md'
|
||||
theme: material
|
||||
'';
|
||||
|
||||
mkDocsYml = pkgs.runCommand "mkdocs.yml" {} ''
|
||||
echo "${mkDocsConfig}" >> $out
|
||||
'';
|
||||
in stdenv.mkDerivation {
|
||||
src = self;
|
||||
name = if doBuild then "docs" else "docs-md";
|
||||
buildInput = [
|
||||
mkDocsYml
|
||||
indexMd
|
||||
nixosOptionsMd
|
||||
homeOptionsMd
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
mkdocs
|
||||
python314Packages.mkdocs-material
|
||||
python314Packages.pygments
|
||||
];
|
||||
buildPhase = ''
|
||||
mkdir docs-build
|
||||
cd docs-build
|
||||
ln -s ${mkDocsYml} "./mkdocs.yml"
|
||||
mkdir docs
|
||||
ln -s ${indexMd} "./docs/index.md"
|
||||
ln -s ${nixosOptionsMd} "./docs/nixos-options.md"
|
||||
ln -s ${homeOptionsMd} "./docs/home-options.md"
|
||||
# generate the site
|
||||
${if doBuild then "mkdocs build" else ""}
|
||||
'';
|
||||
installPhase = if doBuild then ''
|
||||
mv site $out
|
||||
'' else ''
|
||||
cp -r . $out
|
||||
'';
|
||||
};
|
||||
in {
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.docs = mkDocsDerivation { inherit pkgs; };
|
||||
packages.docs-md = mkDocsDerivation { inherit pkgs; doBuild = false; };
|
||||
};
|
||||
}
|
||||
@@ -30,8 +30,6 @@
|
||||
};
|
||||
in {
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.color-converter.enable = lib.mkEnableOption "color-converter";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.color-converter.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.cli.color-converter.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -40,8 +38,6 @@ in {
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.cli.color-converter.enable = lib.mkEnableOption "color-converter";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.color-converter.enable) {
|
||||
home.packages = [ (pkgs.callPackage color-converter-package {}) ];
|
||||
};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.cli.fastfetch.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -10,8 +8,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({
|
||||
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
|
||||
programs.fastfetch.enable = true;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
};
|
||||
in {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.cli.nh.enable = lib.mkEnableOption "nh";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.nh.enable) {
|
||||
programs.nh = mkNhAttrs config.info.rootPath;
|
||||
|
||||
@@ -22,8 +20,6 @@ in {
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.cli.nh.enable = lib.mkEnableOption "nh";
|
||||
|
||||
config = lib.mkIf (config.features.applications.cli.nh.enable && config.info.isStandalone) {
|
||||
programs.nh = mkNhAttrs config.info.rootPath;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, lib, config, ...}: {
|
||||
options.features.applications.gui.equibop = {
|
||||
enable = lib.mkEnableOption "equibop";
|
||||
autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.equibop = lib.mkDefault config.features.applications.gui.equibop;
|
||||
} {
|
||||
@@ -16,14 +8,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.gui.equibop = {
|
||||
enable = lib.mkEnableOption "equibop";
|
||||
autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.equibop.enable) {
|
||||
programs.equibop.enable = true;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.floorp.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -10,8 +8,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
||||
let
|
||||
firefox-addons = with pkgs; inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
|
||||
@@ -65,11 +65,6 @@
|
||||
};
|
||||
in {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.fluxer.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -86,11 +81,6 @@ in {
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
config = let
|
||||
in lib.mkIf (config.features.applications.gui.kitty.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.kitty.enable = lib.mkDefault true;
|
||||
@@ -11,8 +9,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.kitty.enable) {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nautilus
|
||||
@@ -24,8 +22,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
||||
home.packages = lib.mkIf (config.info.isStandalone) [ pkgs.nautilus ];
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.remmina.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.remmina.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -13,8 +11,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.remmina.enable) {
|
||||
home.packages = with pkgs; [
|
||||
remmina
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: let
|
||||
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes);
|
||||
in {
|
||||
options.features.applications.gui.spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify = {
|
||||
enable = lib.mkEnableOption "spicetify";
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.nullOr (theme-option-type);
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.spotify.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.spotify = {
|
||||
enable = lib.mkDefault true;
|
||||
@@ -26,19 +14,7 @@
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: let
|
||||
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes);
|
||||
in {
|
||||
options.features.applications.gui.spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify = {
|
||||
enable = lib.mkEnableOption "spicetify";
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.nullOr (theme-option-type);
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
inputs.spicetify.homeManagerModules.default
|
||||
];
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
} {
|
||||
@@ -10,8 +8,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.gaming = { pkgs, config, lib, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.hardware.steam-controller.enable) {
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
features.hardware.steam-controller.enable = lib.mkDefault true;
|
||||
@@ -14,12 +8,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.gaming = { pkgs, config, lib, inputs, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
|
||||
config = let
|
||||
pkgsCross = import inputs.nixpkgs {
|
||||
localSystem = "x86_64-linux";
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
options.features.nixos.home-manager.enable = lib.mkEnableOption "home-manager";
|
||||
|
||||
config.home-manager = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
inputs.stylix.nixosModules.stylix
|
||||
];
|
||||
|
||||
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
|
||||
config = lib.mkIf (config.features.nixos.stylix.enable) {
|
||||
stylix.enable = true;
|
||||
stylix.image = builtins.path { path = "${self}/modules/hosts/${config.info.hostName}/wallpaper.jpg"; };
|
||||
@@ -18,8 +16,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
|
||||
config = lib.mkIf (config.features.nixos.stylix.enable) {
|
||||
stylix.targets = lib.mkIf (config.features.applications.gui.floorp.enable) {
|
||||
floorp.profileNames = [ "default" ];
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.audio = { pkgs, config, lib, ...}: {
|
||||
options.features.services.easyeffects.enable = lib.mkEnableOption "easyeffects";
|
||||
|
||||
config = lib.mkIf (config.features.services.easyeffects.enable) {
|
||||
services.easyeffects.enable = true;
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { config, pkgs, lib, ... }: {
|
||||
options.features.shells.defaultShell = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/features/shells";
|
||||
default = "zsh";
|
||||
};
|
||||
programs.${config.features.shells.defaultShell}.enable = true;
|
||||
|
||||
config = {
|
||||
programs.${config.features.shells.defaultShell}.enable = true;
|
||||
users.defaultUserShell = pkgs.${config.features.shells.defaultShell};
|
||||
users.users."grey".shell = pkgs.${config.features.shells.defaultShell};
|
||||
|
||||
users.defaultUserShell = pkgs.${config.features.shells.defaultShell};
|
||||
users.users."grey".shell = pkgs.${config.features.shells.defaultShell};
|
||||
};
|
||||
features.shells.${config.features.shells.defaultShell}.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { config, pkgs, lib, ... }: {
|
||||
options.features.shells.zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.shells.zsh.enable) {
|
||||
programs.zsh.enable = true;
|
||||
|
||||
@@ -16,11 +11,6 @@
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.features.shells.zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.shells.zsh.enable) {
|
||||
home.shell.enableZshIntegration = true;
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
{ inputs, self, ...}: {
|
||||
{ inputs, self, ... }: {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
];
|
||||
|
||||
flake.flakeModules = {
|
||||
docs-entry-point = inputs.import-tree "${self}/modules";
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.global = { lib, config, pkgs, ... }: {
|
||||
imports = [ self.homeModules.globalOptions ];
|
||||
|
||||
nix.gc = lib.mkIf (!config.features.applications.cli.nh.enable) {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
imports = [ self.nixosModules.globalOptions ];
|
||||
|
||||
system.stateVersion = config.info.stateVersion;
|
||||
|
||||
nix = {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
components.bootLoader = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/boot-loaders";
|
||||
default = "grub";
|
||||
};
|
||||
|
||||
features.applications.extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
isStandalone = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
features.applications = {
|
||||
shellScripts = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.str);
|
||||
default = {};
|
||||
};
|
||||
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.audioOptions = { lib, ...}: {
|
||||
options.features.services.easyeffects.enable = lib.mkEnableOption "easyeffects";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.gamingOptions = { lib, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.gamingOptions = { lib, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
{ inputs, self, ... }: let
|
||||
mkSharedGlobalOptions = { lib }: {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to tell the config the global path to the flake's root directory, in order to perform impure actions (in a Nix sense, not morally impure, I promise).";
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to tell the config the hostname of the current machine, mostly for symlinking the right dotfiles.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to set the stateVersion value.";
|
||||
example = "26.11";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
features = {
|
||||
applications = {
|
||||
cli = {
|
||||
color-converter.enable = lib.mkEnableOption "color-converter";
|
||||
fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
nh.enable = lib.mkEnableOption "nh";
|
||||
};
|
||||
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
shells = {
|
||||
zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mkExtraPackagesDescription = optionName: "This options is equivalent to `${optionName}`, and exists purely for convenience.";
|
||||
in {
|
||||
flake.nixosModules.globalOptions = { lib, ... }: {
|
||||
options = (mkSharedGlobalOptions { inherit lib; }) // {
|
||||
components = {
|
||||
bootLoader = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/boot-loaders";
|
||||
description = "This option defines the bootloader that should be used, enabling any config associated with it in the process.";
|
||||
default = "grub";
|
||||
};
|
||||
};
|
||||
|
||||
features = (mkSharedGlobalOptions { inherit lib; }).features // {
|
||||
shells = {
|
||||
defaultShell = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/features/shells";
|
||||
description = "This option controls the shell that should be used as the default, enabling that shell in the process.";
|
||||
default = "zsh";
|
||||
};
|
||||
} // (mkSharedGlobalOptions { inherit lib; }).features.shells;
|
||||
|
||||
nixos.home-manager.enable = lib.mkEnableOption "home-manager";
|
||||
|
||||
applications = (mkSharedGlobalOptions { inherit lib; }).features.applications // {
|
||||
extraPackages = (mkSharedGlobalOptions { inherit lib; }).features.applications.extraPackages // { description = mkExtraPackagesDescription "environment.systemPackages"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.globalOptions = { lib, ... }: {
|
||||
options = (mkSharedGlobalOptions { inherit lib; }) // {
|
||||
info = {
|
||||
isStandalone = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "This option tells the config whether this home-manager config is part of a larger NixOS config or not, and is read-only.";
|
||||
default = true;
|
||||
readOnly = true;
|
||||
};
|
||||
} // (mkSharedGlobalOptions { inherit lib; }).info;
|
||||
|
||||
features = (mkSharedGlobalOptions { inherit lib; }).features // {
|
||||
applications = (mkSharedGlobalOptions { inherit lib; }).features.applications // {
|
||||
shellScripts = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.str);
|
||||
description = "This option is a set of multiline strings, which are processed into executable bash scripts in `$XDG_BIN_HOME`. The shebang (`#!/bin/bash`) is added afterwards, and shouldn't be included in definitions.";
|
||||
default = {};
|
||||
};
|
||||
|
||||
extraPackages = (mkSharedGlobalOptions { inherit lib; }).features.applications.extraPackages // { description = mkExtraPackagesDescription "home.packages"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{ inputs, self, ... }: let
|
||||
mkSharedGraphicsOptions = { pkgs, lib }: {
|
||||
components = {
|
||||
windowManagers = lib.mkOption {
|
||||
type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers");
|
||||
description = "This option defines the window manager(s) that should be installed, enabling any config associated with it in the process. It can be either a list or just one value.";
|
||||
default = [];
|
||||
};
|
||||
|
||||
shells = lib.mkOption {
|
||||
type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells");
|
||||
description = "This option defines the graphical shell(s) that should be installed (e.g. Noctalia, DMS), enabling any config associated with it in the process. It can be either a list or just one value.";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
features = {
|
||||
applications.gui = {
|
||||
equibop = {
|
||||
enable = lib.mkEnableOption "equibop";
|
||||
autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "This option controls whether an `equibop.desktop` file is generated and placed into `$XDG_CONFIG_HOME/autostart`.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
|
||||
kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify = {
|
||||
enable = lib.mkEnableOption "spicetify";
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes));
|
||||
description = "This option is used to select a theme for Spicetify to use, from the list of available packages themes.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vscode.enable = lib.mkEnableOption "vscode";
|
||||
};
|
||||
|
||||
nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
};
|
||||
};
|
||||
|
||||
redundantOptionWarn = name: value: "The functionality of this option completely depends on `${name}` being `${value}`, and will not be evaluated otherwise.";
|
||||
in {
|
||||
flake.nixosModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }) // {
|
||||
components = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).components // {
|
||||
displayManager = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/display-managers";
|
||||
description = "This option defines the bootloader that should be used, enabling any config associated with it in the process.";
|
||||
default = "lightdm";
|
||||
};
|
||||
};
|
||||
|
||||
features = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features // {
|
||||
applications.gui = {
|
||||
equibop.enable.description = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui.equibop.enable.description + "\n" + (redundantOptionWarn "features.nixos.home-manager.enable" "true");
|
||||
spotify.spicetify.theme.description = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui.spotify.spicetify.theme.description + "\n" + (redundantOptionWarn "features.nixos.home-manager.enable" "true");
|
||||
} // (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options = mkSharedGraphicsOptions { inherit pkgs; inherit lib; };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.options = { ... }: {
|
||||
imports = with self.nixosModules; [
|
||||
globalOptions
|
||||
graphicsOptions
|
||||
gamingOptions
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.options = { ... }: {
|
||||
imports = with self.homeModules; [
|
||||
globalOptions
|
||||
audioOptions
|
||||
graphicsOptions
|
||||
gamingOptions
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user