From 87eff73b586ed97034ead7ca65ac4fdbe89585c6 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Wed, 25 Sep 2024 09:02:43 +0200 Subject: [PATCH] repo: clean code --- home/common/automount.nix | 2 +- home/common/core.nix | 10 +++--- home/common/mime.nix | 2 +- home/common/programs/git.nix | 2 +- home/common/programs/gnupg.nix | 2 +- home/common/shell/direnv.nix | 2 +- home/common/shell/fish.nix | 2 +- home/common/shell/starship.nix | 2 +- home/common/shell/zellij.nix | 2 +- home/common/shell/zoxide.nix | 2 +- hosts/common/default.nix | 11 ++++--- hosts/common/sops.nix | 12 ++++--- hosts/common/system/boot.nix | 2 +- hosts/common/system/core.nix | 17 +++++----- hosts/common/system/locale.nix | 2 +- hosts/common/system/misc.nix | 2 +- hosts/common/system/printing.nix | 32 ++++++++++--------- hosts/solaire/hardware-configuration.nix | 26 +++++++-------- hosts/vamos/default.nix | 23 +++++++------- hosts/vamos/hardware-configuration.nix | 40 +++++++++++++----------- modules/gui/gnome.nix | 38 +++++++++++----------- modules/gui/wezterm.nix | 1 - 22 files changed, 121 insertions(+), 113 deletions(-) diff --git a/home/common/automount.nix b/home/common/automount.nix index 81fc5df..08a5850 100644 --- a/home/common/automount.nix +++ b/home/common/automount.nix @@ -1,3 +1,3 @@ -{...}: { +_: { services.udiskie.enable = true; } diff --git a/home/common/core.nix b/home/common/core.nix index fcc26c5..97f2628 100644 --- a/home/common/core.nix +++ b/home/common/core.nix @@ -1,6 +1,8 @@ -{inputs, ...}: { - home.username = "nezia"; - home.homeDirectory = "/home/nezia"; +_: { + home = { + username = "nezia"; + homeDirectory = "/home/nezia"; + stateVersion = "24.05"; + }; programs.home-manager.enable = true; - home.stateVersion = "24.05"; } diff --git a/home/common/mime.nix b/home/common/mime.nix index 29af8f3..b1e2a2f 100644 --- a/home/common/mime.nix +++ b/home/common/mime.nix @@ -1,4 +1,4 @@ -{...}: { +_: { xdg.mimeApps = { enable = true; defaultApplications = { diff --git a/home/common/programs/git.nix b/home/common/programs/git.nix index 31cb7ec..0e91f25 100644 --- a/home/common/programs/git.nix +++ b/home/common/programs/git.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs.git = { enable = true; userName = "Anthony Rodriguez"; diff --git a/home/common/programs/gnupg.nix b/home/common/programs/gnupg.nix index 3ada3ee..5555ef3 100644 --- a/home/common/programs/gnupg.nix +++ b/home/common/programs/gnupg.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs.gpg = { enable = true; publicKeys = [ diff --git a/home/common/shell/direnv.nix b/home/common/shell/direnv.nix index dd5b52f..eb5f442 100644 --- a/home/common/shell/direnv.nix +++ b/home/common/shell/direnv.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs = { direnv = { enable = true; diff --git a/home/common/shell/fish.nix b/home/common/shell/fish.nix index b0e8514..41ec207 100644 --- a/home/common/shell/fish.nix +++ b/home/common/shell/fish.nix @@ -20,7 +20,7 @@ in { plugins = [ { name = "fzf"; - src = pkgs.fishPlugins.fzf.src; + inherit (pkgs.fishPlugins.fzf) src; } ]; }; diff --git a/home/common/shell/starship.nix b/home/common/shell/starship.nix index ba5adfc..b8a543e 100644 --- a/home/common/shell/starship.nix +++ b/home/common/shell/starship.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs.starship = { enable = true; enableTransience = true; diff --git a/home/common/shell/zellij.nix b/home/common/shell/zellij.nix index 0cee4c9..5e264ef 100644 --- a/home/common/shell/zellij.nix +++ b/home/common/shell/zellij.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs.zellij = { enable = true; settings = { diff --git a/home/common/shell/zoxide.nix b/home/common/shell/zoxide.nix index 9f66920..d083624 100644 --- a/home/common/shell/zoxide.nix +++ b/home/common/shell/zoxide.nix @@ -1,4 +1,4 @@ -{...}: { +_: { programs.zoxide = { enable = true; enableBashIntegration = false; diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 51668f9..843d230 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -4,9 +4,10 @@ _: { ./syncthing ./sops.nix ]; - - modules.gnome.enable = true; - modules.stylix.enable = true; - modules.docker.enable = true; - modules.pipewire.enable = true; + modules = { + gnome.enable = true; + stylix.enable = true; + docker.enable = true; + pipewire.enable = true; + }; } diff --git a/hosts/common/sops.nix b/hosts/common/sops.nix index 13a487c..c5a5d02 100644 --- a/hosts/common/sops.nix +++ b/hosts/common/sops.nix @@ -3,10 +3,12 @@ username, ... }: { - sops.defaultSopsFile = ../../secrets/secrets.yaml; - sops.defaultSopsFormat = "yaml"; - sops.age.keyFile = "/home/${username}/.config/sops/age/keys.txt"; + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/${username}/.config/sops/age/keys.txt"; - sops.secrets."syncthing/${hostname}/key" = {}; - sops.secrets."syncthing/${hostname}/cert" = {}; + secrets."syncthing/${hostname}/key" = {}; + secrets."syncthing/${hostname}/cert" = {}; + }; } diff --git a/hosts/common/system/boot.nix b/hosts/common/system/boot.nix index 20196dc..fcf9e4f 100644 --- a/hosts/common/system/boot.nix +++ b/hosts/common/system/boot.nix @@ -1,4 +1,4 @@ -{...}: { +_: { boot = { loader = { timeout = 0; diff --git a/hosts/common/system/core.nix b/hosts/common/system/core.nix index afae51a..e06e30e 100644 --- a/hosts/common/system/core.nix +++ b/hosts/common/system/core.nix @@ -1,10 +1,16 @@ {hostname, ...}: { networking.hostName = hostname; networking.networkmanager.enable = true; + services = { + xserver.xkb = { + layout = "us"; + variant = ""; + }; - services.xserver.xkb = { - layout = "us"; - variant = ""; + # automount + udisks2.enable = true; + + fwupd.enable = true; }; users.users.nezia = { @@ -16,11 +22,6 @@ ]; }; - # automount - services.udisks2.enable = true; - - services.fwupd.enable = true; - nixpkgs.config.allowUnfree = true; hardware.enableAllFirmware = true; diff --git a/hosts/common/system/locale.nix b/hosts/common/system/locale.nix index 2b98ae7..52022ba 100644 --- a/hosts/common/system/locale.nix +++ b/hosts/common/system/locale.nix @@ -1,4 +1,4 @@ -{...}: { +_: { # Set your time zone. time.timeZone = "Europe/Paris"; diff --git a/hosts/common/system/misc.nix b/hosts/common/system/misc.nix index 829ba8d..dc56967 100644 --- a/hosts/common/system/misc.nix +++ b/hosts/common/system/misc.nix @@ -1,4 +1,4 @@ -{...}: { +_: { # fix direnv integration with fish environment.pathsToLink = ["/share/fish"]; diff --git a/hosts/common/system/printing.nix b/hosts/common/system/printing.nix index f58819f..3fd0010 100644 --- a/hosts/common/system/printing.nix +++ b/hosts/common/system/printing.nix @@ -1,18 +1,24 @@ {pkgs, ...}: { - # setup printing service - services.printing.enable = true; + services = { + # setup printing service + printing.enable = true; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + printing.drivers = [ + pkgs.gutenprint + pkgs.hplip + ]; + udev.packages = [ + pkgs.sane-airscan + pkgs.utsushi + ]; }; - services.printing.drivers = [ - pkgs.gutenprint - pkgs.hplip - ]; - hardware.sane.enable = true; # enables support for SANE scanners hardware.sane.extraBackends = [ pkgs.sane-airscan # generic @@ -20,8 +26,4 @@ pkgs.epkowa # Epson pkgs.utsushi # other printers ]; - services.udev.packages = [ - pkgs.sane-airscan - pkgs.utsushi - ]; } diff --git a/hosts/solaire/hardware-configuration.nix b/hosts/solaire/hardware-configuration.nix index 9c2aa35..75647b8 100644 --- a/hosts/solaire/hardware-configuration.nix +++ b/hosts/solaire/hardware-configuration.nix @@ -4,25 +4,25 @@ { config, lib, - pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usb_storage" - "usbhid" - "sd_mod" - ]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; + boot = { + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + }; fileSystems."/" = { device = "/dev/disk/by-label/NIXROOT"; diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 72a9dda..96f74aa 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -3,17 +3,18 @@ ./hardware-configuration.nix inputs.nixos-hardware.nixosModules.framework-13-7040-amd ]; - - services.fprintd.enable = true; - services.power-profiles-daemon.enable = true; - services.keyd = { - enable = true; - keyboards = { - default = { - ids = ["*"]; - settings = { - main = { - capslock = "overload(control, esc)"; + services = { + fprintd.enable = true; + power-profiles-daemon.enable = true; + keyd = { + enable = true; + keyboards = { + default = { + ids = ["*"]; + settings = { + main = { + capslock = "overload(control, esc)"; + }; }; }; }; diff --git a/hosts/vamos/hardware-configuration.nix b/hosts/vamos/hardware-configuration.nix index 8d08381..75f255e 100644 --- a/hosts/vamos/hardware-configuration.nix +++ b/hosts/vamos/hardware-configuration.nix @@ -4,31 +4,33 @@ { config, lib, - pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "thunderbolt" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = [ - "amdgpu" - "dm-snapshot" - ]; - boot.kernelModules = [ - "kvm-amd" - "cryptd" - ]; - boot.initrd.luks.devices."crypt".device = "/dev/disk/by-uuid/39d0e0c6-ea32-4ee4-ac76-b28fbff687f8"; - boot.extraModulePackages = []; + boot = { + initrd = { + availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ + "amdgpu" + "dm-snapshot" + ]; + luks.devices."crypt".device = "/dev/disk/by-uuid/39d0e0c6-ea32-4ee4-ac76-b28fbff687f8"; + }; + kernelModules = [ + "kvm-amd" + "cryptd" + ]; + extraModulePackages = []; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/4ef04567-9633-45b9-addc-55c3020f45b7"; diff --git a/modules/gui/gnome.nix b/modules/gui/gnome.nix index 0548a43..f2c93c3 100644 --- a/modules/gui/gnome.nix +++ b/modules/gui/gnome.nix @@ -27,26 +27,24 @@ in { }; }; - environment.gnome.excludePackages = ( - with pkgs; [ - gnome-console - gnome-photos - gnome-tour - gnome-software - iagno - hitori - atomix - gnome-contacts - gnome-initial-setup - gnome-music - gedit - cheese - tali - epiphany - geary - yelp - ] - ); + environment.gnome.excludePackages = with pkgs; [ + gnome-console + gnome-photos + gnome-tour + gnome-software + iagno + hitori + atomix + gnome-contacts + gnome-initial-setup + gnome-music + gedit + cheese + tali + epiphany + geary + yelp + ]; environment.systemPackages = with pkgs; [ gnome-tweaks diff --git a/modules/gui/wezterm.nix b/modules/gui/wezterm.nix index a98d82e..85365a4 100644 --- a/modules/gui/wezterm.nix +++ b/modules/gui/wezterm.nix @@ -1,7 +1,6 @@ { config, lib, - inputs, username, ... }: let