style: add alejandra and format

This commit is contained in:
Michael Thomas 2023-11-16 10:55:39 -05:00
parent 754404ace1
commit 59624111cf
39 changed files with 666 additions and 612 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
check:
alejandra --check ./**/*.nix
format:
alejandra ./**/*.nix

View File

@ -34,8 +34,20 @@
}; };
}; };
outputs = { self, nixpkgs, unstable, nur, utils, rust-overlay, nix-vscode-extensions, nixos-wsl, vscode-server, darwin, home-manager, ... }@inputs: { outputs = {
self,
nixpkgs,
unstable,
nur,
utils,
rust-overlay,
nix-vscode-extensions,
nixos-wsl,
vscode-server,
darwin,
home-manager,
...
} @ inputs: {
# This repo's overlay plus any other overlays you use # This repo's overlay plus any other overlays you use
# If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\ # If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\
overlays = { overlays = {
@ -55,7 +67,6 @@
}; };
nixosConfigurations = { nixosConfigurations = {
loft = nixpkgs.lib.nixosSystem { loft = nixpkgs.lib.nixosSystem {
system = utils.lib.system.x86_64-linux; system = utils.lib.system.x86_64-linux;
modules = [ modules = [
@ -96,7 +107,6 @@
]; ];
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
}; };
}; };
darwinConfigurations = { darwinConfigurations = {
@ -123,8 +133,11 @@
homeDirectory = "/home/michael"; homeDirectory = "/home/michael";
username = "michael"; username = "michael";
stateVersion = "21.05"; stateVersion = "21.05";
configuration = { config, pkgs, ... }: configuration = {
{ config,
pkgs,
...
}: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [ imports = [
@ -138,8 +151,11 @@
homeDirectory = "/home/michael"; homeDirectory = "/home/michael";
username = "michael"; username = "michael";
stateVersion = "21.05"; stateVersion = "21.05";
configuration = { config, pkgs, ... }: configuration = {
{ config,
pkgs,
...
}: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [ imports = [
@ -153,8 +169,11 @@
homeDirectory = "/Users/michael"; homeDirectory = "/Users/michael";
username = "michael"; username = "michael";
stateVersion = "22.05"; stateVersion = "22.05";
configuration = { config, pkgs, ... }: configuration = {
{ config,
pkgs,
...
}: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [ imports = [
@ -163,7 +182,6 @@
}; };
}; };
}; };
}; };
# // utils.lib.eachSystem [ "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (system: { # // utils.lib.eachSystem [ "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (system: {
# nixpkgs = import nixpkgs { # nixpkgs = import nixpkgs {

View File

@ -1,12 +1,13 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -72,5 +73,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment? system.stateVersion = "22.05"; # Did you read the comment?
} }

View File

@ -1,9 +1,13 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];

View File

@ -1,12 +1,13 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -68,7 +69,8 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget micro wget
micro
google-chrome google-chrome
gnome3.gnome-tweaks gnome3.gnome-tweaks
gnomeExtensions.gsconnect gnomeExtensions.gsconnect
@ -100,5 +102,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.09"; # Did you read the comment? system.stateVersion = "20.09"; # Did you read the comment?
} }

View File

@ -1,9 +1,13 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
users.users.michael = { users.users.michael = {
home = "/Users/michael"; home = "/Users/michael";
shell = pkgs.zsh; shell = pkgs.zsh;

View File

@ -1,10 +1,13 @@
{ lib, pkgs, modulesPath, inputs, ... }:
with lib;
let
defaultUser = "michael";
in
{ {
lib,
pkgs,
modulesPath,
inputs,
...
}:
with lib; let
defaultUser = "michael";
in {
imports = [ imports = [
"${modulesPath}/profiles/minimal.nix" "${modulesPath}/profiles/minimal.nix"

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Enable Podman w/ docker compose compatibility # Enable Podman w/ docker compose compatibility
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing = { services.printing = {
enable = true; enable = true;

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Font Settings # Font Settings
fonts = { fonts = {
fonts = with pkgs; [ fonts = with pkgs; [

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
nix = { nix = {
extraOptions = '' extraOptions = ''
experimental-features = flakes nix-command experimental-features = flakes nix-command

View File

@ -1,10 +1,13 @@
{ nixpkgs, unstable, ... }: {
nixpkgs,
let unstable,
...
}: let
inherit (nixpkgs.lib) composeManyExtensions; inherit (nixpkgs.lib) composeManyExtensions;
inherit (builtins) attrNames readDir; inherit (builtins) attrNames readDir;
localOverlays = map localOverlays =
map
(f: import (./default + "/${f}")) (f: import (./default + "/${f}"))
(attrNames (readDir ./default)); (attrNames (readDir ./default));
in in
composeManyExtensions (localOverlays) composeManyExtensions localOverlays

View File

@ -1,5 +1,7 @@
self: super: { self: super: {
gnomeExtensions = super.gnomeExtensions // { gnomeExtensions =
super.gnomeExtensions
// {
paperwm = super.gnomeExtensions.paperwm.overrideDerivation (old: { paperwm = super.gnomeExtensions.paperwm.overrideDerivation (old: {
version = "43.0"; version = "43.0";
src = super.fetchFromGitHub { src = super.fetchFromGitHub {

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
imports = [ imports = [
../../modules/zsh.nix ../../modules/zsh.nix
../../modules/dev.nix ../../modules/dev.nix

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
imports = [ imports = [
../../modules/dev.nix ../../modules/dev.nix
../../modules/git.nix ../../modules/git.nix

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
# devbox # devbox
unstable.devbox unstable.devbox
@ -18,7 +17,7 @@
kubernetes-helm kubernetes-helm
# Nix # Nix
nil nil
nixpkgs-fmt alejandra
# Rust # Rust
(rust-bin.stable.latest.default.override { (rust-bin.stable.latest.default.override {
extensions = ["rust-src"]; extensions = ["rust-src"];

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Add Firefox GNOME theme directory # Add Firefox GNOME theme directory
home.file."firefox-gnome-theme" = { home.file."firefox-gnome-theme" = {
target = ".mozilla/firefox/default/chrome/firefox-gnome-theme"; target = ".mozilla/firefox/default/chrome/firefox-gnome-theme";

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
(nerdfonts.override {fonts = ["FiraCode"];}) (nerdfonts.override {fonts = ["FiraCode"];})
google-fonts google-fonts

View File

@ -1,5 +1,8 @@
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
...
}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
git-lfs git-lfs
]; ];

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# Use pkgs.gitAndTools.gitFull in order to get libsecret support # Use pkgs.gitAndTools.gitFull in order to get libsecret support
programs.git = { programs.git = {
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
gnomeExtensions.caffeine gnomeExtensions.caffeine
unstable.gnomeExtensions.paperwm unstable.gnomeExtensions.paperwm

View File

@ -1,5 +1,8 @@
{ pkgs, config, ... }:
{ {
pkgs,
config,
...
}: {
programs.neovim = { programs.neovim = {
enable = true; enable = true;
}; };
@ -9,7 +12,8 @@
}; };
# Copy Neovim config # Copy Neovim config
xdg.configFile.nvim.source = config.lib.file.mkOutOfStoreSymlink xdg.configFile.nvim.source =
config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/Projects/nix-dots/user/modules/nvim"; "${config.home.homeDirectory}/Projects/nix-dots/user/modules/nvim";
home.packages = with pkgs; [ home.packages = with pkgs; [

View File

@ -42,4 +42,14 @@ return {
}, },
}, },
}, },
{
"stevearc/conform.nvim",
---@class ConformOpts
opts = {
---@type table<string, conform.FormatterUnit[]>
formatters_by_ft = {
nix = { "alejandra" },
},
},
},
} }

View File

@ -1,20 +1,24 @@
{ config, pkgs, ... }: {
config,
let pkgs,
...
}: let
package = pkgs.vscodium; package = pkgs.vscodium;
vscodePname = package.pname; vscodePname = package.pname;
configDir = { configDir =
{
"vscode" = "Code"; "vscode" = "Code";
"vscode-insiders" = "Code - Insiders"; "vscode-insiders" = "Code - Insiders";
"vscodium" = "VSCodium"; "vscodium" = "VSCodium";
}.${vscodePname}; }
.${vscodePname};
userDir = if pkgs.stdenv.hostPlatform.isDarwin then userDir =
"Library/Application Support/${configDir}/User" if pkgs.stdenv.hostPlatform.isDarwin
else then "Library/Application Support/${configDir}/User"
"${config.xdg.configHome}/${configDir}/User"; else "${config.xdg.configHome}/${configDir}/User";
configFilePath = "${userDir}/settings.json"; configFilePath = "${userDir}/settings.json";
keybindingsFilePath = "${userDir}/keybindings.json"; keybindingsFilePath = "${userDir}/keybindings.json";
@ -39,6 +43,7 @@ in {
mhutchie.git-graph mhutchie.git-graph
waderyan.gitblame waderyan.gitblame
# Web Development # Web Development
astro-build.astro-vscode astro-build.astro-vscode
redwan-hossain.auto-rename-tag-clone redwan-hossain.auto-rename-tag-clone
@ -49,6 +54,7 @@ in {
esbenp.prettier-vscode esbenp.prettier-vscode
antfu.iconify antfu.iconify
csstools.postcss csstools.postcss
ms-playwright.playwright
# Dart / Flutter # Dart / Flutter
dart-code.dart-code dart-code.dart-code
@ -62,6 +68,7 @@ in {
# Nix # Nix
jnoortheen.nix-ide jnoortheen.nix-ide
kamadorueda.alejandra
]; ];
}; };
}; };

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.zsh = { programs.zsh = {
enable = true; enable = true;
plugins = [ plugins = [