Use nixfmt to all files

This commit is contained in:
Gabriel Arazas 2020-10-25 23:49:14 +08:00
parent 8ed3f6b1c4
commit c74dd2ff17
48 changed files with 623 additions and 636 deletions

View File

@ -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 = {

View File

@ -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 = {
@ -41,14 +39,16 @@
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 {
};
in {
"recoll" = insertXDGDataFolder "recoll";
"unison" = insertXDGDataFolder "unison";
};
@ -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;
@ -163,14 +157,15 @@
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*
ruby # Gems, lots of gems.
];
my.packages = with pkgs; [
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!
@ -194,9 +189,7 @@
]
# My custom packages.
++ (with pkgs.nur.foo-dogsquared; [
segno
]);
++ (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?
}

View File

@ -1,8 +1,7 @@
{ lib, ... }:
with builtins;
with lib;
rec {
with lib; rec {
# attrsToList
attrsToList = attrs:
mapAttrsToList (name: value: { inherit name value; }) attrs;

View File

@ -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))

View File

@ -2,50 +2,37 @@
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))
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);

View File

@ -1,16 +1,14 @@
{ 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 {
mkBoolOpt = default:
mkOption {
inherit default;
type = types.bool;
example = true;

View File

@ -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 = [
<home-manager/nixos>
@ -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,8 +81,9 @@ in {
my.env.PATH = [ <config/bin> "$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;
environment.extraInit = let
exportLines =
mapAttrsToList (key: value: ''export ${key}="${value}"'') config.my.env;
in ''
export XAUTHORITY=/tmp/XAUTHORITY
[ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
@ -85,8 +92,9 @@ in {
'';
my.home.xdg.configFile = {
"zsh/.zshrc".text =
let aliasLines = mapAttrsToList (key: value: "alias ${key}=\"${value}\"") config.my.alias;
"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}

View File

@ -5,14 +5,15 @@
with lib;
let
cfg = config.modules.desktop.audio;
let cfg = config.modules.desktop.audio;
in {
options.modules.desktop.audio =
let mkBoolDefault = bool: mkOption {
options.modules.desktop.audio = let
mkBoolDefault = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
enable = mkBoolDefault false;
composition.enable = mkBoolDefault false;
production.enable = mkBoolDefault false;
@ -22,11 +23,16 @@ in {
# 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 [
@ -35,7 +41,8 @@ in {
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 []) ++
] else
[ ]) ++
(if cfg.production.enable then [
ardour # A DAW focuses on hardware recording but it can be used for something else.
@ -51,7 +58,8 @@ in {
# 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" ];

View File

@ -3,15 +3,15 @@
with lib;
let
cfg = config.modules.desktop.browsers;
in
{
options.modules.desktop.browsers =
let mkBoolDefault = bool: mkOption {
let cfg = config.modules.desktop.browsers;
in {
options.modules.desktop.browsers = let
mkBoolDefault = bool:
mkOption {
type = types.bool;
default = false;
}; in {
};
in {
brave.enable = mkBoolDefault false;
firefox.enable = mkBoolDefault false;
chromium.enable = mkBoolDefault false;
@ -20,9 +20,9 @@ in
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 [ ]);
};
}

View File

@ -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;
@ -13,7 +12,7 @@ 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.
#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.
];

View File

@ -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 {

View File

@ -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,9 +17,9 @@ 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" ];
};
};
@ -31,6 +30,7 @@ with lib;
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.

View File

@ -4,14 +4,15 @@
with lib;
let
cfg = config.modules.desktop.graphics;
let cfg = config.modules.desktop.graphics;
in {
options.modules.desktop.graphics =
let mkBoolDefault = bool: mkOption {
options.modules.desktop.graphics = let
mkBoolDefault = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
programmable.enable = mkBoolDefault false;
raster.enable = mkBoolDefault false;
vector.enable = mkBoolDefault false;
@ -26,23 +27,31 @@ in {
graphviz # The biz central for graphical flowcharts.
] ++
(if cfg.programmable.enable then [
(if cfg.programmable.enable then
[
processing # A visually-oriented language with an energertic train conductor as the mascot.
] else []) ++
]
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 []) ++
] else
[ ]) ++
(if cfg.vector.enable then [
(if cfg.vector.enable then
[
inkscape # Adobe Illustrator (or Affinity Designer) replacement.
] else []) ++
]
else
[ ]) ++
(if cfg._3d.enable then [
blender # It's a great 3D model editor.
goxel # It's a great voxel editor.
] else []);
] else
[ ]);
};
}

View File

@ -1,8 +1,7 @@
# Muh consumer applications...
{ config, options, lib, pkgs, ... }:
with lib;
{
with lib; {
options.modules.desktop.multimedia = {
enable = mkOption {
type = types.bool;
@ -18,7 +17,6 @@ with lib;
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.
];

View File

@ -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;

View File

@ -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;

View File

@ -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;
@ -17,6 +16,7 @@ with lib;
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.

View File

@ -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;

View File

@ -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;
@ -14,7 +13,7 @@ with lib;
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.
#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.

View File

@ -5,15 +5,15 @@
with lib;
let
cfg = config.modules.dev.documentation;
in
{
options.modules.dev.documentation =
let mkBoolOption = bool: mkOption {
let cfg = config.modules.dev.documentation;
in {
options.modules.dev.documentation = let
mkBoolOption = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
enable = mkBoolOption false;
# Jupyter does need a bit of setup so separate option.
@ -24,12 +24,13 @@ in
};
config = mkIf cfg.enable {
my.packages = with pkgs; [
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
#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.
@ -41,17 +42,22 @@ in
# TODO: Make Neuron its own package.
(let
neuronRev = "e7568ca5f51609bb406a48527b5ba52d31d11f9c";
neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz";
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 []) ++
] else
[ ]) ++
(if cfg.latex.enable then [
(if cfg.latex.enable then
[
texlive.combined.scheme-medium # The all-in-one LaTeX distribution for your offline typesetting needs.
] else []);
]
else
[ ]);
};
}

View File

@ -4,15 +4,15 @@
with lib;
let
cfg = config.modules.dev.game-dev;
in
{
options.modules.dev.game-dev =
let mkBoolOption = bool: mkOption {
let cfg = config.modules.dev.game-dev;
in {
options.modules.dev.game-dev = let
mkBoolOption = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
defold.enable = mkBoolOption false;
godot.enable = mkBoolOption false;
unity3d.enable = mkBoolOption false;
@ -20,17 +20,19 @@ in
config = {
my.packages = with pkgs;
(if cfg.godot.enable then [
(if cfg.godot.enable then
[
godot # The Godot, not to be confused with a certain prosecutor.
] else []) ++
]
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 []);
] else
[ ]);
};
}

View File

@ -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;

View File

@ -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;

View File

@ -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 {
let cfg = config.modules.dev.javascript;
in {
options.modules.dev.javascript = let
mkBoolOption = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
deno.enable = mkBoolOption false;
node.enable = mkBoolOption false;
};
config = {
my.packages = with pkgs;
(if cfg.deno.enable then [
(if cfg.deno.enable then
[
deno # The Deltarune of Node.
] else []) ++
]
else
[ ]) ++
(if cfg.node.enable then [
(if cfg.node.enable then
[
nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :)
] else []);
]
else
[ ]);
};
}

View File

@ -5,15 +5,15 @@
with lib;
let
cfg = config.modules.dev.lisp;
in
{
options.modules.dev.lisp =
let mkBoolDefault = bool: mkOption {
let cfg = config.modules.dev.lisp;
in {
options.modules.dev.lisp = let
mkBoolDefault = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
clojure.enable = mkBoolDefault false;
guile.enable = mkBoolDefault false;
racket.enable = mkBoolDefault false;
@ -24,14 +24,21 @@ in
(if cfg.clojure.enable then [
clojure # Improved Java version.
leiningen # Install Clojure projects without pulling your hair.
] else []) ++
] else
[ ]) ++
(if cfg.guile.enable then [
(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 []) ++
]
else
[ ]) ++
(if cfg.racket.enable then [
(if cfg.racket.enable then
[
racket # A DSL for DSLs.
] else []);
]
else
[ ]);
};
}

View File

@ -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 {
};
in {
enable = mkEnableOption;
r.enable = mkEnableOption;
};
config = mkIf cfg.enable {
my.packages = with pkgs; [
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.
#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 []);
] else
[ ]);
};
}

View File

@ -3,8 +3,8 @@
with lib;
let
perlWithPackages = pkgs.perl.withPackages (p: with pkgs.perlPackages;
[
perlWithPackages = pkgs.perl.withPackages (p:
with pkgs.perlPackages; [
ModuleBuild
ModuleInfo
ModuleInstall
@ -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 ]; };
}

View File

@ -5,23 +5,28 @@
with lib;
let
cfg = config.modules.dev.python;
let cfg = config.modules.dev.python;
in {
options.modules.dev.python = let
mkBoolOption = bool: mkOption {
mkBoolOption = bool:
mkOption {
type = types.bool;
default = bool;
}; in {
};
in {
enable = mkBoolOption false;
math.enable = mkBoolOption false;
};
config = mkIf cfg.enable {
my.packages = with pkgs; [
(python37.withPackages (p: with python3Packages; [
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...
@ -32,7 +37,8 @@ in {
++ (if cfg.math.enable then [
numpy # Numbers are also good, right?
sympy # When will you notice that math is good?
] else [])))
] else
[ ])))
];
};
}

View File

@ -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";

View File

@ -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 ];
};
}

View File

@ -1,7 +1,5 @@
{ config, lib, ... }:
{
imports = [
./veikk.nix
];
imports = [ ./veikk.nix ];
}

View File

@ -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;

View File

@ -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; };
}

View File

@ -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
@ -53,7 +51,7 @@ in
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 ];
};
}

View File

@ -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;
@ -11,7 +10,8 @@ with lib;
};
config = mkIf config.modules.editors.neovim.enable {
my.packages = with pkgs; [
my.packages = with pkgs;
[
editorconfig-core-c # Editorconfig is a MUST, you feel me?!
];

View File

@ -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;

View File

@ -3,7 +3,5 @@
{ config, options, lib, pkgs, ... }:
{
imports = [
./recoll.nix
];
imports = [ ./recoll.nix ];
}

View File

@ -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" ]; };
};
};
};

View File

@ -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;
@ -20,6 +19,7 @@ with lib;
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!
@ -30,20 +30,30 @@ with lib;
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!
(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 = {
programs = {
bat = {
enable = true;
config = {
theme = "base16";
config = { theme = "base16"; };
};
};
};
my.zsh = {
rc = ''
eval "$(${pkgs.zoxide}/bin/zoxide init zsh)"
'';
};
};
}

View File

@ -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 ];
}

View File

@ -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;

View File

@ -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

View File

@ -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 ];
}

View File

@ -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 = ""

View File

@ -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: {
(let
recursiveXdgConfig = name: {
source = ./config + "/${name}";
recursive = true;
}; in {
};
in {
"alacritty" = recursiveXdgConfig "alacritty";
"bspwm" = recursiveXdgConfig "bspwm";
"dunst" = recursiveXdgConfig "dunst";
@ -110,9 +111,6 @@ with lib;
arc-theme
];
fonts.fonts = with pkgs; [
iosevka
font-awesome-ttf
];
fonts.fonts = with pkgs; [ iosevka font-awesome-ttf ];
};
}

View File

@ -1,9 +1,12 @@
[
(self: super: with super; {
(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; };
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;
};
})
]

View File

@ -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 ];

View File

@ -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: {
(let
recursiveXdgConfig = name: {
source = ./config + "/${name}";
recursive = true;
}; in {
};
in {
"alacritty" = recursiveXdgConfig "alacritty";
"bspwm" = recursiveXdgConfig "bspwm";
"dunst" = recursiveXdgConfig "dunst";
@ -110,9 +111,6 @@ with lib;
arc-theme
];
fonts.fonts = with pkgs; [
iosevka
font-awesome-ttf
];
fonts.fonts = with pkgs; [ iosevka font-awesome-ttf ];
};
}