From 9ff2bd4e96a2e6fe2997bb60a7e099380b05f5a7 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 25 Mar 2023 22:10:09 +0530 Subject: [PATCH] format stuff --- home/default.nix | 17 ++- home/dev.nix | 11 +- home/downloader.nix | 2 +- home/firefox.nix | 163 +++++++++++++-------- home/kitty.nix | 8 +- home/media.nix | 15 +- home/nvim.nix | 6 +- home/persistence.nix | 2 +- home/scripts.nix | 156 ++++++++++---------- home/sway/default.nix | 36 +++-- home/sway/dunst.nix | 10 +- home/sway/gnome-keyring.nix | 4 +- home/sway/gtk.nix | 15 +- home/sway/kanshi.nix | 4 +- home/sway/rofi/default.nix | 4 +- home/sway/swayidle.nix | 14 +- home/sway/wallpapers.nix | 4 +- home/sway/waybar/default.nix | 38 ++--- home/terminal.nix | 9 +- home/tmux.nix | 4 +- home/virt-manager.nix | 12 +- packages/adi1090x-plymouth/default.nix | 9 +- packages/catppuccin-wallpapers/default.nix | 7 +- packages/default.nix | 8 +- packages/dracula-gtk/default.nix | 14 +- packages/newaita-icon-theme/default.nix | 15 +- system/default.nix | 16 +- system/disk.nix | 4 +- system/filesystem.nix | 10 +- system/gnome-keyring.nix | 3 +- system/gtk.nix | 3 +- system/hardware.nix | 14 +- system/kernel.nix | 11 +- system/nix.nix | 4 +- system/packages.nix | 7 +- system/persistence.nix | 3 +- system/plymouth.nix | 12 +- system/secureboot.nix | 5 +- system/services.nix | 6 +- system/swaylock.nix | 6 +- system/virtualisation.nix | 4 +- users/default.nix | 9 +- 42 files changed, 387 insertions(+), 317 deletions(-) diff --git a/home/default.nix b/home/default.nix index 336e877..eb2ead7 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,20 +1,21 @@ -{ impermanence, pkgs, ... }: -let - user = import ../users/user.nix; -in { + impermanence, + pkgs, + ... +}: let + user = import ../users/user.nix; +in { programs.fuse.userAllowOther = true; fileSystems."/home/${user.primary.userName}" = { device = "tmpfs"; fsType = "tmpfs"; - options = [ "mode=0755" "uid=1000" "gid=100" ]; + options = ["mode=0755" "uid=1000" "gid=100"]; }; home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true; - home-manager.users.${user.primary.userName} = { pkgs, ... }: { - + home-manager.users.${user.primary.userName} = {pkgs, ...}: { imports = [ impermanence.nixosModules.home-manager.impermanence @@ -36,7 +37,7 @@ in home.packages = with pkgs; [ _1password-gui brightnessctl - (discord.override { withOpenASAR = true; }) + discord evince gnome.eog gnome.gnome-system-monitor diff --git a/home/dev.nix b/home/dev.nix index 87525e7..dd44652 100644 --- a/home/dev.nix +++ b/home/dev.nix @@ -1,8 +1,6 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let user = import ../users/user.nix; -in -{ +in { imports = [ ./nvim.nix ]; @@ -10,14 +8,13 @@ in home.packages = with pkgs; [ git-crypt lazydocker - nixpkgs-fmt ripgrep ]; programs = { gh = { enable = true; settings.git_protocol = "ssh"; - extensions = [ pkgs.gh-dash ]; + extensions = [pkgs.gh-dash]; }; git = { enable = true; @@ -34,7 +31,7 @@ in init.defaultBranch = "main"; push.autoSetupRemote = true; }; - ignores = [ "/.nix" "/.direnv" ]; + ignores = ["/.nix" "/.direnv"]; }; lazygit = { enable = true; diff --git a/home/downloader.nix b/home/downloader.nix index f1eb38d..e75dccd 100644 --- a/home/downloader.nix +++ b/home/downloader.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs = { aria2 = { enable = true; diff --git a/home/firefox.nix b/home/firefox.nix index 4a41d37..254b9fc 100644 --- a/home/firefox.nix +++ b/home/firefox.nix @@ -1,75 +1,110 @@ -{ pkgs, osConfig, ... }: { + pkgs, + osConfig, + ... +}: { programs = { firefox = { enable = true; - package = - (pkgs.firefox.override { - extraPolicies = { - DontCheckDefaultBrowser = true; - DisablePocket = true; - DisableTelemetry = true; - DisplayBookmarksToolbar = "always"; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; + package = pkgs.firefox.override { + extraPolicies = { + DontCheckDefaultBrowser = true; + DisablePocket = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "always"; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + }; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = true; + }; + UserMessaging = { + WhatsNew = false; + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + SkipOnboarding = true; + MoreFromMozilla = false; + }; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + SearchSuggestEnabled = false; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + ExtensionSettings = { + "{b743f56d-1cc1-4048-8ba6-f9c2ab7aa54d}" = { + "allowed_types" = "theme"; + "installation_mode" = "force_installed"; + "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/dracula-dark-colorscheme/latest.xpi"; }; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = true; + "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + "allowed_types" = "extension"; + "installation_mode" = "force_installed"; + "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; }; - UserMessaging = { - WhatsNew = false; - ExtensionRecommendations = false; - FeatureRecommendations = false; - UrlbarInterventions = false; - SkipOnboarding = true; - MoreFromMozilla = false; - }; - NoDefaultBookmarks = true; - OfferToSaveLogins = false; - SearchSuggestEnabled = false; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - ExtensionSettings = { - "{b743f56d-1cc1-4048-8ba6-f9c2ab7aa54d}" = { - "allowed_types" = "theme"; - "installation_mode" = "force_installed"; - "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/dracula-dark-colorscheme/latest.xpi"; - }; - "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { - "allowed_types" = "extension"; - "installation_mode" = "force_installed"; - "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; - }; - "queryamoid@kaply.com" = { - "allowed_types" = "extension"; - "installation_mode" = "force_installed"; - "install_url" = "https://github.com/mkaply/queryamoid/releases/download/v0.2/query_amo_addon_id-0.2-fx.xpi"; - }; - }; - Preferences = { - "browser.crashReports.unsubmittedCheck.autoSubmit2" = { Value = false; Status = "locked"; }; - "browser.selfsupport.url" = { Value = ""; Status = "locked"; }; - "browser.aboutConfig.showWarning" = { Value = false; Status = "locked"; }; - "browser.aboutHomeSnippets.updateUrl" = { Value = ""; Status = "locked"; }; - "browser.startup.homepage_override.mstone" = { Value = "ignore"; Status = "locked"; }; - "browser.startup.homepage_override.buildID" = { Value = ""; Status = "locked"; }; - "browser.tabs.firefox-view" = { Value = false; Status = "locked"; }; - "dom.security.https_only_mode" = { Value = true; Status = "locked"; }; - "extensions.htmlaboutaddons.recommendations.enabled" = { Value = false; Status = "locked"; }; - "extensions.recommendations.themeRecommendationUrl" = { Value = ""; Status = "locked"; }; - "network.IDN_show_punycode" = { Value = true; Status = "locked"; }; + "queryamoid@kaply.com" = { + "allowed_types" = "extension"; + "installation_mode" = "force_installed"; + "install_url" = "https://github.com/mkaply/queryamoid/releases/download/v0.2/query_amo_addon_id-0.2-fx.xpi"; }; }; - }); + Preferences = { + "browser.crashReports.unsubmittedCheck.autoSubmit2" = { + Value = false; + Status = "locked"; + }; + "browser.selfsupport.url" = { + Value = ""; + Status = "locked"; + }; + "browser.aboutConfig.showWarning" = { + Value = false; + Status = "locked"; + }; + "browser.aboutHomeSnippets.updateUrl" = { + Value = ""; + Status = "locked"; + }; + "browser.startup.homepage_override.mstone" = { + Value = "ignore"; + Status = "locked"; + }; + "browser.startup.homepage_override.buildID" = { + Value = ""; + Status = "locked"; + }; + "browser.tabs.firefox-view" = { + Value = false; + Status = "locked"; + }; + "dom.security.https_only_mode" = { + Value = true; + Status = "locked"; + }; + "extensions.htmlaboutaddons.recommendations.enabled" = { + Value = false; + Status = "locked"; + }; + "extensions.recommendations.themeRecommendationUrl" = { + Value = ""; + Status = "locked"; + }; + "network.IDN_show_punycode" = { + Value = true; + Status = "locked"; + }; + }; + }; + }; profiles.default = { id = 0; name = "Default"; diff --git a/home/kitty.nix b/home/kitty.nix index 68ad834..515b563 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -1,16 +1,14 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let dracula = pkgs.fetchFromGitHub { owner = "dracula"; repo = "kitty"; rev = "87717a3f00e3dff0fc10c93f5ff535ea4092de70"; hash = "sha256-78PTH9wE6ktuxeIxrPp0ZgRI8ST+eZ3Ok2vW6BCIZkc="; }; -in -{ +in { programs.kitty = { enable = true; - font.package = (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }); + font.package = pkgs.nerdfonts.override {fonts = ["FiraCode"];}; font.name = "FiraCode Nerd Font"; extraConfig = '' font_size 14 diff --git a/home/media.nix b/home/media.nix index 89d39da..7838888 100644 --- a/home/media.nix +++ b/home/media.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { xdg.desktopEntries."mpv".name = "mpv Media Player"; xdg.desktopEntries."mpv".exec = "mpv --player-operation-mode=pseudo-gui -- %U"; xdg.desktopEntries."mpv".noDisplay = true; @@ -16,18 +14,21 @@ ]; programs.mpv = { enable = true; - package = pkgs.mpv.override { youtubeSupport = true; }; + package = pkgs.mpv.override {youtubeSupport = true;}; config = { hwdec = "auto-safe"; gpu-context = "wayland"; }; - defaultProfiles = [ "gpu-hq" ]; - scripts = with pkgs.mpvScripts; [ mpris ]; + defaultProfiles = ["gpu-hq"]; + scripts = with pkgs.mpvScripts; [mpris]; }; services = { spotifyd = { enable = true; - package = (pkgs.spotifyd.override { withKeyring = true; withMpris = true; }); + package = pkgs.spotifyd.override { + withKeyring = true; + withMpris = true; + }; settings = { global = { use_keyring = true; diff --git a/home/nvim.nix b/home/nvim.nix index 616bceb..447dc7b 100644 --- a/home/nvim.nix +++ b/home/nvim.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { xdg.desktopEntries."nvim".name = "Neovim wrapper"; xdg.desktopEntries."nvim".exec = "nvim %F"; xdg.desktopEntries."nvim".noDisplay = true; @@ -25,7 +23,7 @@ ]; plugins = with pkgs.vimPlugins; [ dracula-nvim - (nvim-treesitter.withPlugins (plugins: with plugins; [ bash dockerfile gitcommit gitignore git_rebase go markdown markdown_inline nix rust toml yaml ])) + (nvim-treesitter.withPlugins (plugins: with plugins; [bash dockerfile gitcommit gitignore git_rebase go markdown markdown_inline nix rust toml yaml])) nvim-treesitter-context nvim-treesitter-refactor telescope-nvim diff --git a/home/persistence.nix b/home/persistence.nix index 8142898..1d9e1c7 100644 --- a/home/persistence.nix +++ b/home/persistence.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { home.persistence."/persist/home" = { allowOther = true; directories = [ diff --git a/home/scripts.nix b/home/scripts.nix index b92fefd..0f6f67a 100644 --- a/home/scripts.nix +++ b/home/scripts.nix @@ -1,9 +1,11 @@ -{ osConfig, pkgs, ... }: -let +{ + osConfig, + pkgs, + ... +}: let notify-send = "${pkgs.libnotify}/bin/notify-send"; dmenu = "${pkgs.rofi-wayland}/bin/rofi -dmenu"; -in -{ +in { xdg.configFile = { "scripts/power_menu.sh" = { executable = true; @@ -40,88 +42,82 @@ in ''; }; - "scripts/volume_up.sh" = - let - wpctl = "${pkgs.wireplumber}/bin/wpctl"; - in - { - executable = true; - text = '' - #!/bin/sh + "scripts/volume_up.sh" = let + wpctl = "${pkgs.wireplumber}/bin/wpctl"; + in { + executable = true; + text = '' + #!/bin/sh - set -eu + set -eu - ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ 0 - [ $(${wpctl} get-volume @DEFAULT_AUDIO_SINK@ | awk -F': ' '{print $2}' | sed 's/\.//') -lt 100 ] && ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ - ''; - }; + ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ 0 + [ $(${wpctl} get-volume @DEFAULT_AUDIO_SINK@ | awk -F': ' '{print $2}' | sed 's/\.//') -lt 100 ] && ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ + ''; + }; - "scripts/tmux_sessions.sh" = - let - kitty = "${pkgs.kitty}/bin/kitty"; - tmux = "${pkgs.tmux}/bin/tmux"; - in - { - executable = true; - text = '' - #!/bin/sh + "scripts/tmux_sessions.sh" = let + kitty = "${pkgs.kitty}/bin/kitty"; + tmux = "${pkgs.tmux}/bin/tmux"; + in { + executable = true; + text = '' + #!/bin/sh - set -eu + set -eu - SESSION="$(${tmux} list-sessions -F "(#{session_attached}) #S [#{pane_current_command} in #{pane_current_path}] #{pane_title}" | sort | ${dmenu} -p "Running TMUX Sessions" | awk '{print $2}')" - case "$SESSION" in - "") - ;; - *) - ${kitty} ${tmux} -u attach-session -dEt "$SESSION" - ;; - esac''; - }; - "scripts/power_profile.sh" = - let - sudo = "/run/wrappers/bin/sudo"; - cpupower = "${osConfig.boot.kernelPackages.cpupower}/bin/cpupower"; - powerprofilesctl = "${pkgs.power-profiles-daemon}/bin/powerprofilesctl"; - in - { - executable = true; - text = '' - #!/bin/sh - - set -eu - - POWER_PROFILE_FILE="$HOME/.cache/power_profile" - POWER_PROFILE="powersave" - - if [ -f "$POWER_PROFILE_FILE" ]; then - POWER_PROFILE="$(<$POWER_PROFILE_FILE)" - fi - - case "$1" in - "toggle") - if [ "$POWER_PROFILE" == "powersave" ]; then - ${sudo} ${cpupower} frequency-set --governor performance > /dev/null - ${powerprofilesctl} set performance - POWER_PROFILE="performance" - elif [ "$POWER_PROFILE" == "performance" ]; then - ${sudo} ${cpupower} frequency-set --governor powersave > /dev/null - ${powerprofilesctl} set power-saver - POWER_PROFILE="powersave" - fi - echo $POWER_PROFILE > $POWER_PROFILE_FILE - ${notify-send} -u normal "Power Profile" "Switched to $POWER_PROFILE mode." + SESSION="$(${tmux} list-sessions -F "(#{session_attached}) #S [#{pane_current_command} in #{pane_current_path}] #{pane_title}" | sort | ${dmenu} -p "Running TMUX Sessions" | awk '{print $2}')" + case "$SESSION" in + "") ;; - "icon") - if [ "$POWER_PROFILE" == "powersave" ]; then - echo "󰌪" - elif [ "$POWER_PROFILE" == "performance" ]; then - echo "󰓅" - fi + *) + ${kitty} ${tmux} -u attach-session -dEt "$SESSION" ;; - *) - ;; - esac - ''; - }; + esac''; + }; + "scripts/power_profile.sh" = let + sudo = "/run/wrappers/bin/sudo"; + cpupower = "${osConfig.boot.kernelPackages.cpupower}/bin/cpupower"; + powerprofilesctl = "${pkgs.power-profiles-daemon}/bin/powerprofilesctl"; + in { + executable = true; + text = '' + #!/bin/sh + + set -eu + + POWER_PROFILE_FILE="$HOME/.cache/power_profile" + POWER_PROFILE="powersave" + + if [ -f "$POWER_PROFILE_FILE" ]; then + POWER_PROFILE="$(<$POWER_PROFILE_FILE)" + fi + + case "$1" in + "toggle") + if [ "$POWER_PROFILE" == "powersave" ]; then + ${sudo} ${cpupower} frequency-set --governor performance > /dev/null + ${powerprofilesctl} set performance + POWER_PROFILE="performance" + elif [ "$POWER_PROFILE" == "performance" ]; then + ${sudo} ${cpupower} frequency-set --governor powersave > /dev/null + ${powerprofilesctl} set power-saver + POWER_PROFILE="powersave" + fi + echo $POWER_PROFILE > $POWER_PROFILE_FILE + ${notify-send} -u normal "Power Profile" "Switched to $POWER_PROFILE mode." + ;; + "icon") + if [ "$POWER_PROFILE" == "powersave" ]; then + echo "󰌪" + elif [ "$POWER_PROFILE" == "performance" ]; then + echo "󰓅" + fi + ;; + *) + ;; + esac + ''; + }; }; } diff --git a/home/sway/default.nix b/home/sway/default.nix index f3d737f..18402fb 100644 --- a/home/sway/default.nix +++ b/home/sway/default.nix @@ -1,6 +1,9 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + pkgs, + ... +}: { imports = [ ./gnome-keyring.nix ./gtk.nix @@ -19,10 +22,10 @@ wayland.windowManager.sway.enable = true; wayland.windowManager.sway.package = pkgs.sway; wayland.windowManager.sway.config.modifier = "Mod4"; - wayland.windowManager.sway.config.bars = [ ]; + wayland.windowManager.sway.config.bars = []; wayland.windowManager.sway.xwayland = true; wayland.windowManager.sway.config.fonts = { - names = [ "FiraCode Nerd Font" ]; + names = ["FiraCode Nerd Font"]; size = 11.0; }; wayland.windowManager.sway.config.input = { @@ -82,10 +85,9 @@ }; }; - wayland.windowManager.sway.config.keybindings = - let - modifier = config.wayland.windowManager.sway.config.modifier; - in + wayland.windowManager.sway.config.keybindings = let + modifier = config.wayland.windowManager.sway.config.modifier; + in lib.mkOptionDefault { "${modifier}+Return" = "exec ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux new"; "${modifier}+Shift+Return" = "exec ${pkgs.kitty}/bin/kitty"; @@ -112,10 +114,19 @@ }; wayland.windowManager.sway.config.startup = [ - { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } - { command = "~/.config/scripts/chpaper.sh"; always = true; } - { command = "systemctl --user restart waybar.service"; always = true; } - { command = "systemctl --user restart kanshi.service"; always = true; } + {command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";} + { + command = "~/.config/scripts/chpaper.sh"; + always = true; + } + { + command = "systemctl --user restart waybar.service"; + always = true; + } + { + command = "systemctl --user restart kanshi.service"; + always = true; + } ]; wayland.windowManager.sway.config.window.commands = [ @@ -216,4 +227,3 @@ wayland.windowManager.sway.config.window.titlebar = false; wayland.windowManager.sway.config.floating.titlebar = false; } - diff --git a/home/sway/dunst.nix b/home/sway/dunst.nix index 8f97b47..399fb45 100644 --- a/home/sway/dunst.nix +++ b/home/sway/dunst.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: -let +{ + config, + pkgs, + ... +}: let dmenu = "${config.programs.rofi.package}/bin/rofi -dmenu"; firefox = "${config.programs.firefox.package}/bin/firefox"; -in -{ +in { services.dunst = { enable = true; iconTheme.name = config.gtk.iconTheme.name; diff --git a/home/sway/gnome-keyring.nix b/home/sway/gnome-keyring.nix index c3bcc63..b0d3e1b 100644 --- a/home/sway/gnome-keyring.nix +++ b/home/sway/gnome-keyring.nix @@ -1,5 +1,3 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services.gnome-keyring.enable = true; } diff --git a/home/sway/gtk.nix b/home/sway/gtk.nix index 162da6a..700d595 100644 --- a/home/sway/gtk.nix +++ b/home/sway/gtk.nix @@ -1,5 +1,8 @@ -{ lib, pkgs, ... }: -let +{ + lib, + pkgs, + ... +}: let gtkTheme = { name = "Dracula"; package = pkgs.dracula-gtk; @@ -7,15 +10,17 @@ let iconTheme = { name = "Newaita-dark"; - package = pkgs.newaita-icon-theme.override { panel = "dark"; folder = "bluegray"; }; + package = pkgs.newaita-icon-theme.override { + panel = "dark"; + folder = "bluegray"; + }; }; cursorTheme = { name = "Bibata-Modern-Classic"; package = pkgs.bibata-cursors; }; -in -{ +in { gtk.enable = true; gtk.theme = gtkTheme; home.sessionVariables.GTK_THEME = gtkTheme.name; diff --git a/home/sway/kanshi.nix b/home/sway/kanshi.nix index c9a4c48..ea6336f 100644 --- a/home/sway/kanshi.nix +++ b/home/sway/kanshi.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.kanshi.enable = true; services.kanshi.profiles = { undocked = { diff --git a/home/sway/rofi/default.nix b/home/sway/rofi/default.nix index d66ad8d..4620d0d 100644 --- a/home/sway/rofi/default.nix +++ b/home/sway/rofi/default.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { xdg.desktopEntries."rofi".name = "Rofi"; xdg.desktopEntries."rofi".exec = "rofi -show"; xdg.desktopEntries."rofi".noDisplay = true; diff --git a/home/sway/swayidle.nix b/home/sway/swayidle.nix index 111dd37..3dbafe3 100644 --- a/home/sway/swayidle.nix +++ b/home/sway/swayidle.nix @@ -1,11 +1,15 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services.swayidle.enable = true; services.swayidle.events = [ - { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } + { + event = "before-sleep"; + command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; + } ]; services.swayidle.timeouts = [ - { timeout = 600; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } + { + timeout = 600; + command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; + } ]; } diff --git a/home/sway/wallpapers.nix b/home/sway/wallpapers.nix index 4155c5d..8215859 100644 --- a/home/sway/wallpapers.nix +++ b/home/sway/wallpapers.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { xdg.dataFile."wallpapers/catppuccin".source = "${pkgs.catppuccin-wallpapers}/share/wallpapers"; xdg.configFile."scripts/chpaper.sh" = { text = '' diff --git a/home/sway/waybar/default.nix b/home/sway/waybar/default.nix index b4c4dc7..3c90f60 100644 --- a/home/sway/waybar/default.nix +++ b/home/sway/waybar/default.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.waybar.enable = true; programs.waybar.systemd.enable = true; programs.waybar.style = ./style.css; @@ -10,9 +12,9 @@ layer = "top"; position = "top"; height = 28; - modules-left = [ "sway/workspaces" "sway/window" "sway/mode" ]; - modules-center = [ ]; - modules-right = [ "tray" "custom/power_profile" "idle_inhibitor" "network" "bluetooth" "pulseaudio" "backlight" "battery" "clock" ]; + modules-left = ["sway/workspaces" "sway/window" "sway/mode"]; + modules-center = []; + modules-right = ["tray" "custom/power_profile" "idle_inhibitor" "network" "bluetooth" "pulseaudio" "backlight" "battery" "clock"]; "sway/mode" = { "format" = "{}"; }; @@ -35,7 +37,7 @@ }; "backlight" = { "format" = "{icon}"; - "format-icons" = [ "" "" "" "" ]; + "format-icons" = ["" "" "" ""]; }; "battery" = { "states" = { @@ -47,7 +49,7 @@ "format-alt" = "{icon} {capacity}% ({time})"; "format-charging" = " {capacity}%"; "format-plugged" = "‭ﮣ {capacity}%"; - "format-icons" = [ "" "" "" "" "" "" "" "" "" "" "" ]; + "format-icons" = ["" "" "" "" "" "" "" "" "" "" ""]; "tooltip" = false; }; "network" = { @@ -73,7 +75,7 @@ "phone" = ""; "portable" = ""; "car" = ""; - "default" = [ "奄" "奔" "墳" ]; + "default" = ["奄" "奔" "墳"]; }; "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; }; @@ -88,17 +90,15 @@ "tray" = { "spacing" = 4; }; - "custom/power_profile" = - let - script = "${config.xdg.configHome}/scripts/power_profile.sh"; - in - { - exec = "${script} icon"; - on-click = "${script} toggle"; - format = "{}"; - tooltip = false; - interval = "10"; - }; + "custom/power_profile" = let + script = "${config.xdg.configHome}/scripts/power_profile.sh"; + in { + exec = "${script} icon"; + on-click = "${script} toggle"; + format = "{}"; + tooltip = false; + interval = "10"; + }; }; }; } diff --git a/home/terminal.nix b/home/terminal.nix index c02d42a..0c82b71 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -1,12 +1,13 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { imports = [ ./kitty.nix ./tmux.nix ]; - xdg.desktopEntries."btop".name = "btop++"; xdg.desktopEntries."btop".exec = "btop"; xdg.desktopEntries."btop".noDisplay = true; @@ -34,7 +35,7 @@ exa = { enable = true; enableAliases = true; - extraOptions = [ "--group-directories-first" "--group" ]; + extraOptions = ["--group-directories-first" "--group"]; git = true; icons = true; }; diff --git a/home/tmux.nix b/home/tmux.nix index 31cb39e..2b6630b 100644 --- a/home/tmux.nix +++ b/home/tmux.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.tmux = { enable = true; shell = "${pkgs.zsh}/bin/zsh"; diff --git a/home/virt-manager.nix b/home/virt-manager.nix index 796023a..0721b6e 100644 --- a/home/virt-manager.nix +++ b/home/virt-manager.nix @@ -1,18 +1,18 @@ -{ pkgs, ... }: { - home.packages = [ pkgs.virt-manager ]; +{pkgs, ...}: { + home.packages = [pkgs.virt-manager]; dconf.settings = { "org/virt-manager/virt-manager/confirm" = { "forcepoweroff" = false; }; "org/virt-manager/virt-manager/connections" = { - "autoconnect" = [ "qemu:///system" ]; - "uris" = [ "qemu:///system" ]; + "autoconnect" = ["qemu:///system"]; + "uris" = ["qemu:///system"]; }; - "org/virt-manager/virt-manager/new-vm" = { "firmware" = "uefi"; }; + "org/virt-manager/virt-manager/new-vm" = {"firmware" = "uefi";}; "org/virt-manager/virt-manager/stats" = { "enable-disk-poll" = true; "enable-net-poll" = true; }; - "org/virt-manager/virt-manager/vmlist-fields" = { "network-traffic" = true; }; + "org/virt-manager/virt-manager/vmlist-fields" = {"network-traffic" = true;}; }; } diff --git a/packages/adi1090x-plymouth/default.nix b/packages/adi1090x-plymouth/default.nix index b8c31c1..1b6fe33 100644 --- a/packages/adi1090x-plymouth/default.nix +++ b/packages/adi1090x-plymouth/default.nix @@ -1,5 +1,10 @@ -{ lib, stdenvNoCC, fetchFromGitHub, pack ? "pack_1", theme ? "cuts" }: - +{ + lib, + stdenvNoCC, + fetchFromGitHub, + pack ? "pack_1", + theme ? "cuts", +}: stdenvNoCC.mkDerivation { pname = "adi1090x-plymouth"; version = "latest"; diff --git a/packages/catppuccin-wallpapers/default.nix b/packages/catppuccin-wallpapers/default.nix index 90016b2..ff925a5 100644 --- a/packages/catppuccin-wallpapers/default.nix +++ b/packages/catppuccin-wallpapers/default.nix @@ -1,5 +1,8 @@ -{ lib, stdenvNoCC, fetchFromGitHub }: - +{ + lib, + stdenvNoCC, + fetchFromGitHub, +}: stdenvNoCC.mkDerivation { pname = "catppuccin-wallpapers"; version = "latest"; diff --git a/packages/default.nix b/packages/default.nix index 788f9f6..4226843 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,6 +1,6 @@ self: super: { - adi1090x-plymouth = super.callPackage ./adi1090x-plymouth { }; - catppuccin-wallpapers = super.callPackage ./catppuccin-wallpapers { }; - dracula-gtk = super.callPackage ./dracula-gtk { }; - newaita-icon-theme = super.callPackage ./newaita-icon-theme { }; + adi1090x-plymouth = super.callPackage ./adi1090x-plymouth {}; + catppuccin-wallpapers = super.callPackage ./catppuccin-wallpapers {}; + dracula-gtk = super.callPackage ./dracula-gtk {}; + newaita-icon-theme = super.callPackage ./newaita-icon-theme {}; } diff --git a/packages/dracula-gtk/default.nix b/packages/dracula-gtk/default.nix index 6ac86c3..b021612 100644 --- a/packages/dracula-gtk/default.nix +++ b/packages/dracula-gtk/default.nix @@ -1,5 +1,11 @@ -{ lib, stdenvNoCC, fetchFromGitHub, gtk3, gnome-themes-extra, gtk-engine-murrine }: - +{ + lib, + stdenvNoCC, + fetchFromGitHub, + gtk3, + gnome-themes-extra, + gtk-engine-murrine, +}: stdenvNoCC.mkDerivation { pname = "dracula-gtk"; version = "4.0"; @@ -11,13 +17,13 @@ stdenvNoCC.mkDerivation { hash = "sha256-2lmpEPYxdbRnKgcJ792cuzyOBmOIWhja18q+F3Pxgjs="; }; - nativeBuildInputs = [ gtk3 ]; + nativeBuildInputs = [gtk3]; buildInputs = [ gnome-themes-extra ]; - propagatedUserEnvPkgs = [ gtk-engine-murrine ]; + propagatedUserEnvPkgs = [gtk-engine-murrine]; installPhase = '' runHook preInstall diff --git a/packages/newaita-icon-theme/default.nix b/packages/newaita-icon-theme/default.nix index dae8b84..8f6bc47 100644 --- a/packages/newaita-icon-theme/default.nix +++ b/packages/newaita-icon-theme/default.nix @@ -1,5 +1,14 @@ -{ lib, stdenvNoCC, fetchFromGitHub, gtk3, gnome, gnome-icon-theme, hicolor-icon-theme, panel ? "dark", folder ? "default" }: - +{ + lib, + stdenvNoCC, + fetchFromGitHub, + gtk3, + gnome, + gnome-icon-theme, + hicolor-icon-theme, + panel ? "dark", + folder ? "default", +}: stdenvNoCC.mkDerivation { pname = "newaita-icon-theme"; version = "latest"; @@ -11,7 +20,7 @@ stdenvNoCC.mkDerivation { hash = "sha256-tqtjUy8RjvOu0NaK+iE0R1g7/eqCpmhbdxuNGd/YfSI="; }; - nativeBuildInputs = [ gtk3 ]; + nativeBuildInputs = [gtk3]; propagatedBuildInputs = [ gnome.adwaita-icon-theme diff --git a/system/default.nix b/system/default.nix index 9136bd3..72f0eac 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,5 +1,9 @@ -{ config, lib, pkgs, ... }: { - +{ + config, + lib, + pkgs, + ... +}: { imports = [ ./filesystem.nix ./gnome-keyring.nix @@ -37,7 +41,7 @@ LC_TIME = "en_US.UTF-8"; LC_ALL = "en_US.UTF-8"; }; - supportedLocales = [ "en_US.UTF-8/UTF-8" ]; + supportedLocales = ["en_US.UTF-8/UTF-8"]; }; networking = { @@ -79,10 +83,10 @@ tctiEnvironment.enable = true; }; sudo = { - package = pkgs.sudo.override { withInsults = true; }; + package = pkgs.sudo.override {withInsults = true;}; extraConfig = '' Defaults lecture="never" - + %wheel ALL=NOPASSWD: ${config.boot.kernelPackages.cpupower}/bin/cpupower ''; wheelNeedsPassword = true; @@ -97,7 +101,7 @@ portal = { enable = true; wlr.enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; }; }; diff --git a/system/disk.nix b/system/disk.nix index f46ce43..ad931ec 100644 --- a/system/disk.nix +++ b/system/disk.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { boot = { resumeDevice = "/dev/vg0/swap"; initrd.luks.devices = { @@ -11,5 +11,5 @@ }; }; - swapDevices = [{ device = "/dev/vg0/swap"; }]; + swapDevices = [{device = "/dev/vg0/swap";}]; } diff --git a/system/filesystem.nix b/system/filesystem.nix index f6919a9..95e2ed9 100644 --- a/system/filesystem.nix +++ b/system/filesystem.nix @@ -1,28 +1,28 @@ -{ ... }: { +{...}: { boot.tmpOnTmpfs = true; fileSystems = { "/" = { device = "tmpfs"; fsType = "tmpfs"; - options = [ "defaults" "uid=0" "gid=0" "mode=0755" ]; + options = ["defaults" "uid=0" "gid=0" "mode=0755"]; neededForBoot = true; }; "/nix" = { device = "/dev/vg0/system"; fsType = "btrfs"; - options = [ "subvol=/@nix" "compress-force=zstd" ]; + options = ["subvol=/@nix" "compress-force=zstd"]; neededForBoot = true; }; "/persist" = { device = "/dev/vg0/system"; fsType = "btrfs"; - options = [ "subvol=/@persist" "compress-force=zstd" ]; + options = ["subvol=/@persist" "compress-force=zstd"]; neededForBoot = true; }; "/mnt/system" = { device = "/dev/vg0/system"; fsType = "btrfs"; - options = [ "subvol=/" "compress-force=zstd" ]; + options = ["subvol=/" "compress-force=zstd"]; }; "/boot" = { device = "/dev/disk/by-partlabel/ESP"; diff --git a/system/gnome-keyring.nix b/system/gnome-keyring.nix index 046e23b..9153989 100644 --- a/system/gnome-keyring.nix +++ b/system/gnome-keyring.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +{...}: { programs.seahorse.enable = true; services.gnome.gnome-keyring.enable = true; security.pam.services.passwd.enableGnomeKeyring = true; diff --git a/system/gtk.nix b/system/gtk.nix index 0dd1639..e3002fb 100644 --- a/system/gtk.nix +++ b/system/gtk.nix @@ -1,4 +1,3 @@ -{ ... }: -{ +{...}: { programs.dconf.enable = true; } diff --git a/system/hardware.nix b/system/hardware.nix index 01e30e6..f988146 100644 --- a/system/hardware.nix +++ b/system/hardware.nix @@ -1,12 +1,16 @@ -{ lib, pkgs, config, ... }: { - - imports = [ ./disk.nix ./kernel.nix ]; +{ + lib, + pkgs, + config, + ... +}: { + imports = [./disk.nix ./kernel.nix]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.opengl = { enable = true; - extraPackages = [ pkgs.intel-media-driver ]; + extraPackages = [pkgs.intel-media-driver]; driSupport = true; }; @@ -19,7 +23,7 @@ hardware.sensor.hddtemp = { enable = true; - drives = [ "/dev/disk/by-path/pci-0000:01:00.0-nvme-1" ]; + drives = ["/dev/disk/by-path/pci-0000:01:00.0-nvme-1"]; }; boot.loader = { diff --git a/system/kernel.nix b/system/kernel.nix index a9e5647..3a3b93c 100644 --- a/system/kernel.nix +++ b/system/kernel.nix @@ -1,5 +1,8 @@ -{ lib, pkgs, ... }: { - +{ + lib, + pkgs, + ... +}: { boot = { initrd = { availableKernelModules = [ @@ -11,9 +14,9 @@ "sd_mod" "rtsx_pci_sdmmc" ]; - kernelModules = [ "i915" ]; + kernelModules = ["i915"]; }; - kernelModules = [ "kvm-intel" ]; + kernelModules = ["kvm-intel"]; kernelPackages = pkgs.linuxKernel.packages.linux_zen; }; diff --git a/system/nix.nix b/system/nix.nix index dbc3829..e5daca9 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { nix.settings = { substituters = [ "https://nix-community.cachix.org/" @@ -7,7 +7,7 @@ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = ["nix-command" "flakes"]; }; nixpkgs.config.allowUnfree = true; } diff --git a/system/packages.nix b/system/packages.nix index dc0201b..49069b7 100644 --- a/system/packages.nix +++ b/system/packages.nix @@ -1,12 +1,11 @@ -{ pkgs, ... }: { - +{pkgs, ...}: { fonts = { enableDefaultFonts = true; fontDir.enable = true; fonts = with pkgs; [ cantarell-fonts liberation_ttf - (nerdfonts.override { fonts = [ "FiraCode" ]; }) + (nerdfonts.override {fonts = ["FiraCode"];}) noto-fonts noto-fonts-cjk noto-fonts-emoji @@ -31,5 +30,5 @@ xwayland.enable = true; zsh.enable = true; }; - environment.pathsToLink = [ "/share/zsh" ]; + environment.pathsToLink = ["/share/zsh"]; } diff --git a/system/persistence.nix b/system/persistence.nix index b46447c..e9384f4 100644 --- a/system/persistence.nix +++ b/system/persistence.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +{...}: { environment.persistence."/persist/system" = { hideMounts = true; directories = [ diff --git a/system/plymouth.nix b/system/plymouth.nix index 1f4695c..7e2c3bf 100644 --- a/system/plymouth.nix +++ b/system/plymouth.nix @@ -1,10 +1,14 @@ -{ pkgs, ... }: { - +{pkgs, ...}: { boot.consoleLogLevel = 3; - boot.kernelParams = [ "quiet" ]; + boot.kernelParams = ["quiet"]; boot.plymouth = { enable = true; - themePackages = [ (pkgs.adi1090x-plymouth.override { pack = "pack_3"; theme = "owl"; }) ]; + themePackages = [ + (pkgs.adi1090x-plymouth.override { + pack = "pack_3"; + theme = "owl"; + }) + ]; theme = "adi1090x"; }; } diff --git a/system/secureboot.nix b/system/secureboot.nix index c173c31..f2cc70e 100644 --- a/system/secureboot.nix +++ b/system/secureboot.nix @@ -1,5 +1,8 @@ -{ lib, pkgs, ... }: { + lib, + pkgs, + ... +}: { boot.bootspec.enable = true; boot.loader.systemd-boot.enable = lib.mkForce false; boot.lanzaboote = { diff --git a/system/services.nix b/system/services.nix index 8c3a835..41f5188 100644 --- a/system/services.nix +++ b/system/services.nix @@ -1,10 +1,10 @@ -{ pkgs, ... }: { +{pkgs, ...}: { services = { blueman.enable = true; dbus = { enable = true; apparmor = "enabled"; - packages = [ pkgs.gcr pkgs.gcr_4 ]; + packages = [pkgs.gcr pkgs.gcr_4]; }; fstrim.enable = true; fwupd.enable = true; @@ -20,7 +20,7 @@ power-profiles-daemon.enable = true; resolved.enable = true; thermald.enable = true; - udev.packages = [ pkgs.yubikey-personalization ]; + udev.packages = [pkgs.yubikey-personalization]; udisks2.enable = true; }; } diff --git a/system/swaylock.nix b/system/swaylock.nix index 98d2b8b..eef9213 100644 --- a/system/swaylock.nix +++ b/system/swaylock.nix @@ -1,5 +1,3 @@ -{ ... }: - -{ - security.pam.services.swaylock = { }; +{...}: { + security.pam.services.swaylock = {}; } diff --git a/system/virtualisation.nix b/system/virtualisation.nix index 706c334..9db5bd5 100644 --- a/system/virtualisation.nix +++ b/system/virtualisation.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { virtualisation = { docker = { enable = true; @@ -9,7 +9,7 @@ enable = true; qemu.ovmf = { enable = true; - packages = [ pkgs.OVMFFull.fd ]; + packages = [pkgs.OVMFFull.fd]; }; }; }; diff --git a/users/default.nix b/users/default.nix index acfc906..bc23a03 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,9 +1,6 @@ -{ pkgs, ... }: - -let +{pkgs, ...}: let user = import ./user.nix; -in -{ +in { users.mutableUsers = false; users.users = { root.hashedPassword = user.root.hashedPassword; @@ -12,7 +9,7 @@ in hashedPassword = user.primary.hashedPassword; description = user.primary.realName; isNormalUser = true; - extraGroups = [ "docker" "libvirtd" "networkmanager" "tss" "wheel" ]; + extraGroups = ["docker" "libvirtd" "networkmanager" "tss" "wheel"]; shell = pkgs.zsh; }; };