format: apply nixpkgs-fmt

This commit is contained in:
Timothy DeHerrera 2020-07-30 22:17:28 -06:00
parent 14edf3fd19
commit 2369f43398
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
39 changed files with 319 additions and 242 deletions

View File

@ -1,14 +1,12 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
in
{
inherit imports;
nix.binaryCaches = ["https://cache.nixos.org/"];
nix.binaryCaches = [ "https://cache.nixos.org/" ];
}

View File

@ -1,4 +1,3 @@
{
nix = {
binaryCaches = [
@ -9,4 +8,3 @@
];
};
}

View File

@ -7,11 +7,13 @@ let
hostname = lib.fileContents /etc/hostname;
host = "/etc/nixos/hosts/${hostname}.nix";
config = if (builtins.pathExists host) then
config =
if (builtins.pathExists host) then
[ host ]
else
[ /etc/nixos/hosts/NixOS.nix ];
in {
in
{
imports = (import ./modules/list.nix) ++ [
"${
builtins.fetchTarball
@ -27,8 +29,11 @@ in {
"nixpkgs-overlays=/etc/nixos/overlays"
];
nixpkgs.overlays = let
overlays = map (name: import (./overlays + "/${name}"))
nixpkgs.overlays =
let
overlays = map
(name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
in overlays;
in
overlays;
}

View File

@ -26,7 +26,8 @@
pkgs = pkgImport nixpkgs;
unstablePkgs = pkgImport unstable;
in {
in
{
nixosConfigurations =
import ./hosts (inputs // { inherit system pkgs unstablePkgs utils; });
@ -34,15 +35,18 @@
overlay = import ./pkgs;
overlays = let
overlays =
let
overlayDir = ./overlays;
fullPath = name: overlayDir + "/${name}";
overlayPaths = map fullPath (attrNames (readDir overlayDir));
in pathsToImportedAttrs overlayPaths;
in
pathsToImportedAttrs overlayPaths;
packages."${system}" = self.overlay pkgs pkgs;
nixosModules = let
nixosModules =
let
# binary cache
cachix = import ./cachix.nix;
cachixAttrs = { inherit cachix; };
@ -55,6 +59,7 @@
profilesList = import ./profiles/list.nix;
profilesAttrs = { profiles = pathsToImportedAttrs profilesList; };
in cachixAttrs // modulesAttrs // profilesAttrs;
in
cachixAttrs // modulesAttrs // profilesAttrs;
};
}

View File

@ -8,7 +8,8 @@ let
lib.nixosSystem {
inherit system;
modules = let
modules =
let
inherit (home.nixosModules) home-manager;
core = self.nixosModules.profiles.core;
@ -37,7 +38,8 @@ let
with unstablePkgs; {
inherit starship element-desktop discord signal-desktop mpv
dhall;
})
}
)
];
};
@ -47,7 +49,8 @@ let
flakeModules =
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
in flakeModules ++ [ core global local home-manager unstables ];
in
flakeModules ++ [ core global local home-manager unstables ];
};
@ -55,4 +58,5 @@ let
dir = ./.;
_import = config;
};
in hosts
in
hosts

View File

@ -13,18 +13,21 @@ let
# Generate an attribute set by mapping a function over a list of values.
genAttrs' = values: f: listToAttrs (map f values);
in {
in
{
inherit mapFilterAttrs genAttrs';
recImport = { dir, _import ? base: import "${dir}/${base}.nix" }:
mapFilterAttrs (_: v: v != null) (n: v:
mapFilterAttrs
(_: v: v != null)
(n: v:
if n != "default.nix" && hasSuffix ".nix" n && v == "regular"
then
let name = removeSuffix ".nix" n; in nameValuePair (name) (_import name)
else
nameValuePair ("") (null)) (readDir dir);
nameValuePair ("") (null))
(readDir dir);
# Convert a list to file paths to attribute set
# that has the filenames stripped of nix extension as keys

View File

@ -8,7 +8,8 @@ let
cmdline = ''
ibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off
'';
in {
in
{
options = {
security.mitigations.disable = mkOption {
type = types.bool;

View File

@ -1,9 +1,9 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.gamemode;
in {
in
{
options.services.gamemode = {
enable = mkOption {
type = types.bool;

View File

@ -1,9 +1,9 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.wii-u-gc-adapter;
in {
in
{
options = {
services.wii-u-gc-adapter = {
enable = mkOption {

View File

@ -4,7 +4,8 @@ let
cfg = config.services.qbittorrent;
configDir = "${cfg.dataDir}/.config";
openFilesLimit = 4096;
in {
in
{
options.services.qbittorrent = {
enable = mkOption {
type = types.bool;

View File

@ -1,9 +1,9 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.services.xserver.windowManager.steam;
in {
in
{
options = {
services.xserver.windowManager.steam = {
enable = mkEnableOption "steam";

View File

@ -1,5 +1,6 @@
let version = "1.6.0";
in final: prev: {
in
final: prev: {
pcsx2 = prev.pcsx2.overrideAttrs (o: {
inherit version;
src = prev.fetchFromGitHub {

View File

@ -1,5 +1,6 @@
let version = "1.8.9";
in final: prev: {
in
final: prev: {
retroarchBare = prev.retroarchBare.overrideAttrs (o: {
inherit version;

View File

@ -1,4 +1,3 @@
final: prev: {
slock = prev.slock.overrideAttrs
(o: { patches = [ ../pkgs/misc/screensavers/slock/window_name.patch ]; });
slock = prev.slock.overrideAttrs (o: { patches = [ ../pkgs/misc/screensavers/slock/window_name.patch ]; });
}

View File

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub, ... }:
let version = "0.1.5";
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
pname = "sddm-chili";
inherit version;

View File

@ -1,5 +1,17 @@
{ stdenv, fetchFromGitHub, libudev, SDL, SDL_image, libXdamage, libXcomposite
, libXrender, libXext, libXxf86vm, pkgconfig, autoreconfHook, gnumake }:
{ stdenv
, fetchFromGitHub
, libudev
, SDL
, SDL_image
, libXdamage
, libXcomposite
, libXrender
, libXext
, libXxf86vm
, pkgconfig
, autoreconfHook
, gnumake
}:
stdenv.mkDerivation {
name = "steamcompmgr";

View File

@ -1,5 +1,6 @@
let version = "2.0.0";
in { stdenv, fetchzip }:
in
{ stdenv, fetchzip }:
stdenv.mkDerivation {
pname = "dejavu-nerdfont";

View File

@ -1,6 +1,7 @@
{ stdenv, meson, ninja, fetchFromGitHub, ... }:
let version = "r50";
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
pname = "libinih";
inherit version;

View File

@ -1,6 +1,16 @@
let version = "1.5.1";
in { stdenv, meson, ninja, polkit, pkgconfig, systemd, dbus, libinih
, fetchFromGitHub, ... }:
in
{ stdenv
, meson
, ninja
, polkit
, pkgconfig
, systemd
, dbus
, libinih
, fetchFromGitHub
, ...
}:
stdenv.mkDerivation {
pname = "gamemode";

View File

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub }:
let version = "0e87bd8";
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
pname = "pure";
inherit version;

View File

@ -5,7 +5,8 @@ let
inherit (builtins) readFile toFile;
init = toFile "init.sh" "${readFile ./init.sh}";
in buildRustPackage {
in
buildRustPackage {
pname = "purs";
version = "0.1.0";

View File

@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }:
let inherit (lib) fileContents;
in {
in
{
nix.package = pkgs.nixFlakes;
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
@ -38,7 +39,8 @@ in {
shellAliases =
let ifSudo = lib.mkIf config.security.sudo.enable;
in {
in
{
# quick cd
".." = "cd ..";
"..." = "cd ../..";

View File

@ -1,7 +1,9 @@
{ pkgs, ... }:
let inherit (pkgs) python3Packages;
in {
environment.systemPackages = let
in
{
environment.systemPackages =
let
packages = pythonPackages:
with pythonPackages; [
numpy
@ -13,10 +15,13 @@ in {
python = pkgs.python3.withPackages packages;
in [ python ];
in
[ python ];
environment.sessionVariables = {
PYTHONSTARTUP = let
startup = pkgs.writers.writePython3 "ptpython.py" {
PYTHONSTARTUP =
let
startup = pkgs.writers.writePython3 "ptpython.py"
{
libraries = with python3Packages; [ ptpython ];
} ''
from __future__ import unicode_literals
@ -36,7 +41,7 @@ in {
else:
sys.exit(embed(globals(), locals(), configure=configure))
'';
in "${startup}";
in
"${startup}";
};
}

View File

@ -5,10 +5,12 @@ let
inherit (lib) removePrefix;
pluginConf = plugins:
concatStringsSep "\n\n" (map (plugin:
concatStringsSep "\n\n" (map
(plugin:
let name = removePrefix "tmuxplugin-" plugin.pname;
in "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux")
plugins);
plugins
);
plugins = with pkgs.tmuxPlugins; [
copycat
@ -17,7 +19,8 @@ let
yank
vim-tmux-navigator
];
in {
in
{
environment.shellAliases = { tx = "tmux new-session -A -s $USER"; };
programs.tmux = {

View File

@ -4,19 +4,24 @@ let
inherit (lib) fileContents;
in {
in
{
users.defaultUserShell = pkgs.zsh;
environment = {
sessionVariables = let fd = "${pkgs.fd}/bin/fd -H";
in {
sessionVariables =
let fd = "${pkgs.fd}/bin/fd -H";
in
{
BAT_PAGER = "less";
SKIM_ALT_C_COMMAND = let
SKIM_ALT_C_COMMAND =
let
alt_c_cmd = pkgs.writeScriptBin "cdr-skim.zsh" ''
#!${pkgs.zsh}/bin/zsh
${fileContents ./cdr-skim.zsh}
'';
in "${alt_c_cmd}/bin/cdr-skim.zsh";
in
"${alt_c_cmd}/bin/cdr-skim.zsh";
SKIM_DEFAULT_COMMAND = fd;
SKIM_CTRL_T_COMMAND = fd;
};
@ -84,7 +89,8 @@ in {
eval "$(${pkgs.starship}/bin/starship init zsh)"
'';
interactiveShellInit = let
interactiveShellInit =
let
zshrc = fileContents ./zshrc;
sources = with pkgs; [
@ -107,8 +113,10 @@ in {
man = "${pkgs.man}";
exa = "${pkgs.exa}";
installPhase = let basename = "\${file##*/}";
in ''
installPhase =
let basename = "\${file##*/}";
in
''
mkdir $out
for file in $src/*; do
@ -122,7 +130,8 @@ in {
"${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin"
] ++ source);
in ''
in
''
${plugins}
fpath+=( ${functions} )

View File

@ -1,6 +1,7 @@
{ pkgs, ... }:
let inherit (builtins) readFile;
in {
in
{
imports = [ ./sway ../develop ./xmonad ../networkmanager ../im ];
hardware.opengl.enable = true;
@ -35,12 +36,14 @@ in {
# Theme settings
QT_QPA_PLATFORMTHEME = "gtk2";
GTK2_RC_FILES = let
GTK2_RC_FILES =
let
gtk = ''
gtk-icon-theme-name="Papirus"
gtk-cursor-theme-name="Adwaita"
'';
in [
in
[
("${pkgs.writeText "iconrc" "${gtk}"}")
"${pkgs.adapta-gtk-theme}/share/themes/Adapta/gtk-2.0/gtkrc"
"${pkgs.gnome3.gnome-themes-extra}/share/themes/Adwaita/gtk-2.0/gtkrc"

View File

@ -1,6 +1,7 @@
{ pkgs, ... }:
let inherit (pkgs) alsaUtils bash gnugrep volnoti;
in pkgs.writeScript "volnoti.sh" ''
in
pkgs.writeScript "volnoti.sh" ''
#!${bash}/bin/bash
declare -i current=$(${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -m1 -Po "[0-9]+(?=%)")

View File

@ -1,11 +1,14 @@
{ pkgs, ... }:
let inherit (builtins) readFile;
in {
in
{
sound.enable = true;
environment = {
etc."xdg/qutebrowser/config.py".text = let mpv = "${pkgs.mpv}/bin/mpv";
in ''
etc."xdg/qutebrowser/config.py".text =
let mpv = "${pkgs.mpv}/bin/mpv";
in
''
${readFile ./config.py}
config.bind(',m', 'hint links spawn -d ${mpv} {hint-url}')

View File

@ -3,7 +3,8 @@ let
inherit (builtins) readFile;
inherit (config.hardware) pulseaudio;
in {
in
{
imports = [ ../qutebrowser ];
sound.enable = true;
@ -38,7 +39,8 @@ in {
environment.etc = {
"sway/config".text =
let volnoti = import ../misc/volnoti.nix { inherit pkgs; };
in ''
in
''
set $volume ${volnoti}
set $mixer "${pkgs.alsaUtils}/bin/amixer -q set Master"

View File

@ -1,6 +1,7 @@
{ autostart, screenshots, pkgs, stoggle, volnoti }:
let inherit (pkgs) alsaUtils;
in ''
in
''
-- Function for fullscreen toggle
fullToggle :: X ()
fullToggle = do

View File

@ -13,7 +13,8 @@ let
writeScript "xmonad-touchtoggle" (readFile ./scripts/touchtoggle);
volnoti = import ../misc/volnoti.nix { inherit pkgs; };
in ''
in
''
${readFile ./_xmonad.hs}
${import ./_xmonad.nix {
inherit screenshots touchtoggle autostart stoggle pkgs volnoti;

View File

@ -5,4 +5,3 @@
signal-desktop
];
}

View File

@ -45,7 +45,8 @@
'';
services.logind.lidSwitch = "suspend";
nixpkgs.overlays = let
nixpkgs.overlays =
let
light_ov = self: super: {
light = super.light.overrideAttrs (o: {
src = self.fetchFromGitHub {
@ -56,5 +57,6 @@
};
});
};
in [ light_ov ];
in
[ light_ov ];
}

View File

@ -33,10 +33,12 @@ let
blacklist = concatStringsSep ''
0.0.0.0 '' [
0.0.0.0 ''
[
"# auto-generated: must be first"
# starts here
];
in { networking.extraHosts = readFile "${hosts}/etc/hosts"; }
in
{ networking.extraHosts = readFile "${hosts}/etc/hosts"; }

View File

@ -2,7 +2,8 @@
let
inherit (config.services.qbittorrent) port;
inherit (lib) mkAfter;
in {
in
{
services.qbittorrent = {
enable = true;
group = "media";

View File

@ -5,4 +5,3 @@
package = pkgs.postgresql_12;
};
}

View File

@ -6,4 +6,3 @@
forwardX11 = true;
};
}

View File

@ -7,17 +7,18 @@
# you'll need to add your user to 'libvirtd' group to use virt-manager
environment.systemPackages = with pkgs; [ virt-manager ];
nixpkgs.overlays = let
nixpkgs.overlays =
let
overlay = final: prev: {
# Patch libvirt to use ebtables-legacy
libvirt = if prev.libvirt.version <= "5.4.0" && prev.ebtables.version
libvirt =
if prev.libvirt.version <= "5.4.0" && prev.ebtables.version
> "2.0.10-4" then
prev.libvirt.overrideAttrs
(o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; })
prev.libvirt.overrideAttrs (o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; })
else
prev.libvirt;
};
in [ overlay ];
in
[ overlay ];
}

View File

@ -5,7 +5,8 @@ let
buildIso = pkgs.writeShellScriptBin "build-iso" ''
nix build ${configs}.niximg.config.system.build.isoImage $@
'';
in pkgs.mkShell {
in
pkgs.mkShell {
name = "nixflk";
nativeBuildInputs = with pkgs; [ git git-crypt nixFlakes buildIso ];