add alejandra formatter

This commit is contained in:
Fabian Montero 2024-08-24 01:55:59 -06:00
parent 93d38992e1
commit 1f69ba4229
Signed by untrusted user: fabian
GPG key ID: 1FFAC35E1798174F
29 changed files with 405 additions and 326 deletions

View file

@ -1,11 +1,13 @@
# Edet this configuration file to define what should be installed on # Edet 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, lib, ... }:
{ {
imports = config,
[ pkgs,
lib,
...
}: {
imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration-custom.nix ./hardware-configuration-custom.nix
]; ];
@ -51,7 +53,7 @@
hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = true;
programs.zsh.enable = true; programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ]; environment.pathsToLink = ["/share/zsh"];
users = { users = {
users.fabian = { users.fabian = {
@ -59,7 +61,7 @@
uid = 1002; # nunca cambiar mi ID de usuario uid = 1002; # nunca cambiar mi ID de usuario
group = "fabian"; group = "fabian";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ "users" "wheel" "networkmanager" "dialout" "libvirtd" ]; extraGroups = ["users" "wheel" "networkmanager" "dialout" "libvirtd"];
}; };
groups.fabian.gid = 1002; groups.fabian.gid = 1002;
}; };
@ -70,14 +72,14 @@
users.users.temp = { users.users.temp = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = ["wheel"];
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
virtualisation.libvirtd.qemu.ovmf.enable = true; virtualisation.libvirtd.qemu.ovmf.enable = true;
virtualisation.libvirtd.qemu.ovmf.packages = [ pkgs.OVMFFull.fd ]; virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd];
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
# boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; # boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
@ -101,5 +103,4 @@
}; };
system.stateVersion = "21.11"; # No tocar esto system.stateVersion = "21.11"; # No tocar esto
} }

View file

@ -1,22 +1,22 @@
{ config, lib, pkgs, modulesPath, ... }: {
let config,
lib,
pkgs,
modulesPath,
...
}: let
subvol = subvol: { subvol = subvol: {
device = "/dev/disk/by-uuid/645fdba0-5c03-4285-926b-facded1ee259"; device = "/dev/disk/by-uuid/645fdba0-5c03-4285-926b-facded1ee259";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=${subvol}" "compress=zstd" "noatime" "ssd" ]; options = ["subvol=${subvol}" "compress=zstd" "noatime" "ssd"];
}; };
in {
in imports = [
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd = { boot.initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
luks.devices."toplevel" = { luks.devices."toplevel" = {
device = "/dev/disk/by-uuid/58277baa-90d4-4a5e-a658-1b918b89130a"; device = "/dev/disk/by-uuid/58277baa-90d4-4a5e-a658-1b918b89130a";
preLVM = false; preLVM = false;
@ -29,17 +29,15 @@ in
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/B007-B007"; device = "/dev/disk/by-uuid/B007-B007";
fsType = "vfat"; fsType = "vfat";
options = [ "umask=027" ]; options = ["umask=027"];
}; };
"/extern" = { "/extern" = {
device = "/dev/disk/by-uuid/7d8d3ec9-b456-4e2a-9396-551dcaf7705b"; device = "/dev/disk/by-uuid/7d8d3ec9-b456-4e2a-9396-551dcaf7705b";
fsType = "btrfs"; fsType = "btrfs";
options = [ "noatime" "compress=zstd" ]; options = ["noatime" "compress=zstd"];
}; };
}; };
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -1 +1 @@
{ } {}

View file

@ -12,8 +12,16 @@
}; };
}; };
outputs = { self, nixpkgs, unstable, home-manager, nur, hm-isolation, nixGL, ... }: outputs = {
let self,
nixpkgs,
unstable,
home-manager,
nur,
hm-isolation,
nixGL,
...
}: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
@ -27,7 +35,7 @@
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ (import ./base) ]; modules = [(import ./base)];
}; };
}; };
@ -44,7 +52,7 @@
./home/platforms/${platform}.nix ./home/platforms/${platform}.nix
{ {
config.local = { inherit platform; }; config.local = {inherit platform;};
} }
]; ];
}; };
@ -60,12 +68,11 @@
configs = domain: builder: configs = domain: builder:
lib.listToAttrs lib.listToAttrs
(map builder (platforms domain)); (map builder (platforms domain));
in in {
{
nixosConfigurations = configs "base" base; nixosConfigurations = configs "base" base;
homeConfigurations = configs "home" home; homeConfigurations = configs "home" home;
packages.${system} = localPkgs pkgs; packages.${system} = localPkgs pkgs;
formatter.${system} = pkgs.nixpkgs-fmt; formatter.${system} = pkgs.alejandra;
overlay = self: super: { overlay = self: super: {
unstable = import unstable { unstable = import unstable {

View file

@ -1,6 +1,9 @@
{ lib, config, ... }:
with lib;
{ {
lib,
config,
...
}:
with lib; {
config = mkIf (!config.home.isolation.active) { config = mkIf (!config.home.isolation.active) {
accounts.email.maildirBasePath = "${config.home.homeDirectory}/mail"; accounts.email.maildirBasePath = "${config.home.homeDirectory}/mail";
accounts.email.accounts = { accounts.email.accounts = {

View file

@ -1,7 +1,12 @@
{ pkgs, config, lib, ... }:
with lib;
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ pkgs,
config,
lib,
...
}:
with lib; {
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"discord" "discord"
"pycharm-professional" "pycharm-professional"
"rar" "rar"

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.local.apps;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps;
in {
options.local.apps.enable = mkEnableOption "Applications and tools"; options.local.apps.enable = mkEnableOption "Applications and tools";
imports = [ imports = [
./library.nix ./library.nix

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.local.apps.defaultApps;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps.defaultApps;
in {
options.local.apps.defaultApps.enable = mkEnableOption "Default app library"; options.local.apps.defaultApps.enable = mkEnableOption "Default app library";
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -37,16 +40,16 @@ in
]; ];
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {
"application/x-extension-htm" = [ "firefox.desktop" ]; "application/x-extension-htm" = ["firefox.desktop"];
"application/x-extension-html" = [ "firefox.desktop" ]; "application/x-extension-html" = ["firefox.desktop"];
"application/x-extension-shtml" = [ "firefox.desktop" ]; "application/x-extension-shtml" = ["firefox.desktop"];
"application/x-extension-xht" = [ "firefox.desktop" ]; "application/x-extension-xht" = ["firefox.desktop"];
"application/x-extension-xhtml" = [ "firefox.desktop" ]; "application/x-extension-xhtml" = ["firefox.desktop"];
"application/xhtml+xml" = [ "firefox.desktop" ]; "application/xhtml+xml" = ["firefox.desktop"];
"text/html" = [ "firefox.desktop" ]; "text/html" = ["firefox.desktop"];
"x-scheme-handler/http" = [ "firefox.desktop" ]; "x-scheme-handler/http" = ["firefox.desktop"];
"x-scheme-handler/https" = [ "firefox.desktop" ]; "x-scheme-handler/https" = ["firefox.desktop"];
"application/pdf" = [ "qpdfview.desktop" ]; "application/pdf" = ["qpdfview.desktop"];
}; };
}; };
} }

View file

@ -1,12 +1,16 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
with lib; let with lib; let
cfg = config.local.apps.steam; cfg = config.local.apps.steam;
in in {
{
options.local.apps.steam.enable = mkEnableOption "Steam"; options.local.apps.steam.enable = mkEnableOption "Steam";
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ home.packages = [
(pkgs.callPackage ./package.nix { }) (pkgs.callPackage ./package.nix {})
pkgs.protonup pkgs.protonup
pkgs.winetricks pkgs.winetricks
pkgs.protontricks pkgs.protontricks

View file

@ -1,4 +1,9 @@
{ writeShellScriptBin, steam-run, steam, ... }: {
writeShellScriptBin,
steam-run,
steam,
...
}:
writeShellScriptBin "steam" '' writeShellScriptBin "steam" ''
exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console
'' ''

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.local.apps.terminal;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps.terminal;
in {
options.local.apps.terminal.enable = mkEnableOption "Terminal emulator settings"; options.local.apps.terminal.enable = mkEnableOption "Terminal emulator settings";
config.programs = mkIf cfg.enable { config.programs = mkIf cfg.enable {
kitty = { kitty = {

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.local.apps.virtmanager;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.apps.virtmanager;
in {
options.local.apps.virtmanager.enable = mkEnableOption "Virtmanager"; options.local.apps.virtmanager.enable = mkEnableOption "Virtmanager";
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -1,6 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
{ {
config,
lib,
pkgs,
...
}:
with lib; {
programs = { programs = {
## talvez esto debería moverse a base ## talvez esto debería moverse a base
zsh = { zsh = {
@ -31,8 +35,7 @@ with lib;
pinentryPackage = pkgs.pinentry-emacs; pinentryPackage = pkgs.pinentry-emacs;
}; };
home.packages = with pkgs; home.packages = with pkgs; [
[
calc calc
file file
gcc gcc

View file

@ -1,7 +1,16 @@
{ self, nixpkgs, unstable, hm-isolation, nixGL }:
{ config, pkgs, lib, ... }:
with lib;
{ {
self,
nixpkgs,
unstable,
hm-isolation,
nixGL,
}: {
config,
pkgs,
lib,
...
}:
with lib; {
imports = [ imports = [
(hm-isolation.homeManagerModule) (hm-isolation.homeManagerModule)
./accounts.nix ./accounts.nix
@ -14,7 +23,7 @@ with lib;
./systemd ./systemd
]; ];
nixpkgs.overlays = [ self.overlay nixGL.overlay ]; nixpkgs.overlays = [self.overlay nixGL.overlay];
services.ssh-agent.enable = true; services.ssh-agent.enable = true;
@ -55,4 +64,3 @@ with lib;
}; };
}; };
} }

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui.autorandr;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.autorandr;
in {
options.local.gui.autorandr.enable = mkEnableOption "Autorandr"; options.local.gui.autorandr.enable = mkEnableOption "Autorandr";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.autorandr = { programs.autorandr = {

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui;
in {
options.local.gui = { options.local.gui = {
enable = mkEnableOption "GUI settings and programs"; enable = mkEnableOption "GUI settings and programs";
desktop = mkEnableOption "i3 desktop envirorment"; desktop = mkEnableOption "i3 desktop envirorment";
@ -19,7 +22,6 @@ in
]; ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
local.gui = { local.gui = {
fonts.enable = mkDefault true; fonts.enable = mkDefault true;
gtk.enable = mkDefault true; gtk.enable = mkDefault true;

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui.fonts;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.fonts;
in {
options.local.gui.fonts.enable = mkEnableOption "Font management"; options.local.gui.fonts.enable = mkEnableOption "Font management";
config = mkIf cfg.enable { config = mkIf cfg.enable {
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.local.gui.gtk;
in
{ {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.gui.gtk;
in {
options.local.gui.gtk.enable = mkEnableOption "GTK related programs"; options.local.gui.gtk.enable = mkEnableOption "GTK related programs";
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -1,25 +1,26 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui.i3;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.i3;
in {
options.local.gui.i3.enable = mkEnableOption "i3 window manager"; options.local.gui.i3.enable = mkEnableOption "i3 window manager";
config = mkIf cfg.enable { config = mkIf cfg.enable {
xsession.windowManager.i3 = { xsession.windowManager.i3 = {
enable = true; enable = true;
package = pkgs.i3-gaps; package = pkgs.i3-gaps;
config = config = let
let
mod = "Mod4"; mod = "Mod4";
in in {
{
modifier = mod; modifier = mod;
# revisar luego si config.bars tiene un default danino # revisar luego si config.bars tiene un default danino
fonts = { fonts = {
names = [ "JetBrains Mono" ]; names = ["JetBrains Mono"];
style = "Regular"; style = "Regular";
size = 8.0; size = 8.0;
}; };
@ -90,17 +91,19 @@ in
} }
]; ];
workspaceOutputAssign = [ workspaceOutputAssign =
[
{ {
output = config.local.display."0"; output = config.local.display."0";
workspace = "1"; workspace = "1";
} }
] ++ optional (config.local.display."1" != null) { ]
++ optional (config.local.display."1" != null) {
output = config.local.display."1"; output = config.local.display."1";
workspace = "10"; workspace = "10";
}; };
bars = [ ]; bars = [];
}; };
}; };
}; };

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui.polybar;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.polybar;
in {
options.local.gui.polybar.enable = mkEnableOption "Polybar"; options.local.gui.polybar.enable = mkEnableOption "Polybar";
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.polybar = mkIf (!config.home.isolation.active) { services.polybar = mkIf (!config.home.isolation.active) {

View file

@ -1,19 +1,23 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.gui.startx;
in
{ {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.local.gui.startx;
in {
options.local.gui.startx.enable = mkEnableOption "startx"; options.local.gui.startx.enable = mkEnableOption "startx";
config = mkIf cfg.enable { config = mkIf cfg.enable {
xsession.enable = true; xsession.enable = true;
home.file.".xinitrc".source = home.file.".xinitrc".source = let
let
content = content =
if config.local.nixos then '' if config.local.nixos
then ''
exec ~/.xsession exec ~/.xsession
'' else '' ''
else ''
exec ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ~/.xsession exec ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ~/.xsession
''; '';
in in

View file

@ -1,6 +1,10 @@
{ pkgs, config, lib, ... }:
with lib;
{ {
pkgs,
config,
lib,
...
}:
with lib; {
home.isolation = { home.isolation = {
enable = true; enable = true;
btrfsSupport = true; btrfsSupport = true;

View file

@ -1,6 +1,9 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
options.local = with types; { options.local = with types; {
platform = mkOption { platform = mkOption {
type = str; type = str;
@ -18,7 +21,6 @@ with lib;
autorandrProfile = mkOption { autorandrProfile = mkOption {
type = attrs; type = attrs;
}; };
}; };
nixos = mkOption { nixos = mkOption {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
static = true; static = true;
packages = with pkgs; [ packages = with pkgs; [

View file

@ -1,10 +1,10 @@
{ pkgs, ... }: {pkgs, ...}: {
{
static = true; static = true;
packages = with pkgs; [ packages = with pkgs; [
pipenv pipenv
(python310.withPackages (packages: with packages; [ (python310.withPackages (packages:
with packages; [
setuptools setuptools
])) ]))
]; ];

View file

@ -1,6 +1,9 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
systemd.user.tmpfiles.rules = [ systemd.user.tmpfiles.rules = [
"d %t/tmp 0700 fabian fabian 24h" "d %t/tmp 0700 fabian fabian 24h"
]; ];

View file

@ -1,4 +1,9 @@
{ maim, redshift, xclip, ... }: '' {
maim,
redshift,
xclip,
...
}: ''
# The following lines were added by compinstall # The following lines were added by compinstall
zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' auto-description 'specify: %d'

View file

@ -1,5 +1,4 @@
pkgs: pkgs: {
{
#andesight = pkgs.callPackage ./andesight {}; #andesight = pkgs.callPackage ./andesight {};
#netextender = pkgs.callPackage ./netextender {}; #netextender = pkgs.callPackage ./netextender {};
} }