From 42b8f67be810965a07f38e05d8a1b62020ee9b7f Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 3 Sep 2024 11:38:50 +0200 Subject: [PATCH] Upgrade to nixfmt-rfc-style --- configuration.nix | 42 ++++++++++++++++++++++++++++++++++-------- modules/audio.nix | 17 +++++++++++++---- modules/gui.nix | 7 ++++++- modules/software.nix | 26 +++++++++++++++++++------- 4 files changed, 72 insertions(+), 20 deletions(-) diff --git a/configuration.nix b/configuration.nix index 0bd658f..10b5a0c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, inputs, ... }: +{ + config, + lib, + pkgs, + inputs, + ... +}: with pkgs; @@ -6,9 +12,11 @@ with pkgs; # Kernel configuration boot = { kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; - kernelParams = - [ "zfs.zfs_arc_max=8589934592" "zfs.zfs_arc_min=1073741824" ]; blacklistedKernelModules = [ "btusb" "bluetooth" ]; + kernelParams = [ + "zfs.zfs_arc_max=8589934592" + "zfs.zfs_arc_min=1073741824" + ]; supportedFilesystems = [ "zfs" ]; zfs = { requestEncryptionCredentials = true; @@ -38,7 +46,10 @@ with pkgs; nix = { settings = { auto-optimise-store = true; - trusted-users = [ "root" "coolneng" ]; + trusted-users = [ + "root" + "coolneng" + ]; }; gc = { automatic = true; @@ -76,7 +87,12 @@ with pkgs; users.users.coolneng = { isNormalUser = true; home = "/home/coolneng"; - extraGroups = [ "wheel" "video" "audio" "lp" ]; + extraGroups = [ + "wheel" + "video" + "audio" + "lp" + ]; shell = fish; }; @@ -97,15 +113,25 @@ with pkgs; }; # Use same version of nixpkgs for nix-shell - nix.nixPath = let path = toString ./.; - in [ "nixpkgs=${inputs.nixpkgs}" "nixos-config=${path}/configuration.nix" ]; + nix.nixPath = + let + path = toString ./.; + in + [ + "nixpkgs=${inputs.nixpkgs}" + "nixos-config=${path}/configuration.nix" + ]; # Auto-upgrade the system system.autoUpgrade = { enable = true; dates = "22:30"; flake = "/home/coolneng/Projects/panacea"; - flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; + flags = [ + "--update-input" + "nixpkgs" + "--commit-lock-file" + ]; }; # Add required dependencies to the auto-upgrade service diff --git a/modules/audio.nix b/modules/audio.nix index d7bd9df..edfdb9a 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,16 +1,25 @@ -{ config, lib, pkgs, inputs, ... }: +{ + config, + lib, + pkgs, + inputs, + ... +}: with pkgs; let # HACK Replace youtube-dl with yt-dlp in mopidy-youtube mopidy-youtube-yt_dlp = mopidy-youtube.overrideAttrs (old: rec { - propagatedBuildInputs = old.propagatedBuildInputs - ++ [ python3.pkgs.yt-dlp python3.pkgs.ytmusicapi ]; + propagatedBuildInputs = old.propagatedBuildInputs ++ [ + python3.pkgs.yt-dlp + python3.pkgs.ytmusicapi + ]; }); soundcloud_token = builtins.readFile ../secrets/soundcloud_token; -in { +in +{ # Configure pipewire as sound server services.pipewire = { enable = true; diff --git a/modules/gui.nix b/modules/gui.nix index f25f834..4c2a73b 100644 --- a/modules/gui.nix +++ b/modules/gui.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with pkgs; diff --git a/modules/software.nix b/modules/software.nix index 9dcc1e0..ff8469b 100644 --- a/modules/software.nix +++ b/modules/software.nix @@ -1,12 +1,23 @@ -{ config, lib, pkgs, inputs, ... }: +{ + config, + lib, + pkgs, + inputs, + ... +}: with pkgs; let - custom-mpv = (mpv-unwrapped.wrapper { - mpv = mpv-unwrapped; - scripts = with mpvScripts; [ sponsorblock-minimal mpv-cheatsheet ]; - }); + custom-mpv = ( + mpv-unwrapped.wrapper { + mpv = mpv-unwrapped; + scripts = with mpvScripts; [ + sponsorblock-minimal + mpv-cheatsheet + ]; + } + ); patched-bitwig = bitwig-studio.overrideAttrs (old: rec { src = "${inputs.local-bitwig}/bitwig-studio.deb"; @@ -15,7 +26,8 @@ let ''; }); -in { +in +{ environment.systemPackages = [ # Monitoring htop @@ -102,7 +114,7 @@ in { shellcheck shfmt ## Nix - nixfmt + nixfmt-rfc-style ## Python nodePackages.pyright black