From c74dd2ff1753b4040683c7bfab86971050d7ceb5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 25 Oct 2020 23:49:14 +0800 Subject: [PATCH] Use nixfmt to all files --- default.nix | 29 +++-- hosts/zilch/default.nix | 112 ++++++++---------- lib/attrs.nix | 3 +- lib/default.nix | 14 +-- lib/modules.nix | 61 ++++------ lib/options.nix | 20 ++-- modules/default.nix | 50 ++++---- modules/desktop/audio.nix | 64 +++++----- modules/desktop/browsers.nix | 34 +++--- modules/desktop/cad.nix | 11 +- modules/desktop/files.nix | 21 ++-- modules/desktop/fonts.nix | 34 +++--- modules/desktop/graphics.nix | 65 +++++----- modules/desktop/multimedia.nix | 20 ++-- modules/desktop/research.nix | 7 +- modules/dev/android.nix | 13 +- modules/dev/base.nix | 22 ++-- modules/dev/cc.nix | 11 +- modules/dev/data.nix | 15 ++- modules/dev/documentation.nix | 76 ++++++------ modules/dev/gamedev.nix | 46 +++---- modules/dev/go.nix | 10 +- modules/dev/java.nix | 10 +- modules/dev/javascript.nix | 40 ++++--- modules/dev/lisp.nix | 49 ++++---- modules/dev/math.nix | 37 +++--- modules/dev/perl.nix | 19 ++- modules/dev/python.nix | 52 ++++---- modules/dev/rust.nix | 10 +- modules/dev/vcs.nix | 12 +- modules/drivers/default.nix | 4 +- modules/drivers/veikk.nix | 3 +- modules/editors/default.nix | 13 +- modules/editors/emacs.nix | 22 ++-- modules/editors/neovim.nix | 10 +- modules/editors/vscode.nix | 6 +- modules/services/default.nix | 4 +- modules/services/recoll.nix | 30 ++--- modules/shell/base.nix | 68 ++++++----- modules/shell/default.nix | 9 +- modules/shell/lf.nix | 7 +- modules/shell/zsh.nix | 17 +-- modules/themes/default.nix | 12 +- .../fair-and-square/config/polybar/config | 2 +- modules/themes/fair-and-square/default.nix | 30 +++-- packages/default.nix | 17 +-- packages/veikk-driver.nix | 8 +- .../{{ cookiecutter.slug }}/default.nix | 30 +++-- 48 files changed, 623 insertions(+), 636 deletions(-) diff --git a/default.nix b/default.nix index cda67f21..6c354df2 100755 --- a/default.nix +++ b/default.nix @@ -14,16 +14,19 @@ device: username: networking.hostName = lib.mkDefault device; my.username = username; - imports = [ - ./modules - "${./hosts}/${device}" - ] ++ (if builtins.pathExists(/etc/nixos/cachix.nix) then [ - /etc/nixos/cachix.nix - ] else []) ++ (if builtins.pathExists(/etc/nixos/hardware-configuration.nix) then [ - /etc/nixos/hardware-configuration.nix - ] else []) ++ (if builtins.pathExists(/mnt/etc/nixos/hardware-configuration.nix) then [ - /mnt/etc/nixos/hardware-configuration.nix - ] else []); + imports = [ ./modules "${./hosts}/${device}" ] + ++ (if builtins.pathExists (/etc/nixos/cachix.nix) then + [ /etc/nixos/cachix.nix ] + else + [ ]) + ++ (if builtins.pathExists (/etc/nixos/hardware-configuration.nix) then + [ /etc/nixos/hardware-configuration.nix ] + else + [ ]) + ++ (if builtins.pathExists (/mnt/etc/nixos/hardware-configuration.nix) then + [ /mnt/etc/nixos/hardware-configuration.nix ] + else + [ ]); # GARBAGE DAY! nix.gc = { @@ -40,7 +43,7 @@ device: username: # Add custom packages & unstable channel, so they can be accessed via pkgs.* nixpkgs.overlays = import ./packages; - nixpkgs.config.allowUnfree = true; # forgive me Stallman senpai + nixpkgs.config.allowUnfree = true; # forgive me Stallman senpai # These are the things I want installed on all my systems. environment.systemPackages = with pkgs; [ @@ -57,8 +60,8 @@ device: username: vim wget - gnumake # for our own makefile - cachix # less time buildin' mo time nixin' + gnumake # for our own makefile + cachix # less time buildin' mo time nixin' # nix-shell with the modified Nix path. (writeScriptBin "nix-shell" '' diff --git a/hosts/zilch/default.nix b/hosts/zilch/default.nix index 3300f861..2d03c453 100755 --- a/hosts/zilch/default.nix +++ b/hosts/zilch/default.nix @@ -3,9 +3,7 @@ { config, pkgs, lib, ... }: { - nixpkgs.config.permittedInsecurePackages = [ - "spidermonkey-38.8.0" - ]; + nixpkgs.config.permittedInsecurePackages = [ "spidermonkey-38.8.0" ]; # Set the Nix package manager to use the unstable version for flakes. nix = { @@ -38,19 +36,21 @@ my.home.xdg.enable = true; environment.variables = { XDG_CONFIG_HOME = "$HOME/.config"; - XDG_CACHE_HOME = "$HOME/.cache"; - XDG_DATA_HOME = "$HOME/.local/share"; - XDG_BIN_HOME = "$HOME/.local/bin"; + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_BIN_HOME = "$HOME/.local/bin"; + PATH = "$PATH:$XDG_BIN_HOME"; }; # Moving all of the host-specific configurations into its appropriate place. - my.home.xdg.dataFile = - let insertXDGDataFolder = name: { + my.home.xdg.dataFile = let + insertXDGDataFolder = name: { source = ./config + "/${name}"; recursive = true; - }; in { - "recoll" = insertXDGDataFolder "recoll"; - "unison" = insertXDGDataFolder "unison"; + }; + in { + "recoll" = insertXDGDataFolder "recoll"; + "unison" = insertXDGDataFolder "unison"; }; # Install documentations for tools and whatnot. @@ -62,13 +62,9 @@ # Enable virutialization. virtualisation = { - docker = { - enable = true; - }; + docker = { enable = true; }; - libvirtd = { - enable = true; - }; + libvirtd = { enable = true; }; }; # Enable some font configs. @@ -122,9 +118,11 @@ node.enable = true; }; lisp = { + clojure.enable = true; guile.enable = true; racket.enable = true; }; + math.enable = true; perl.enable = true; python = { enable = true; @@ -134,9 +132,7 @@ vcs.enable = true; }; - drivers = { - veikk.enable = true; - }; + drivers = { veikk.enable = true; }; editors = { default = "nvim"; @@ -145,9 +141,7 @@ vscode.enable = true; }; - services = { - recoll.enable = true; - }; + services = { recoll.enable = true; }; shell = { base.enable = true; @@ -161,42 +155,41 @@ # Additional programs that doesn't need much configuration (or at least personally configured). # It is pointless to create modules for it, anyways. environment.systemPackages = with pkgs; [ - nim # Jack the nimble, jack jumped over the nightstick, and got over not being the best pick. - python # *insert Monty Python quote here* + nim # Jack the nimble, jack jumped over the nightstick, and got over not being the best pick. + python # *insert Monty Python quote here* + ruby # Gems, lots of gems. ]; - my.packages = with pkgs; [ - # Muh games. - dwarf-fortress # Losing is fun! - endless-sky # Losing is meh! - minetest # Losing?! What's that? - openmw # Losing is even more meh1 - wesnoth # Losing is frustrating! - zeroad # Losing is fun and frustrating! + my.packages = with pkgs; + [ + # Muh games. + dwarf-fortress # Losing is fun! + endless-sky # Losing is meh! + minetest # Losing?! What's that? + wesnoth # Losing is frustrating! + zeroad # Losing is fun and frustrating! - # Installing some of the dependencies required for my scripts. - ffcast - giflib - leptonica - libpng - libwebp - maim - (tesseract.override { enableLanguages = [ "eng" ]; }) - slop - virt-manager - xclip - xdg-user-dirs - xorg.xwininfo - zbar + # Installing some of the dependencies required for my scripts. + ffcast + giflib + leptonica + libpng + libwebp + maim + (tesseract.override { enableLanguages = [ "eng" ]; }) + slop + virt-manager + xclip + xdg-user-dirs + xorg.xwininfo + zbar - # Some other packages. - screenkey - ] + # Some other packages. + screenkey + ] - # My custom packages. - ++ (with pkgs.nur.foo-dogsquared; [ - segno - ]); + # My custom packages. + ++ (with pkgs.nur.foo-dogsquared; [ segno ]); # Setting up the shell environment. my.env = { @@ -233,7 +226,7 @@ enable = true; middleEmulation = true; }; - # digimend.enable = true; + digimend.enable = true; # videoDrivers = [ "nvidiaLegacy390" ]; }; @@ -242,9 +235,7 @@ hardware.pulseaudio.enable = true; # Enable OpenGL. - hardware = { - opengl.enable = true; - }; + hardware = { opengl.enable = true; }; # Additional host-specific program configurations. my.home = { @@ -267,7 +258,8 @@ services = { unison = let homeDirectory = "/home/${config.my.username}"; - backupDrive = "/run/media/${config.my.username}/Seagate Backup Plus Drive"; + backupDrive = + "/run/media/${config.my.username}/Seagate Backup Plus Drive"; in { enable = true; pairs.mainBackup = { @@ -291,5 +283,5 @@ # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you # should. - system.stateVersion = "20.03"; # Did you read the comment? + system.stateVersion = "20.09"; # Did you read the comment? } diff --git a/lib/attrs.nix b/lib/attrs.nix index 0f8ebd19..473f6e04 100755 --- a/lib/attrs.nix +++ b/lib/attrs.nix @@ -1,8 +1,7 @@ { lib, ... }: with builtins; -with lib; -rec { +with lib; rec { # attrsToList attrsToList = attrs: mapAttrsToList (name: value: { inherit name value; }) attrs; diff --git a/lib/default.nix b/lib/default.nix index d74386d8..e66f9a26 100755 --- a/lib/default.nix +++ b/lib/default.nix @@ -6,13 +6,13 @@ let modules = import ./modules.nix { inherit lib; - self.attrs = import ./attrs.nix { inherit lib; self = {}; }; + self.attrs = import ./attrs.nix { + inherit lib; + self = { }; + }; }; mylib = makeExtensible (self: - with self; mapModules (toString ./.) - (file: import file { inherit self lib pkgs; })); -in -mylib.extend - (self: super: - foldr (a: b: a // b) {} (attrValues super)) + with self; + mapModules (toString ./.) (file: import file { inherit self lib pkgs; })); +in mylib.extend (self: super: foldr (a: b: a // b) { } (attrValues super)) diff --git a/lib/modules.nix b/lib/modules.nix index 47743f12..55794bf0 100755 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -2,51 +2,38 @@ let inherit (builtins) attrValues readDir pathExists concatLists; - inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix; + inherit (lib) + id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair + removeSuffix; inherit (self.attrs) mapFilterAttrs; -in -rec { +in rec { mapModules = dir: fn: - mapFilterAttrs - (n: v: - v != null && - !(hasPrefix "_" n)) - (n: v: - let path = "${toString dir}/${n}"; in - if v == "directory" && pathExists "${path}/default.nix" - then nameValuePair n (fn path) - else if v == "regular" && - n != "default.nix" && - hasSuffix ".nix" n - then nameValuePair (removeSuffix ".nix" n) (fn path) - else nameValuePair "" null) - (readDir dir); + mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (n: v: + let path = "${toString dir}/${n}"; + in if v == "directory" && pathExists "${path}/default.nix" then + nameValuePair n (fn path) + else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n then + nameValuePair (removeSuffix ".nix" n) (fn path) + else + nameValuePair "" null) (readDir dir); - mapModules' = dir: fn: - attrValues (mapModules dir fn); + mapModules' = dir: fn: attrValues (mapModules dir fn); mapModulesRec = dir: fn: - mapFilterAttrs - (n: v: - v != null && - !(hasPrefix "_" n)) - (n: v: - let path = "${toString dir}/${n}"; in - if v == "directory" - then nameValuePair n (mapModulesRec path fn) - else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n - then nameValuePair (removeSuffix ".nix" n) (fn path) - else nameValuePair "" null) - (readDir dir); + mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (n: v: + let path = "${toString dir}/${n}"; + in if v == "directory" then + nameValuePair n (mapModulesRec path fn) + else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n then + nameValuePair (removeSuffix ".nix" n) (fn path) + else + nameValuePair "" null) (readDir dir); mapModulesRec' = dir: fn: let - dirs = - mapAttrsToList - (k: _: "${dir}/${k}") - (filterAttrs - (n: v: v == "directory" && !(hasPrefix "_" n)) - (readDir dir)); + dirs = mapAttrsToList (k: _: "${dir}/${k}") + (filterAttrs (n: v: v == "directory" && !(hasPrefix "_" n)) + (readDir dir)); files = attrValues (mapModules dir id); paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs); in map fn paths; diff --git a/lib/options.nix b/lib/options.nix index 2b9c0810..f659189d 100755 --- a/lib/options.nix +++ b/lib/options.nix @@ -1,18 +1,16 @@ { lib, ... }: -let - inherit (lib) mkOption types; -in -rec { - mkOpt = type: default: - mkOption { inherit type default; }; +let inherit (lib) mkOption types; +in rec { + mkOpt = type: default: mkOption { inherit type default; }; mkOpt' = type: default: description: mkOption { inherit type default description; }; - mkBoolOpt = default: mkOption { - inherit default; - type = types.bool; - example = true; - }; + mkBoolOpt = default: + mkOption { + inherit default; + type = types.bool; + example = true; + }; } diff --git a/modules/default.nix b/modules/default.nix index 61fd8675..1f258635 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,9 +3,11 @@ with lib; let - mkOptionStr = value: mkOption - { type = types.str; - default = value; }; + mkOptionStr = value: + mkOption { + type = types.str; + default = value; + }; in { imports = [ @@ -26,17 +28,20 @@ in { email = mkOptionStr "foo.dogsquared@gmail.com"; # Convenience aliases - home = mkOption { type = options.home-manager.users.type.functor.wrapped; }; + home = + mkOption { type = options.home-manager.users.type.functor.wrapped; }; user = mkOption { type = options.users.users.type; }; packages = mkOption { type = with types; listOf package; }; # Environment env = mkOption { - type = with types; attrsOf (either (either str path) (listOf (either str path))); - apply = mapAttrs - (n: v: if isList v - then concatMapStringsSep ":" (x: toString x) v - else (toString v)); + type = with types; + attrsOf (either (either str path) (listOf (either str path))); + apply = mapAttrs (n: v: + if isList v then + concatMapStringsSep ":" (x: toString x) v + else + (toString v)); }; alias = mkOption { @@ -66,7 +71,8 @@ in { config = { # Convenience aliases - home-manager.users.${config.my.username} = mkAliasDefinitions options.my.home; + home-manager.users.${config.my.username} = + mkAliasDefinitions options.my.home; home-manager.useGlobalPkgs = true; users.users.${config.my.username} = mkAliasDefinitions options.my.user; my.user.packages = config.my.packages; @@ -75,23 +81,25 @@ in { my.env.PATH = [ "$PATH" ]; # Put the configured custom environment variables (config.my.env) into initialization phase. - environment.extraInit = - let exportLines = mapAttrsToList (key: value: "export ${key}=\"${value}\"") config.my.env; - in '' + environment.extraInit = let + exportLines = + mapAttrsToList (key: value: ''export ${key}="${value}"'') config.my.env; + in '' export XAUTHORITY=/tmp/XAUTHORITY [ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY" ${concatStringsSep "\n" exportLines} - ''; + ''; my.home.xdg.configFile = { - "zsh/.zshrc".text = - let aliasLines = mapAttrsToList (key: value: "alias ${key}=\"${value}\"") config.my.alias; - in '' - # This file is autogenerated, do not edit it! - ${concatStringsSep "\n" aliasLines} - ${config.my.zsh.rc} - ''; + "zsh/.zshrc".text = let + aliasLines = mapAttrsToList (key: value: ''alias ${key}="${value}"'') + config.my.alias; + in '' + # This file is autogenerated, do not edit it! + ${concatStringsSep "\n" aliasLines} + ${config.my.zsh.rc} + ''; "zsh/.zshenv".text = '' # This file is autogenerated, please do not edit it! ${config.my.zsh.env} diff --git a/modules/desktop/audio.nix b/modules/desktop/audio.nix index ea1faae5..9ffb4b19 100755 --- a/modules/desktop/audio.nix +++ b/modules/desktop/audio.nix @@ -5,53 +5,61 @@ with lib; -let - cfg = config.modules.desktop.audio; +let cfg = config.modules.desktop.audio; in { - options.modules.desktop.audio = - let mkBoolDefault = bool: mkOption { - type = types.bool; - default = bool; - }; in { - enable = mkBoolDefault false; - composition.enable = mkBoolDefault false; - production.enable = mkBoolDefault false; - }; + options.modules.desktop.audio = let + mkBoolDefault = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + enable = mkBoolDefault false; + composition.enable = mkBoolDefault false; + production.enable = mkBoolDefault false; + }; config = mkIf cfg.enable { # Enable JACK for the most serious audio applications. services.jack = { jackd.enable = true; + alsa.enable = false; + loopback = { enable = true; }; }; + hardware.pulseaudio.package = + pkgs.pulseaudio.override { jackaudioSupport = true; }; + my.packages = with pkgs; [ - cadence + cadence # A JACK interface for newbs. ] ++ (if cfg.composition.enable then [ - lilypond # Prevent your compositions to be forever lost when you're in grave by engraving them now (or whenever you feel like it). - musescore # A music composer for creating musical cheatsheets. - soundfont-fluid # A soundfont for it or something. - sonic-pi # A pie made up of them supersonic sounds created from electricity. - supercollider # Programming platform for synthesizing them 'zics. - ] else []) ++ + lilypond # Prevent your compositions to be forever lost when you're in grave by engraving them now (or whenever you feel like it). + musescore # A music composer for creating musical cheatsheets. + soundfont-fluid # A soundfont for it or something. + sonic-pi # A pie made up of them supersonic sounds created from electricity. + supercollider # Programming platform for synthesizing them 'zics. + ] else + [ ]) ++ (if cfg.production.enable then [ - ardour # A DAW focuses on hardware recording but it can be used for something else. - audacity # Belongs in the great city of "Simple tools for short audio samples". - carla # A plugin host useful for a consistent hub for them soundfonts and SFZs. - fluidsynth # Synth for fluid sounds. - geonkick # Create them percussions. - helm # A great synthesizer plugin. - hydrogen # Them drum beats composition will get good. - polyphone # Edit your fonts for sound. - #zrythm # An up-and-coming DAW in Linux town. + ardour # A DAW focuses on hardware recording but it can be used for something else. + audacity # Belongs in the great city of "Simple tools for short audio samples". + carla # A plugin host useful for a consistent hub for them soundfonts and SFZs. + fluidsynth # Synth for fluid sounds. + geonkick # Create them percussions. + helm # A great synthesizer plugin. + hydrogen # Them drum beats composition will get good. + polyphone # Edit your fonts for sound. + #zrythm # An up-and-coming DAW in Linux town. zynaddsubfx # Ze most advanced synthesizer I've seen so far (aside from the upcoming Vital syntehsizer). # As of 2020-07-03, lmms has some trouble regarding Qt or something so at least use the "unstable" channel just to be safe. # lmms - ] else []); + ] else + [ ]); # Required when enabling JACK daemon. my.user.extraGroups = [ "audio" "jackaudio" ]; diff --git a/modules/desktop/browsers.nix b/modules/desktop/browsers.nix index 3812ad65..3897b0ee 100755 --- a/modules/desktop/browsers.nix +++ b/modules/desktop/browsers.nix @@ -3,26 +3,26 @@ with lib; -let - cfg = config.modules.desktop.browsers; -in -{ - options.modules.desktop.browsers = - let mkBoolDefault = bool: mkOption { - type = types.bool; - default = false; - }; in { - brave.enable = mkBoolDefault false; - firefox.enable = mkBoolDefault false; - chromium.enable = mkBoolDefault false; - nyxt.enable = mkBoolDefault false; +let cfg = config.modules.desktop.browsers; +in { + options.modules.desktop.browsers = let + mkBoolDefault = bool: + mkOption { + type = types.bool; + default = false; + }; + in { + brave.enable = mkBoolDefault false; + firefox.enable = mkBoolDefault false; + chromium.enable = mkBoolDefault false; + nyxt.enable = mkBoolDefault false; }; config = { my.packages = with pkgs; - (if cfg.brave.enable then [ brave ] else []) ++ - (if cfg.firefox.enable then [ firefox-bin ] else []) ++ - (if cfg.chromium.enable then [ chromium ] else []) ++ - (if cfg.nyxt.enable then [ next ] else []); + (if cfg.brave.enable then [ brave ] else [ ]) + ++ (if cfg.firefox.enable then [ firefox-bin ] else [ ]) + ++ (if cfg.chromium.enable then [ chromium ] else [ ]) + ++ (if cfg.nyxt.enable then [ next ] else [ ]); }; } diff --git a/modules/desktop/cad.nix b/modules/desktop/cad.nix index fe58a999..5d3b8865 100755 --- a/modules/desktop/cad.nix +++ b/modules/desktop/cad.nix @@ -1,8 +1,7 @@ # Even if my designs are computer-aided, it's still horrible. :( { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.desktop.cad = { enable = mkOption { type = types.bool; @@ -12,10 +11,10 @@ with lib; config = mkIf config.modules.desktop.cad.enable { my.packages = with pkgs; [ - freecad # FREE AS A BIRD, FREE AS A ALL-YOU-CAN-EAT BUFFER! - kicad # The CAD for ki which is a form of energy found everywhere. - leocad # A CAD for leos, a well-known brand of toys. - openscad # A programmable CAD for programmers. + freecad # FREE AS A BIRD, FREE AS A ALL-YOU-CAN-EAT BUFFER! + #kicad # The CAD for ki which is a form of energy found everywhere. + leocad # A CAD for leos, a well-known brand of toys. + openscad # A programmable CAD for programmers. ]; }; } diff --git a/modules/desktop/files.nix b/modules/desktop/files.nix index 75a80b0f..1e693d62 100755 --- a/modules/desktop/files.nix +++ b/modules/desktop/files.nix @@ -3,8 +3,7 @@ with lib; -let - cfg = config.modules.desktop.files; +let cfg = config.modules.desktop.files; in { options.modules.desktop.files = { enable = mkOption { @@ -15,17 +14,17 @@ in { config = mkIf cfg.enable { my.packages = with pkgs; [ - exiftool # A file metadata reader/writer/manager/helicopter. + exiftool # A file metadata reader/writer/manager/helicopter. (recoll.override { withGui = false; - }) # Bring the search engine to the desktop! - unison # Back those files up, son. - magic-wormhole # Magically transfer stuff between your wormholes! - oneshot # Basically `python -m http.server` that can deliver files to various devices. - qbittorrent # Free version of uBittorrent. - xfce.thunar # A graphical file manager. - xfce.thunar-volman # A Thunar plugin on volume management for external devices. - udiskie # An automounter for external devices with authentication. + }) # Bring the search engine to the desktop! + unison # Back those files up, son. + magic-wormhole # Magically transfer stuff between your wormholes! + oneshot # Basically `python -m http.server` that can deliver files to various devices. + qbittorrent # Free version of uBittorrent. + xfce.thunar # A graphical file manager. + xfce.thunar-volman # A Thunar plugin on volume management for external devices. + udiskie # An automounter for external devices with authentication. ]; services = { diff --git a/modules/desktop/fonts.nix b/modules/desktop/fonts.nix index 9589f468..0d3a5cbf 100755 --- a/modules/desktop/fonts.nix +++ b/modules/desktop/fonts.nix @@ -1,8 +1,7 @@ # My selection of fonts for this setup. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.desktop.fonts = { enable = mkOption { type = types.bool; @@ -18,25 +17,26 @@ with lib; fontconfig = { enable = true; defaultFonts = { - sansSerif = [ "Source Sans Pro" "IBM Plex Sans" ]; - serif = [ "Source Serif Pro" "IBM Plex Serif" ]; - monospace = [ "Source Code Pro" "IBM Plex Mono" ]; + sansSerif = [ "Source Sans Pro" "IBM Plex Sans" "Noto Sans" ]; + serif = [ "Source Serif Pro" "IBM Plex Serif" "Noto Serif" ]; + monospace = [ "Source Code Pro" "IBM Plex Mono" "Noto Mono" ]; }; }; fonts = with pkgs; [ - dejavu_fonts # Makes you feel like you've seen them before. - fira-code # The programming font with fancy symbols. - ibm-plex # IBM's face, is it professional? - iosevka # The fancy monofont with fancy ligatures. - jetbrains-mono # Jet to the face, land on the brains. - latinmodern-math # The ol' mathematical typeface. - noto-fonts # It's all about family and that's what so powerful about it. - noto-fonts-cjk # I don't condone anime. - source-code-pro # The Adobe pro code. - source-serif-pro # The Adobe serif code. - source-sans-pro # The above descriptions doesn't make much sense. - stix-otf # The font you need for them math moonrunes. + dejavu_fonts # Makes you feel like you've seen them before. + fira-code # The programming font with fancy symbols. + ibm-plex # IBM's face, is it professional? + iosevka # The fancy monofont with fancy ligatures. + jetbrains-mono # Jet to the face, land on the brains. + latinmodern-math # The ol' mathematical typeface. + nerdfonts # Fonts for NEEEEEEEEEEEEEEEEEEEEEEEEERDS! + noto-fonts # It's all about family and that's what so powerful about it. + noto-fonts-cjk # I don't condone anime. + source-code-pro # The Adobe pro code. + source-serif-pro # The Adobe serif code. + source-sans-pro # The above descriptions doesn't make much sense. + stix-otf # The font you need for them math moonrunes. ]; }; }; diff --git a/modules/desktop/graphics.nix b/modules/desktop/graphics.nix index cdbec533..817c53c1 100755 --- a/modules/desktop/graphics.nix +++ b/modules/desktop/graphics.nix @@ -4,45 +4,54 @@ with lib; -let - cfg = config.modules.desktop.graphics; +let cfg = config.modules.desktop.graphics; in { - options.modules.desktop.graphics = - let mkBoolDefault = bool: mkOption { - type = types.bool; - default = bool; - }; in { - programmable.enable = mkBoolDefault false; - raster.enable = mkBoolDefault false; - vector.enable = mkBoolDefault false; - _3d.enable = mkBoolDefault false; - }; + options.modules.desktop.graphics = let + mkBoolDefault = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + programmable.enable = mkBoolDefault false; + raster.enable = mkBoolDefault false; + vector.enable = mkBoolDefault false; + _3d.enable = mkBoolDefault false; + }; config = { my.packages = with pkgs; [ - font-manager # Self-explanatory name is self-explanatory. - imagemagick7 # A command-line tool for manipulating images. - graphviz # The biz central for graphical flowcharts. + font-manager # Self-explanatory name is self-explanatory. + imagemagick7 # A command-line tool for manipulating images. + graphviz # The biz central for graphical flowcharts. ] ++ - (if cfg.programmable.enable then [ - processing # A visually-oriented language with an energertic train conductor as the mascot. - ] else []) ++ + (if cfg.programmable.enable then + [ + processing # A visually-oriented language with an energertic train conductor as the mascot. + ] + else + [ ]) ++ (if cfg.raster.enable then [ - gimp # Adobe Photoshop replacement. - krita # A good painting program useful for "pure" digital arts. - aseprite-unfree # A pixel art editor. - ] else []) ++ + gimp # Adobe Photoshop replacement. + krita # A good painting program useful for "pure" digital arts. + aseprite-unfree # A pixel art editor. + ] else + [ ]) ++ - (if cfg.vector.enable then [ - inkscape # Adobe Illustrator (or Affinity Designer) replacement. - ] else []) ++ + (if cfg.vector.enable then + [ + inkscape # Adobe Illustrator (or Affinity Designer) replacement. + ] + else + [ ]) ++ (if cfg._3d.enable then [ - blender # It's a great 3D model editor. - goxel # It's a great voxel editor. - ] else []); + blender # It's a great 3D model editor. + goxel # It's a great voxel editor. + ] else + [ ]); }; } diff --git a/modules/desktop/multimedia.nix b/modules/desktop/multimedia.nix index 0b63ae62..592934d1 100755 --- a/modules/desktop/multimedia.nix +++ b/modules/desktop/multimedia.nix @@ -1,8 +1,7 @@ # Muh consumer applications... { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.desktop.multimedia = { enable = mkOption { type = types.bool; @@ -12,15 +11,14 @@ with lib; config = mkIf config.modules.desktop.multimedia.enable { my.packages = with pkgs; [ - ffmpeg # The ultimate multimedia toolkit for everybody! - hexchat # The ultimate IRC client for neckbeards. - kdenlive # A decent free and open source video editor. - mpv # The ultimate media player for hipsters. - newsboat # The ultimate RSS aggregator for some person. - obs-studio # Open Broadcasting Studio Studio, the reliable recording workflow. - obs-linuxbrowser # OBS plugin for browser source. - thunderbird # The ultimate email client for dumbasses like me. - zathura # The ultimate PDF viewer for run-of-the-mill ricing. + ffmpeg # The ultimate multimedia toolkit for everybody! + hexchat # The ultimate IRC client for neckbeards. + kdenlive # A decent free and open source video editor. + mpv # The ultimate media player for hipsters. + newsboat # The ultimate RSS aggregator for some person. + obs-studio # Open Broadcasting Studio Studio, the reliable recording workflow. + thunderbird # The ultimate email client for dumbasses like me. + zathura # The ultimate PDF viewer for run-of-the-mill ricing. ]; }; } diff --git a/modules/desktop/research.nix b/modules/desktop/research.nix index cb27b5d1..6f5e24ac 100755 --- a/modules/desktop/research.nix +++ b/modules/desktop/research.nix @@ -1,8 +1,7 @@ # I'm not in academia but I like managing my library resources. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.desktop.research = { enable = mkOption { type = types.bool; @@ -12,8 +11,8 @@ with lib; config = mkIf config.modules.desktop.research.enable { my.packages = with pkgs; [ - exiftool # A file metadata reader/writer/helicopter. - zotero # An academic's best friend. + exiftool # A file metadata reader/writer/helicopter. + zotero # An academic's best friend. ]; }; } diff --git a/modules/dev/android.nix b/modules/dev/android.nix index 5493b9ff..9f376519 100755 --- a/modules/dev/android.nix +++ b/modules/dev/android.nix @@ -1,8 +1,7 @@ # Android is the mobile version of Linux. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.dev.android = { enable = mkOption { type = types.bool; @@ -12,11 +11,11 @@ with lib; config = mkIf config.modules.dev.android.enable { my.packages = with pkgs; [ - android-studio # The apartment for Android development. - dart # It's JavaScript except saner and slimmer. - flutter # It's Electron except saner and slimmer. - kotlin # It's Java except saner and slimmer. - scrcpy # Cast your phone over TCP/IP! + android-studio # The apartment for Android development. + dart # It's JavaScript except saner and slimmer. + flutter # It's Electron except saner and slimmer. + kotlin # It's Java except saner and slimmer. + scrcpy # Cast your phone over TCP/IP! ]; # Enable Android Debug Bridge for some device debugging. diff --git a/modules/dev/base.nix b/modules/dev/base.nix index a9be7896..95ac859a 100755 --- a/modules/dev/base.nix +++ b/modules/dev/base.nix @@ -1,8 +1,7 @@ # The utmost requirements for a development workflow. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.dev.base = { enable = mkOption { type = types.bool; @@ -12,15 +11,16 @@ with lib; config = mkIf config.modules.dev.base.enable { my.packages = with pkgs; [ - caddy # THE ULTIMATE HTTPS/2 SERVER FOR 'YER GOLFIN' SESSIONS!!! - cmake # Yo, I heard you like Makefiles. - cookiecutter # A project scaffolding tool. - gnumake # Make your life easier with GNU Make. - hyperfine # You shouldn't be feel just fine with your programs... - nixfmt # Formatter for uniform Nix code. - stow # Build your symlink farm on the other side of the country, er, filesystem. - tldr # What manuals should include. - universal-ctags # Enable fast traveling to your code (assuming written in a supported language). + caddy # THE ULTIMATE HTTPS/2 SERVER FOR 'YER GOLFIN' SESSIONS!!! + cmake # Yo, I heard you like Makefiles. + cookiecutter # A project scaffolding tool. + gnumake # Make your life easier with GNU Make. + hyperfine # You shouldn't be feel just fine with your programs... + kmon # A Linux kernel monitoring tool, right... + nixfmt # Formatter for uniform Nix code. + stow # Build your symlink farm on the other side of the country, er, filesystem. + tldr # What manuals should include. + universal-ctags # Enable fast traveling to your code (assuming written in a supported language). ]; # Augment your shell with automatic environment variables loading and unloading. diff --git a/modules/dev/cc.nix b/modules/dev/cc.nix index f005ba29..b73d5396 100755 --- a/modules/dev/cc.nix +++ b/modules/dev/cc.nix @@ -1,8 +1,7 @@ # My stuff for C and C++. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.dev.cc = { enable = mkOption { type = types.bool; @@ -12,11 +11,11 @@ with lib; config = mkIf config.modules.dev.cc.enable { my.packages = with pkgs; [ - cmake # Yo dawg, I heard you like Make. + cmake # Yo dawg, I heard you like Make. # clang # A C compiler frontend for LLVM. - gcc # A compiler toolchain. - gdb # GNU Debugger. - llvmPackages.libcxx # When GCC has become too bloated for someone's taste. + gcc # A compiler toolchain. + gdb # GNU Debugger. + llvmPackages.libcxx # When GCC has become too bloated for someone's taste. ]; }; } diff --git a/modules/dev/data.nix b/modules/dev/data.nix index e71d2a23..d5e47e03 100755 --- a/modules/dev/data.nix +++ b/modules/dev/data.nix @@ -1,8 +1,7 @@ # A bunch of data-related tools and libraries. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.dev.data = { enable = mkOption { type = types.bool; @@ -12,12 +11,12 @@ with lib; config = mkIf config.modules.dev.data.enable { my.packages = with pkgs; [ - cfitsio # A data library for FITS images which is an image used for analyzing your fitness level. - hdf5 # A binary data format with hierarchy and metadata. - hdfview # HDF4 and HDF5 viewer. - jq # A JSON parser on the command-line (with the horrible syntax, in my opinion). - pup # A cute little puppy that can understand HTML. - sqlite # A cute little battle-tested library for your data abominations. + cfitsio # A data library for FITS images which is an image used for analyzing your fitness level. + hdf5 # A binary data format with hierarchy and metadata. + #hdfview # HDF4 and HDF5 viewer. + jq # A JSON parser on the command-line (with the horrible syntax, in my opinion). + pup # A cute little puppy that can understand HTML. + sqlite # A cute little battle-tested library for your data abominations. sqlitebrowser # Skim the DB and create a quick scraping script for it. ]; }; diff --git a/modules/dev/documentation.nix b/modules/dev/documentation.nix index 2fa8977a..22452a97 100755 --- a/modules/dev/documentation.nix +++ b/modules/dev/documentation.nix @@ -5,15 +5,15 @@ with lib; -let - cfg = config.modules.dev.documentation; -in -{ - options.modules.dev.documentation = - let mkBoolOption = bool: mkOption { - type = types.bool; - default = bool; - }; in { +let cfg = config.modules.dev.documentation; +in { + options.modules.dev.documentation = let + mkBoolOption = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { enable = mkBoolOption false; # Jupyter does need a bit of setup so separate option. @@ -24,34 +24,40 @@ in }; config = mkIf cfg.enable { - my.packages = with pkgs; [ - asciidoctor # An Asciidoctor document keeps a handful of few frustrated users a day. - aspell # The not-opinionated spell checker. - aspellDicts.en - aspellDicts.en-computers - aspellDicts.en-science - editorconfig-core-c # A library just for formatting files? - editorconfig-checker # Check yer formatting. - hugo # An SSG for your DDD (documentation-driven development) workflow. - languagetool # A grammar checker with a HUGE data set. - pandoc # The Swiss army knife for document conversion. - R # Rated G for accessibility. - vale # The customizable linter for your intended writings. + my.packages = with pkgs; + [ + asciidoctor # An Asciidoctor document keeps a handful of few frustrated users a day. + aspell # The not-opinionated spell checker. + aspellDicts.en + aspellDicts.en-computers + #aspellDicts.en-science + editorconfig-core-c # A library just for formatting files? + editorconfig-checker # Check yer formatting. + hugo # An SSG for your DDD (documentation-driven development) workflow. + languagetool # A grammar checker with a HUGE data set. + pandoc # The Swiss army knife for document conversion. + R # Rated G for accessibility. + vale # The customizable linter for your intended writings. - # TODO: Make Neuron its own package. - (let - neuronRev = "e7568ca5f51609bb406a48527b5ba52d31d11f9c"; - neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz"; - in import neuronSrc {}) # Neurons and zettels are good for the brain. - ] ++ + # TODO: Make Neuron its own package. + (let + neuronRev = "e7568ca5f51609bb406a48527b5ba52d31d11f9c"; + neuronSrc = builtins.fetchTarball + "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz"; + in import neuronSrc { }) # Neurons and zettels are good for the brain. + ] ++ - (if cfg.jupyter.enable then [ - jupyter # The interactive notebook. - iruby # The Ruby kernel for Jupyter. - ] else []) ++ + (if cfg.jupyter.enable then [ + jupyter # The interactive notebook. + iruby # The Ruby kernel for Jupyter. + ] else + [ ]) ++ - (if cfg.latex.enable then [ - texlive.combined.scheme-medium # The all-in-one LaTeX distribution for your offline typesetting needs. - ] else []); + (if cfg.latex.enable then + [ + texlive.combined.scheme-medium # The all-in-one LaTeX distribution for your offline typesetting needs. + ] + else + [ ]); }; } diff --git a/modules/dev/gamedev.nix b/modules/dev/gamedev.nix index 543ca191..423d63f9 100755 --- a/modules/dev/gamedev.nix +++ b/modules/dev/gamedev.nix @@ -4,33 +4,35 @@ with lib; -let - cfg = config.modules.dev.game-dev; -in -{ - options.modules.dev.game-dev = - let mkBoolOption = bool: mkOption { - type = types.bool; - default = bool; - }; in { - defold.enable = mkBoolOption false; - godot.enable = mkBoolOption false; - unity3d.enable = mkBoolOption false; - }; +let cfg = config.modules.dev.game-dev; +in { + options.modules.dev.game-dev = let + mkBoolOption = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + defold.enable = mkBoolOption false; + godot.enable = mkBoolOption false; + unity3d.enable = mkBoolOption false; + }; config = { my.packages = with pkgs; - (if cfg.godot.enable then [ - godot # The Godot, not to be confused with a certain prosecutor. - ] else []) ++ + (if cfg.godot.enable then + [ + godot # The Godot, not to be confused with a certain prosecutor. + ] + else + [ ]) ++ - (if cfg.defold.enable then [ - defold - ] else []) ++ + (if cfg.defold.enable then [ defold ] else [ ]) ++ (if cfg.unity3d.enable then [ - unity3d # The Unity, not to be confused with a certain ideal. - unityhub # The ideal hub for your Unity projects. - ] else []); + unity3d # The Unity, not to be confused with a certain ideal. + unityhub # The ideal hub for your Unity projects. + ] else + [ ]); }; } diff --git a/modules/dev/go.nix b/modules/dev/go.nix index 5f1b179d..e2e81b1e 100755 --- a/modules/dev/go.nix +++ b/modules/dev/go.nix @@ -3,10 +3,8 @@ with lib; -let - cfg = config.modules.dev.go; -in -{ +let cfg = config.modules.dev.go; +in { options.modules.dev.go = { enable = mkOption { type = types.bool; @@ -16,8 +14,8 @@ in config = mkIf cfg.enable { my.packages = with pkgs; [ - delve # Wait, Go doesn't have a proper debugger? - go # The other zoomer proglang (READ: proglang is a zoomer term for programming language). + delve # Wait, Go doesn't have a proper debugger? + go # The other zoomer proglang (READ: proglang is a zoomer term for programming language). ]; }; } diff --git a/modules/dev/java.nix b/modules/dev/java.nix index d3c3b766..a654a731 100755 --- a/modules/dev/java.nix +++ b/modules/dev/java.nix @@ -4,10 +4,8 @@ with lib; -let - cfg = config.modules.dev.java; -in -{ +let cfg = config.modules.dev.java; +in { options.modules.dev.java = { enable = mkOption { type = types.bool; @@ -17,8 +15,8 @@ in config = mkIf cfg.enable { my.packages = with pkgs; [ - jdk # The Java Development Kit. - jre # The Java Runtime Environment for running Java apps. + jdk # The Java Development Kit. + jre # The Java Runtime Environment for running Java apps. ]; }; } diff --git a/modules/dev/javascript.nix b/modules/dev/javascript.nix index 1c57203f..a1948c1d 100755 --- a/modules/dev/javascript.nix +++ b/modules/dev/javascript.nix @@ -5,27 +5,33 @@ { config, options, lib, pkgs, ... }: with lib; -let - cfg = config.modules.dev.javascript; -in -{ - options.modules.dev.javascript = - let mkBoolOption = bool: mkOption { - type = types.bool; - default = bool; - }; in { - deno.enable = mkBoolOption false; - node.enable = mkBoolOption false; +let cfg = config.modules.dev.javascript; +in { + options.modules.dev.javascript = let + mkBoolOption = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + deno.enable = mkBoolOption false; + node.enable = mkBoolOption false; }; config = { my.packages = with pkgs; - (if cfg.deno.enable then [ - deno # The Deltarune of Node. - ] else []) ++ + (if cfg.deno.enable then + [ + deno # The Deltarune of Node. + ] + else + [ ]) ++ - (if cfg.node.enable then [ - nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :) - ] else []); + (if cfg.node.enable then + [ + nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :) + ] + else + [ ]); }; } diff --git a/modules/dev/lisp.nix b/modules/dev/lisp.nix index 40c364e5..773222cc 100755 --- a/modules/dev/lisp.nix +++ b/modules/dev/lisp.nix @@ -5,33 +5,40 @@ with lib; -let - cfg = config.modules.dev.lisp; -in -{ - options.modules.dev.lisp = - let mkBoolDefault = bool: mkOption { - type = types.bool; - default = bool; - }; in { - clojure.enable = mkBoolDefault false; - guile.enable = mkBoolDefault false; - racket.enable = mkBoolDefault false; +let cfg = config.modules.dev.lisp; +in { + options.modules.dev.lisp = let + mkBoolDefault = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + clojure.enable = mkBoolDefault false; + guile.enable = mkBoolDefault false; + racket.enable = mkBoolDefault false; }; config = { my.packages = with pkgs; (if cfg.clojure.enable then [ - clojure # Improved Java version. - leiningen # Install Clojure projects without pulling your hair. - ] else []) ++ + clojure # Improved Java version. + leiningen # Install Clojure projects without pulling your hair. + ] else + [ ]) ++ - (if cfg.guile.enable then [ - guile # A general-purpose language for stuff, named after a certain pop culture icon from an iconic fighting game. - ] else []) ++ + (if cfg.guile.enable then + [ + guile # A general-purpose language for stuff, named after a certain pop culture icon from an iconic fighting game. + ] + else + [ ]) ++ - (if cfg.racket.enable then [ - racket # A DSL for DSLs. - ] else []); + (if cfg.racket.enable then + [ + racket # A DSL for DSLs. + ] + else + [ ]); }; } diff --git a/modules/dev/math.nix b/modules/dev/math.nix index dd43adcf..21c130c2 100755 --- a/modules/dev/math.nix +++ b/modules/dev/math.nix @@ -3,29 +3,30 @@ with lib; -let - cfg = config.modules.dev.math; -in -{ - options.modules.dev.math = - let mkEnableOption = mkOption { +let cfg = config.modules.dev.math; +in { + options.modules.dev.math = let + mkEnableOption = mkOption { type = types.bool; default = false; - }; in { - enable = mkEnableOption; - r.enable = mkEnableOption; + }; + in { + enable = mkEnableOption; + r.enable = mkEnableOption; }; config = mkIf cfg.enable { - my.packages = with pkgs; [ - gnuplot # I came for the plots. - julia # A statistics-focused languaged named after a character in an iconic fighting game. - octave # Matlab's hipster brother. - ] ++ + my.packages = with pkgs; + [ + gnuplot # I came for the plots. + #julia # A statistics-focused languaged named after a character in an iconic fighting game. + octaveFull # Matlab's hipster brother. + ] ++ - (if cfg.r.enable then [ - R # Rated G for accessibility. - rstudio # It's not that kind of studio. - ] else []); + (if cfg.r.enable then [ + R # Rated G for accessibility. + rstudio # It's not that kind of studio. + ] else + [ ]); }; } diff --git a/modules/dev/perl.nix b/modules/dev/perl.nix index 11b89599..d7ff6647 100755 --- a/modules/dev/perl.nix +++ b/modules/dev/perl.nix @@ -3,13 +3,13 @@ with lib; let - perlWithPackages = pkgs.perl.withPackages (p: with pkgs.perlPackages; - [ - ModuleBuild - ModuleInfo - ModuleInstall - ModernPerl - ]); + perlWithPackages = pkgs.perl.withPackages (p: + with pkgs.perlPackages; [ + ModuleBuild + ModuleInfo + ModuleInstall + ModernPerl + ]); in { options.modules.dev.perl = { enable = mkOption { @@ -18,7 +18,6 @@ in { }; }; - config = mkIf config.modules.dev.perl.enable { - my.packages = [ perlWithPackages ]; - }; + config = + mkIf config.modules.dev.perl.enable { my.packages = [ perlWithPackages ]; }; } diff --git a/modules/dev/python.nix b/modules/dev/python.nix index bd288176..cd1ff350 100755 --- a/modules/dev/python.nix +++ b/modules/dev/python.nix @@ -5,35 +5,41 @@ with lib; -let - cfg = config.modules.dev.python; +let cfg = config.modules.dev.python; in { options.modules.dev.python = let - mkBoolOption = bool: mkOption { - type = types.bool; - default = bool; - }; in { - enable = mkBoolOption false; - math.enable = mkBoolOption false; + mkBoolOption = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + enable = mkBoolOption false; + math.enable = mkBoolOption false; }; config = mkIf cfg.enable { - my.packages = with pkgs; [ - (python37.withPackages (p: with python3Packages; [ - beautifulsoup4 # How soups are beautiful again? - requests # The requests for your often-asked questions. - pytools # It's the little things that counts. - pytest # Try to make a good grade or else. - poetry # It rhymes... - scrapy # Create an extractor from a box of scraps. - setuptools # Setup your stuff. - ] + my.packages = with pkgs; + [ + (python37.withPackages (p: + with python3Packages; + [ + beautifulsoup4 # How soups are beautiful again? + requests # The requests for your often-asked questions. + pip # Named after a certain mouse that lives in a barnyard and its ability to keep track of dependencies. + pytools # It's the little things that counts. + pytest # Try to make a good grade or else. + poetry # It rhymes... + scrapy # Create an extractor from a box of scraps. + setuptools # Setup your stuff. + ] - ++ (if cfg.math.enable then [ - numpy # Numbers are also good, right? - sympy # When will you notice that math is good? - ] else []))) - ]; + ++ (if cfg.math.enable then [ + numpy # Numbers are also good, right? + sympy # When will you notice that math is good? + ] else + [ ]))) + ]; }; } diff --git a/modules/dev/rust.nix b/modules/dev/rust.nix index 8c8d559b..f8884caa 100755 --- a/modules/dev/rust.nix +++ b/modules/dev/rust.nix @@ -4,10 +4,8 @@ with lib; -let - cfg = config.modules.dev.rust; -in -{ +let cfg = config.modules.dev.rust; +in { options.modules.dev.rust = { enable = mkOption { type = types.bool; @@ -16,9 +14,7 @@ in }; config = mkIf cfg.enable { - my.packages = with pkgs; [ - rustup - ]; + my.packages = with pkgs; [ rustup ]; my.env = { CARGO_HOME = "$XDG_DATA_HOME/cargo"; diff --git a/modules/dev/vcs.nix b/modules/dev/vcs.nix index 8f32bfd4..4dfed03d 100755 --- a/modules/dev/vcs.nix +++ b/modules/dev/vcs.nix @@ -3,10 +3,8 @@ with lib; -let - cfg = config.modules.dev.vcs; -in -{ +let cfg = config.modules.dev.vcs; +in { options.modules.dev.vcs = { enable = mkOption { type = types.bool; @@ -15,10 +13,6 @@ in }; config = mkIf cfg.enable { - my.packages = with pkgs; [ - gitAndTools.gitFull - mercurial - subversion - ]; + my.packages = with pkgs; [ gitAndTools.gitFull mercurial subversion ]; }; } diff --git a/modules/drivers/default.nix b/modules/drivers/default.nix index 064941a6..7f0d8c8c 100755 --- a/modules/drivers/default.nix +++ b/modules/drivers/default.nix @@ -1,7 +1,5 @@ { config, lib, ... }: { - imports = [ - ./veikk.nix - ]; + imports = [ ./veikk.nix ]; } diff --git a/modules/drivers/veikk.nix b/modules/drivers/veikk.nix index 68323ec1..727b5e32 100755 --- a/modules/drivers/veikk.nix +++ b/modules/drivers/veikk.nix @@ -1,8 +1,7 @@ # Installs the VEIKK Linux driver at https://github.com/jlam55555/veikk-linux-driver. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.drivers.veikk = { enable = mkOption { type = types.bool; diff --git a/modules/editors/default.nix b/modules/editors/default.nix index d66498f1..b87ba36b 100755 --- a/modules/editors/default.nix +++ b/modules/editors/default.nix @@ -3,13 +3,8 @@ # The entryway to all of your text editors and IDEs. { config, options, lib, pkgs, ... }: -with lib; -{ - imports = [ - ./emacs.nix - ./neovim.nix - ./vscode.nix - ]; +with lib; { + imports = [ ./emacs.nix ./neovim.nix ./vscode.nix ]; options.modules.editors = { default = mkOption { @@ -18,7 +13,5 @@ with lib; }; }; - config = { - my.env.EDITOR = config.modules.editors.default; - }; + config = { my.env.EDITOR = config.modules.editors.default; }; } diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 04ef216a..0cb169a9 100755 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -13,8 +13,7 @@ let type = "Application"; mimeType = "x-scheme-handler/org-protocol"; }; -in -{ +in { options.modules.editors.emacs = { enable = mkOption { type = types.bool; @@ -30,9 +29,8 @@ in config = mkIf config.modules.editors.emacs.enable { my.packages = with pkgs; [ - ((emacsPackagesNgGen config.modules.editors.emacs.pkg).emacsWithPackages (epkgs: [ - epkgs.vterm - ])) + ((emacsPackagesNgGen config.modules.editors.emacs.pkg).emacsWithPackages + (epkgs: [ epkgs.vterm ])) emacsOrgProtocolDesktopEntry @@ -42,18 +40,18 @@ in gnutls # Optional depedencies - fd # faster projectile - imagemagick # image-dired + fd # faster projectile + imagemagick # image-dired (lib.mkIf (config.programs.gnupg.agent.enable) - pinentry_emacs) # gnupg-emacs - zstd # for undo-fu-sessions + pinentry_emacs) # gnupg-emacs + zstd # for undo-fu-sessions # Module dependencies ## :checkers spell aspell aspellDicts.en aspellDicts.en-computers - aspellDicts.en-science + #aspellDicts.en-science ## :checkers grammar languagetool @@ -68,8 +66,6 @@ in sqlite ]; - fonts.fonts = with pkgs; [ - emacs-all-the-icons-fonts - ]; + fonts.fonts = with pkgs; [ emacs-all-the-icons-fonts ]; }; } diff --git a/modules/editors/neovim.nix b/modules/editors/neovim.nix index 430e904a..c24261d3 100755 --- a/modules/editors/neovim.nix +++ b/modules/editors/neovim.nix @@ -1,8 +1,7 @@ # (Neo)Vim is love, (Neo)Vim is life. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.editors.neovim = { enable = mkOption { type = types.bool; @@ -10,9 +9,10 @@ with lib; }; }; - config = mkIf config.modules.editors.neovim.enable { - my.packages = with pkgs; [ - editorconfig-core-c # Editorconfig is a MUST, you feel me?! + config = mkIf config.modules.editors.neovim.enable { + my.packages = with pkgs; + [ + editorconfig-core-c # Editorconfig is a MUST, you feel me?! ]; my.home = { diff --git a/modules/editors/vscode.nix b/modules/editors/vscode.nix index 308ea3b7..f8f72f80 100755 --- a/modules/editors/vscode.nix +++ b/modules/editors/vscode.nix @@ -105,8 +105,7 @@ let sha256 = "039ns854v1k4jb9xqknrjkj8lf62nfcpfn0716ancmjc4f0xlzb3"; } ]; -in -{ +in { options.modules.editors.vscode = { enable = mkOption { type = types.bool; @@ -121,7 +120,8 @@ in extensions = extensions; userSettings = { "diffEditor.codeLens" = true; - "editor.fontFamily" = "'Iosevka', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'"; + "editor.fontFamily" = + "'Iosevka', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'"; "editor.fontLigatures" = true; "eslint.alwaysShowStatus" = true; "git.alwaysShowStagedChangesResourceGroup" = true; diff --git a/modules/services/default.nix b/modules/services/default.nix index 535046f8..e0fe6510 100755 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -3,7 +3,5 @@ { config, options, lib, pkgs, ... }: { - imports = [ - ./recoll.nix - ]; + imports = [ ./recoll.nix ]; } diff --git a/modules/services/recoll.nix b/modules/services/recoll.nix index cc4d62a4..bacd2c61 100755 --- a/modules/services/recoll.nix +++ b/modules/services/recoll.nix @@ -4,10 +4,8 @@ with lib; -let - cfg = config.modules.services.recoll; -in -{ +let cfg = config.modules.services.recoll; +in { options.modules.services.recoll = { enable = mkOption { type = types.bool; @@ -25,24 +23,30 @@ in systemd.user.services.recoll = { Unit = { Description = "Recoll periodic index update"; - Documentation = [ "man:recollindex.1" "https://www.lesbonscomptes.com/recoll/pages/documentation.html" ]; + Documentation = [ + "man:recollindex.1" + "https://www.lesbonscomptes.com/recoll/pages/documentation.html" + ]; }; Service = { - Environment = [ "RECOLL_CONFDIR=\"$XDG_DATA_HOME/recoll\"" ]; - ExecStart = "${(pkgs.recoll.override { withGui = false; })}/bin/recollindex ${cfg.flags}"; + Environment = [ ''RECOLL_CONFDIR="$XDG_DATA_HOME/recoll"'' ]; + ExecStart = "${ + (pkgs.recoll.override { withGui = false; }) + }/bin/recollindex ${cfg.flags}"; }; - Install = { - WantedBy = [ "default.target" ]; - }; + Install = { WantedBy = [ "default.target" ]; }; }; # Make the service run every 4 hours (and still activate if it misses the interval). systemd.user.timers.recoll = { Unit = { Description = "Recoll periodic index update"; - Documentation = [ "man:recollindex.1" "https://www.lesbonscomptes.com/recoll/pages/documentation.html" ]; + Documentation = [ + "man:recollindex.1" + "https://www.lesbonscomptes.com/recoll/pages/documentation.html" + ]; }; Timer = { @@ -50,9 +54,7 @@ in Persistent = true; }; - Install = { - WantedBy = [ "default.target" ]; - }; + Install = { WantedBy = [ "default.target" ]; }; }; }; }; diff --git a/modules/shell/base.nix b/modules/shell/base.nix index 18d59131..24584f3f 100755 --- a/modules/shell/base.nix +++ b/modules/shell/base.nix @@ -1,8 +1,7 @@ # Here are the base packages for my shell workflow. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.shell.base = { enable = mkOption { type = types.bool; @@ -12,38 +11,49 @@ with lib; config = mkIf config.modules.shell.base.enable { my.packages = with pkgs; [ - aria2 # The sequel to aria(1). - aspell # Hunt down a spelling bee champion to come to your shell. - bat # cat(1) with wings. - buku # A developer-oriented browser-independent bookmark manager. - exa # ls(1) after an exodus. - fd # find(1) after a cognitive behavioral therapy. - fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception. - gopass # The improved version of Password Store which is a password manager for hipsters. - graphviz # The biz central for graphical flowcharts. - hexyl # Binary viewer with a cool name on the command-line. - hledger # Do your accountancy thing ON THE COMMAND LINE, sure why not! - httpie # Want a piece of the HTTP pie. - jq # A command-line interface for parsing JSON. - lazygit # For the lazy gits who cannot get good at Git. - lazydocker # For the lazy gits who cannot get good at Docker. - maim # A command-line interface for parsing screenshots. - pup # A command-line interface for parsing HTML. - (ripgrep.override { withPCRE2 = true; }) # Super-fast full-text searcher. - (recoll.override { withGui = false; }) # Bring the search engine to the desktop! - sqlite # Battle-tested cute little database that can grow into an abomination of a data spaghetti. - tree # I'm not a scammer, I swear. - unzip # Unzip what? The world may never know. - youtube-dl # A program that can be sued for false advertisement as you can download from other video sources. + aria2 # The sequel to aria(1). + aspell # Hunt down a spelling bee champion to come to your shell. + bat # cat(1) with wings. + buku # A developer-oriented browser-independent bookmark manager. + exa # ls(1) after an exodus. + fd # find(1) after a cognitive behavioral therapy. + fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception. + gopass # The improved version of Password Store which is a password manager for hipsters. + gotop # A sysadmin's best friend that just happens to be a dashboard. + graphviz # The biz central for graphical flowcharts. + hexyl # Binary viewer with a cool name on the command-line. + hledger # Do your accountancy thing ON THE COMMAND LINE, sure why not! + httpie # Want a piece of the HTTP pie. + jq # A command-line interface for parsing JSON. + lazygit # For the lazy gits who cannot get good at Git. + lazydocker # For the lazy gits who cannot get good at Docker. + maim # A command-line interface for parsing screenshots. + pup # A command-line interface for parsing HTML. + (ripgrep.override { withPCRE2 = true; }) # Super-fast full-text searcher. + (recoll.override { + withGui = false; + }) # Bring the search engine to the desktop! + shellcheck # Check your shell if it's broken. + sqlite # Battle-tested cute little database that can grow into an abomination of a data spaghetti. + tree # I'm not a scammer, I swear. + unzip # Unzip what? The world may never know. + youtube-dl # A program that can be sued for false advertisement as you can download from other video sources. + zoxide # Navigate the filesystem at the speed of sound. ]; my.home = { - programs.bat = { - enable = true; - config = { - theme = "base16"; + programs = { + bat = { + enable = true; + config = { theme = "base16"; }; }; }; }; + + my.zsh = { + rc = '' + eval "$(${pkgs.zoxide}/bin/zoxide init zsh)" + ''; + }; }; } diff --git a/modules/shell/default.nix b/modules/shell/default.nix index 81aeb886..96078619 100755 --- a/modules/shell/default.nix +++ b/modules/shell/default.nix @@ -1,11 +1,6 @@ # All of the command-line tools will be put here. { config, options, lib, pkgs, ... }: -with lib; -{ - imports = [ - ./base.nix - ./lf.nix - ./zsh.nix - ]; +with lib; { + imports = [ ./base.nix ./lf.nix ./zsh.nix ]; } diff --git a/modules/shell/lf.nix b/modules/shell/lf.nix index c9dcd82c..b21293de 100755 --- a/modules/shell/lf.nix +++ b/modules/shell/lf.nix @@ -1,8 +1,7 @@ # A file manager for hipsters. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.shell.lf = { enable = mkOption { type = types.bool; @@ -11,9 +10,7 @@ with lib; }; config = mkIf config.modules.shell.lf.enable { - my.packages = with pkgs; [ - lf - ]; + my.packages = with pkgs; [ lf ]; my.home.xdg.configFile."lf" = { source = ../../config/lf; diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index 4dfe2d03..b0018589 100755 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -1,8 +1,7 @@ # The Zoomer shell is cool for them prompts. { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.shell.zsh = { enable = mkOption { type = types.bool; @@ -16,20 +15,12 @@ with lib; enable = true; enableCompletion = true; autosuggestions.enable = true; - histFile = "\$XDG_DATA_HOME/zsh/history"; + histFile = "$XDG_DATA_HOME/zsh/history"; # Adding basic version control support to the zsh prompt. # https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Zsh - promptInit = " - autoload -Uz vcs_info - precmd_vcs_info() { vcs_info } - precmd_functions+=( precmd_vcs_info ) - setopt prompt_subst - zstyle ':vcs_info:*' formats '[%s] (%b)' - autoload -U colors && colors - PROMPT=\"%F%{\${fg[white]}%}%(0?.√.%?) %B%{\$fg[magenta]%}%1~%{\$reset_color%} \$vcs_info_msg_0_ $%f%b \" - RPROMPT=\"[%D %*]\" - "; + promptInit = + "\n autoload -Uz vcs_info\n precmd_vcs_info() { vcs_info }\n precmd_functions+=( precmd_vcs_info )\n setopt prompt_subst\n zstyle ':vcs_info:*' formats '[%s] (%b)'\n autoload -U colors && colors\n PROMPT=\"%F%{\${fg[white]}%}%(0?.√.%?) %B%{$fg[magenta]%}%1~%{$reset_color%} $vcs_info_msg_0_ $%f%b \"\n RPROMPT=\"[%D %*]\"\n "; interactiveShellInit = '' # Use lf to switch directories and bind it to ctrl-o diff --git a/modules/themes/default.nix b/modules/themes/default.nix index a5f39c21..cfa30f35 100755 --- a/modules/themes/default.nix +++ b/modules/themes/default.nix @@ -4,15 +4,15 @@ with lib; let cfg = config.modules.themes; - my = import ../../lib { inherit pkgs; lib = lib; }; -in -{ + my = import ../../lib { + inherit pkgs; + lib = lib; + }; +in { assertions = [{ assertion = my.countAttrs (_: x: x.enable) cfg < 2; message = "Can't have more than one theme enabled at a time"; }]; - imports = [ - ./fair-and-square - ]; + imports = [ ./fair-and-square ]; } diff --git a/modules/themes/fair-and-square/config/polybar/config b/modules/themes/fair-and-square/config/polybar/config index df4bb52e..82c44b76 100755 --- a/modules/themes/fair-and-square/config/polybar/config +++ b/modules/themes/fair-and-square/config/polybar/config @@ -75,7 +75,7 @@ [module/home-fs] type = internal/fs - mount-0 = /home/ + mount-0 = /home format-mounted-prefix = "" format-mounted-prefix-margin-right = 1 format-unmounted-prefix = "" diff --git a/modules/themes/fair-and-square/default.nix b/modules/themes/fair-and-square/default.nix index 391e0df0..7246f372 100755 --- a/modules/themes/fair-and-square/default.nix +++ b/modules/themes/fair-and-square/default.nix @@ -1,7 +1,6 @@ { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.themes."fair-and-square" = { enable = mkOption { type = types.bool; @@ -45,10 +44,12 @@ with lib; # Install all of the configurations in the XDG config home. xdg.configFile = mkMerge [ - (let recursiveXdgConfig = name: { - source = ./config + "/${name}"; - recursive = true; - }; in { + (let + recursiveXdgConfig = name: { + source = ./config + "/${name}"; + recursive = true; + }; + in { "alacritty" = recursiveXdgConfig "alacritty"; "bspwm" = recursiveXdgConfig "bspwm"; "dunst" = recursiveXdgConfig "dunst"; @@ -94,25 +95,22 @@ with lib; }; my.packages = with pkgs; [ - alacritty # Muh GPU-accelerated terminal emulator. - dunst # Add more annoying pop-ups on your screen! - feh # Meh, it's a image viewer that can set desktop background, what gives? + alacritty # Muh GPU-accelerated terminal emulator. + dunst # Add more annoying pop-ups on your screen! + feh # Meh, it's a image viewer that can set desktop background, what gives? gnome3.adwaita-icon-theme - libnotify # Library for yer notifications. + libnotify # Library for yer notifications. (polybar.override { pulseSupport = true; nlSupport = true; - }) # Add some bars to your magnum opus. - rofi # A ricer's best friend (one of them at least). + }) # Add some bars to your magnum opus. + rofi # A ricer's best friend (one of them at least). # The Arc theme arc-icon-theme arc-theme ]; - fonts.fonts = with pkgs; [ - iosevka - font-awesome-ttf - ]; + fonts.fonts = with pkgs; [ iosevka font-awesome-ttf ]; }; } diff --git a/packages/default.nix b/packages/default.nix index 7b19f03e..e864927a 100755 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,9 +1,12 @@ [ - (self: super: with super; { - # Add packages from the unstable channel with `pkgs.unstable.$PKG`. - veikk-linux-driver = (callPackage ./veikk-driver.nix { kernel = pkgs.linux_5_8; }); - nur.foo-dogsquared = import ( - fetchTarball "https://github.com/foo-dogsquared/nur-packages/archive/develop.tar.gz" - ) { inherit pkgs; }; - }) + (self: super: + with super; { + # Add packages from the unstable channel with `pkgs.unstable.$PKG`. + veikk-linux-driver = + (callPackage ./veikk-driver.nix { kernel = pkgs.linux_5_8; }); + nur.foo-dogsquared = import (fetchTarball + "https://github.com/foo-dogsquared/nur-packages/archive/develop.tar.gz") { + inherit pkgs; + }; + }) ] diff --git a/packages/veikk-driver.nix b/packages/veikk-driver.nix index 4184df94..cb0490be 100755 --- a/packages/veikk-driver.nix +++ b/packages/veikk-driver.nix @@ -19,12 +19,12 @@ stdenv.mkDerivation rec { INSTALL_MOD_PATH = "\${out}"; - makeFlags = [ - "BUILD_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ]; + makeFlags = + [ "BUILD_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; meta = with stdenv.lib; { - description = "Linux device driver for supported VEIKK tablets (e.g., S640, A50, A30)."; + description = + "Linux device driver for supported VEIKK tablets (e.g., S640, A50, A30)."; homepage = "https://github.com/jlam55555/veikk-linux-driver"; licenses = licenses.free; maintainers = with maintainers; [ foo-dogsquared ]; diff --git a/templates/themes/fair-and-square/{{ cookiecutter.slug }}/default.nix b/templates/themes/fair-and-square/{{ cookiecutter.slug }}/default.nix index fc70e383..06cee4eb 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.slug }}/default.nix +++ b/templates/themes/fair-and-square/{{ cookiecutter.slug }}/default.nix @@ -1,7 +1,6 @@ { config, options, lib, pkgs, ... }: -with lib; -{ +with lib; { options.modules.themes."{{ cookiecutter.slug }}" = { enable = mkOption { type = types.bool; @@ -45,10 +44,12 @@ with lib; # Install all of the configurations in the XDG config home. xdg.configFile = mkMerge [ - (let recursiveXdgConfig = name: { - source = ./config + "/${name}"; - recursive = true; - }; in { + (let + recursiveXdgConfig = name: { + source = ./config + "/${name}"; + recursive = true; + }; + in { "alacritty" = recursiveXdgConfig "alacritty"; "bspwm" = recursiveXdgConfig "bspwm"; "dunst" = recursiveXdgConfig "dunst"; @@ -94,25 +95,22 @@ with lib; }; my.packages = with pkgs; [ - alacritty # Muh GPU-accelerated terminal emulator. - dunst # Add more annoying pop-ups on your screen! - feh # Meh, it's a image viewer that can set desktop background, what gives? + alacritty # Muh GPU-accelerated terminal emulator. + dunst # Add more annoying pop-ups on your screen! + feh # Meh, it's a image viewer that can set desktop background, what gives? gnome3.adwaita-icon-theme - libnotify # Library for yer notifications. + libnotify # Library for yer notifications. (polybar.override { pulseSupport = true; nlSupport = true; - }) # Add some bars to your magnum opus. - rofi # A ricer's best friend (one of them at least). + }) # Add some bars to your magnum opus. + rofi # A ricer's best friend (one of them at least). # The Arc theme arc-icon-theme arc-theme ]; - fonts.fonts = with pkgs; [ - iosevka - font-awesome-ttf - ]; + fonts.fonts = with pkgs; [ iosevka font-awesome-ttf ]; }; }