From e6f2aa347e13fe497a8d2966b5c103e4e8a8d7bc Mon Sep 17 00:00:00 2001 From: caandt Date: Sun, 27 Oct 2024 12:34:49 -0500 Subject: [PATCH] formatting --- flake.nix | 46 +++++++++++------- hosts/hyuganatsu/default.nix | 6 +-- hosts/hyuganatsu/hardware-configuration.nix | 40 ++++++++------- hosts/hyuganatsu/users/ahnwuoa/default.nix | 4 +- hosts/iyokan/default.nix | 6 +-- hosts/iyokan/hardware-configuration.nix | 54 +++++++++++---------- system/audio.nix | 4 +- system/bash.nix | 4 +- system/boot.nix | 4 +- system/configuration.nix | 15 +++--- system/default.nix | 4 +- system/display.nix | 4 +- system/locale.nix | 6 +-- system/plasma.nix | 4 +- system/security.nix | 9 ++-- system/users.nix | 6 +-- system/virt.nix | 4 +- user/bin/default.nix | 22 +++++---- user/default.nix | 4 +- user/home.nix | 13 +++-- user/share/default.nix | 4 +- user/share/nsxiv-rifle.nix | 4 +- user/theme.nix | 8 +-- user/xdg.nix | 22 +++++---- 24 files changed, 152 insertions(+), 145 deletions(-) diff --git a/flake.nix b/flake.nix index b41d711..f9a7b79 100644 --- a/flake.nix +++ b/flake.nix @@ -14,12 +14,19 @@ }; }; - outputs = { nixpkgs, nixpkgs-stable, home-manager, flake-programs-sqlite, ... }@inputs: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - pkgs-stable = nixpkgs-stable.legacyPackages.${system}; - in with builtins; with nixpkgs.lib.attrsets; { + outputs = { + nixpkgs, + nixpkgs-stable, + home-manager, + flake-programs-sqlite, + ... + } @ inputs: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-stable = nixpkgs-stable.legacyPackages.${system}; + in + with builtins; + with nixpkgs.lib.attrsets; { nixosConfigurations = mapAttrs' (host: _: { name = host; value = nixpkgs.lib.nixosSystem { @@ -28,20 +35,25 @@ inherit pkgs-stable; inherit flake-programs-sqlite; }; - modules = [ (./hosts + "/${host}") ]; + modules = [(./hosts + "/${host}")]; }; }) (readDir ./hosts); - homeConfigurations = foldl' (a: b: a//b) {} (map (host: let users = ./hosts + "/${host}/users"; in - if pathExists users - then mapAttrs' (user: _: { - name = "${user}@${host}"; - value = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { - inherit pkgs-stable; + homeConfigurations = foldl' (a: b: a // b) {} (map ( + host: let + users = ./hosts + "/${host}/users"; + in + if pathExists users + then + mapAttrs' (user: _: { + name = "${user}@${host}"; + value = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit pkgs-stable; + }; + modules = [(users + "/${user}")]; }; - modules = [ (users + "/${user}") ]; - };}) (readDir users) + }) (readDir users) else {} ) (attrNames (readDir ./hosts))); }; diff --git a/hosts/hyuganatsu/default.nix b/hosts/hyuganatsu/default.nix index c7d10e9..884d866 100644 --- a/hosts/hyuganatsu/default.nix +++ b/hosts/hyuganatsu/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ../../system ./hardware-configuration.nix @@ -9,7 +7,7 @@ networking.hostName = "hyuganatsu"; time.timeZone = "America/Chicago"; services.xserver = { - videoDrivers = [ "amdgpu" ]; + videoDrivers = ["amdgpu"]; deviceSection = ''Option "TearFree" "true"''; }; } diff --git a/hosts/hyuganatsu/hardware-configuration.nix b/hosts/hyuganatsu/hardware-configuration.nix index 173e9b5..2f6c4e9 100644 --- a/hosts/hyuganatsu/hardware-configuration.nix +++ b/hosts/hyuganatsu/hardware-configuration.nix @@ -1,29 +1,33 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/37229430-3b89-413e-9f9d-f36b3d2935bf"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/37229430-3b89-413e-9f9d-f36b3d2935bf"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1FF4-8F2A"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1FF4-8F2A"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/hyuganatsu/users/ahnwuoa/default.nix b/hosts/hyuganatsu/users/ahnwuoa/default.nix index af3b5a6..edd3c2a 100644 --- a/hosts/hyuganatsu/users/ahnwuoa/default.nix +++ b/hosts/hyuganatsu/users/ahnwuoa/default.nix @@ -1,6 +1,4 @@ -{ config, ... }: - -{ +{config, ...}: { imports = [ ../../../../user ]; diff --git a/hosts/iyokan/default.nix b/hosts/iyokan/default.nix index 2b29763..2a67390 100644 --- a/hosts/iyokan/default.nix +++ b/hosts/iyokan/default.nix @@ -1,6 +1,4 @@ -{ lib, ... }: - -{ +{lib, ...}: { imports = [ ../common ./hardware-configuration.nix @@ -9,7 +7,7 @@ networking.hostName = "iyokan"; time.timeZone = "America/Chicago"; services.xserver = { - videoDrivers = [ "nvidia" ]; + videoDrivers = ["nvidia"]; deviceSection = ''Option "TearFree" "true"''; }; hardware.nvidia.open = false; diff --git a/hosts/iyokan/hardware-configuration.nix b/hosts/iyokan/hardware-configuration.nix index 67f502d..d461cd3 100644 --- a/hosts/iyokan/hardware-configuration.nix +++ b/hosts/iyokan/hardware-configuration.nix @@ -1,37 +1,41 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/6c86675c-7428-4a34-98e2-7fa2b423b53e"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6c86675c-7428-4a34-98e2-7fa2b423b53e"; + fsType = "ext4"; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/d376771f-3dd5-4d8a-94d3-dcb75aae146d"; - fsType = "ext4"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/d376771f-3dd5-4d8a-94d3-dcb75aae146d"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4F3D-4702"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4F3D-4702"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/8049404d-f5fb-4387-bb75-f308a7f7126f"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/8049404d-f5fb-4387-bb75-f308a7f7126f";} + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/system/audio.nix b/system/audio.nix index 64c32ca..84ce705 100644 --- a/system/audio.nix +++ b/system/audio.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.pipewire = { enable = true; alsa.enable = true; diff --git a/system/bash.nix b/system/bash.nix index a0c28cb..b773238 100644 --- a/system/bash.nix +++ b/system/bash.nix @@ -1,6 +1,4 @@ -{ lib, ... }: - -{ +{lib, ...}: { programs.bash = { completion.enable = true; promptInit = ''PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "''; diff --git a/system/boot.nix b/system/boot.nix index 90fc5ba..8d52b99 100644 --- a/system/boot.nix +++ b/system/boot.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { boot.loader = { grub.enable = true; grub.device = "nodev"; diff --git a/system/configuration.nix b/system/configuration.nix index 89c9ace..6ef4320 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -1,12 +1,16 @@ -{ config, pkgs, lib, flake-programs-sqlite, ... }: - { + config, + pkgs, + lib, + flake-programs-sqlite, + ... +}: { nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = ["nix-command" "flakes"]; use-xdg-base-directories = true; }; - environment.pathsToLink = [ "/libexec" ]; + environment.pathsToLink = ["/libexec"]; environment.localBinInPath = true; boot.tmp.useTmpfs = true; @@ -29,11 +33,10 @@ xdg.terminal-exec = { enable = true; - settings.default = [ "Alacritty.desktop" ]; + settings.default = ["Alacritty.desktop"]; }; programs.command-not-found.dbPath = flake-programs-sqlite.packages.${pkgs.system}.programs-sqlite; system.stateVersion = "24.05"; } - diff --git a/system/default.nix b/system/default.nix index 57c359f..d20e269 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./audio.nix ./bash.nix diff --git a/system/display.nix b/system/display.nix index 4c18d04..8ce9a1b 100644 --- a/system/display.nix +++ b/system/display.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.xserver = { enable = true; autorun = false; diff --git a/system/locale.nix b/system/locale.nix index 256b93a..64708b8 100644 --- a/system/locale.nix +++ b/system/locale.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { i18n.defaultLocale = "en_US.UTF-8"; i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" @@ -19,6 +17,6 @@ noto-fonts-cjk-sans source-han-sans source-han-serif - (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + (nerdfonts.override {fonts = ["JetBrainsMono"];}) ]; } diff --git a/system/plasma.nix b/system/plasma.nix index 8b16d2d..78344e4 100644 --- a/system/plasma.nix +++ b/system/plasma.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.partition-manager = { enable = true; package = pkgs.libsForQt5.partitionmanager; diff --git a/system/security.nix b/system/security.nix index 510262a..69d82d6 100644 --- a/system/security.nix +++ b/system/security.nix @@ -1,10 +1,11 @@ -{ ... }: - -{ +{...}: { security.doas = { enable = true; extraRules = [ - { groups = [ "wheel" ]; persist = true; } + { + groups = ["wheel"]; + persist = true; + } ]; }; security.polkit.enable = true; diff --git a/system/users.nix b/system/users.nix index de9fb17..8bc7ca5 100644 --- a/system/users.nix +++ b/system/users.nix @@ -1,8 +1,6 @@ -{ ... }: - -{ +{...}: { users.users.ahnwuoa = { isNormalUser = true; - extraGroups = [ "wheel" "podman" ]; + extraGroups = ["wheel" "podman"]; }; } diff --git a/system/virt.nix b/system/virt.nix index 28caa71..146ae0e 100644 --- a/system/virt.nix +++ b/system/virt.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { virtualisation.containers.enable = true; virtualisation = { podman = { diff --git a/user/bin/default.nix b/user/bin/default.nix index 6c27d6c..c6b861f 100644 --- a/user/bin/default.nix +++ b/user/bin/default.nix @@ -1,19 +1,23 @@ -{ config, pkgs, ... }: - -let +{ + config, + pkgs, + ... +}: let deps = { - bell = [ pkgs.pipewire pkgs.libnotify ]; - nsxiv-rifle = [ pkgs.nsxiv ]; - screenshot = [ pkgs.maim pkgs.xclip ]; + bell = [pkgs.pipewire pkgs.libnotify]; + nsxiv-rifle = [pkgs.nsxiv]; + screenshot = [pkgs.maim pkgs.xclip]; }; mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/bin/${x}"; in { - home.file = builtins.listToAttrs (map + home.file = builtins.listToAttrs ( + map (x: { name = ".local/bin/${x}"; - value = { source = mkln x; }; + value = {source = mkln x;}; }) - (builtins.filter + ( + builtins.filter (x: x != "default.nix") (builtins.attrNames (builtins.readDir ./.)) ) diff --git a/user/default.nix b/user/default.nix index be98305..06696d3 100644 --- a/user/default.nix +++ b/user/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./bin ./home.nix diff --git a/user/home.nix b/user/home.nix index 364d9d8..065059a 100644 --- a/user/home.nix +++ b/user/home.nix @@ -1,11 +1,14 @@ -{ config, pkgs, pkgs-stable, ... }: - { + config, + pkgs, + pkgs-stable, + ... +}: { home.packages = with pkgs; [ (pkgs.symlinkJoin { name = "firefox"; - paths = [ pkgs-stable.firefox ]; - buildInputs = [ pkgs.makeWrapper ]; + paths = [pkgs-stable.firefox]; + buildInputs = [pkgs.makeWrapper]; postBuild = '' wrapProgram $out/bin/firefox \ --set HOME "${config.home.homeDirectory}/.local/share" @@ -72,7 +75,7 @@ gdb pwndbg - (pkgs-stable.cutter.withPlugins (ps: with ps; [ jsdec rz-ghidra sigdb ])) + (pkgs-stable.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) ghidra-bin pwninit patchelf diff --git a/user/share/default.nix b/user/share/default.nix index ddeb83c..8d20ef7 100644 --- a/user/share/default.nix +++ b/user/share/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./nsxiv-rifle.nix ]; diff --git a/user/share/nsxiv-rifle.nix b/user/share/nsxiv-rifle.nix index 66d94b2..7e69e54 100644 --- a/user/share/nsxiv-rifle.nix +++ b/user/share/nsxiv-rifle.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { xdg.desktopEntries."nsxiv-rifle" = { exec = "nsxiv-rifle %F"; icon = "nsxiv"; diff --git a/user/theme.nix b/user/theme.nix index 1ca18f2..e3096d0 100644 --- a/user/theme.nix +++ b/user/theme.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { qt = { enable = true; platformTheme.name = "qtct"; @@ -10,7 +12,7 @@ gtk = { enable = true; gtk2.extraConfig = "gtk-recent-files-max-age = 0"; - gtk3.extraConfig = { gtk-recent-files-limit = 0; }; + gtk3.extraConfig = {gtk-recent-files-limit = 0;}; theme = { name = "Breeze"; package = pkgs.libsForQt5.breeze-gtk; diff --git a/user/xdg.nix b/user/xdg.nix index 51b10d7..8a51b34 100644 --- a/user/xdg.nix +++ b/user/xdg.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - -let +{ + config, + pkgs, + ... +}: let mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/${x}"; in { xdg.configFile.alacritty.source = mkln "config/alacritty"; @@ -22,10 +24,12 @@ in { xdg.configFile.readline.source = config/readline; xdg.configFile."starship.toml".source = config/starship.toml; xdg.configFile.sx.source = mkln "config/sx"; - xdg.configFile."tmux/tmux.conf".text = (builtins.readFile config/tmux/tmux.conf) + '' - run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp} - run ${pkgs.tmuxPlugins.sessionist.rtp} - ''; + xdg.configFile."tmux/tmux.conf".text = + (builtins.readFile config/tmux/tmux.conf) + + '' + run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp} + run ${pkgs.tmuxPlugins.sessionist.rtp} + ''; fonts.fontconfig.enable = false; gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; xdg.mimeApps.enable = true; @@ -52,8 +56,8 @@ in { }; xdg.portal = { enable = true; - configPackages = [ pkgs.libsForQt5.xdg-desktop-portal-kde ]; - extraPortals = [ pkgs.libsForQt5.xdg-desktop-portal-kde ]; + configPackages = [pkgs.libsForQt5.xdg-desktop-portal-kde]; + extraPortals = [pkgs.libsForQt5.xdg-desktop-portal-kde]; config.common.default = "kde"; }; }