Compare commits

..

No commits in common. "f05dfab5c59d6d4cc47abd86f90ed031bded2c4b" and "c7c866f8a5e2a8a29cf9efdadeb25a82d53dc514" have entirely different histories.

31 changed files with 72 additions and 78 deletions

View file

@ -1,12 +1,11 @@
inputs: let inputs: let
inherit (inputs) self; inherit (inputs) self;
inherit (builtins) filter map toString;
inherit (inputs.nixpkgs) lib; inherit (inputs.nixpkgs) lib;
inherit (lib.attrsets) recursiveUpdate;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.lists) concatLists flatten singleton; inherit (lib.lists) concatLists flatten singleton;
inherit (lib) nixosSystem recursiveUpdate;
inherit (builtins) filter map toString;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix; inherit (lib.strings) hasSuffix;
inherit (lib) nixosSystem;
# NOTE: This was inspired by raf, and I find this # NOTE: This was inspired by raf, and I find this
# to be quite a sane way of managing all modules in my flake. # to be quite a sane way of managing all modules in my flake.

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption; inherit (lib) mkOption;
inherit (lib.types) submodule int ints number attrsOf ; inherit (lib.types) submodule int ints number attrsOf ;
in { in {
options.modules.system.hardware.monitors = mkOption { options.modules.system.hardware.monitors = mkOption {

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption; inherit (lib) mkEnableOption mkOption types;
in { in {
options.modules.system.networking = { options.modules.system.networking = {
nftbles.enable = mkEnableOption "Nftables firewall"; nftbles.enable = mkEnableOption "Nftables firewall";

View file

@ -1,6 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.types) str enum; inherit (lib) mkEnableOption mkOption types;
inherit (lib.options) mkEnableOption mkOption;
in { in {
options.modules.system.programs = { options.modules.system.programs = {
editors = { editors = {
@ -20,30 +19,30 @@ in {
git = { git = {
signingKey = mkOption { signingKey = mkOption {
type = str; type = types.str;
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6"; default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6";
description = "The default gpg key used for signing commits"; description = "The default gpg key used for signing commits";
}; };
}; };
default = { default = {
terminal = mkOption { terminal = mkOption {
type = enum ["foot" "kitty"]; type = types.enum ["foot" "kitty"];
default = "foot"; default = "foot";
}; };
fileManager = mkOption { fileManager = mkOption {
type = enum ["thunar" "dolphin" "nemo"]; type = types.enum ["thunar" "dolphin" "nemo"];
default = "thunar"; default = "thunar";
}; };
browser = mkOption { browser = mkOption {
type = enum ["firefox" "librewolf" "chromium"]; type = types.enum ["firefox" "librewolf" "chromium"];
default = "firefox"; default = "firefox";
}; };
editor = mkOption { editor = mkOption {
type = enum ["neovim" "helix" "emacs"]; type = types.enum ["neovim" "helix" "emacs"];
default = "emacs"; default = "emacs";
}; };
launcher = mkOption { launcher = mkOption {
type = enum ["anyrun" "rofi" "wofi"]; type = types.enum ["anyrun" "rofi" "wofi"];
default = "anyrun"; default = "anyrun";
}; };
}; };

View file

@ -1,11 +1,10 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption; inherit (lib) mkOption types;
inherit (lib.types) str;
in { in {
options.modules.other.system = { options.modules.other.system = {
username = mkOption { username = mkOption {
description = "username for this system"; description = "username for this system";
type = str; type = types.str;
}; };
}; };
} }

View file

@ -5,8 +5,7 @@
}: let }: let
cfg = config.modules.programs.nh; cfg = config.modules.programs.nh;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
inherit (lib.modules) mkIf; inherit (lib) mkEnableOption mkIf;
inherit (lib.options) mkEnableOption;
in { in {
options.modules.programs.nh.enable = mkEnableOption "nh"; options.modules.programs.nh.enable = mkEnableOption "nh";

View file

@ -4,11 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkIf;
inherit (config.meta.mainUser) username;
cfg = config.modules.system.programs.terminals.foot; cfg = config.modules.system.programs.terminals.foot;
colours = config.modules.style.colorScheme.colors; colours = config.modules.style.colorScheme.colors;
inherit (config.meta.mainUser) username;
inherit (lib) mkIf;
foot-config = pkgs.writeText "foot.ini" (lib.generators.toINI {} { foot-config = pkgs.writeText "foot.ini" (lib.generators.toINI {} {
main = { main = {

View file

@ -4,10 +4,9 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.modules.programs.minecraft;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.programs.minecraft;
in { in {
options.modules.programs.minecraft = { options.modules.programs.minecraft = {
enable = mkEnableOption "minecraft"; enable = mkEnableOption "minecraft";

View file

@ -4,9 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.options) mkEnableOption; inherit (lib) mkEnableOption mkIf;
inherit (lib.modules) mkIf;
cfg = config.modules.programs.btop; cfg = config.modules.programs.btop;
btop-settings = pkgs.writeTextDir "btop/btop.conf" '' btop-settings = pkgs.writeTextDir "btop/btop.conf" ''

View file

@ -3,10 +3,9 @@
lib, lib,
... ...
}: let }: let
cfg = config.modules.services.kanata;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.services.kanata;
in { in {
options.modules.services.kanata.enable = mkEnableOption "kanata"; options.modules.services.kanata.enable = mkEnableOption "kanata";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -6,7 +6,6 @@
}: let }: let
inherit (lib.meta) getExe'; inherit (lib.meta) getExe';
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.system.services.nextcloud; cfg = config.modules.system.services.nextcloud;
in { in {
options.modules.system.services.nextcloud.enable = lib.mkEnableOption "nextcloud"; options.modules.system.services.nextcloud.enable = lib.mkEnableOption "nextcloud";

View file

@ -6,7 +6,6 @@
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.database.postgresql; cfg = config.modules.system.services.database.postgresql;
in { in {
options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql"; options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql";

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption; inherit (lib) mkEnableOption;
in { in {
options.modules.programs.ssh.enable = mkEnableOption "ssh"; options.modules.programs.ssh.enable = mkEnableOption "ssh";
config = { config = {

View file

@ -11,8 +11,9 @@
... ...
}: let }: let
inherit (lib.options) mkOption literalExpression; inherit (lib.options) mkOption literalExpression;
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo; inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo;
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
# inherit (lib) serializeTheme;
cfg = config.modules.style; cfg = config.modules.style;

View file

@ -4,10 +4,9 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str package; inherit (lib.types) str package;
inherit (lib.modules) mkIf;
cfg = config.modules.theming.gtk; cfg = config.modules.theming.gtk;
in { in {
options.modules.theming.gtk = { options.modules.theming.gtk = {

View file

@ -5,9 +5,8 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption; inherit (lib) mkEnableOption mkOption;
inherit (lib.types) str package; inherit (lib.types) str package;
cfg = config.modules.theming.qt; cfg = config.modules.theming.qt;
in { in {
options.modules.theming.qt = { options.modules.theming.qt = {

View file

@ -4,16 +4,13 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (builtins) toString isBool;
inherit (lib.generators) toINI;
inherit (lib.modules) mkMerge mkIf; inherit (lib.modules) mkMerge mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.strings) escape;
inherit (lib.trivial) boolToString;
cfg = config.modules.theming; cfg = config.modules.theming;
inherit (builtins) toString isBool;
inherit (lib) boolToString escape generators;
toGtk3Ini = toINI { toGtk3Ini = generators.toINI {
mkKeyValue = key: value: let mkKeyValue = key: value: let
value' = value' =
if isBool value if isBool value

View file

@ -5,8 +5,8 @@
... ...
}: let }: let
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
cfg = config.modules.system.boot; cfg = config.modules.system.boot;
in { in {
options.modules.system.boot = { options.modules.system.boot = {
@ -31,8 +31,6 @@ in {
}; };
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
# I love spamming space
timeout = 0;
systemd-boot = { systemd-boot = {
enable = cfg.systemd-boot.enable; enable = cfg.systemd-boot.enable;
editor = mkForce false; editor = mkForce false;

View file

@ -4,9 +4,8 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkIf;
cfg = config.modules.system.hardware.bluetooth; cfg = config.modules.system.hardware.bluetooth;
inherit (lib) mkIf;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
hardware.bluetooth = { hardware.bluetooth = {

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkDefault; inherit (lib) mkDefault mkIf;
inherit (config.modules.system.video) nvidia amd;
in { in {
hardware = { hardware = {
cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -3,9 +3,8 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf;
cfg = config.modules.system.sound; cfg = config.modules.system.sound;
inherit (lib) mkIf;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.pipewire = { services.pipewire = {

View file

@ -6,8 +6,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.attrsets) mapAttrsToList; inherit (lib) mapAttrsToList mkForce;
inherit (lib.modules) mkForce;
in { in {
imports = [ imports = [
./documentation.nix # nixos documentation ./documentation.nix # nixos documentation

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf mkForce; inherit (lib) mkIf mkForce;
inherit (builtins) map; inherit (builtins) map;
cfg = config.modules.system.impermanence; cfg = config.modules.system.impermanence;

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.modules) mkForce; inherit (lib) mkForce;
in { in {
networking.networkmanager = { networking.networkmanager = {
enable = true; enable = true;

View file

@ -3,7 +3,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkForce mkDefault; inherit (lib) mkForce mkDefault;
in { in {
security = { security = {
sudo-rs.enable = mkForce false; sudo-rs.enable = mkForce false;

View file

@ -1,8 +1,10 @@
{ {
config,
lib, lib,
pkgs, pkgs,
... ...
}: let }: let
cfg = config.modules.desktops.hyprland;
inherit (builtins) map genList toString; inherit (builtins) map genList toString;
inherit (lib.meta) getExe getExe'; inherit (lib.meta) getExe getExe';
in { in {
@ -47,10 +49,10 @@ in {
"$mainMod, V, togglespecialworkspace, audio" "$mainMod, V, togglespecialworkspace, audio"
# Reload hyprland # Reload hyprland
"$mainMod, R, exec, ${getExe' pkgs.hyprland "hyprctl"} reload" "$mainMod, R, exec, ${cfg.package}/bin/hyprctl reload"
# Restart waybar # Restart waybar
"$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${getExe pkgs.waybar}" "$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${pkgs.waybar}/bin/waybar"
]; ];
binde = [ binde = [

View file

@ -5,11 +5,11 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption;
inherit (lib.types) bool;
cfg = config.modules.desktops.hyprland; cfg = config.modules.desktops.hyprland;
# inherit (inputs.hyprsplit.packages.${pkgs.system}) hyprsplit;
inherit (lib.modules) mkIf mkDefault;
inherit (lib.options) mkOption;
inherit (lib.types) bool enum package;
in { in {
imports = [ imports = [
./binds.nix ./binds.nix
@ -19,6 +19,8 @@ in {
./workspaces.nix ./workspaces.nix
inputs.hyprland.nixosModules.default inputs.hyprland.nixosModules.default
]; ];
# we disable the default hyprland module
# disabledModules = ["programs/hyprland.nix"];
options.modules.desktops.hyprland = { options.modules.desktops.hyprland = {
enable = mkOption { enable = mkOption {
@ -28,6 +30,19 @@ in {
Whether to enable Hyprland wayland compositor. Whether to enable Hyprland wayland compositor.
''; '';
}; };
package = mkOption {
type = package;
default = pkgs.hyprland;
description = ''
The Hyprland package to be used.
'';
};
portalPackage = mkOption {
type = package;
default = pkgs.xdg-desktop-portal-hyprland;
description = "The hyprland portal package";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -44,14 +59,15 @@ in {
# xdg Portal # xdg Portal
xdg.portal = { xdg.portal = {
enable = true; enable = true;
xdgOpenUsePortal = true; configPackages = mkDefault [
pkgs.xdg-desktop-portal-hyprland
];
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-hyprland
]; ];
config = { config = {
common.default = ["*"]; common.default = ["gtk" "hyprland"];
hyprland.default = ["gtk" "hyprland"];
}; };
}; };
}; };

View file

@ -3,11 +3,10 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) toString;
inherit (lib.attrsets) mapAttrsToList;
inherit (config.modules.style.colorScheme) colors;
inherit (config.modules.system.hardware) monitors; inherit (config.modules.system.hardware) monitors;
inherit (lib) mapAttrsToList;
inherit (builtins) toString;
inherit (config.modules.style.colorScheme) colors;
in { in {
config = { config = {
programs.hyprland = { programs.hyprland = {

View file

@ -3,11 +3,9 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) map genList attrNames toString;
inherit (lib.lists) imap0 flatten;
inherit (lib.strings) optionalString;
inherit (config.modules.system.hardware) monitors; inherit (config.modules.system.hardware) monitors;
inherit (lib) imap0 flatten optionalString;
inherit (builtins) map genList attrNames toString;
in { in {
programs.hyprland.settings = { programs.hyprland.settings = {
# INFO: This is a custom function to map all of my monitors to workspaces. # INFO: This is a custom function to map all of my monitors to workspaces.

View file

@ -3,10 +3,8 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.wms.wayland; cfg = config.modules.wms.wayland;
inherit (lib) mkIf mkEnableOption;
in { in {
options.modules.wms.wayland.enable = mkEnableOption "wayland"; options.modules.wms.wayland.enable = mkEnableOption "wayland";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -32,8 +32,7 @@
basedpyright, basedpyright,
... ...
}: let }: let
inherit (lib.meta) getExe; inherit (lib) getExe;
toml = formats.toml {}; toml = formats.toml {};
helix-config = { helix-config = {
theme = "gruvbox"; theme = "gruvbox";