mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-09 04:10:05 +00:00
✨ Add tons of missing system, desktop and home modules
This commit is contained in:
parent
01367c4222
commit
fa3bbb2f6f
15 changed files with 453 additions and 7 deletions
73
modules/home/app/zed/default.nix
Normal file
73
modules/home/app/zed/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.apps.zed;
|
||||
in {
|
||||
options.${namespace}.apps.zed = {
|
||||
enable = mkEnableOption "zed, the graphical editor from the future";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
sops.secrets.wakatime-cfg = {
|
||||
format = "binary";
|
||||
sopsFile = "${self.outPath}/${osConfig.networking.hostname}/secrets/wakatime.cfg";
|
||||
path = "/home/${config.home.homeDirectory}/.wakatime.cfg";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
alejandra
|
||||
];
|
||||
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
extensions = ["nix" "catppuccin" "wakatime" "discord_presence" "deno"];
|
||||
|
||||
userSettings = {
|
||||
icon_theme = "Catppuccin Macchiato";
|
||||
theme = {
|
||||
dark = "Catppuccin Macchiato (blue)";
|
||||
light = "Catppuccin Macchiato (blue)";
|
||||
};
|
||||
|
||||
### Disable telemetry
|
||||
telemetry = {
|
||||
metrics = false;
|
||||
};
|
||||
|
||||
### Disable certain AI features
|
||||
features = {
|
||||
copilot = false;
|
||||
};
|
||||
|
||||
### Language specific configurations
|
||||
languages = {
|
||||
### Nix language
|
||||
Nix = {
|
||||
language_servers = ["nixd" "!nil"];
|
||||
};
|
||||
};
|
||||
|
||||
### LSP configurations
|
||||
lsp = {
|
||||
nixd = {
|
||||
initialization_options = {
|
||||
formatting = {
|
||||
command = ["alejandra" "--quiet" "--"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [nixd];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
{...}: {
|
||||
}
|
91
modules/home/desktop/gnome/default.nix
Normal file
91
modules/home/desktop/gnome/default.nix
Normal file
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption;
|
||||
inherit (self) namespace;
|
||||
inherit (self.lib) mkOpt;
|
||||
|
||||
cfg = config.${namespace}.desktop.gnome;
|
||||
in {
|
||||
options.${namespace}.desktop.gnome = with lib.types; {
|
||||
enabled-extensions = mkOption {
|
||||
type = listOf package;
|
||||
default = with pkgs.gnomeExtensions; [user-themes blur-my-shell appindicator unite color-picker clipboard-history];
|
||||
example = [dash-to-dock blur-my-shell];
|
||||
description = "Specify gnome extensions to install.";
|
||||
};
|
||||
favorite-apps = mkOption {
|
||||
type = listOf str;
|
||||
default = ["org.gnome.Nautilus.desktop" "obsidian.desktop" "firefox.desktop" "dev.zed.Zed.desktop"];
|
||||
example = ["org.gnome.Nautilus.desktop" "obsidian.desktop"];
|
||||
description = "Specify your favorite apps (sorted left to right).";
|
||||
};
|
||||
extensions = {
|
||||
unite = {
|
||||
show-window-buttons = mkOption {
|
||||
type = str;
|
||||
default = "never";
|
||||
example = "never | maximized | tiled | both | always";
|
||||
description = "Specify when Unite should display window buttons within the top panel.";
|
||||
};
|
||||
hide-window-titlebars = mkOption {
|
||||
type = str;
|
||||
default = "maximized";
|
||||
example = "never | maximized | tiled | both | always";
|
||||
description = "Specify when Unite should hide window titlebars.";
|
||||
};
|
||||
};
|
||||
blur-my-shell = {
|
||||
enable-blur = mkOpt bool false "Whether to enable blur-my-shell application blur.";
|
||||
};
|
||||
};
|
||||
wallpaper = mkOpt str (builtins.toString ../wallpapers/mountain_tower_sunset.jpg) "Specify the path of your prefered Gnome wallpaper.";
|
||||
};
|
||||
|
||||
config = mkIf osConfig.${namespace}.desktop.gnome.enable {
|
||||
home.packages = cfg.enabled-extensions;
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/shell" = {
|
||||
favorite-apps = cfg.favorite-apps;
|
||||
enabled-extensions = lib.forEach cfg.enabled-extensions (x: x.extensionUuid);
|
||||
disabled-extensions = []; # Make sure none of our extensions are disabled on system rebuild
|
||||
};
|
||||
"org/gnome/shell/extensions/unite" = mkIf (builtins.elem pkgs.gnomeExtensions.unite cfg.enabled-extensions) {
|
||||
show-window-buttons = cfg.extensions.unite.show-window-buttons;
|
||||
hide-window-titlebars = cfg.extensions.unite.hide-window-titlebars;
|
||||
|
||||
use-activities-text = false;
|
||||
extend-left-box = false;
|
||||
reduce-panel-spacing = false;
|
||||
show-legacy-tray = false;
|
||||
show-appmenu-button = false;
|
||||
show-desktop-name = false;
|
||||
enable-titlebar-actions = false;
|
||||
restrict-to-primary-screen = false;
|
||||
hide-activities-button = "never";
|
||||
autofocus-windows = true;
|
||||
notifications-position = "right";
|
||||
};
|
||||
"org/gnome/shell/extensions/blur-my-shell/applications" = mkIf cfg.extensions.blur-my-shell.enable-blur {
|
||||
blur = true;
|
||||
sigma = 30;
|
||||
opacity = 230;
|
||||
enable-all = true;
|
||||
dynamic-opacity = false;
|
||||
};
|
||||
"org/gnome/desktop/background" = {
|
||||
picture-uri = cfg.wallpaper;
|
||||
picture-uri-dark = cfg.wallpaper;
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 186 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
24
modules/nixos/archetypes/laptop/default.nix
Normal file
24
modules/nixos/archetypes/laptop/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.archetypes.laptop;
|
||||
in {
|
||||
options.${namespace}.archetypes.laptop = {
|
||||
enable = mkEnableOption "the laptop archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
# Inherit from workstation archetype
|
||||
archetypes.workstation.enable = true;
|
||||
};
|
||||
|
||||
hardware.sensor.iio.enable = true; # Enable iio-sensor for automatic screen rotation and similar features.
|
||||
};
|
||||
}
|
|
@ -16,9 +16,20 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
# Basic system functionality
|
||||
system.grub.enable = true;
|
||||
system.networking.enable = true;
|
||||
system.kernel.enable = true;
|
||||
system = {
|
||||
networking.enable = true;
|
||||
grub.enable = true;
|
||||
shell.enable = true;
|
||||
locale.enable = true;
|
||||
fonts.enable = true;
|
||||
bluetooth.enable = true;
|
||||
audio.enable = true;
|
||||
kernel.enable = true;
|
||||
nix = {
|
||||
enable = true;
|
||||
use-lix = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Services
|
||||
services.docker.enable = true;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
@ -17,5 +18,29 @@ in {
|
|||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
gnome-tour
|
||||
gedit
|
||||
cheese
|
||||
geary
|
||||
yelp # Help view
|
||||
epiphany # Gnome web
|
||||
gnome-console
|
||||
gnome-terminal
|
||||
gnome-music
|
||||
hitori # Sudoku game
|
||||
gnome-contacts
|
||||
gnome-initial-setup
|
||||
gnome-system-monitor
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-tweaks
|
||||
resources
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
27
modules/nixos/system/audio/default.nix
Normal file
27
modules/nixos/system/audio/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.audio;
|
||||
in {
|
||||
options.${namespace}.system.audio = {
|
||||
enable = mkEnableOption "system audio support.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
36
modules/nixos/system/bluetooth/default.nix
Normal file
36
modules/nixos/system/bluetooth/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.bluetooth;
|
||||
in {
|
||||
options.${namespace}.system.bluetooth = {
|
||||
enable = mkEnableOption "bluetooth support.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [bluez];
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
package = pkgs.bluez;
|
||||
|
||||
settings = {
|
||||
General = {
|
||||
ControllerMode = "dual";
|
||||
FastConnectable = "true";
|
||||
Experimental = "true";
|
||||
KernelExperimental = "true";
|
||||
Disable = "Handsfree";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
28
modules/nixos/system/fonts/default.nix
Normal file
28
modules/nixos/system/fonts/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.fonts;
|
||||
in {
|
||||
options.${namespace}.system.fonts = with lib.types; {
|
||||
enable = mkEnableOption "system font management";
|
||||
fonts = mkOption {
|
||||
type = listOf package;
|
||||
default = with pkgs; [noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif noto-fonts-emoji nerd-fonts.bigblue-terminal nerd-fonts.zed-mono monocraft];
|
||||
example = [noto-fonts noto-fonts-emoji];
|
||||
description = "Install additional font packages";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [font-manager];
|
||||
|
||||
fonts.packages = cfg.fonts;
|
||||
};
|
||||
}
|
58
modules/nixos/system/locale/default.nix
Normal file
58
modules/nixos/system/locale/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.locale;
|
||||
in {
|
||||
options.${namespace}.system.locale = {
|
||||
enable = mkEnableOption "system locale tweaks.";
|
||||
|
||||
language = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "en_US";
|
||||
example = "en_US";
|
||||
description = "Sets the language for most text, doesn't include monetary or measurement settings";
|
||||
};
|
||||
|
||||
country = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "de_DE";
|
||||
example = "de_DE";
|
||||
description = "Sets the language used for monetary or measurement settings (USD vs Euro, etc...)";
|
||||
};
|
||||
|
||||
keymap = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "de";
|
||||
example = "de";
|
||||
description = "Sets the keymap to be used by the system";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Internationalisation properties.
|
||||
i18n.defaultLocale = "${cfg.language}.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "${cfg.country}.UTF-8";
|
||||
LC_IDENTIFICATION = "${cfg.country}.UTF-8";
|
||||
LC_MEASUREMENT = "${cfg.country}.UTF-8";
|
||||
LC_MONETARY = "${cfg.country}.UTF-8";
|
||||
LC_NAME = "${cfg.country}.UTF-8";
|
||||
LC_NUMERIC = "${cfg.country}.UTF-8";
|
||||
LC_PAPER = "${cfg.country}.UTF-8";
|
||||
LC_TELEPHONE = "${cfg.country}.UTF-8";
|
||||
LC_TIME = "${cfg.country}.UTF-8";
|
||||
};
|
||||
|
||||
# Set console keymap.
|
||||
console.keyMap = cfg.keymap;
|
||||
services.xserver = {
|
||||
xkb.layout = cfg.keymap;
|
||||
};
|
||||
};
|
||||
}
|
50
modules/nixos/system/nix/default.nix
Normal file
50
modules/nixos/system/nix/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.nix;
|
||||
in {
|
||||
options.${namespace}.system.nix = {
|
||||
enable = mkEnableOption "Nix configuration overrides.";
|
||||
use-lix = mkEnableOption "Lix as an alternative to CppNix.";
|
||||
use-nixld = mkEnableOption "the use of dynamically linked executables on nix based systems.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
builders-use-substitutes = true;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
keep-derivations = true;
|
||||
keep-outputs = true;
|
||||
max-jobs = "auto";
|
||||
warn-dirty = false;
|
||||
};
|
||||
|
||||
# Garbage collection configuration.
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 3d";
|
||||
};
|
||||
|
||||
package = mkIf cfg.use-lix pkgs.lix; # Enable LIX
|
||||
};
|
||||
|
||||
# Dynamic libraries for unpackaged programs
|
||||
programs.nix-ld = mkIf cfg.use-nixld {
|
||||
enable = true;
|
||||
libraries = with pkgs; [
|
||||
glibc
|
||||
libcxx
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
25
modules/nixos/system/shell/default.nix
Normal file
25
modules/nixos/system/shell/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf types;
|
||||
inherit (self) namespace;
|
||||
inherit (self.lib) mkOpt;
|
||||
|
||||
cfg = config.${namespace}.system.shell;
|
||||
in {
|
||||
options.${namespace}.system.shell = {
|
||||
enable = mkEnableOption "custom user shells.";
|
||||
installed = mkOpt types.listOf types.package [pkgs.fish] "List of shell packages to install";
|
||||
default = mkOpt types.str "fish" "Set a custom shell as the default for all users.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.shells = cfg.installed;
|
||||
users.defaultUserShell = pkgs.${cfg.shell.type};
|
||||
programs.${cfg.shell.type}.enable = true;
|
||||
};
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
extraGroups = ["wheel"];
|
||||
};
|
||||
|
||||
archetypes.workstation.enable = true;
|
||||
archetypes.laptop.enable = true;
|
||||
};
|
||||
|
||||
# Configure 8GB SWAP partition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue