diff --git a/options/device/README.md b/options/device/README.md deleted file mode 100644 index d433491..0000000 --- a/options/device/README.md +++ /dev/null @@ -1 +0,0 @@ -Опции для конфигурации устройства. \ No newline at end of file diff --git a/options/device/laptop.nix b/options/device/laptop.nix index 4d686ee..7625fe4 100644 --- a/options/device/laptop.nix +++ b/options/device/laptop.nix @@ -18,20 +18,20 @@ in battery.enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Battery configuration for the laptop."; }; bluetooth.enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Bluetooth configuration for the laptop."; }; cpu = { enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "CPU configuration for the laptop."; }; type = lib.mkOption { @@ -42,11 +42,13 @@ in default = "intel"; description = "Laptop CPU type."; }; + # FIXME: Additional imports for devices config: + # inputs.nixos-hardware.nixosModules.common-cpu-intel }; sound.enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Sound configuration for the laptop."; }; }; diff --git a/options/home/dev.nix b/options/home/dev.nix new file mode 100644 index 0000000..83e841f --- /dev/null +++ b/options/home/dev.nix @@ -0,0 +1,198 @@ +{ + lib, + pkgs, + config, + ... +}: +let + cfg = config.home.dev; +in +{ + options = { + home.dev = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Development settings."; + }; + additionalDevPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = [ ]; + description = "Development additional packages: cli/tui/utils"; + }; + + git = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Git settings."; + }; + userName = lib.mkOption { + type = lib.types.str; + default = config.home.username; + description = "Git user name."; + }; + userEmail = lib.mkOption { + type = lib.types.str; + default = ""; + description = "Git user email."; + }; + }; + + python = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Python base settings & packages."; + }; + packages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = [ + pkgs.python314 + pkgs.uv + ]; + description = "List of user python packages."; + }; + }; + + rust = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Rust base settings & packages."; + }; + packages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = [ + pkgs.gcc + pkgs.cargo + pkgs.rustc + ]; + description = "List of user rust packages."; + }; + }; + terminal = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Terminal settings & other stuff."; + }; + shell = lib.mkOption { + type = lib.types.str; + default = if cfg.terminal.zsh.enable then "zsh" else "bash"; + description = "Change standart shell for kitty"; + }; + aliases = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = { + gc = "sudo nix-collect-garbage -d"; + dev = "nix develop --command ${cfg.terminal.shell}"; + "..." = "cd ../.."; + }; + description = "Terminal aliases."; + }; + kitty.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Configure kitty - terminal emulator."; + }; + zsh = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Configure zsh - terminal shell."; + }; + oh-my-zsh = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Configure oh-my-zsh."; + }; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = "Plugins for oh-my-zsh"; + }; + }; + }; + }; + }; + }; + + config = lib.mkIf cfg.enable { + programs.git = lib.mkIf cfg.git.enable { + enable = true; + package = pkgs.gitAndTools.gitFull; + userName = cfg.git.userName; + userEmail = cfg.git.userEmail; + lfs.enable = true; + aliases = { + aa = "add --all"; + c = "commit"; + cm = "commit -m"; + br = "branch"; + s = "status"; + uncommit = "reset --soft HEAD^"; + unadd = "reset"; + d = "diff"; + ds = "diff --staged"; + }; + extraConfig = { + init = { + defaultbranch = "main"; + }; + branch = { + soft = "-committerdate"; + }; + pull.rebase = true; + }; + }; + + programs.kitty = lib.mkIf cfg.terminal.kitty.enable { + enable = true; + package = pkgs.kitty; + shellIntegration = lib.mkIf (cfg.terminal.shell == "zsh") { + enableZshIntegration = true; + }; + settings = { + shell = cfg.terminal.shell; + confirm_os_window_close = 0; + enable_audio_bell = false; + scrollback_lines = 10000; + mouse_hide_wait = "-1.0"; + }; + keybindings = { + "ctrl+=" = "increase_font_size"; + "ctrl+-" = "decrease_font_size"; + }; + }; + + programs.zsh = lib.mkIf cfg.terminal.zsh.enable { + enable = true; + package = pkgs.zsh; + autocd = true; + autosuggestion = { + enable = true; + strategy = [ "history" ]; + }; + history = { + saveNoDups = true; + size = 10000; + save = 10000; + }; + oh-my-zsh = lib.mkIf cfg.terminal.zsh.oh-my-zsh.enable { + enable = true; + plugins = cfg.terminal.zsh.oh-my-zsh.plugins; + }; + syntaxHighlighting = { + enable = true; + }; + shellAliases = cfg.terminal.aliases; + }; + + home.packages = + cfg.additionalDevPackages + ++ lib.optionals cfg.python.enable cfg.python.packages + ++ lib.optionals cfg.rust.enable cfg.rust.packages; + }; +} diff --git a/options/host/README.md b/options/host/README.md deleted file mode 100644 index f04d5d2..0000000 --- a/options/host/README.md +++ /dev/null @@ -1 +0,0 @@ -Опции для конфигурации хоста (системы). \ No newline at end of file diff --git a/options/host/locale.nix b/options/host/locale.nix index 5602c50..c888b36 100644 --- a/options/host/locale.nix +++ b/options/host/locale.nix @@ -12,7 +12,7 @@ in host.locale = { enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Basic locale settings."; }; diff --git a/options/host/nix.nix b/options/host/nix.nix index 24cacea..47ceca6 100644 --- a/options/host/nix.nix +++ b/options/host/nix.nix @@ -12,7 +12,7 @@ in host.nix = { enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Nix settings for host."; }; optimization.enable = lib.mkOption { diff --git a/options/host/polkit.nix b/options/host/polkit.nix index da0a100..ecfc2e2 100644 --- a/options/host/polkit.nix +++ b/options/host/polkit.nix @@ -12,7 +12,7 @@ in host.polkit = { enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Polkit configurations for host."; }; }; diff --git a/options/host/window_managers.nix b/options/host/window_managers.nix index b26f229..b3d1082 100644 --- a/options/host/window_managers.nix +++ b/options/host/window_managers.nix @@ -23,7 +23,7 @@ in powerProfiles.enable = lib.mkOption { type = lib.types.bool; - default = !config.device.battery.enable; + default = !config.device.laptop.battery.enable; description = "Power Profiles Daemon configurations for host."; }; }; diff --git a/options/host/xserver.nix b/options/host/xserver.nix index 699d10d..d31f685 100644 --- a/options/host/xserver.nix +++ b/options/host/xserver.nix @@ -7,7 +7,7 @@ in host.xserver = { enable = lib.mkOption { type = lib.types.bool; - default = true; + default = false; description = "Xserver configurations for host."; }; };