chore(fmt): use nixpkgs-fmt

This commit is contained in:
Zhongheng Liu 2025-01-08 14:13:31 +02:00
commit ecaf5df80a
Signed by: steven
GPG key ID: 805A28B071DAD84B
22 changed files with 151 additions and 164 deletions

View file

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

View file

@ -1,8 +1,8 @@
{
config,
pkgs,
...
}: let
{ config
, pkgs
, ...
}:
let
distro-grub-themes = pkgs.stdenv.mkDerivation {
pname = "distro-grub-themes";
version = "3.1";
@ -25,8 +25,9 @@
};
installPhase = "cp -r xenlism-grub-1080p-nixos/Xenlism-Nixos $out";
};
in {
environment.systemPackages = with pkgs; [hack-font];
in
{
environment.systemPackages = with pkgs; [ hack-font ];
#fileSystems."/mnt/winsys" = {
# device = "/dev/nvme0n1p5";
# fsType = "ntfs-3g";
@ -43,7 +44,7 @@ in {
theme = "rings";
themePackages = with pkgs; [
# By default we would install all themes
(adi1090x-plymouth-themes.override {selected_themes = ["rings"];})
(adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; })
];
};
@ -62,16 +63,16 @@ in {
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
supportedFilesystems = ["ntfs"];
supportedFilesystems = [ "ntfs" ];
loader = {
#timeout = 0;
efi = {canTouchEfiVariables = true;};
efi = { canTouchEfiVariables = true; };
grub = {
enable = true;
efiSupport = true;
device = "nodev";
fsIdentifier = "label";
devices = ["nodev"];
devices = [ "nodev" ];
extraConfig = ''
function load_video {
if [ x$feature_all_video_module = xy ]; then

View file

@ -1,16 +1,14 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
...
{ inputs
, lib
, config
, pkgs
, ...
}: {
imports = [
../common/variables.nix
./greetd.nix
#./ly.nix
./bootloader.nix
./nvidia.nix
./fonts.nix
@ -23,13 +21,14 @@
FLAKE = config.myConfigLocation;
MANPAGER = "nvim +Man!";
NVD_BACKEND = "direct";
NIXOS_OZONE_WL = "1";
# GTK_IM_MODULE = lib.mkForce "";
};
services.keyd = {
enable = true;
keyboards = {
default = {
ids = ["*"];
ids = [ "*" ];
settings = {
main = {
capslock = "overload(control, esc)";
@ -49,7 +48,7 @@
enable = true;
capSysNice = true;
};
security.pam.services.hyprlock = {};
security.pam.services.hyprlock = { };
i18n.inputMethod = {
type = "fcitx5";
enable = true;
@ -65,7 +64,7 @@
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {General = {Disable = "Handsfree,Headset";};};
settings = { General = { Disable = "Handsfree,Headset"; }; };
};
specialisation = {
in-china.configuration = {
@ -77,13 +76,13 @@
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
config = {common.default = ["gtk"];};
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
config = { common.default = [ "gtk" ]; };
};
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = ["network.target" "sound.target"];
wantedBy = ["default.target"];
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
programs = {
@ -96,13 +95,13 @@
true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall =
true; # Open ports in the firewall for Steam Local Network Game Transfers
extraCompatPackages = with pkgs; [proton-ge-bin];
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamemode.enable = true;
};
boot = {
kernelPackages = pkgs.linuxPackages_zen;
supportedFilesystems = ["ntfs"];
supportedFilesystems = [ "ntfs" ];
};
documentation = {
enable = true;
@ -114,7 +113,7 @@
environment.systemPackages = with pkgs; [
man-pages-posix
man-pages
(pass-wayland.withExtensions (exts: [exts.pass-otp exts.pass-import]))
(pass-wayland.withExtensions (exts: [ exts.pass-otp exts.pass-import ]))
gparted
zed-editor
libsForQt5.qt5.qtquickcontrols2
@ -122,7 +121,7 @@
/*
(blender.override {
cudaSupport = true;
})
})
*/
trash-cli
#inputs.hyprswitch.packages.x86_64-linux.default
@ -154,28 +153,30 @@
# wrapperFeatures.gtk = true;
#};
nixpkgs = {
overlays = [];
overlays = [ ];
config = {
allowUnfree = true;
permittedInsecurePackages = ["dotnet-core-combined"];
permittedInsecurePackages = [ "dotnet-core-combined" ];
};
};
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = "nix-command flakes";
# flake-registry = "";
nix-path = config.nix.nixPath;
nix =
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in
{
settings = {
experimental-features = "nix-command flakes";
# flake-registry = "";
nix-path = config.nix.nixPath;
};
extraOptions = ''
trusted-users = root stvnliu
'';
channel.enable = false;
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
extraOptions = ''
trusted-users = root stvnliu
'';
channel.enable = false;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
systemd.network.wait-online.enable = false;
networking = {
@ -188,15 +189,15 @@
"${config.myUserName}" = {
initialPassword = "stevenpassword";
isNormalUser = true;
openssh.authorizedKeys.keys = [];
packages = with pkgs; [nh];
extraGroups = ["wheel" "input" "networkmanager"];
openssh.authorizedKeys.keys = [ ];
packages = with pkgs; [ nh ];
extraGroups = [ "wheel" "input" "networkmanager" ];
};
"xi_jinping" = {
initialPassword = "bingchilling";
isNormalUser = true;
packages = with pkgs; [git];
extraGroups = ["input"];
packages = with pkgs; [ git ];
extraGroups = [ "input" ];
};
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion

View file

@ -1,8 +1,7 @@
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
networking.extraHosts = ''
# home IP mapping

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
fonts.packages = with pkgs;
[
helvetica-neue-lt-std

View file

@ -1,11 +1,12 @@
{
pkgs,
config,
lib,
...
}: let
{ pkgs
, config
, lib
, ...
}:
let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
in {
in
{
services.greetd = {
enable = true;
settings = {

View file

@ -1,21 +1,20 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
{ config
, lib
, pkgs
, modulesPath
, ...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410";
@ -25,7 +24,7 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2E4F-3060";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/games" = {
@ -33,7 +32,7 @@
fsType = "ext4";
};
swapDevices = [];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,9 +0,0 @@
{
pkgs,
config,
...
}: {
services.displayManager.ly = {
enable = true;
};
}

View file

@ -1,8 +1,7 @@
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
specialisation = {
powersave.configuration = {
@ -15,14 +14,14 @@
};
};
};
boot.kernelModules = ["nvidia_uvm"];
boot.kernelModules = [ "nvidia_uvm" ];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libvdpau-va-gl
];
};
services.xserver.videoDrivers = ["nvidia"];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
dynamicBoost.enable = true;
prime = {

View file

@ -1,4 +1,4 @@
{pkgs, ...}:
{ pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "sddm-theme";
src = pkgs.fetchFromGitHub {

View file

@ -1,4 +1,4 @@
{...}: {
{ ... }: {
services.avahi = {
enable = true;
nssmdns4 = true;

View file

@ -1,4 +1,4 @@
{...}: {
{ ... }: {
imports = [
./nginx.service.nix
./pipewire.service.nix
@ -10,5 +10,6 @@
./power_management.service.nix
./seatd.service.nix
./logind.service.nix
#./mpd.service.nix
];
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
services.logind.extraConfig = ''
# don't shutdown in short press

View file

@ -1,4 +1,4 @@
{...}: {
{ ... }: {
specialisation.powersave.configuration = {
services.auto-cpufreq.enable = true;
};

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
services.nginx = {
enable = true;
@ -15,8 +14,8 @@
'';
};
};
listenAddresses = ["127.0.0.1" "[::1]"];
listenAddresses = [ "127.0.0.1" "[::1]" ];
};
};
networking.firewall.allowedTCPPorts = [80];
networking.firewall.allowedTCPPorts = [ 80 ];
}

View file

@ -1,4 +1,5 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
pw_rnnoise_config = {
"context.modules" = [
{
@ -13,11 +14,11 @@
"name" = "rnnoise";
"plugin" = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so";
"label" = "noise_suppressor_stereo";
"control" = {"VAD Threshold (%)" = 50.0;};
"control" = { "VAD Threshold (%)" = 50.0; };
}
];
};
"audio.position" = ["FL" "FR"];
"audio.position" = [ "FL" "FR" ];
"capture.props" = {
"node.name" = "effect_input.rnnoise";
"node.passive" = true;
@ -30,7 +31,8 @@
}
];
};
in {
in
{
services.pipewire = {
enable = true;
alsa = {
@ -42,33 +44,33 @@ in {
wireplumber.configPackages = [
(pkgs.writeTextDir
"share/wireplumber/wireplumber.conf.d/52-profile-switch.conf" ''
wireplumber.settings = {
bluetooth.autoswitch-to-headset-profile = false
}
wireplumber.settings = {
bluetooth.autoswitch-to-headset-profile = false
}
monitor.bluez.properties = {
## Supported roles: hsp_hs (HSP Headset),
## hsp_ag (HSP Audio Gateway),
## hfp_hf (HFP Hands-Free),
## hfp_ag (HFP Audio Gateway)
## a2dp_sink (A2DP Audio Sink)
## a2dp_source (A2DP Audio Source)
## bap_sink (LE Audio Basic Audio Profile Sink)
## bap_source (LE Audio Basic Audio Profile Source)
## --
## Only enable A2DP here and disable HFP. See note at the top as to why.
bluez5.roles = [ a2dp_sink a2dp_source ]
}
'')
monitor.bluez.properties = {
## Supported roles: hsp_hs (HSP Headset),
## hsp_ag (HSP Audio Gateway),
## hfp_hf (HFP Hands-Free),
## hfp_ag (HFP Audio Gateway)
## a2dp_sink (A2DP Audio Sink)
## a2dp_source (A2DP Audio Source)
## bap_sink (LE Audio Basic Audio Profile Sink)
## bap_source (LE Audio Basic Audio Profile Source)
## --
## Only enable A2DP here and disable HFP. See note at the top as to why.
bluez5.roles = [ a2dp_sink a2dp_source ]
}
'')
(pkgs.writeTextDir
"share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'')
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'')
];
#extraConfig.pipewire."99-input-denoising" = pw_rnnoise_config;
};

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
services.tlp = {
enable = true;

View file

@ -1,6 +1,6 @@
{...}: {
{ ... }: {
services.printing = {
enable = true;
drivers = [];
drivers = [ ];
};
}

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
services.seatd = {
enable = true;

View file

@ -1,8 +1,7 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}: {
services = {
syncthing = {
@ -12,6 +11,6 @@
configDir = "/home/${config.myUserName}/.config/syncthing";
};
};
networking.firewall.allowedTCPPorts = [8384 22000];
networking.firewall.allowedUDPPorts = [22000 21027];
networking.firewall.allowedTCPPorts = [ 8384 22000 ];
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
}

View file

@ -1,7 +1,6 @@
{
pkgs,
config,
...
{ pkgs
, config
, ...
}: {
services.tailscale = {
enable = true;

View file

@ -1,8 +1,7 @@
{
pkgs,
lib,
config,
...
{ pkgs
, lib
, config
, ...
}: {
virtualisation = {
libvirtd.enable = true;
@ -13,5 +12,5 @@
#virtualisation.virtualbox.host = {
# enable = true;
#};
users.users."${config.myUserName}".extraGroups = ["libvirtd"];
users.users."${config.myUserName}".extraGroups = [ "libvirtd" ];
}