some modularizing and refactoring
This commit is contained in:
@@ -12,6 +12,7 @@ in {
|
||||
nixos.gui.hyprland.enable = mkEnableOption "Enables hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
security.pam.services.hyprlock.text = "auth include login";
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
|
||||
@@ -10,6 +10,7 @@ in {
|
||||
nixos.services.system.pipewire.enable = mkEnableOption "Enables pipewire";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
||||
50
modules/nixos/system/devpkgs/default.nix
Normal file
50
modules/nixos/system/devpkgs/default.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
cfg = config.nixos.system.devpkgs;
|
||||
in {
|
||||
options = {
|
||||
nixos.system.devpkgs = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable various packages for development";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Language servers, utilities, and tools
|
||||
gcc
|
||||
rust-analyzer
|
||||
lua-language-server
|
||||
nixd
|
||||
php
|
||||
# php84Packages.php-cs-fixer
|
||||
phpactor
|
||||
python312Packages.python-lsp-server
|
||||
bash-language-server
|
||||
nil
|
||||
nodePackages.vscode-langservers-extracted
|
||||
clang-tools
|
||||
marksman
|
||||
pyright
|
||||
nodePackages_latest.intelephense
|
||||
|
||||
# Formatters
|
||||
alejandra
|
||||
stylua
|
||||
nodePackages_latest.fixjson
|
||||
nodePackages_latest.sql-formatter
|
||||
prettierd
|
||||
shfmt
|
||||
luaformatter
|
||||
black
|
||||
];
|
||||
};
|
||||
}
|
||||
49
modules/nixos/system/fonts/default.nix
Normal file
49
modules/nixos/system/fonts/default.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
cfg = config.nixos.system.fonts;
|
||||
in {
|
||||
options = {
|
||||
nixos.system.fonts = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable various font packages";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
liberation_ttf
|
||||
fira-code-symbols
|
||||
font-awesome
|
||||
recursive
|
||||
input-fonts
|
||||
(pkgs.nerdfonts.override {
|
||||
fonts = [
|
||||
"JetBrainsMono"
|
||||
"FiraCode"
|
||||
"FiraMono"
|
||||
"Iosevka"
|
||||
"3270"
|
||||
"DroidSansMono"
|
||||
"SourceCodePro"
|
||||
"UbuntuMono"
|
||||
"Overpass"
|
||||
"Monoid"
|
||||
"Mononoki"
|
||||
"Hack"
|
||||
"IBMPlexMono"
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption mkDefault;
|
||||
inherit (lib) mkIf mkOption mkDefault types;
|
||||
cfg = config.nixos.system.locale;
|
||||
defaultCategories = [
|
||||
"LC_ADDRESS"
|
||||
@@ -20,22 +20,22 @@ in {
|
||||
options = {
|
||||
nixos.system.locale = {
|
||||
enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable locale configuration.";
|
||||
};
|
||||
timeZone = mkOption {
|
||||
type = lib.types.str;
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = "The system time zone (e.g., \"Europe/Stockholm\").";
|
||||
};
|
||||
defaultLocale = mkOption {
|
||||
type = lib.types.str;
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = "The default locale for the system (e.g., \"en_US.UTF-8\").";
|
||||
};
|
||||
extraLocale = mkOption {
|
||||
type = lib.types.str;
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The locale to use for specific LC_* categories.
|
||||
@@ -44,7 +44,7 @@ in {
|
||||
'';
|
||||
};
|
||||
categories = mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
type = types.listOf types.str;
|
||||
default = defaultCategories;
|
||||
description = ''
|
||||
List of LC_* categories to override with `locale.extraLocale`.
|
||||
|
||||
37
modules/nixos/system/xdg/default.nix
Normal file
37
modules/nixos/system/xdg/default.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption mkEnableOption types;
|
||||
cfg = config.nixos.system.xdg;
|
||||
in {
|
||||
options = {
|
||||
nixos.system.xdg = {
|
||||
enable = mkEnableOption "Enable XDG portal.";
|
||||
xdgOpenUsePortal = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Use xdg-open via the portal.";
|
||||
};
|
||||
extraPortals = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [pkgs.xdg-desktop-portal-gtk];
|
||||
description = "List of extra portals to include.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = cfg.xdgOpenUsePortal;
|
||||
config = {
|
||||
common.default = ["gtk"];
|
||||
hyprland.default = ["gtk" "hyprland"];
|
||||
};
|
||||
extraPortals = cfg.extraPortals;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user