From 14edf3fd1927286669d3dcb1d6eeb027b711352b Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Thu, 30 Jul 2020 22:13:41 -0600 Subject: [PATCH] fix various linting errors throughout the repo * replace `rec` attrs with let bindings * remove unused args --- modules/security/mitigations.nix | 2 +- modules/services/games/gamemode.nix | 2 +- overlays/pcsx2.nix | 7 ++++--- overlays/retroarch.nix | 7 ++++--- .../display-managers/sddm/themes/chili/default.nix | 5 +++-- pkgs/data/fonts/dejavu-nerdfont/default.nix | 7 ++++--- pkgs/development/libraries/libinih/default.nix | 6 +++--- pkgs/os-specific/linux/gamemode/default.nix | 9 +++++---- pkgs/shells/zsh/pure/default.nix | 8 ++++---- profiles/core.nix | 2 +- profiles/graphical/default.nix | 2 +- profiles/graphical/xmonad/_xmonad.nix | 2 +- profiles/misc/stubby.nix | 2 +- profiles/postgres/default.nix | 2 +- profiles/virt/default.nix | 2 +- 15 files changed, 35 insertions(+), 30 deletions(-) diff --git a/modules/security/mitigations.nix b/modules/security/mitigations.nix index 9a5766d..33e8b13 100644 --- a/modules/security/mitigations.nix +++ b/modules/security/mitigations.nix @@ -1,4 +1,4 @@ -{ config, lib, options, ... }: +{ config, lib, ... }: with lib; let inherit (builtins) readFile fetchurl; diff --git a/modules/services/games/gamemode.nix b/modules/services/games/gamemode.nix index 90d9bcf..7a47348 100644 --- a/modules/services/games/gamemode.nix +++ b/modules/services/games/gamemode.nix @@ -1,4 +1,4 @@ -{ config, lib, options, pkgs, ... }: +{ config, lib, pkgs, ... }: with lib; diff --git a/overlays/pcsx2.nix b/overlays/pcsx2.nix index 2af7760..a8bace8 100644 --- a/overlays/pcsx2.nix +++ b/overlays/pcsx2.nix @@ -1,6 +1,7 @@ -final: prev: { - pcsx2 = prev.pcsx2.overrideAttrs (o: rec { - version = "1.6.0"; +let version = "1.6.0"; +in final: prev: { + pcsx2 = prev.pcsx2.overrideAttrs (o: { + inherit version; src = prev.fetchFromGitHub { owner = "PCSX2"; repo = "pcsx2"; diff --git a/overlays/retroarch.nix b/overlays/retroarch.nix index 378b066..b69b4ed 100644 --- a/overlays/retroarch.nix +++ b/overlays/retroarch.nix @@ -1,6 +1,7 @@ -final: prev: { - retroarchBare = prev.retroarchBare.overrideAttrs (o: rec { - version = "1.8.9"; +let version = "1.8.9"; +in final: prev: { + retroarchBare = prev.retroarchBare.overrideAttrs (o: { + inherit version; src = prev.fetchFromGitHub { owner = "libretro"; diff --git a/pkgs/applications/display-managers/sddm/themes/chili/default.nix b/pkgs/applications/display-managers/sddm/themes/chili/default.nix index e013bcf..7b35990 100644 --- a/pkgs/applications/display-managers/sddm/themes/chili/default.nix +++ b/pkgs/applications/display-managers/sddm/themes/chili/default.nix @@ -1,7 +1,8 @@ { stdenv, fetchFromGitHub, ... }: -stdenv.mkDerivation rec { +let version = "0.1.5"; +in stdenv.mkDerivation { pname = "sddm-chili"; - version = "0.1.5"; + inherit version; src = fetchFromGitHub { owner = "MarianArlt"; diff --git a/pkgs/data/fonts/dejavu-nerdfont/default.nix b/pkgs/data/fonts/dejavu-nerdfont/default.nix index ad0e4b9..9e36e00 100644 --- a/pkgs/data/fonts/dejavu-nerdfont/default.nix +++ b/pkgs/data/fonts/dejavu-nerdfont/default.nix @@ -1,8 +1,9 @@ -{ stdenv, fetchzip }: +let version = "2.0.0"; +in { stdenv, fetchzip }: -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "dejavu-nerdfont"; - version = "2.0.0"; + inherit version; src = fetchzip { url = diff --git a/pkgs/development/libraries/libinih/default.nix b/pkgs/development/libraries/libinih/default.nix index 19b12e0..5e4789a 100644 --- a/pkgs/development/libraries/libinih/default.nix +++ b/pkgs/development/libraries/libinih/default.nix @@ -1,8 +1,8 @@ { stdenv, meson, ninja, fetchFromGitHub, ... }: - -stdenv.mkDerivation rec { +let version = "r50"; +in stdenv.mkDerivation { pname = "libinih"; - version = "r50"; + inherit version; src = fetchFromGitHub { owner = "benhoyt"; diff --git a/pkgs/os-specific/linux/gamemode/default.nix b/pkgs/os-specific/linux/gamemode/default.nix index daf718b..547af85 100644 --- a/pkgs/os-specific/linux/gamemode/default.nix +++ b/pkgs/os-specific/linux/gamemode/default.nix @@ -1,9 +1,10 @@ -{ stdenv, appstream, meson, ninja, pkgsi686Linux, polkit, pkgconfig, systemd -, dbus, libinih, fetchFromGitHub, ... }: +let version = "1.5.1"; +in { stdenv, meson, ninja, polkit, pkgconfig, systemd, dbus, libinih +, fetchFromGitHub, ... }: -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "gamemode"; - version = "1.5.1"; + inherit version; src = fetchFromGitHub { owner = "FeralInteractive"; diff --git a/pkgs/shells/zsh/pure/default.nix b/pkgs/shells/zsh/pure/default.nix index 458f9c0..f713975 100644 --- a/pkgs/shells/zsh/pure/default.nix +++ b/pkgs/shells/zsh/pure/default.nix @@ -1,8 +1,8 @@ -{ stdenv, fetchFromGitHub, openssl, pkgconfig, rustPlatform }: - -stdenv.mkDerivation rec { +{ stdenv, fetchFromGitHub }: +let version = "0e87bd8"; +in stdenv.mkDerivation { pname = "pure"; - version = "0e87bd8"; + inherit version; srcs = fetchFromGitHub { owner = "sindresorhus"; diff --git a/profiles/core.nix b/profiles/core.nix index 4bbd3be..70fbaa5 100644 --- a/profiles/core.nix +++ b/profiles/core.nix @@ -37,7 +37,7 @@ in { ''; shellAliases = - let ifSudo = string: lib.mkIf config.security.sudo.enable string; + let ifSudo = lib.mkIf config.security.sudo.enable; in { # quick cd ".." = "cd .."; diff --git a/profiles/graphical/default.nix b/profiles/graphical/default.nix index 586afcc..67486cd 100644 --- a/profiles/graphical/default.nix +++ b/profiles/graphical/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: let inherit (builtins) readFile; in { imports = [ ./sway ../develop ./xmonad ../networkmanager ../im ]; diff --git a/profiles/graphical/xmonad/_xmonad.nix b/profiles/graphical/xmonad/_xmonad.nix index 7d6ab1a..5e28115 100644 --- a/profiles/graphical/xmonad/_xmonad.nix +++ b/profiles/graphical/xmonad/_xmonad.nix @@ -1,4 +1,4 @@ -{ autostart, screenshots, touchtoggle, pkgs, stoggle, volnoti }: +{ autostart, screenshots, pkgs, stoggle, volnoti }: let inherit (pkgs) alsaUtils; in '' -- Function for fullscreen toggle diff --git a/profiles/misc/stubby.nix b/profiles/misc/stubby.nix index 81a4b1d..4f7de05 100644 --- a/profiles/misc/stubby.nix +++ b/profiles/misc/stubby.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ ... }: { services.stubby = { enable = true; upstreamServers = '' diff --git a/profiles/postgres/default.nix b/profiles/postgres/default.nix index fb9f877..8f9c7fe 100644 --- a/profiles/postgres/default.nix +++ b/profiles/postgres/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: { +{ pkgs, ... }: { services.postgresql = { enable = true; dataDir = "/srv/postgres"; diff --git a/profiles/virt/default.nix b/profiles/virt/default.nix index f6d7f9c..f8c7f1c 100644 --- a/profiles/virt/default.nix +++ b/profiles/virt/default.nix @@ -14,7 +14,7 @@ libvirt = if prev.libvirt.version <= "5.4.0" && prev.ebtables.version > "2.0.10-4" then prev.libvirt.overrideAttrs - (oldAttrs: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; }) + (o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; }) else prev.libvirt; };