format nix with alejandra

This commit is contained in:
js0ny 2025-10-24 22:41:27 +01:00
parent e1cc141ce7
commit 2b498c9fd3
37 changed files with 183 additions and 177 deletions

View file

@ -88,5 +88,17 @@
"telemetry": { "telemetry": {
"diagnostics": false, "diagnostics": false,
"metrics": false "metrics": false
},
"languages": {
"Nix": {
"formatter": {
"external": {
"command": "alejandra"
}
},
"completions": {
"lsp_insert_mode": "replace"
}
}
} }
} }

View file

@ -5,8 +5,7 @@
pkgs, pkgs,
nix-flatpak, nix-flatpak,
... ...
}: }: {
{
imports = [ imports = [
# impure build # impure build
/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix

View file

@ -1,6 +1,8 @@
{ config, pkgs, ...}:
{ {
config,
pkgs,
...
}: {
homebrew = { homebrew = {
enable = true; enable = true;
brewPrefix = "/opt/homebrew/bin"; brewPrefix = "/opt/homebrew/bin";
@ -65,5 +67,4 @@
"font-maple-mono-nf-cn" "font-maple-mono-nf-cn"
]; ];
}; };
} }

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {pkgs, ...}: {
{
imports = [ imports = [
./packages.nix ./packages.nix
./brew.nix ./brew.nix

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
# Managed by Determinate # Managed by Determinate
nix.enable = false; nix.enable = false;
system.stateVersion = 6; system.stateVersion = 6;
@ -51,5 +53,4 @@
]; ];
programs.zsh.enable = true; programs.zsh.enable = true;
} }

View file

@ -1,6 +1,5 @@
# ~/.config/nixcfgs/hosts/zephyrus/default.nix # ~/.config/nixcfgs/hosts/zephyrus/default.nix
{ pkgs, ... }: {pkgs, ...}: {
{
imports = [ imports = [
# Host-specific configs # Host-specific configs
./asus.nix ./asus.nix
@ -23,6 +22,7 @@
# desktop environment and display manager # desktop environment and display manager
../../modules/nixos/desktop/dm/gdm.nix ../../modules/nixos/desktop/dm/gdm.nix
../../modules/nixos/desktop/de/gnome.nix ../../modules/nixos/desktop/de/gnome.nix
../../modules/nixos/desktop/de/niri.nix
# desktop programs # desktop programs
../../modules/nixos/programs/chromium.nix ../../modules/nixos/programs/chromium.nix

View file

@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
@ -13,37 +17,36 @@
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74"; device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@"]; options = ["subvol=@"];
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74"; device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@home"]; options = ["subvol=@home"];
}; };
fileSystems."/swap" = fileSystems."/swap" = {
{ device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74"; device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@swap"]; options = ["subvol=@swap"];
}; };
fileSystems."/nix" = fileSystems."/nix" = {
{ device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74"; device = "/dev/disk/by-uuid/ed71c463-1cf6-449d-9aa8-ed715fe7ad74";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@nix"]; options = ["subvol=@nix"];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/0BDA-B0A4"; device = "/dev/disk/by-uuid/0BDA-B0A4";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0022" "dmask=0022"]; options = ["fmask=0022" "dmask=0022"];
}; };
swapDevices = []; swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
keyd keyd
]; ];

View file

@ -1,12 +1,14 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. lib,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
../common/nixos.nix ../common/nixos.nix
../common/desktop-linux.nix ../common/desktop-linux.nix
../common/packages-fonts.nix ../common/packages-fonts.nix
@ -20,10 +22,8 @@
../common/docker.nix ../common/docker.nix
]; ];
networking.hostName = "zp"; # Define your hostname. networking.hostName = "zp"; # Define your hostname.
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
# #
@ -42,6 +42,4 @@
# #
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.05"; # Did you read the comment? system.stateVersion = "25.05"; # Did you read the comment?
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
luajit luajit
lua-language-server lua-language-server

View file

@ -8,4 +8,3 @@
enableZshIntegration = true; enableZshIntegration = true;
}; };
} }

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
freerdp freerdp
winboat winboat

View file

@ -3,7 +3,6 @@
pkgs, pkgs,
... ...
}: { }: {
# Select internationalisation properties. # Select internationalisation properties.
i18n = { i18n = {
defaultLocale = "en_GB.UTF-8"; defaultLocale = "en_GB.UTF-8";

View file

@ -5,4 +5,5 @@
korganizer korganizer
kdepim-addons kdepim-addons
]; ];
services.xserver.desktopManager.cinnamon.enable = true;
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.niri.enable = true; programs.niri.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
waybar waybar

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
services.displayManager.gdm = { services.displayManager.gdm = {
enable = true; enable = true;
wayland = true; wayland = true;

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {pkgs, ...}:
# See https://www.reddit.com/r/NixOS/comments/1kcj34p/how_to_apply_this_sddm_theme_on_nixos/ # See https://www.reddit.com/r/NixOS/comments/1kcj34p/how_to_apply_this_sddm_theme_on_nixos/
let let
custom-sddm-astronaut = pkgs.sddm-astronaut.override { custom-sddm-astronaut = pkgs.sddm-astronaut.override {
@ -9,7 +8,6 @@ let
# Font = "M+1 Nerd Font"; # Font = "M+1 Nerd Font";
#}; #};
}; };
in { in {
# Enable the KDE Plasma Desktop Environment. # Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm = { services.displayManager.sddm = {
@ -30,5 +28,4 @@ in {
custom-sddm-astronaut custom-sddm-astronaut
kdePackages.qtmultimedia kdePackages.qtmultimedia
]; ];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
boot.extraModprobeConfig = '' boot.extraModprobeConfig = ''
blacklist nouveau blacklist nouveau
options nouveau modeset=0 options nouveau modeset=0

View file

@ -8,4 +8,3 @@
enable32Bit = true; enable32Bit = true;
}; };
} }

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
programs.chromium = { programs.chromium = {
enable = true; enable = true;
homepageLocation = "https://duckduckgo.com"; homepageLocation = "https://duckduckgo.com";

View file

@ -1,5 +1,8 @@
{ pkgs, inputs, ... }:
{ {
pkgs,
inputs,
...
}: {
virtualisation.waydroid.enable = true; virtualisation.waydroid.enable = true;
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.nur.overlays.default inputs.nur.overlays.default

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
services.syncthing.enable = true; services.syncthing.enable = true;
services.tailscale.enable = true; services.tailscale.enable = true;
} }

View file

@ -1,11 +1,12 @@
# ~/.config/nixcfgs/users/js0ny/default.nix # ~/.config/nixcfgs/users/js0ny/default.nix
{ pkgs, ... }: {pkgs, ...}: let
let
username = "js0ny"; username = "js0ny";
in in {
{
home.username = username; home.username = username;
home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/${username}" else "/home/${username}"; home.homeDirectory =
if pkgs.stdenv.isDarwin
then "/Users/${username}"
else "/home/${username}";
home.packages = with pkgs; [ home.packages = with pkgs; [
home-manager home-manager

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: let
let
my-catppuccin-kde = pkgs.catppuccin-kde.override { my-catppuccin-kde = pkgs.catppuccin-kde.override {
flavour = [ flavour = [
"mocha" "mocha"
@ -12,9 +11,7 @@ let
accents = ["pink"]; accents = ["pink"];
variant = "mocha"; variant = "mocha";
}; };
in in {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
catppuccin catppuccin
my-catppuccin-gtk my-catppuccin-gtk

View file

@ -1,6 +1,5 @@
# ~/.config/nix-config/common/packages-headless.nix # ~/.config/nix-config/common/packages-headless.nix
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
rclone rclone
age age

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
# Terminal Emulator # Terminal Emulator
ghostty # default ghostty # default

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.chromium = { programs.chromium = {
enable = true; enable = true;
commandLineArgs = [ commandLineArgs = [

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.sessionVariables = { home.sessionVariables = {
QT_STYLE_OVERRIDE = "adwaita"; QT_STYLE_OVERRIDE = "adwaita";
}; };

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs.gnomeExtensions; [ home.packages = with pkgs.gnomeExtensions; [
paperwm paperwm
]; ];
@ -50,8 +49,8 @@
center-vertically = [""]; center-vertically = [""];
drift-left = [""]; drift-left = [""];
drift-right = [""]; drift-right = [""];
move-up-workspace = [ "<Alt><Super>k" ]; move-up-workspace = ["<Control><Super>k"];
move-down-workspace = [ "<Alt><Super>j" ]; move-down-workspace = ["<Control><Super>j"];
}; };
}; };
} }

View file

@ -106,6 +106,7 @@
"org.kde.plasma.pager" "org.kde.plasma.pager"
"org.kde.plasma.windowlist" "org.kde.plasma.windowlist"
"org.kde.plasma.marginsseparator" "org.kde.plasma.marginsseparator"
"org.kde.plasma.systemmonitor.memory"
]; ];
opacity = "translucent"; opacity = "translucent";
hiding = "none"; hiding = "none";

View file

@ -0,0 +1,19 @@
# TODO
{pkgs}: let
dictBz2 = [
{
url = "http://download.huzheng.org/zh_CN/stardict-langdao-ec-gb-2.4.2.tar.bz2";
sha256 = "68adfd6348418725b1810b5aeda2506ce44ddbc1ad99f2f68f6ba135cd3bf03c";
}
];
fetchedArchives = map (spec:
pkgs.fetchurl {
url = spec.url;
sha256 = spec.sha256;
})
dictBz2;
in {
home.packages = with pkgs; [
sdcv
];
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.zed-editor = { programs.zed-editor = {
enable = true; enable = true;
extensions = [ extensions = [

View file

@ -1,5 +1,4 @@
{...}: {...}: {
{
imports = [ imports = [
./default.nix ./default.nix
./programs/shell.nix ./programs/shell.nix
@ -14,5 +13,3 @@
home.stateVersion = "25.05"; home.stateVersion = "25.05";
} }

View file

@ -1,6 +1,5 @@
# ~/.config/nixcfgs/users/js0ny/default.nix # ~/.config/nixcfgs/users/js0ny/default.nix
{ ... }: {...}: {
{
imports = [ imports = [
# General config # General config
./default.nix ./default.nix