From 98dbc82d278f38387cb358c559844867abe9f124 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 4 Nov 2023 18:14:42 +0800 Subject: [PATCH] flake: format everything using alejandra --- darwin/networking/default.nix | 6 +- darwin/networking/dns.nix | 6 +- darwin/nix/default.nix | 6 +- darwin/nix/flake.nix | 6 +- darwin/nix/gc.nix | 4 +- darwin/nix/nix.nix | 14 +- darwin/packages/core.nix | 18 +- darwin/packages/default.nix | 6 +- darwin/packages/fonts.nix | 8 +- darwin/packages/homebrew.nix | 8 +- darwin/packages/unfree.nix | 15 +- darwin/presets/desktop.nix | 6 +- darwin/presets/desktop/gaming.nix | 6 +- darwin/system/default.nix | 6 +- darwin/system/system.nix | 34 +-- flake.lock | 248 +++++++--------- flake.nix | 68 +++-- flakes/darwin/home-manager.nix | 10 +- flakes/nixos/berberman.nix | 6 +- flakes/nixos/disko.nix | 26 +- flakes/nixos/home-manager.nix | 10 +- flakes/nixos/hosts.nix | 8 +- flakes/nixos/impermanence.nix | 8 +- flakes/nixos/lanzaboote.nix | 12 +- flakes/nixos/sops-nix.nix | 6 +- machines/darwin/imac-2017/default.nix | 6 +- machines/darwin/imac-2017/hardware.nix | 6 +- .../81fw-lenovo-legion-y7000/default.nix | 6 +- .../81fw-lenovo-legion-y7000/hardware.nix | 8 +- .../machine-1/default.nix | 10 +- .../nixos/hardware/accessories/logitech.nix | 5 +- machines/nixos/hardware/accessories/xbox.nix | 5 +- machines/nixos/hardware/cpu/intel.nix | 8 +- machines/nixos/hardware/gpu/amd.nix | 9 +- machines/nixos/hardware/gpu/intel.nix | 13 +- machines/nixos/hardware/gpu/nvidia-prime.nix | 5 +- machines/nixos/hardware/gpu/nvidia.nix | 8 +- machines/nixos/hardware/misc/audio.nix | 5 +- machines/nixos/hardware/misc/bluetooth.nix | 5 +- machines/nixos/hardware/misc/opengl.nix | 5 +- machines/nixos/hardware/misc/tpm.nix | 4 +- machines/nixos/imac-2017/default.nix | 6 +- machines/nixos/imac-2017/hardware.nix | 12 +- nixos/boot/boot.nix | 4 +- nixos/boot/default.nix | 6 +- nixos/boot/plymouth.nix | 6 +- nixos/boot/sysctl.nix | 8 +- nixos/networking/default.nix | 4 +- nixos/networking/dns.nix | 6 +- nixos/networking/firewall.nix | 4 +- nixos/networking/iwd.nix | 6 +- nixos/nix/default.nix | 6 +- nixos/nix/flake.nix | 8 +- nixos/nix/gc.nix | 6 +- nixos/nix/nix.nix | 15 +- nixos/packages/default.nix | 4 +- nixos/packages/graphical/default.nix | 4 +- .../graphical/display-server/default.nix | 4 +- .../display-server/display-server.nix | 8 +- .../graphical/display-server/input.nix | 4 +- nixos/packages/graphical/fonts.nix | 12 +- nixos/packages/graphical/gnome-keyring.nix | 6 +- nixos/packages/graphical/graphical.nix | 4 +- nixos/packages/graphical/polkit.nix | 14 +- nixos/packages/graphical/xdg.nix | 8 +- nixos/packages/hardware.nix | 6 +- nixos/packages/overlays/default.nix | 6 +- nixos/packages/overlays/firefox.nix | 39 +-- nixos/packages/overlays/nautilus.nix | 53 ++-- nixos/packages/overlays/prismlauncher.nix | 24 +- nixos/packages/overlays/sway.nix | 24 +- nixos/packages/overlays/ydict.nix | 24 +- nixos/packages/unfree/default.nix | 6 +- nixos/packages/unfree/unfree.nix | 38 ++- nixos/power-management/cpu-governor.nix | 6 +- nixos/power-management/default.nix | 6 +- .../power-profiles-daemon.nix | 6 +- nixos/power-management/system76-scheduler.nix | 6 +- nixos/power-management/tlp.nix | 6 +- nixos/presets/core.nix | 3 +- nixos/presets/core/legacy-boot.nix | 4 +- nixos/presets/core/networkmanager-iwd.nix | 4 +- nixos/presets/core/networkmanager.nix | 4 +- nixos/presets/core/no-bootloader-menu.nix | 6 +- nixos/presets/core/systemd-resolved.nix | 8 +- nixos/presets/desktop.nix | 6 +- nixos/presets/desktop/flatpak.nix | 6 +- nixos/presets/desktop/gaming.nix | 6 +- nixos/presets/desktop/virtualbox.nix | 6 +- nixos/presets/desktop/wayland.nix | 10 +- nixos/presets/server.nix | 5 +- nixos/specialisation/default.nix | 10 +- users/guanranwang/darwin/presets/core.nix | 8 +- .../guanranwang/darwin/presets/core/proxy.nix | 10 +- users/guanranwang/darwin/presets/desktop.nix | 6 +- .../guanranwang/home-manager/common/home.nix | 75 ++--- .../home-manager/darwin/dotfiles.nix | 9 +- .../guanranwang/home-manager/darwin/home.nix | 51 ++-- .../home-manager/darwin/presets/desktop.nix | 6 +- .../darwin/presets/desktop/gaming.nix | 6 +- .../home-manager/nixos/dotfiles.nix | 9 +- users/guanranwang/home-manager/nixos/home.nix | 275 +++++++++--------- users/guanranwang/home-manager/nixos/i18n.nix | 6 +- .../home-manager/nixos/presets/desktop.nix | 6 +- .../nixos/presets/desktop/gaming.nix | 6 +- users/guanranwang/home-manager/nixos/sway.nix | 78 ++--- .../guanranwang/home-manager/nixos/waybar.nix | 30 +- .../home-manager/nixos/xdg/default.nix | 6 +- .../home-manager/nixos/xdg/xdg-mime.nix | 4 +- .../home-manager/nixos/xdg/xdg.nix | 6 +- .../guanranwang/nixos/networking/default.nix | 6 +- users/guanranwang/nixos/networking/dns.nix | 6 +- users/guanranwang/nixos/presets/core.nix | 22 +- .../nixos/presets/core/clash-meta-client.nix | 24 +- .../nixos/presets/core/hysteria2-server.nix | 27 +- .../nixos/presets/core/juicity-server.nix | 27 +- users/guanranwang/nixos/presets/desktop.nix | 6 +- 117 files changed, 843 insertions(+), 1024 deletions(-) diff --git a/darwin/networking/default.nix b/darwin/networking/default.nix index c856686..eae6e9b 100644 --- a/darwin/networking/default.nix +++ b/darwin/networking/default.nix @@ -1,8 +1,6 @@ -{ ... }: - -{ +{...}: { imports = [ ./dns.nix ./proxy.nix ]; -} \ No newline at end of file +} diff --git a/darwin/networking/dns.nix b/darwin/networking/dns.nix index 2d303ba..e188b5c 100644 --- a/darwin/networking/dns.nix +++ b/darwin/networking/dns.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # please configure `networking.knownNetworkServices` in ../hosts/your-machine.nix networking.dns = [ "223.5.5.5" @@ -16,4 +14,4 @@ #"2001:4860:4860::8888" #"2001:4860:4860::8844" ]; -} \ No newline at end of file +} diff --git a/darwin/nix/default.nix b/darwin/nix/default.nix index bc04325..8af348c 100644 --- a/darwin/nix/default.nix +++ b/darwin/nix/default.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ +{...}: { imports = [ ./flake.nix ./nix.nix ./gc.nix ]; -} \ No newline at end of file +} diff --git a/darwin/nix/flake.nix b/darwin/nix/flake.nix index 3a48344..85bc3cc 100755 --- a/darwin/nix/flake.nix +++ b/darwin/nix/flake.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # Enable Flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; } diff --git a/darwin/nix/gc.nix b/darwin/nix/gc.nix index 666b890..7aa7038 100755 --- a/darwin/nix/gc.nix +++ b/darwin/nix/gc.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { nix = { ### Auto hard linking settings.auto-optimise-store = true; diff --git a/darwin/nix/nix.nix b/darwin/nix/nix.nix index 2352813..c365c6d 100755 --- a/darwin/nix/nix.nix +++ b/darwin/nix/nix.nix @@ -1,13 +1,11 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { nix.settings = { - trusted-users = [ "@admin" ]; + trusted-users = ["@admin"]; substituters = [ - "https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror - "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror - "https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror - "https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror + "https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror + "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror + "https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror + "https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror "https://nix-community.cachix.org" "https://cache.garnix.io" diff --git a/darwin/packages/core.nix b/darwin/packages/core.nix index b03fb68..912483f 100644 --- a/darwin/packages/core.nix +++ b/darwin/packages/core.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget #environment.systemPackages = with pkgs; [ @@ -9,7 +7,7 @@ #]; # Create /etc/zshrc that loads the nix-darwin environment. - programs.zsh.enable = true; # default shell on catalina + programs.zsh.enable = true; # default shell on catalina programs.fish.enable = true; services = { @@ -17,18 +15,18 @@ enable = true; enableScriptingAddition = true; config = { - layout = "bsp"; + layout = "bsp"; mouse_modifier = "fn"; # very broken on slow cpu #focus_follows_mouse = "autoraise"; #mouse_follows_focus = "on"; - top_padding = 10; + top_padding = 10; bottom_padding = 10; - left_padding = 10; - right_padding = 10; - window_gap = 4; + left_padding = 10; + right_padding = 10; + window_gap = 4; }; }; skhd = { @@ -50,4 +48,4 @@ ''; }; }; -} \ No newline at end of file +} diff --git a/darwin/packages/default.nix b/darwin/packages/default.nix index e291741..470830e 100644 --- a/darwin/packages/default.nix +++ b/darwin/packages/default.nix @@ -1,10 +1,8 @@ -{ ... }: - -{ +{...}: { imports = [ ./core.nix ./fonts.nix ./homebrew.nix ./unfree.nix ]; -} \ No newline at end of file +} diff --git a/darwin/packages/fonts.nix b/darwin/packages/fonts.nix index 42387c6..a7927a0 100644 --- a/darwin/packages/fonts.nix +++ b/darwin/packages/fonts.nix @@ -1,7 +1,5 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { fonts.fonts = with pkgs; [ - (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) + (nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];}) ]; -} \ No newline at end of file +} diff --git a/darwin/packages/homebrew.nix b/darwin/packages/homebrew.nix index 07fbe81..d13ddbb 100644 --- a/darwin/packages/homebrew.nix +++ b/darwin/packages/homebrew.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { homebrew = { enable = true; brews = [ @@ -13,7 +11,7 @@ #"vscodium" "alt-tab" - "altserver" + "altserver" "balenaetcher" #"clashx" "opencore-patcher" @@ -30,4 +28,4 @@ "b3z/small" # activate ]; }; -} \ No newline at end of file +} diff --git a/darwin/packages/unfree.nix b/darwin/packages/unfree.nix index cf6e2e5..034a3fe 100644 --- a/darwin/packages/unfree.nix +++ b/darwin/packages/unfree.nix @@ -1,9 +1,8 @@ -{ lib, ... }: - -{ +{lib, ...}: { # Allow unfree applications - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "spotify" - "keka" - ]; -} \ No newline at end of file + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "spotify" + "keka" + ]; +} diff --git a/darwin/presets/desktop.nix b/darwin/presets/desktop.nix index 6ddbd6f..77ce394 100644 --- a/darwin/presets/desktop.nix +++ b/darwin/presets/desktop.nix @@ -1,10 +1,8 @@ -{ ... }: - -{ +{...}: { imports = [ ./networking ./nix ./packages ./system ]; -} \ No newline at end of file +} diff --git a/darwin/presets/desktop/gaming.nix b/darwin/presets/desktop/gaming.nix index bd67d73..24f4fc8 100644 --- a/darwin/presets/desktop/gaming.nix +++ b/darwin/presets/desktop/gaming.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { homebrew.casks = [ "steam" ]; -} \ No newline at end of file +} diff --git a/darwin/system/default.nix b/darwin/system/default.nix index baa959b..31df8d9 100644 --- a/darwin/system/default.nix +++ b/darwin/system/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./system.nix ]; -} \ No newline at end of file +} diff --git a/darwin/system/system.nix b/darwin/system/system.nix index 3889dc6..357a5f4 100644 --- a/darwin/system/system.nix +++ b/darwin/system/system.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { system.defaults = { # Apple... Do I really have to change literally # every setting in macOS to make it actually usable. @@ -23,9 +21,9 @@ AppleShowAllExtensions = true; AppleShowAllFiles = true; CreateDesktop = false; - FXDefaultSearchScope = "SCcf"; # "SCcf" = Current folder + FXDefaultSearchScope = "SCcf"; # "SCcf" = Current folder FXEnableExtensionChangeWarning = false; - FXPreferredViewStyle = "Nlsv"; # "icnv" = Icon view, "Nlsv" = List view, "clmv" = Column View, "Flwv" = Gallery View + FXPreferredViewStyle = "Nlsv"; # "icnv" = Icon view, "Nlsv" = List view, "clmv" = Column View, "Flwv" = Gallery View QuitMenuItem = true; ShowPathbar = true; ShowStatusBar = false; @@ -43,7 +41,7 @@ IsAnalog = false; Show24Hour = false; ShowAMPM = true; - ShowDate = 0; # 0 = show, 1, 2 = don't show + ShowDate = 0; # 0 = show, 1, 2 = don't show ShowDayOfMonth = true; ShowDayOfWeek = true; ShowSeconds = false; @@ -55,25 +53,25 @@ "com.apple.mouse.tapBehavior" = 1; "com.apple.sound.beep.feedback" = 0; "com.apple.springing.enabled" = true; - "com.apple.swipescrolldirection" = true; # Natrual scrolling + "com.apple.swipescrolldirection" = true; # Natrual scrolling "com.apple.trackpad.enableSecondaryClick" = true; - "com.apple.trackpad.trackpadCornerClickBehavior" = null; # ??? "null or value 1 (singular enum)" + "com.apple.trackpad.trackpadCornerClickBehavior" = null; # ??? "null or value 1 (singular enum)" #"com.apple.trackpad.scaling" = -1; _HIHideMenuBar = false; - AppleEnableMouseSwipeNavigateWithScrolls = true; # Magic Mouse - AppleEnableSwipeNavigateWithScrolls = true; # Trackpad - AppleFontSmoothing = 1; # https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501 + AppleEnableMouseSwipeNavigateWithScrolls = true; # Magic Mouse + AppleEnableSwipeNavigateWithScrolls = true; # Trackpad + AppleFontSmoothing = 1; # https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501 AppleICUForce24HourTime = false; - AppleInterfaceStyle = "Dark"; # "null or value "Dark" (singular enum)" + AppleInterfaceStyle = "Dark"; # "null or value "Dark" (singular enum)" AppleInterfaceStyleSwitchesAutomatically = false; - AppleKeyboardUIMode = 3; # ??? "null or value 3 (singular enum)" - AppleMeasurementUnits = "Centimeters"; # "null or one of "Centimeters", "Inches"" - ApplePressAndHoldEnabled = false; # https://stackoverflow.com/questions/33152551/how-can-i-disable-applepressandholdenabled-for-a-specific-application-repeat#33497193 + AppleKeyboardUIMode = 3; # ??? "null or value 3 (singular enum)" + AppleMeasurementUnits = "Centimeters"; # "null or one of "Centimeters", "Inches"" + ApplePressAndHoldEnabled = false; # https://stackoverflow.com/questions/33152551/how-can-i-disable-applepressandholdenabled-for-a-specific-application-repeat#33497193 AppleScrollerPagingBehavior = false; #AppleShowAllExtensions = true; # Dupelicate? #AppleShowAllFiles = true; AppleShowScrollBars = "Always"; - AppleTemperatureUnit = "Celsius"; # "null or one of "Celsius", "Fahrenheit"" + AppleTemperatureUnit = "Celsius"; # "null or one of "Celsius", "Fahrenheit"" #AppleWindowTabbingMode # ? InitialKeyRepeat = 32; KeyRepeat = 2; @@ -81,7 +79,7 @@ NSAutomaticDashSubstitutionEnabled = false; NSAutomaticPeriodSubstitutionEnabled = false; NSAutomaticQuoteSubstitutionEnabled = false; - NSAutomaticSpellingCorrectionEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; #NSAutomaticWindowAnimationsEnabled NSDisableAutomaticTermination = true; NSDocumentSaveNewDocumentsToCloud = false; @@ -96,4 +94,4 @@ PMPrintingExpandedStateForPrint2 = true; }; }; -} \ No newline at end of file +} diff --git a/flake.lock b/flake.lock index 9a84125..19d8ee3 100755 --- a/flake.lock +++ b/flake.lock @@ -5,7 +5,9 @@ "nixpkgs": [ "nixpkgs" ], - "nvfetcher": "nvfetcher" + "nvfetcher": [ + "nvfetcher" + ] }, "locked": { "lastModified": 1698697308, @@ -24,16 +26,15 @@ "crane": { "inputs": { "nixpkgs": [ - "lanzaboote", "nixpkgs" ] }, "locked": { - "lastModified": 1698166613, - "narHash": "sha256-y4rdN4flxRiROqNi1waMYIZj/Fs7L2OrszFk/1ry9vU=", + "lastModified": 1699030822, + "narHash": "sha256-a25bCHvTPJfAvK3qLoi5uI2pvwnOYhMQLRpJYNEt55o=", "owner": "ipetkov", "repo": "crane", - "rev": "b7db46f0f1751f7b1d1911f6be7daf568ad5bc65", + "rev": "2c89c36bffac32d8267e719f73b0d06e313ede30", "type": "github" }, "original": { @@ -63,22 +64,6 @@ } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -97,16 +82,15 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "lanzaboote", "nixpkgs" ] }, "locked": { - "lastModified": 1698579227, - "narHash": "sha256-KVWjFZky+gRuWennKsbo6cWyo7c/z/VgCte5pR9pEKg=", + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f76e870d64779109e41370848074ac4eaa1606ec", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", "type": "github" }, "original": { @@ -117,25 +101,9 @@ }, "flake-utils": { "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_3" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1694529238, @@ -154,17 +122,15 @@ "gitignore": { "inputs": { "nixpkgs": [ - "lanzaboote", - "pre-commit-hooks-nix", "nixpkgs" ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1694102001, + "narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6", "type": "github" }, "original": { @@ -215,13 +181,21 @@ }, "hyprland": { "inputs": { - "hyprland-protocols": "hyprland-protocols", + "hyprland-protocols": [ + "hyprland-protocols" + ], "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2", - "wlroots": "wlroots", - "xdph": "xdph" + "systems": [ + "systems" + ], + "wlroots": [ + "wlroots" + ], + "xdph": [ + "xdph" + ] }, "locked": { "lastModified": 1698694605, @@ -237,14 +211,32 @@ "type": "github" } }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1699059248, + "narHash": "sha256-RjME4USbwF1lhC5spkHkLdM65kW39oG0zOyG5cjz4dc=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "874deb29807259d19da134af33bd44357a642493", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, "hyprland-protocols": { "inputs": { "nixpkgs": [ - "hyprland", "nixpkgs" ], "systems": [ - "hyprland", "systems" ] }, @@ -279,15 +271,27 @@ }, "lanzaboote": { "inputs": { - "crane": "crane", - "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts", - "flake-utils": "flake-utils_2", + "crane": [ + "crane" + ], + "flake-compat": [ + "flake-compat" + ], + "flake-parts": [ + "flake-parts" + ], + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "rust-overlay": "rust-overlay" + "pre-commit-hooks-nix": [ + "pre-commit-hooks-nix" + ], + "rust-overlay": [ + "rust-overlay" + ] }, "locked": { "lastModified": 1698669922, @@ -358,11 +362,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1698942558, + "narHash": "sha256-/UmnB+mEd6Eg3mJBrAgqRcyZX//RSjHphcCO7Ig9Bpk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "621f51253edffa1d6f08d5fce4f08614c852d17e", "type": "github" }, "original": { @@ -372,28 +376,15 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1698544399, - "narHash": "sha256-vhRmPyEyoPkrXF2iykBsWHA05MIaOSmMRLMF7Hul6+s=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d87c5d8c41c9b3b39592563242f3a448b5cc4bc9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nvfetcher": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-compat": [ + "flake-compat" + ], + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ - "berberman", "nixpkgs" ] }, @@ -414,26 +405,27 @@ "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ - "lanzaboote", "flake-compat" ], "flake-utils": [ - "lanzaboote", "flake-utils" ], - "gitignore": "gitignore", + "gitignore": [ + "gitignore" + ], "nixpkgs": [ - "lanzaboote", "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": [ + "nixpkgs-stable" + ] }, "locked": { - "lastModified": 1698227354, - "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", + "lastModified": 1698852633, + "narHash": "sha256-Hsc/cCHud8ZXLvmm8pxrXpuaPEeNaaUttaCvtdX/Wug=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", + "rev": "dec10399e5b56aa95fcd530e0338be72ad6462a0", "type": "github" }, "original": { @@ -445,36 +437,48 @@ "root": { "inputs": { "berberman": "berberman", + "crane": "crane", "disko": "disko", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "flake-utils": "flake-utils", + "gitignore": "gitignore", "home-manager": "home-manager", "hosts": "hosts", "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", + "hyprland-protocols": "hyprland-protocols", "impermanence": "impermanence", "lanzaboote": "lanzaboote", "metacubexd": "metacubexd", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "nvfetcher": "nvfetcher", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "rust-overlay": "rust-overlay", "sops-nix": "sops-nix", - "tokyonight": "tokyonight" + "systems": "systems", + "tokyonight": "tokyonight", + "wlroots": "wlroots", + "xdph": "xdph" } }, "rust-overlay": { "inputs": { "flake-utils": [ - "lanzaboote", "flake-utils" ], "nixpkgs": [ - "lanzaboote", "nixpkgs" ] }, "locked": { - "lastModified": 1698631970, - "narHash": "sha256-uO+iqGslP1TdH0q3pMkpo6XHtzoEa6bjjF3dEQJSDcc=", + "lastModified": 1698977568, + "narHash": "sha256-bnbCqPDFdOUcSANJv9Br3q/b1LyK9vyB1I7os5T4jXI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "44210df7a70dcf0a81a5919f9422b6ae589ee673", + "rev": "321affd863e3e4e669990a1db5fdabef98387b95", "type": "github" }, "original": { @@ -488,7 +492,9 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs-stable": [ + "nixpkgs-stable" + ] }, "locked": { "lastModified": 1698548647, @@ -505,21 +511,6 @@ } }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -534,21 +525,6 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tokyonight": { "flake": false, "locked": { @@ -569,42 +545,38 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1697909146, - "narHash": "sha256-jU0I6FoCKnj4zIBL4daosFWh81U1fM719Z6cae8PxSY=", + "lastModified": 1698919268, + "narHash": "sha256-MDKjcfKyQ4x3U3GnNiGPIUubHSLeQ4Nfp1BpeRkNTfI=", "owner": "wlroots", "repo": "wlroots", - "rev": "47bf87ade2bd32395615a385ebde1fefbcdf79a2", + "rev": "26eac25d7f7d25a5bfbeb308aa09de618a1384ef", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "47bf87ade2bd32395615a385ebde1fefbcdf79a2", "type": "gitlab" } }, "xdph": { "inputs": { "hyprland-protocols": [ - "hyprland", "hyprland-protocols" ], "nixpkgs": [ - "hyprland", "nixpkgs" ], "systems": [ - "hyprland", "systems" ] }, "locked": { - "lastModified": 1697981233, - "narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=", + "lastModified": 1699048835, + "narHash": "sha256-IKcRTKzlcDsbD5xydRNc9s4c4KjcQHaZgOc5kWPOAtU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2", + "rev": "081b36add935e5c099ae82d6a4db4f3740aad711", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2fbf779..023b747 100755 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ inputs.nixpkgs-stable.follows = "nixpkgs-stable"; }; - ### De-dupe crane = { url = "github:ipetkov/crane"; @@ -119,9 +118,6 @@ inputs.systems.follows = "systems"; }; - - - # TODO: Unused, Soon(TM) #daeuniverse.url = "github:daeuniverse/flake.nix"; #nixos-hardware = { @@ -147,63 +143,66 @@ }; }; - outputs = { self, - nixpkgs, - berberman, - disko, - home-manager, - hosts, - hyprland, - lanzaboote, - nix-darwin, - sops-nix, - impermanence, - tokyonight, - metacubexd, - ... } @ inputs: { - + outputs = { + self, + nixpkgs, + berberman, + disko, + home-manager, + hosts, + hyprland, + lanzaboote, + nix-darwin, + sops-nix, + impermanence, + tokyonight, + metacubexd, + ... + } @ inputs: { formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; ### NixOS nixosConfigurations = { "81FW-NixOS" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = {inherit inputs;}; modules = [ - ./nixos/presets/desktop.nix # OS preset - ./nixos/presets/core/no-bootloader-menu.nix # Addtional, opt-in OS preset(s) + # OS + ./nixos/presets/desktop.nix + ./nixos/presets/core/no-bootloader-menu.nix ./nixos/presets/desktop/gaming.nix ./nixos/presets/desktop/virtualbox.nix ./nixos/presets/desktop/wayland.nix - ./users/guanranwang/nixos/presets/desktop.nix # User preset - ./users/guanranwang/nixos/presets/core/clash-meta-client.nix # Addtional, opt-in user preset(s) + # User + ./users/guanranwang/nixos/presets/desktop.nix + ./users/guanranwang/nixos/presets/core/clash-meta-client.nix - ./machines/nixos/81fw-lenovo-legion-y7000 # Hardware - ./machines/nixos/81fw-lenovo-legion-y7000/machine-1 # Machine + # Hardware + ./machines/nixos/81fw-lenovo-legion-y7000 + ./machines/nixos/81fw-lenovo-legion-y7000/machine-1 { # extra home-manager stuff home-manager.users.guanranwang = import ./users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix; networking.hostName = "81FW-NixOS"; # Hostname - time.timeZone = "Asia/Shanghai"; # Timezone + time.timeZone = "Asia/Shanghai"; # Timezone } ]; }; }; - ### nix-darwin (macOS) darwinConfigurations = { "iMac-macOS" = nix-darwin.lib.darwinSystem { system = "x86_64-darwin"; - specialArgs = { inherit inputs; }; + specialArgs = {inherit inputs;}; modules = [ - ./darwin/presets/desktop.nix # OS preset - ./users/guanranwang/darwin/presets/desktop.nix # User preset - ./users/guanranwang/darwin/presets/core/proxy.nix # Addtional user preset(s) - ./machines/darwin/imac-2017 # Hardware + ./darwin/presets/desktop.nix + ./users/guanranwang/darwin/presets/desktop.nix + ./users/guanranwang/darwin/presets/core/proxy.nix + ./machines/darwin/imac-2017 { #home-manager.users.guanranwang = import ./users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix; @@ -215,13 +214,12 @@ }; }; - ### Home-Manager # TODO: Actually figure out how this works homeConfigurations = { "guanranwang@81fw-nixos" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = {inherit inputs;}; modules = [ sops-nix.homeManagerModules.sops hyprland.homeManagerModules.default diff --git a/flakes/darwin/home-manager.nix b/flakes/darwin/home-manager.nix index e5ba846..5fc9f94 100644 --- a/flakes/darwin/home-manager.nix +++ b/flakes/darwin/home-manager.nix @@ -1,11 +1,9 @@ -{ inputs, ... }: - -{ - imports = [ inputs.home-manager.darwinModules.home-manager ]; +{inputs, ...}: { + imports = [inputs.home-manager.darwinModules.home-manager]; home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; # ??? isnt specialArgs imported by default ??? + extraSpecialArgs = {inherit inputs;}; # ??? isnt specialArgs imported by default ??? }; -} \ No newline at end of file +} diff --git a/flakes/nixos/berberman.nix b/flakes/nixos/berberman.nix index 7f1d3fb..a39333c 100644 --- a/flakes/nixos/berberman.nix +++ b/flakes/nixos/berberman.nix @@ -1,7 +1,5 @@ -{ inputs, ... }: - -{ +{inputs, ...}: { nixpkgs.overlays = [ inputs.berberman.overlays.default ]; -} \ No newline at end of file +} diff --git a/flakes/nixos/disko.nix b/flakes/nixos/disko.nix index 7c6a9c8..db7042c 100644 --- a/flakes/nixos/disko.nix +++ b/flakes/nixos/disko.nix @@ -1,7 +1,9 @@ -{ inputs, disks ? [ "/dev/vdb" ], ... }: - { - imports = [ inputs.disko.nixosModules.disko ]; + inputs, + disks ? ["/dev/sda"], + ... +}: { + imports = [inputs.disko.nixosModules.disko]; disko.devices = { disk = { @@ -11,7 +13,7 @@ content = { type = "gpt"; partitions = { - ESP = { + "ESP" = { size = "2G"; type = "EF00"; content = { @@ -19,17 +21,19 @@ format = "vfat"; mountpoint = "/boot"; mountOptions = [ - "defaults" "fmask=0077" "dmask=0077" + "defaults" + "fmask=0077" + "dmask=0077" ]; }; }; - luks = { + "luks" = { #size = "100%"; end = "-16G"; content = { type = "luks"; name = "crypted"; - extraOpenArgs = [ "--allow-discards" ]; + extraOpenArgs = ["--allow-discards"]; # if you want to use the key for interactive login be sure there is no trailing newline # for example use `echo -n "password" > /tmp/secret.key` passwordFile = "/tmp/secret.key"; # Interactive @@ -37,22 +41,22 @@ #additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; mountpoint = "/btrfs"; subvolumes = { "/@home" = { mountpoint = "/home"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "/@nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; }; }; }; }; - swap = { + "swap" = { size = "100%"; content = { type = "swap"; diff --git a/flakes/nixos/home-manager.nix b/flakes/nixos/home-manager.nix index 7a6e7ab..7ddd20b 100644 --- a/flakes/nixos/home-manager.nix +++ b/flakes/nixos/home-manager.nix @@ -1,11 +1,9 @@ -{ inputs, ... }: - -{ - imports = [ inputs.home-manager.nixosModules.home-manager ]; +{inputs, ...}: { + imports = [inputs.home-manager.nixosModules.home-manager]; home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; # ??? isnt specialArgs imported by default ??? + extraSpecialArgs = {inherit inputs;}; # ??? isnt specialArgs imported by default ??? }; -} \ No newline at end of file +} diff --git a/flakes/nixos/hosts.nix b/flakes/nixos/hosts.nix index 1fcdfc4..3b59cbb 100644 --- a/flakes/nixos/hosts.nix +++ b/flakes/nixos/hosts.nix @@ -1,7 +1,5 @@ -{ inputs, ... }: - -{ - imports = [ inputs.hosts.nixosModule ]; +{inputs, ...}: { + imports = [inputs.hosts.nixosModule]; networking.stevenBlackHosts = { enable = true; @@ -10,4 +8,4 @@ blockPorn = true; blockSocial = true; }; -} \ No newline at end of file +} diff --git a/flakes/nixos/impermanence.nix b/flakes/nixos/impermanence.nix index 8df8fbd..950886a 100644 --- a/flakes/nixos/impermanence.nix +++ b/flakes/nixos/impermanence.nix @@ -1,7 +1,5 @@ -{ inputs, ... }: - -{ - imports = [ inputs.impermanence.nixosModules.impermanence ]; +{inputs, ...}: { + imports = [inputs.impermanence.nixosModules.impermanence]; # this folder is where the files will be stored (don't put it in tmpfs) environment.persistence."/nix/persist/system" = { @@ -23,4 +21,4 @@ "/etc/ssh/ssh_host_rsa_key.pub" ]; }; -} \ No newline at end of file +} diff --git a/flakes/nixos/lanzaboote.nix b/flakes/nixos/lanzaboote.nix index 8268684..5f6a78e 100644 --- a/flakes/nixos/lanzaboote.nix +++ b/flakes/nixos/lanzaboote.nix @@ -1,12 +1,14 @@ -{ inputs, pkgs, ... }: - { - imports = [ inputs.lanzaboote.nixosModules.lanzaboote ]; + inputs, + pkgs, + ... +}: { + imports = [inputs.lanzaboote.nixosModules.lanzaboote]; - environment.systemPackages = with pkgs; [ sbctl ]; + environment.systemPackages = with pkgs; [sbctl]; boot.loader.systemd-boot.enable = false; boot.lanzaboote = { enable = true; pkiBundle = "/etc/secureboot"; }; -} \ No newline at end of file +} diff --git a/flakes/nixos/sops-nix.nix b/flakes/nixos/sops-nix.nix index 1e01be4..c7f4a27 100644 --- a/flakes/nixos/sops-nix.nix +++ b/flakes/nixos/sops-nix.nix @@ -1,5 +1,3 @@ -{ inputs, ... }: - -{ - imports = [ inputs.sops-nix.nixosModules.sops ]; +{inputs, ...}: { + imports = [inputs.sops-nix.nixosModules.sops]; } diff --git a/machines/darwin/imac-2017/default.nix b/machines/darwin/imac-2017/default.nix index 08c9b06..b377e8f 100644 --- a/machines/darwin/imac-2017/default.nix +++ b/machines/darwin/imac-2017/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./hardware.nix ]; -} \ No newline at end of file +} diff --git a/machines/darwin/imac-2017/hardware.nix b/machines/darwin/imac-2017/hardware.nix index 9246ca5..1e8db51 100644 --- a/machines/darwin/imac-2017/hardware.nix +++ b/machines/darwin/imac-2017/hardware.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { networking.knownNetworkServices = [ "Ethernet" "Wi-Fi" @@ -11,4 +9,4 @@ # The platform the configuration will be used on. nixpkgs.hostPlatform = "x86_64-darwin"; -} \ No newline at end of file +} diff --git a/machines/nixos/81fw-lenovo-legion-y7000/default.nix b/machines/nixos/81fw-lenovo-legion-y7000/default.nix index 08c9b06..b377e8f 100644 --- a/machines/nixos/81fw-lenovo-legion-y7000/default.nix +++ b/machines/nixos/81fw-lenovo-legion-y7000/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./hardware.nix ]; -} \ No newline at end of file +} diff --git a/machines/nixos/81fw-lenovo-legion-y7000/hardware.nix b/machines/nixos/81fw-lenovo-legion-y7000/hardware.nix index 0246e02..0c97c01 100755 --- a/machines/nixos/81fw-lenovo-legion-y7000/hardware.nix +++ b/machines/nixos/81fw-lenovo-legion-y7000/hardware.nix @@ -1,6 +1,8 @@ -{ lib, modulesPath, ... }: - { + lib, + modulesPath, + ... +}: { imports = [ ../hardware/misc/audio.nix ../hardware/misc/bluetooth.nix @@ -13,7 +15,7 @@ (modulesPath + "/installer/scan/not-detected.nix") # what is this ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"]; services.fstrim.enable = true; # Nvidia PRIME diff --git a/machines/nixos/81fw-lenovo-legion-y7000/machine-1/default.nix b/machines/nixos/81fw-lenovo-legion-y7000/machine-1/default.nix index 758ace3..772d62b 100644 --- a/machines/nixos/81fw-lenovo-legion-y7000/machine-1/default.nix +++ b/machines/nixos/81fw-lenovo-legion-y7000/machine-1/default.nix @@ -1,12 +1,10 @@ -{ ... }: - -{ +{...}: { imports = [ ../../../../flakes/nixos/lanzaboote.nix ../../../../flakes/nixos/impermanence.nix ../../../../flakes/nixos/disko.nix ]; - _module.args.disks = [ "/dev/nvme0n1" ]; # Disko - boot.initrd.systemd.enable = true; # LUKS TPM unlocking -} \ No newline at end of file + _module.args.disks = ["/dev/nvme0n1"]; # Disko + boot.initrd.systemd.enable = true; # LUKS TPM unlocking +} diff --git a/machines/nixos/hardware/accessories/logitech.nix b/machines/nixos/hardware/accessories/logitech.nix index cea7d3e..5a3db68 100755 --- a/machines/nixos/hardware/accessories/logitech.nix +++ b/machines/nixos/hardware/accessories/logitech.nix @@ -1,9 +1,8 @@ -{ ... }: - +{...}: # Logitech { hardware.logitech.wireless = { enable = true; enableGraphical = true; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/accessories/xbox.nix b/machines/nixos/hardware/accessories/xbox.nix index 6465af3..66eac76 100755 --- a/machines/nixos/hardware/accessories/xbox.nix +++ b/machines/nixos/hardware/accessories/xbox.nix @@ -1,9 +1,8 @@ -{ ... }: - +{...}: # Xbox accessories { hardware = { xone.enable = true; xpadneo.enable = true; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/cpu/intel.nix b/machines/nixos/hardware/cpu/intel.nix index ecafaa6..98719c9 100755 --- a/machines/nixos/hardware/cpu/intel.nix +++ b/machines/nixos/hardware/cpu/intel.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ - boot.kernelModules = [ "kvm-intel" ]; +{...}: { + boot.kernelModules = ["kvm-intel"]; hardware.cpu.intel.updateMicrocode = true; nixpkgs.hostPlatform = "x86_64-linux"; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/gpu/amd.nix b/machines/nixos/hardware/gpu/amd.nix index f4ed7bd..0e4387b 100644 --- a/machines/nixos/hardware/gpu/amd.nix +++ b/machines/nixos/hardware/gpu/amd.nix @@ -1,10 +1,9 @@ -{ pkgs, ... }: - +{pkgs, ...}: # FOLLOWING https://nixos.wiki/wiki/AMD_GPU DIRECTLY # I HAVE NO IDEA WHAT AM I DOING { - boot.initrd.kernelModules = [ "amdgpu" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; + boot.initrd.kernelModules = ["amdgpu"]; + services.xserver.videoDrivers = ["amdgpu"]; # OpenCL hardware.opengl = { @@ -23,4 +22,4 @@ systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.hip}" ]; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/gpu/intel.nix b/machines/nixos/hardware/gpu/intel.nix index 6d755ce..fcaafa6 100644 --- a/machines/nixos/hardware/gpu/intel.nix +++ b/machines/nixos/hardware/gpu/intel.nix @@ -1,19 +1,18 @@ -{ pkgs, ... }: - +{pkgs, ...}: # Following https://nixos.wiki/wiki/Intel_Graphics { - boot.initrd.kernelModules = [ "i915" ]; # if not enabled, plymouth's distro logo wont show for some reason - nixpkgs.config.packageOverrides = pkgs: { vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; }; + boot.initrd.kernelModules = ["i915"]; # if not enabled, plymouth's distro logo wont show for some reason + nixpkgs.config.packageOverrides = pkgs: {vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};}; hardware.opengl = { extraPackages = with pkgs; [ intel-media-driver # libva_driver_name=ihd - vaapiIntel # libva_driver_name=i965 (older but works better for firefox/chromium) + vaapiIntel # libva_driver_name=i965 (older but works better for firefox/chromium) vaapiVdpau libvdpau-va-gl intel-compute-runtime # intel opencl intel-media-driver # intel vaapi ]; - extraPackages32 = with pkgs; [ pkgsi686Linux.vaapiIntel ]; + extraPackages32 = with pkgs; [pkgsi686Linux.vaapiIntel]; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/gpu/nvidia-prime.nix b/machines/nixos/hardware/gpu/nvidia-prime.nix index 54e5ca1..cb8b7a0 100755 --- a/machines/nixos/hardware/gpu/nvidia-prime.nix +++ b/machines/nixos/hardware/gpu/nvidia-prime.nix @@ -1,5 +1,4 @@ -{ ... }: - +{...}: # Nvidia Prime ( multi gpu on laptop ) { hardware.nvidia.prime = { @@ -16,4 +15,4 @@ environment.sessionVariables = { "GAMEMODERUNEXEC" = "env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only"; # gamemode: nvidia offload }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/gpu/nvidia.nix b/machines/nixos/hardware/gpu/nvidia.nix index 4aaea5c..e6e624c 100755 --- a/machines/nixos/hardware/gpu/nvidia.nix +++ b/machines/nixos/hardware/gpu/nvidia.nix @@ -1,10 +1,8 @@ -{ config, ... }: - +{config, ...}: # NVIDIA drivers # fuck you nvidia btw { - - services.xserver.videoDrivers = [ "nvidia" ]; # tell xorg to use the nvidia driver, also valid for wayland + services.xserver.videoDrivers = ["nvidia"]; # tell xorg to use the nvidia driver, also valid for wayland hardware.nvidia = { package = config.boot.kernelPackages.nvidiaPackages.stable; open = false; @@ -15,4 +13,4 @@ #finegrained = true; }; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/misc/audio.nix b/machines/nixos/hardware/misc/audio.nix index fc184c8..51da0ea 100755 --- a/machines/nixos/hardware/misc/audio.nix +++ b/machines/nixos/hardware/misc/audio.nix @@ -1,5 +1,4 @@ -{ lib, ... }: - +{lib, ...}: # Audio system (pipewire) { security.rtkit.enable = true; @@ -14,4 +13,4 @@ support32Bit = true; }; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/misc/bluetooth.nix b/machines/nixos/hardware/misc/bluetooth.nix index 5a854b3..0d2526f 100755 --- a/machines/nixos/hardware/misc/bluetooth.nix +++ b/machines/nixos/hardware/misc/bluetooth.nix @@ -1,10 +1,9 @@ -{ pkgs, ... }: - +{pkgs, ...}: # Bluetooth { # Bluetooth manager #services.blueman.enable = true; - environment.systemPackages = with pkgs; [ blueberry ]; + environment.systemPackages = with pkgs; [blueberry]; # Bluetooth service hardware.bluetooth = { diff --git a/machines/nixos/hardware/misc/opengl.nix b/machines/nixos/hardware/misc/opengl.nix index 90944c6..4806140 100755 --- a/machines/nixos/hardware/misc/opengl.nix +++ b/machines/nixos/hardware/misc/opengl.nix @@ -1,5 +1,4 @@ -{ ... }: - +{...}: # OpenGL { hardware = { @@ -9,4 +8,4 @@ driSupport32Bit = true; }; }; -} \ No newline at end of file +} diff --git a/machines/nixos/hardware/misc/tpm.nix b/machines/nixos/hardware/misc/tpm.nix index dcdbfc1..9d5c25f 100644 --- a/machines/nixos/hardware/misc/tpm.nix +++ b/machines/nixos/hardware/misc/tpm.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # TPM is currently broken on latest kernel, # but luckily, linux-zen have a patch for it # UPDATE: it got fixed in 6.5.3 diff --git a/machines/nixos/imac-2017/default.nix b/machines/nixos/imac-2017/default.nix index 08c9b06..b377e8f 100644 --- a/machines/nixos/imac-2017/default.nix +++ b/machines/nixos/imac-2017/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./hardware.nix ]; -} \ No newline at end of file +} diff --git a/machines/nixos/imac-2017/hardware.nix b/machines/nixos/imac-2017/hardware.nix index d32bc96..5b6c5d7 100755 --- a/machines/nixos/imac-2017/hardware.nix +++ b/machines/nixos/imac-2017/hardware.nix @@ -1,6 +1,8 @@ -{ lib, modulesPath, ... }: - { + lib, + modulesPath, + ... +}: { imports = [ ../hardware/misc/audio.nix ../hardware/misc/bluetooth.nix @@ -11,10 +13,10 @@ (modulesPath + "/installer/scan/not-detected.nix") # what is this ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; # Options from github:NixOS/nixos-hardware - boot.kernelParams = [ "hid_apple.iso_layout=0" ]; + boot.kernelParams = ["hid_apple.iso_layout=0"]; hardware.facetimehd.enable = true; # TODO: Camera already works before adding this, not sure what is the point... # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -24,4 +26,4 @@ networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; -} \ No newline at end of file +} diff --git a/nixos/boot/boot.nix b/nixos/boot/boot.nix index 8edeeba..8614cce 100755 --- a/nixos/boot/boot.nix +++ b/nixos/boot/boot.nix @@ -1,6 +1,4 @@ -{ lib, ... }: - -{ +{lib, ...}: { boot = { consoleLogLevel = lib.mkDefault 3; loader = { diff --git a/nixos/boot/default.nix b/nixos/boot/default.nix index ef6a739..8f8859a 100644 --- a/nixos/boot/default.nix +++ b/nixos/boot/default.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ +{...}: { imports = [ ./boot.nix ./plymouth.nix ./sysctl.nix ]; -} \ No newline at end of file +} diff --git a/nixos/boot/plymouth.nix b/nixos/boot/plymouth.nix index eb4d448..ce0bde3 100644 --- a/nixos/boot/plymouth.nix +++ b/nixos/boot/plymouth.nix @@ -1,5 +1,3 @@ -{ lib, ... }: - -{ +{lib, ...}: { boot.plymouth.enable = lib.mkDefault true; # mkDefault for headless devices, check out server.nix -} \ No newline at end of file +} diff --git a/nixos/boot/sysctl.nix b/nixos/boot/sysctl.nix index ccae85f..e50dfc4 100644 --- a/nixos/boot/sysctl.nix +++ b/nixos/boot/sysctl.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # All sysctl-s are from https://madaidans-insecurities.github.io/guides/linux-hardening.html#sysctl boot.kernel.sysctl = { # Kernel self-protection @@ -22,7 +20,7 @@ "net.ipv4.conf.all.rp_filter" = "1"; # against IP spoofing "net.ipv4.conf.default.rp_filter" = "1"; "net.ipv4.conf.all.accept_redirects" = "0"; - "net.ipv4.conf.default.accept_redirects" ="0"; # disable ICMP redirect acceptance and sending, against MITM + "net.ipv4.conf.default.accept_redirects" = "0"; # disable ICMP redirect acceptance and sending, against MITM "net.ipv4.conf.all.secure_redirects" = "0"; "net.ipv4.conf.default.secure_redirects" = "0"; "net.ipv6.conf.all.accept_redirects" = "0"; @@ -49,4 +47,4 @@ "fs.protected_fifos" = "2"; "fs.protected_regular" = "2"; }; -} \ No newline at end of file +} diff --git a/nixos/networking/default.nix b/nixos/networking/default.nix index 7d071ef..58c4614 100755 --- a/nixos/networking/default.nix +++ b/nixos/networking/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./dns.nix ./firewall.nix diff --git a/nixos/networking/dns.nix b/nixos/networking/dns.nix index cb1ccae..27b57e4 100644 --- a/nixos/networking/dns.nix +++ b/nixos/networking/dns.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { networking.nameservers = [ ### Google DNS "8.8.8.8" @@ -8,4 +6,4 @@ "2001:4860:4860::8888" "2001:4860:4860::8844" ]; -} \ No newline at end of file +} diff --git a/nixos/networking/firewall.nix b/nixos/networking/firewall.nix index f2ff23d..0731a08 100644 --- a/nixos/networking/firewall.nix +++ b/nixos/networking/firewall.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { networking.firewall = { enable = true; # Open ports in the firewall. diff --git a/nixos/networking/iwd.nix b/nixos/networking/iwd.nix index 0c71a97..2fedd82 100644 --- a/nixos/networking/iwd.nix +++ b/nixos/networking/iwd.nix @@ -1,5 +1,3 @@ -{ lib, ... }: - -{ +{lib, ...}: { networking.wireless.iwd.enable = lib.mkDefault true; -} \ No newline at end of file +} diff --git a/nixos/nix/default.nix b/nixos/nix/default.nix index bc04325..8af348c 100644 --- a/nixos/nix/default.nix +++ b/nixos/nix/default.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ +{...}: { imports = [ ./flake.nix ./nix.nix ./gc.nix ]; -} \ No newline at end of file +} diff --git a/nixos/nix/flake.nix b/nixos/nix/flake.nix index 590718a..59f4592 100755 --- a/nixos/nix/flake.nix +++ b/nixos/nix/flake.nix @@ -1,11 +1,9 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # Enable Flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; # Install Git - environment.systemPackages = [ pkgs.git ]; + environment.systemPackages = [pkgs.git]; # Does not work with Flake based configurations system.copySystemConfiguration = false; diff --git a/nixos/nix/gc.nix b/nixos/nix/gc.nix index 62f15fa..c6c9b1a 100755 --- a/nixos/nix/gc.nix +++ b/nixos/nix/gc.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { nix = { ### Auto hard linking settings.auto-optimise-store = true; @@ -15,7 +13,7 @@ ### optimiser optimise = { automatic = true; - dates = [ "03:45" ]; + dates = ["03:45"]; }; }; } diff --git a/nixos/nix/nix.nix b/nixos/nix/nix.nix index 37b8340..07e9324 100755 --- a/nixos/nix/nix.nix +++ b/nixos/nix/nix.nix @@ -1,13 +1,11 @@ -{ lib, ... }: - -{ +{lib, ...}: { nix.settings = { - trusted-users = [ "@wheel" ]; + trusted-users = ["@wheel"]; substituters = [ - "https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror - "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror - "https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror - "https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror + "https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror + "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror + "https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror + "https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror "https://nix-community.cachix.org" "https://berberman.cachix.org" @@ -37,7 +35,6 @@ # Does not work with flake based configurations copySystemConfiguration = lib.mkDefault true; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave diff --git a/nixos/packages/default.nix b/nixos/packages/default.nix index bc956fd..08fd07a 100755 --- a/nixos/packages/default.nix +++ b/nixos/packages/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./hardware.nix # TODO: move this somewhere else? diff --git a/nixos/packages/graphical/default.nix b/nixos/packages/graphical/default.nix index 6e39350..e135de3 100755 --- a/nixos/packages/graphical/default.nix +++ b/nixos/packages/graphical/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./display-server diff --git a/nixos/packages/graphical/display-server/default.nix b/nixos/packages/graphical/display-server/default.nix index 998c888..fc6ecb3 100644 --- a/nixos/packages/graphical/display-server/default.nix +++ b/nixos/packages/graphical/display-server/default.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./display-server.nix ./input.nix diff --git a/nixos/packages/graphical/display-server/display-server.nix b/nixos/packages/graphical/display-server/display-server.nix index e99dea4..80b74d2 100755 --- a/nixos/packages/graphical/display-server/display-server.nix +++ b/nixos/packages/graphical/display-server/display-server.nix @@ -1,9 +1,7 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services.xserver = { enable = true; - excludePackages = with pkgs; [ xterm ]; + excludePackages = with pkgs; [xterm]; displayManager = { startx.enable = true; }; @@ -14,4 +12,4 @@ #bspwm.enable = true; }; }; -} \ No newline at end of file +} diff --git a/nixos/packages/graphical/display-server/input.nix b/nixos/packages/graphical/display-server/input.nix index 610829c..38c0a83 100755 --- a/nixos/packages/graphical/display-server/input.nix +++ b/nixos/packages/graphical/display-server/input.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.xserver = { libinput = { enable = true; diff --git a/nixos/packages/graphical/fonts.nix b/nixos/packages/graphical/fonts.nix index e00728a..b694893 100755 --- a/nixos/packages/graphical/fonts.nix +++ b/nixos/packages/graphical/fonts.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # Fonts fonts = { fontDir.enable = true; @@ -38,10 +36,10 @@ fontconfig = { cache32Bit = true; defaultFonts = { - emoji = [ "Noto Color Emoji" ]; - serif = [ "Noto Serif" ]; - sansSerif = [ "Inter" "Noto Sans" ]; - monospace = [ "JetBrainsMono Nerd Font" "JetBrains Mono" "FiraCode Nerd Font" "Fira Code" "Noto Sans Mono" ]; + emoji = ["Noto Color Emoji"]; + serif = ["Noto Serif"]; + sansSerif = ["Inter" "Noto Sans"]; + monospace = ["JetBrainsMono Nerd Font" "JetBrains Mono" "FiraCode Nerd Font" "Fira Code" "Noto Sans Mono"]; }; }; # fontconfig is too limited here, and appling it globally is **bad**, use Home Manager instead diff --git a/nixos/packages/graphical/gnome-keyring.nix b/nixos/packages/graphical/gnome-keyring.nix index 120e936..e5caece 100644 --- a/nixos/packages/graphical/gnome-keyring.nix +++ b/nixos/packages/graphical/gnome-keyring.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # gnome keyring services.gnome.gnome-keyring.enable = true; programs.seahorse.enable = true; @@ -9,4 +7,4 @@ session optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start password optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so ''; -} \ No newline at end of file +} diff --git a/nixos/packages/graphical/graphical.nix b/nixos/packages/graphical/graphical.nix index a69faf8..c21a1c4 100644 --- a/nixos/packages/graphical/graphical.nix +++ b/nixos/packages/graphical/graphical.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services = { # GNOME applications gvfs.enable = true; # nautilus diff --git a/nixos/packages/graphical/polkit.nix b/nixos/packages/graphical/polkit.nix index a7fbfdb..cbcfb1e 100644 --- a/nixos/packages/graphical/polkit.nix +++ b/nixos/packages/graphical/polkit.nix @@ -1,16 +1,14 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { security.polkit.enable = true; - environment.systemPackages = with pkgs; [ polkit_gnome ]; + environment.systemPackages = with pkgs; [polkit_gnome]; # polkit_gnome autostart for wms systemd = { user.services.polkit-gnome-authentication-agent-1 = { description = "polkit-gnome-authentication-agent-1"; - wantedBy = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; + wantedBy = ["graphical-session.target"]; + wants = ["graphical-session.target"]; + after = ["graphical-session.target"]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; @@ -20,4 +18,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/nixos/packages/graphical/xdg.nix b/nixos/packages/graphical/xdg.nix index 9e964a1..c03e188 100644 --- a/nixos/packages/graphical/xdg.nix +++ b/nixos/packages/graphical/xdg.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # XDG portal xdg.portal = { enable = true; wlr.enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; # disable if on gnome + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; # disable if on gnome }; -} \ No newline at end of file +} diff --git a/nixos/packages/hardware.nix b/nixos/packages/hardware.nix index 7f0213e..14a845c 100644 --- a/nixos/packages/hardware.nix +++ b/nixos/packages/hardware.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { hardware = { enableRedistributableFirmware = true; #enableAllFirmware = true; @@ -12,4 +10,4 @@ thermald.enable = true; # Prevents overheating fwupd.enable = true; # Firmware update }; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/default.nix b/nixos/packages/overlays/default.nix index 6aff767..5cd708e 100644 --- a/nixos/packages/overlays/default.nix +++ b/nixos/packages/overlays/default.nix @@ -1,10 +1,8 @@ -{ ... }: - -{ +{...}: { imports = [ ./nautilus.nix ./sway.nix ./prismlauncher.nix ./ydict.nix ]; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/firefox.nix b/nixos/packages/overlays/firefox.nix index e2d573b..3484fcc 100644 --- a/nixos/packages/overlays/firefox.nix +++ b/nixos/packages/overlays/firefox.nix @@ -1,27 +1,28 @@ -{ ... }: - -{ +{...}: { nixpkgs = { overlays = [ - (final: prev: - { + ( + final: prev: { firefox-unwrapped = prev.firefox-unwrapped.overrideAttrs (old: { - # Firefox but with .mozilla moved to .config/mozilla - # .patch file from aur/firefox-xdg - # dont actually use this, it take ages to build... =.= - patches = (old.patches or []) ++ [ - (prev.fetchgit { - url = "https://aur.archlinux.org/firefox-xdg.git"; - rev = "ab291ab81140867dea4c08e4e1e4e3da0c73e4a6"; - hash = "sha256-6VgCt028qs/Y5kl20qLUYwFI63pItsHPbLimOFIdsyo="; - sparseCheckout = [ - "firefox-xdg-support.diff" - ]; - } + "/firefox-xdg-support.diff") - ]; + # Firefox but with .mozilla moved to .config/mozilla + # .patch file from aur/firefox-xdg + # dont actually use this, it take ages to build... =.= + patches = + (old.patches or []) + ++ [ + (prev.fetchgit { + url = "https://aur.archlinux.org/firefox-xdg.git"; + rev = "ab291ab81140867dea4c08e4e1e4e3da0c73e4a6"; + hash = "sha256-6VgCt028qs/Y5kl20qLUYwFI63pItsHPbLimOFIdsyo="; + sparseCheckout = [ + "firefox-xdg-support.diff" + ]; + } + + "/firefox-xdg-support.diff") + ]; }); } ) ]; }; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/nautilus.nix b/nixos/packages/overlays/nautilus.nix index c3fe336..b377162 100644 --- a/nixos/packages/overlays/nautilus.nix +++ b/nixos/packages/overlays/nautilus.nix @@ -1,32 +1,35 @@ -{ ... }: - -{ +{...}: { nixpkgs = { overlays = [ - (final: prev: - { - gnome = prev.gnome // { - # Restore Nautilus's typeahead ability - # .patch file from from aur/nautilus-typeahead - nautilus = prev.gnome.nautilus.overrideAttrs (old: { - patches = (old.patches or []) ++ [ - (prev.fetchgit { - url = "https://aur.archlinux.org/nautilus-typeahead.git"; - ### 44.2 - rev = "dc295b3191818d16550400e645e108d9e265baa3"; - hash = "sha256-jCZcmPvmEodDzv+HHp7s+azLKVIno1ue72dQO+WbENU="; - ### 45.0 - #rev = "26776193230b0d56f714d31d79c5e716ac413a26"; - #hash = "sha256-hVWZCQwHzL4j+FcgsEhuumhBkl6d8IIbcYddh08QMJM="; - sparseCheckout = [ - "nautilus-restore-typeahead.patch" + ( + final: prev: { + gnome = + prev.gnome + // { + # Restore Nautilus's typeahead ability + # .patch file from from aur/nautilus-typeahead + nautilus = prev.gnome.nautilus.overrideAttrs (old: { + patches = + (old.patches or []) + ++ [ + (prev.fetchgit { + url = "https://aur.archlinux.org/nautilus-typeahead.git"; + ### 44.2 + rev = "dc295b3191818d16550400e645e108d9e265baa3"; + hash = "sha256-jCZcmPvmEodDzv+HHp7s+azLKVIno1ue72dQO+WbENU="; + ### 45.0 + #rev = "26776193230b0d56f714d31d79c5e716ac413a26"; + #hash = "sha256-hVWZCQwHzL4j+FcgsEhuumhBkl6d8IIbcYddh08QMJM="; + sparseCheckout = [ + "nautilus-restore-typeahead.patch" + ]; + } + + "/nautilus-restore-typeahead.patch") ]; - } + "/nautilus-restore-typeahead.patch") - ]; - }); - }; + }); + }; } ) ]; }; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/prismlauncher.nix b/nixos/packages/overlays/prismlauncher.nix index 47ee61d..00cefd6 100644 --- a/nixos/packages/overlays/prismlauncher.nix +++ b/nixos/packages/overlays/prismlauncher.nix @@ -1,22 +1,22 @@ -{ ... }: - -{ +{...}: { nixpkgs = { overlays = [ - (final: prev: - { + ( + final: prev: { prismlauncher = prev.prismlauncher.overrideAttrs (old: { # Offline mode for Prism Launcher # .patch file from some Misterio77's nix-config repo - patches = (old.patches or []) ++ [ - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/Misterio77/nix-config/main/overlays/offline-mode-prism-launcher.diff"; - hash = "sha256-vMcAvhD0Ms4Tvwpzs/YfORc8ki7MNMurdJJ/yswfxFM="; - }) - ]; + patches = + (old.patches or []) + ++ [ + (prev.fetchpatch { + url = "https://raw.githubusercontent.com/Misterio77/nix-config/main/overlays/offline-mode-prism-launcher.diff"; + hash = "sha256-vMcAvhD0Ms4Tvwpzs/YfORc8ki7MNMurdJJ/yswfxFM="; + }) + ]; }); } ) ]; }; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/sway.nix b/nixos/packages/overlays/sway.nix index 324b936..36935dc 100644 --- a/nixos/packages/overlays/sway.nix +++ b/nixos/packages/overlays/sway.nix @@ -1,22 +1,22 @@ -{ ... }: - -{ +{...}: { nixpkgs = { overlays = [ - (final: prev: - { + ( + final: prev: { sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: { # Add input panel to sway # .patch file from https://github.com/swaywm/sway/pull/7226 - patches = (old.patches or []) ++ [ - (prev.fetchurl { - url = "https://github.com/swaywm/sway/commit/d1c6e44886d1047b3aa6ff6aaac383eadd72f36a.patch"; - sha256 = "sha256-UnNnAgXVBPjhF7ytVpGEStbJK1RQuRIci5PgGEvLp80="; - }) - ]; + patches = + (old.patches or []) + ++ [ + (prev.fetchurl { + url = "https://github.com/swaywm/sway/commit/d1c6e44886d1047b3aa6ff6aaac383eadd72f36a.patch"; + sha256 = "sha256-UnNnAgXVBPjhF7ytVpGEStbJK1RQuRIci5PgGEvLp80="; + }) + ]; }); } ) ]; }; -} \ No newline at end of file +} diff --git a/nixos/packages/overlays/ydict.nix b/nixos/packages/overlays/ydict.nix index deb9797..0b9a687 100644 --- a/nixos/packages/overlays/ydict.nix +++ b/nixos/packages/overlays/ydict.nix @@ -1,23 +1,23 @@ -{ ... }: - -{ +{...}: { nixpkgs = { overlays = [ - (final: prev: - { + ( + final: prev: { ydict = prev.ydict.overrideAttrs (old: { # Let ydict follow XDG # .patch file from https://github.com/TimothyYe/ydict/pull/32 # yes i know theres `YDICT_DB` - patches = (old.patches or []) ++ [ - (prev.fetchurl { - url = "https://github.com/TimothyYe/ydict/commit/5bb0bc3f44922893a17993e295bbcac82c4a0170.patch"; - sha256 = "sha256-Wg7p7dzosbbghSOTDB7duLL4ecmMjQd5trNXqHh29cU="; - }) - ]; + patches = + (old.patches or []) + ++ [ + (prev.fetchurl { + url = "https://github.com/TimothyYe/ydict/commit/5bb0bc3f44922893a17993e295bbcac82c4a0170.patch"; + sha256 = "sha256-Wg7p7dzosbbghSOTDB7duLL4ecmMjQd5trNXqHh29cU="; + }) + ]; }); } ) ]; }; -} \ No newline at end of file +} diff --git a/nixos/packages/unfree/default.nix b/nixos/packages/unfree/default.nix index 1d194ec..756f8b4 100644 --- a/nixos/packages/unfree/default.nix +++ b/nixos/packages/unfree/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./unfree.nix ]; -} \ No newline at end of file +} diff --git a/nixos/packages/unfree/unfree.nix b/nixos/packages/unfree/unfree.nix index f96d720..f688d58 100755 --- a/nixos/packages/unfree/unfree.nix +++ b/nixos/packages/unfree/unfree.nix @@ -1,22 +1,20 @@ -{ lib, ... }: +{lib, ...}: { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "nvidia-x11" # ../hardware/gpu/nvidia.nix + #"nvidia-settings" + #"nvidia-persistenced" + "xow_dongle-firmware" # ../hardware/accessories/xbox.nix + "facetimehd-firmware" # ../hardware/hardwares/imac-2017.nix - -{ - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "nvidia-x11" # ../hardware/gpu/nvidia.nix - #"nvidia-settings" - #"nvidia-persistenced" - "xow_dongle-firmware" # ../hardware/accessories/xbox.nix - "facetimehd-firmware" # ../hardware/hardwares/imac-2017.nix - - "osu-lazer-bin-2023.1026.0" # what? - "spotify" - "steam" - "steam-original" - #"discord" - #"google-chrome" - #"lunar-client" - #"microsoft-edge-stable" - #"qq" - ]; + "osu-lazer-bin-2023.1026.0" # what? + "spotify" + "steam" + "steam-original" + #"discord" + #"google-chrome" + #"lunar-client" + #"microsoft-edge-stable" + #"qq" + ]; } diff --git a/nixos/power-management/cpu-governor.nix b/nixos/power-management/cpu-governor.nix index 51e45ad..94d5f79 100644 --- a/nixos/power-management/cpu-governor.nix +++ b/nixos/power-management/cpu-governor.nix @@ -1,5 +1,3 @@ -{ ... }: - -{ +{...}: { powerManagement.cpuFreqGovernor = "performance"; -} \ No newline at end of file +} diff --git a/nixos/power-management/default.nix b/nixos/power-management/default.nix index 0a382fd..9f902d5 100644 --- a/nixos/power-management/default.nix +++ b/nixos/power-management/default.nix @@ -1,10 +1,8 @@ -{ ... }: - -{ +{...}: { imports = [ ./cpu-governor.nix ./system76-scheduler.nix #./tlp.nix # ] Conflicts with each other, only choose one ./power-profiles-daemon.nix # ] ]; -} \ No newline at end of file +} diff --git a/nixos/power-management/power-profiles-daemon.nix b/nixos/power-management/power-profiles-daemon.nix index 302367d..3ce5ad7 100644 --- a/nixos/power-management/power-profiles-daemon.nix +++ b/nixos/power-management/power-profiles-daemon.nix @@ -1,5 +1,3 @@ -{ ... }: - -{ +{...}: { services.power-profiles-daemon.enable = true; -} \ No newline at end of file +} diff --git a/nixos/power-management/system76-scheduler.nix b/nixos/power-management/system76-scheduler.nix index 7ef73c5..3dca8b6 100644 --- a/nixos/power-management/system76-scheduler.nix +++ b/nixos/power-management/system76-scheduler.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # Auto-configure CFS and process priorities for improved desktop responsiveness services.system76-scheduler.enable = true; -} \ No newline at end of file +} diff --git a/nixos/power-management/tlp.nix b/nixos/power-management/tlp.nix index c86255b..b8b4c73 100644 --- a/nixos/power-management/tlp.nix +++ b/nixos/power-management/tlp.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.tlp = { enable = true; settings = { @@ -16,4 +14,4 @@ CPU_MAX_PERF_ON_BAT = 20; }; }; -} \ No newline at end of file +} diff --git a/nixos/presets/core.nix b/nixos/presets/core.nix index f333ba9..0c358c9 100755 --- a/nixos/presets/core.nix +++ b/nixos/presets/core.nix @@ -1,5 +1,4 @@ -{ config, ... }: - +{config, ...}: # Imported by default, check out ./desktop.nix or ./server.nix { imports = [ diff --git a/nixos/presets/core/legacy-boot.nix b/nixos/presets/core/legacy-boot.nix index 99510a8..5ba523f 100755 --- a/nixos/presets/core/legacy-boot.nix +++ b/nixos/presets/core/legacy-boot.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { boot.loader = { grub.enable = true; grub.device = "/dev/vda"; # or "nodev" for efi only diff --git a/nixos/presets/core/networkmanager-iwd.nix b/nixos/presets/core/networkmanager-iwd.nix index 114dedd..8db8d69 100644 --- a/nixos/presets/core/networkmanager-iwd.nix +++ b/nixos/presets/core/networkmanager-iwd.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { networking.networkmanager = { enable = true; wifi.backend = "iwd"; diff --git a/nixos/presets/core/networkmanager.nix b/nixos/presets/core/networkmanager.nix index cfdf2d4..e0cfbd5 100644 --- a/nixos/presets/core/networkmanager.nix +++ b/nixos/presets/core/networkmanager.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { networking = { networkmanager = { enable = true; diff --git a/nixos/presets/core/no-bootloader-menu.nix b/nixos/presets/core/no-bootloader-menu.nix index 417db06..ce3baa9 100644 --- a/nixos/presets/core/no-bootloader-menu.nix +++ b/nixos/presets/core/no-bootloader-menu.nix @@ -1,5 +1,3 @@ -{ ... }: - -{ +{...}: { boot.loader.timeout = 0; -} \ No newline at end of file +} diff --git a/nixos/presets/core/systemd-resolved.nix b/nixos/presets/core/systemd-resolved.nix index 4fbceb4..36a17e1 100644 --- a/nixos/presets/core/systemd-resolved.nix +++ b/nixos/presets/core/systemd-resolved.nix @@ -1,11 +1,9 @@ -{ ... }: - -{ +{...}: { ### systemd-resolved services.resolved = { enable = true; dnssec = "true"; - domains = [ "~." ]; + domains = ["~."]; fallbackDns = [ "8.8.8.8#dns.google" "8.8.4.4#dns.google" @@ -17,4 +15,4 @@ ### NetworkManager integration networking.networkmanager.dns = "systemd-resolved"; -} \ No newline at end of file +} diff --git a/nixos/presets/desktop.nix b/nixos/presets/desktop.nix index 267a49c..198243b 100644 --- a/nixos/presets/desktop.nix +++ b/nixos/presets/desktop.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { imports = [ ./core.nix ../packages/graphical ]; boot.kernelPackages = pkgs.linuxPackages_zen; -} \ No newline at end of file +} diff --git a/nixos/presets/desktop/flatpak.nix b/nixos/presets/desktop/flatpak.nix index d7f2035..8dad920 100755 --- a/nixos/presets/desktop/flatpak.nix +++ b/nixos/presets/desktop/flatpak.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services.flatpak.enable = true; services.gnome.core-utilities.enable = false; # remove default gnome pkgs, for example, gnome-music, to use flatpaks instead @@ -35,4 +33,4 @@ # "/usr/share/icons" = mkRoSymBind (/run/current-system/sw/share/icons); # "/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts"); #}; -} \ No newline at end of file +} diff --git a/nixos/presets/desktop/gaming.nix b/nixos/presets/desktop/gaming.nix index 911d8eb..321c918 100644 --- a/nixos/presets/desktop/gaming.nix +++ b/nixos/presets/desktop/gaming.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.gamemode = { enable = true; settings.custom = { @@ -8,4 +6,4 @@ end = "${pkgs.libnotify}/bin/notify-send 'GameMode Deactivated' 'GameMode Deactivated. Back to normal mode. ⏹️'"; }; }; -} \ No newline at end of file +} diff --git a/nixos/presets/desktop/virtualbox.nix b/nixos/presets/desktop/virtualbox.nix index 659f669..5817b86 100644 --- a/nixos/presets/desktop/virtualbox.nix +++ b/nixos/presets/desktop/virtualbox.nix @@ -1,5 +1,3 @@ -{ ... }: - -{ +{...}: { virtualisation.virtualbox.host.enable = true; -} \ No newline at end of file +} diff --git a/nixos/presets/desktop/wayland.nix b/nixos/presets/desktop/wayland.nix index 5730bba..5a490a7 100755 --- a/nixos/presets/desktop/wayland.nix +++ b/nixos/presets/desktop/wayland.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ - programs.xwayland.enable = true; # enable XWayland +{...}: { + programs.xwayland.enable = true; # enable XWayland hardware.nvidia.nvidiaSettings = false; # NVIDIA settings menu, wont do anything on wayland environment.sessionVariables = { - "NIXOS_OZONE_WL" = "1"; # let electron applications use wayland + "NIXOS_OZONE_WL" = "1"; # let electron applications use wayland }; -} \ No newline at end of file +} diff --git a/nixos/presets/server.nix b/nixos/presets/server.nix index 3ff7449..4349936 100755 --- a/nixos/presets/server.nix +++ b/nixos/presets/server.nix @@ -1,9 +1,8 @@ -{ ... }: - +{...}: # no i dont actually own a server { imports = [ ./core.nix ]; boot.plymouth.enable = false; -} \ No newline at end of file +} diff --git a/nixos/specialisation/default.nix b/nixos/specialisation/default.nix index 5e5b9c6..4e1fa54 100644 --- a/nixos/specialisation/default.nix +++ b/nixos/specialisation/default.nix @@ -1,16 +1,14 @@ -{ ... }: - -{ +{...}: { specialisation = { bspwm.configuration = { - system.nixos.tags = [ "bspwm" ]; + system.nixos.tags = ["bspwm"]; services.xserver = { displayManager.startx.enable = true; windowManager.bspwm.enable = true; }; }; plasma.configuration = { - system.nixos.tags = [ "plasma" ]; + system.nixos.tags = ["plasma"]; services.xserver = { desktopManager.plasma5.enable = true; displayManager.sddm = { @@ -20,4 +18,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/darwin/presets/core.nix b/users/guanranwang/darwin/presets/core.nix index 9867e55..e219d59 100644 --- a/users/guanranwang/darwin/presets/core.nix +++ b/users/guanranwang/darwin/presets/core.nix @@ -1,8 +1,6 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { users = { - knownUsers = [ "guanranwang" ]; + knownUsers = ["guanranwang"]; users."guanranwang" = { createHome = true; description = "Guanran Wang"; @@ -11,4 +9,4 @@ uid = 501; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/darwin/presets/core/proxy.nix b/users/guanranwang/darwin/presets/core/proxy.nix index 8175a15..c170bd1 100644 --- a/users/guanranwang/darwin/presets/core/proxy.nix +++ b/users/guanranwang/darwin/presets/core/proxy.nix @@ -1,5 +1,8 @@ -{ inputs, pkgs, ... }: - +{ + inputs, + pkgs, + ... +}: # README!!: # I HAVE NO IDEA HOW LAUNCHD DAEMON WORKS # USE AT YOUR OWN RISK @@ -8,7 +11,6 @@ # Remember to manually copy `config.yaml` to `/etc/clash-meta` # I have no idea how to get sops-nix working on darwin... # - { launchd.daemons."clash-meta" = { command = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta"; @@ -22,4 +24,4 @@ }; environment.etc."clash-meta/metacubexd".source = inputs.metacubexd; -} \ No newline at end of file +} diff --git a/users/guanranwang/darwin/presets/desktop.nix b/users/guanranwang/darwin/presets/desktop.nix index a9f86bc..d8bf550 100644 --- a/users/guanranwang/darwin/presets/desktop.nix +++ b/users/guanranwang/darwin/presets/desktop.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./core @@ -9,4 +7,4 @@ ]; ### home-manager home-manager.users.guanranwang = import ../../home-manager/darwin/presets/desktop.nix; # NOTE: using flakes -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/common/home.nix b/users/guanranwang/home-manager/common/home.nix index 47f6e65..d19f03d 100644 --- a/users/guanranwang/home-manager/common/home.nix +++ b/users/guanranwang/home-manager/common/home.nix @@ -1,6 +1,10 @@ -{ pkgs, config, lib, inputs, ... }: - { + pkgs, + config, + lib, + inputs, + ... +}: { home = { # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage @@ -35,7 +39,8 @@ "clock" = "tty-clock -5Ccs"; # proxy - "setproxy" = let proxy = "http://127.0.0.1:7890/"; + "setproxy" = let + proxy = "http://127.0.0.1:7890/"; in "export http_proxy=${proxy} https_proxy=${proxy} ftp_proxy=${proxy} rsync_proxy=${proxy}"; "unsetproxy" = "set -e http_proxy https_proxy all_proxy"; # fish syntax (?) }; @@ -70,15 +75,17 @@ { # should I use flake inputs / fetchurl? name = "sudo"; - src = (pkgs.fetchFromGitHub { - owner = "ohmyzsh"; - repo = "ohmyzsh"; - rev = "f8bf8f0029a475831ebfba0799975ede20e08742"; - hash = "sha256-9cJQQycahO+vo/YcAHjF+PVhsWxu7pa4MsK8Dgr69k0="; - sparseCheckout = [ - "plugins/sudo" - ]; - } + "/plugins/sudo"); + src = + pkgs.fetchFromGitHub { + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "f8bf8f0029a475831ebfba0799975ede20e08742"; + hash = "sha256-9cJQQycahO+vo/YcAHjF+PVhsWxu7pa4MsK8Dgr69k0="; + sparseCheckout = [ + "plugins/sudo" + ]; + } + + "/plugins/sudo"; } ]; initExtra = "zstyle ':fzf-tab:*' fzf-command sk"; @@ -125,7 +132,7 @@ alacritty = { enable = true; settings = { - import = [ "${inputs.tokyonight}/extras/alacritty/tokyonight_night.yml" ]; + import = ["${inputs.tokyonight}/extras/alacritty/tokyonight_night.yml"]; cursor.style = "beam"; env.WINIT_X11_SCALE_FACTOR = "1"; window = { @@ -176,31 +183,31 @@ enableExtensionUpdateCheck = false; enableUpdateCheck = false; userSettings = { - "diffEditor.ignoreTrimWhitespace" = false; - "editor.cursorBlinking" = "smooth"; - "editor.cursorSmoothCaretAnimation" = "on"; - "editor.fontFamily" = lib.mkDefault "Monospace"; - "editor.fontWeight" = 600; - "editor.tabSize" = 2; - "explorer.confirmDragAndDrop" = false; - "explorer.confirmDelete" = false; - "files.autoSave" = "onFocusChange"; - "files.trimTrailingWhitespace" = true; - "files.trimFinalNewlines" = true; - "security.workspace.trust.enabled" = false; - "telemetry.telemetryLevel" = "off"; - "terminal.external.osxExec" = "Alacritty.app"; - "terminal.integrated.cursorBlinking" = true; - "update.mode" = "none"; - "window.menuBarVisibility" = "toggle"; - "workbench.colorTheme" = "Tokyo Night"; + "diffEditor.ignoreTrimWhitespace" = false; + "editor.cursorBlinking" = "smooth"; + "editor.cursorSmoothCaretAnimation" = "on"; + "editor.fontFamily" = lib.mkDefault "Monospace"; + "editor.fontWeight" = 600; + "editor.tabSize" = 2; + "explorer.confirmDragAndDrop" = false; + "explorer.confirmDelete" = false; + "files.autoSave" = "onFocusChange"; + "files.trimTrailingWhitespace" = true; + "files.trimFinalNewlines" = true; + "security.workspace.trust.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "terminal.external.osxExec" = "Alacritty.app"; + "terminal.integrated.cursorBlinking" = true; + "update.mode" = "none"; + "window.menuBarVisibility" = "toggle"; + "workbench.colorTheme" = "Tokyo Night"; # Extensions ### Nix IDE - "nix.enableLanguageServer" = true; - "nix.serverPath" = "${pkgs.nil}/bin/nil"; + "nix.enableLanguageServer" = true; + "nix.serverPath" = "${pkgs.nil}/bin/nil"; ### GitLens - "gitlens.telemetry.enabled" = false; + "gitlens.telemetry.enabled" = false; }; extensions = with pkgs.vscode-extensions; [ ### LSP diff --git a/users/guanranwang/home-manager/darwin/dotfiles.nix b/users/guanranwang/home-manager/darwin/dotfiles.nix index b121188..0936198 100644 --- a/users/guanranwang/home-manager/darwin/dotfiles.nix +++ b/users/guanranwang/home-manager/darwin/dotfiles.nix @@ -1,15 +1,12 @@ -{ ... }: - -let +{...}: let configPath = ../common/dotfiles/config; #dataPath = ../common/dotfiles/data; #binPath = ../common/dotfiles/bin; -in -{ +in { xdg.configFile = { "fish" = { source = "${configPath}/fish"; recursive = true; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/darwin/home.nix b/users/guanranwang/home-manager/darwin/home.nix index 0b8893b..8ffd344 100644 --- a/users/guanranwang/home-manager/darwin/home.nix +++ b/users/guanranwang/home-manager/darwin/home.nix @@ -1,6 +1,9 @@ -{ config, pkgs, lib, ... }: - { + config, + pkgs, + lib, + ... +}: { home = { username = "guanranwang"; homeDirectory = "/Users/guanranwang"; @@ -14,25 +17,28 @@ paths = config.home.packages; pathsToLink = "/Applications"; }; - in lib.hm.dag.entryAfter [ "writeBoundary" ] '' - toDir="$HOME/Applications/Home Manager Trampolines" - fromDir="${apps}/Applications/" - rm -rf "$toDir" - mkdir "$toDir" - ( - cd "$fromDir" - for app in *.app; do - /usr/bin/osacompile -o "$toDir/$app" -e 'do shell script "open '$fromDir/$app'"' - done - ) - ''; - setSystemProxy = let networksetup = /usr/sbin/networksetup; - in lib.hm.dag.entryAfter ["writeBoundary"] '' - ${networksetup} -setwebproxystate "Wi-fi" on - ${networksetup} -setwebproxy "Wi-fi" 127.0.0.1 7890 - ${networksetup} -setwebproxystate "Ethernet" on - ${networksetup} -setwebproxy "Ethernet" 127.0.0.1 7890 - ''; + in + lib.hm.dag.entryAfter ["writeBoundary"] '' + toDir="$HOME/Applications/Home Manager Trampolines" + fromDir="${apps}/Applications/" + rm -rf "$toDir" + mkdir "$toDir" + ( + cd "$fromDir" + for app in *.app; do + /usr/bin/osacompile -o "$toDir/$app" -e 'do shell script "open '$fromDir/$app'"' + done + ) + ''; + setSystemProxy = let + networksetup = /usr/sbin/networksetup; + in + lib.hm.dag.entryAfter ["writeBoundary"] '' + ${networksetup} -setwebproxystate "Wi-fi" on + ${networksetup} -setwebproxy "Wi-fi" 127.0.0.1 7890 + ${networksetup} -setwebproxystate "Ethernet" on + ${networksetup} -setwebproxy "Ethernet" 127.0.0.1 7890 + ''; }; packages = with pkgs; [ @@ -57,7 +63,6 @@ ydict nix-output-monitor - ## GUI ### Music spotify @@ -95,4 +100,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/darwin/presets/desktop.nix b/users/guanranwang/home-manager/darwin/presets/desktop.nix index 7f7fb58..b820943 100644 --- a/users/guanranwang/home-manager/darwin/presets/desktop.nix +++ b/users/guanranwang/home-manager/darwin/presets/desktop.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ +{...}: { imports = [ ../../common/home.nix ../home.nix ../dotfiles.nix ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix b/users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix index 20bf459..218f086 100644 --- a/users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix +++ b/users/guanranwang/home-manager/darwin/presets/desktop/gaming.nix @@ -1,7 +1,5 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { home.packages = with pkgs; [ prismlauncher ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/dotfiles.nix b/users/guanranwang/home-manager/nixos/dotfiles.nix index 0eabacd..8824019 100644 --- a/users/guanranwang/home-manager/nixos/dotfiles.nix +++ b/users/guanranwang/home-manager/nixos/dotfiles.nix @@ -1,12 +1,9 @@ -{ ... }: - -let +{...}: let homePath = ../common/dotfiles; binPath = ../common/dotfiles/bin; configPath = ../common/dotfiles/config; dataPath = ../common/dotfiles/data; -in -{ +in { xdg.configFile = { "foot" = { source = "${configPath}/foot"; @@ -74,4 +71,4 @@ in recursive = true; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/home.nix b/users/guanranwang/home-manager/nixos/home.nix index 5b650d9..0e33608 100644 --- a/users/guanranwang/home-manager/nixos/home.nix +++ b/users/guanranwang/home-manager/nixos/home.nix @@ -1,141 +1,145 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { home = { username = "guanranwang"; homeDirectory = "/home/guanranwang"; - packages = (with pkgs; [ - # x11 + wayland - rofi-wayland - rofi-power-menu - dunst - pamixer - brightnessctl - playerctl - #networkmanagerapplet - pavucontrol + packages = + (with pkgs; [ + # x11 + wayland + rofi-wayland + rofi-power-menu + dunst + pamixer + brightnessctl + playerctl + #networkmanagerapplet + pavucontrol - # wayland - wl-clipboard - cliphist - swaylock-effects - grim - slurp - swappy - #udiskie - swww - mpvpaper - libnotify - jq + # wayland + wl-clipboard + cliphist + swaylock-effects + grim + slurp + swappy + #udiskie + swww + mpvpaper + libnotify + jq - # x11 - #polybar - #picom - #feh - #flameshot + # x11 + #polybar + #picom + #feh + #flameshot + # gui + gparted + timeshift + mpv + spicetify-cli + ### matrix + #fluffychat + element-desktop + cinny-desktop + #nheko - # gui - gparted - timeshift - mpv - spicetify-cli + ### music + easyeffects + spotify + yesplaymusic + amberol + netease-cloud-music-gtk - ### matrix - #fluffychat - element-desktop - cinny-desktop - #nheko + ### misc + bitwarden + #discord + #qq + tuba + mousai + protonup-qt + piper + telegram-desktop + qbittorrent + gradience + dippi + obs-studio + gnome.seahorse + gnome.eog + gnome.file-roller + gnome.gnome-weather + gnome.gnome-calculator + gnome.dconf-editor - ### music - easyeffects - spotify - yesplaymusic - amberol - netease-cloud-music-gtk + # TUI + cava + joshuto # rs + bottom + helix + skim + bat - ### misc - bitwarden - #discord - #qq - tuba - mousai - protonup-qt - piper - telegram-desktop - qbittorrent - gradience - dippi - obs-studio - gnome.seahorse - gnome.eog - gnome.file-roller - gnome.gnome-weather - gnome.gnome-calculator - gnome.dconf-editor + # cli + #fastfetch + wget + sops + skim + ydict + nix-output-monitor + zoxide # rs + trashy + eza + ripgrep + fd + freshfetch + hyperfine - # TUI - cava - joshuto # rs - bottom - helix - skim - bat + # lsp + nil + gopls + libclang - # cli - #fastfetch - wget - sops - skim - ydict - nix-output-monitor - zoxide # rs - trashy - eza - ripgrep - fd - freshfetch - hyperfine + # themes + tela-icon-theme + tela-circle-icon-theme + papirus-icon-theme + adw-gtk3 + ]) + ++ (with pkgs.gnome; [ + # GNOME + nautilus + zenity - # lsp - nil - gopls - libclang - - # themes - tela-icon-theme - tela-circle-icon-theme - papirus-icon-theme - adw-gtk3 - ]) ++ (with pkgs.gnome; [ - # GNOME - nautilus - zenity - - # GNOME only - #gnome-tweaks - #gnome-software - #gnome-shell-extensions - ]) ++ (with pkgs.gnomeExtensions; [ - # GNOME extensions - arcmenu - appindicator - blur-my-shell - caffeine - dash-to-panel - dash-to-dock - gamemode # outdated - just-perfection - kimpanel - ]) ++ (with pkgs.fishPlugins; [ - autopair - done - #tide - sponge - puffer - ]); + # GNOME only + #gnome-tweaks + #gnome-software + #gnome-shell-extensions + ]) + ++ (with pkgs.gnomeExtensions; [ + # GNOME extensions + arcmenu + appindicator + blur-my-shell + caffeine + dash-to-panel + dash-to-dock + gamemode # outdated + just-perfection + kimpanel + ]) + ++ (with pkgs.fishPlugins; [ + autopair + done + #tide + sponge + puffer + ]); pointerCursor = { gtk.enable = true; @@ -279,7 +283,6 @@ "layout.css.grid-template-masonry-value.enabled" = true; "dom.enable_web_task_scheduling" = true; - ### SECTION: SECUREFOX # TRACKING PROTECTION "urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com"; @@ -320,7 +323,6 @@ "permissions.default.desktop-notification" = 2; "dom.push.enabled" = false; - ### SECTION: PESKYFOX ### MOZILLA UI "layout.css.prefers-color-scheme.content-override" = 2; @@ -357,7 +359,6 @@ "browser.bookmarks.openInTabClosesMenu" = false; "findbar.highlightAll" = true; - ### SECTION: SMOOTHFOX "apz.overscroll.enabled" = true; "general.smoothScroll" = true; @@ -381,18 +382,18 @@ # https://github.com/nix-community/home-manager/issues/2216 # https://github.com/nix-community/home-manager/issues/2585 extensions = [ - { id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin - { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } # sponsorblock - { id = "icallnadddjmdinamnolclfjanhfoafe"; } # fastforward - { id = "dbepggeogbaibhgnhhndojpepiihcmeb"; } # vimium - { id = "nngceckbapebfimnlniiiahkandclblb"; } # bitwarden - { id = "gebbhagfogifgggkldgodflihgfeippi"; } # return youtube dislike - { id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; } # dark reader - { id = "njdfdhgcmkocbgbhcioffdbicglldapd"; } # localcdn - { id = "hipekcciheckooncpjeljhnekcoolahp"; } # tabliss - { id = "bgfofngpplpmpijncjegfdgilpgamhdk"; } # modern scrollbar - { id = "ajhmfdgkijocedmfjonnpjfojldioehi"; } # privacy pass - { id = "hkgfoiooedgoejojocmhlaklaeopbecg"; } # picture in picture + {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} # ublock origin + {id = "mnjggcdmjocbbbhaepdhchncahnbgone";} # sponsorblock + {id = "icallnadddjmdinamnolclfjanhfoafe";} # fastforward + {id = "dbepggeogbaibhgnhhndojpepiihcmeb";} # vimium + {id = "nngceckbapebfimnlniiiahkandclblb";} # bitwarden + {id = "gebbhagfogifgggkldgodflihgfeippi";} # return youtube dislike + {id = "eimadpbcbfnmbkopoojfekhnkhdbieeh";} # dark reader + {id = "njdfdhgcmkocbgbhcioffdbicglldapd";} # localcdn + {id = "hipekcciheckooncpjeljhnekcoolahp";} # tabliss + {id = "bgfofngpplpmpijncjegfdgilpgamhdk";} # modern scrollbar + {id = "ajhmfdgkijocedmfjonnpjfojldioehi";} # privacy pass + {id = "hkgfoiooedgoejojocmhlaklaeopbecg";} # picture in picture #{ id = "fnaicdffflnofjppbagibeoednhnbjhg"; } # floccus bookmark sync #{ id = "jaoafjdoijdconemdmodhbfpianehlon"; } # skip redirect #{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # tampermonkey diff --git a/users/guanranwang/home-manager/nixos/i18n.nix b/users/guanranwang/home-manager/nixos/i18n.nix index 01271c7..660d1c2 100644 --- a/users/guanranwang/home-manager/nixos/i18n.nix +++ b/users/guanranwang/home-manager/nixos/i18n.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # Chinese IME i18n.inputMethod = { enabled = "fcitx5"; @@ -20,4 +18,4 @@ #QT_IM_MODULE = "fcitx"; #XMODIFIERS = "@im=fcitx"; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/presets/desktop.nix b/users/guanranwang/home-manager/nixos/presets/desktop.nix index e0e5dd0..07270d5 100644 --- a/users/guanranwang/home-manager/nixos/presets/desktop.nix +++ b/users/guanranwang/home-manager/nixos/presets/desktop.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ../../common/home.nix ../home.nix @@ -12,4 +10,4 @@ ../xdg ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix b/users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix index 9d24915..f1dbdc1 100644 --- a/users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix +++ b/users/guanranwang/home-manager/nixos/presets/desktop/gaming.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { home.packages = with pkgs; [ steam #lunar-client @@ -12,4 +10,4 @@ enable = true; # TODO: add configuration, i have no idea how to display stuff with nix syntax }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/sway.nix b/users/guanranwang/home-manager/nixos/sway.nix index ca47918..475cf20 100644 --- a/users/guanranwang/home-manager/nixos/sway.nix +++ b/users/guanranwang/home-manager/nixos/sway.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { programs.fish.loginShellInit = '' if test -z "$Display" -a "$XDG_VTNR" = 1 exec sway @@ -9,7 +11,7 @@ wayland.windowManager.sway = { enable = true; - extraOptions = [ "--unsupported-gpu" "-D" "noscanout" ]; + extraOptions = ["--unsupported-gpu" "-D" "noscanout"]; wrapperFeatures.gtk = true; systemd = { enable = true; @@ -43,29 +45,27 @@ ### Autostarts startup = [ - { command = "${pkgs.swww}/bin/swww init"; } - { command = "${pkgs.waybar}/bin/waybar"; } - { command = "${pkgs.wl-clipboard}/bin/wl-paste --watch cliphist store"; } + {command = "${pkgs.swww}/bin/swww init";} + {command = "${pkgs.waybar}/bin/waybar";} + {command = "${pkgs.wl-clipboard}/bin/wl-paste --watch cliphist store";} #{ command = "${pkgs.udiskie}/bin/udiskie --smart-tray"; } ]; ### Keybinds modifier = "Mod4"; modes = {}; - keybindings = - let - modifier = config.wayland.windowManager.sway.config.modifier; - setBrightness = "/home/guanranwang/.local/bin/wrapped-brightnessctl"; - setVolume = "/home/guanranwang/.local/bin/wrapped-pamixer"; - screenshot = "/home/guanranwang/.local/bin/wrapped-grim"; - in - { + keybindings = let + modifier = config.wayland.windowManager.sway.config.modifier; + setBrightness = "/home/guanranwang/.local/bin/wrapped-brightnessctl"; + setVolume = "/home/guanranwang/.local/bin/wrapped-pamixer"; + screenshot = "/home/guanranwang/.local/bin/wrapped-grim"; + in { ### Sway itself # Window - "${modifier}+s" = "split toggle"; - "${modifier}+v" = "floating toggle"; - "${modifier}+f" = "fullscreen"; - "${modifier}+q" = "kill"; + "${modifier}+s" = "split toggle"; + "${modifier}+v" = "floating toggle"; + "${modifier}+f" = "fullscreen"; + "${modifier}+q" = "kill"; "${modifier}+Shift+e" = "exec ${pkgs.sway}/bin/swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' '${pkgs.sway}/bin/swaymsg exit'"; # Move around @@ -98,34 +98,34 @@ ### Execute other stuff # Launch applications - "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config. terminal}"; - "${modifier}+w" = "exec ${pkgs.xdg-utils}/bin/xdg-open http:"; - "${modifier}+e" = "exec ${pkgs.xdg-utils}/bin/xdg-open ~"; + "${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}"; + "${modifier}+w" = "exec ${pkgs.xdg-utils}/bin/xdg-open http:"; + "${modifier}+e" = "exec ${pkgs.xdg-utils}/bin/xdg-open ~"; # Rofi - "${modifier}+d" = "exec ${config.wayland.windowManager.sway.config. menu} -show drun -show-icons -icon-theme ${config.gtk.iconTheme.name}"; - "${modifier}+Shift+d" = "exec ${pkgs.cliphist}/bin/cliphist list | ${config. wayland.windowManager.sway.config.menu} -dmenu | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"; - "${modifier}+Shift+l" = "exec ${config.wayland.windowManager.sway.config. menu} -modi \"power-menu:rofi-power-menu --confirm=reboot/shutdown\" -show power-menu"; + "${modifier}+d" = "exec ${config.wayland.windowManager.sway.config.menu} -show drun -show-icons -icon-theme ${config.gtk.iconTheme.name}"; + "${modifier}+Shift+d" = "exec ${pkgs.cliphist}/bin/cliphist list | ${config.wayland.windowManager.sway.config.menu} -dmenu | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy"; + "${modifier}+Shift+l" = "exec ${config.wayland.windowManager.sway.config.menu} -modi \"power-menu:rofi-power-menu --confirm=reboot/shutdown\" -show power-menu"; # Screenshot - "${modifier}+Shift+s" = "exec ${screenshot} region"; - "${modifier}+Control+Shift+s" = "exec ${screenshot} region edit"; - "Print" = "exec ${screenshot} fullscreen"; - "Print+Control" = "exec ${screenshot} fullscreen edit"; + "${modifier}+Shift+s" = "exec ${screenshot} region"; + "${modifier}+Control+Shift+s" = "exec ${screenshot} region edit"; + "Print" = "exec ${screenshot} fullscreen"; + "Print+Control" = "exec ${screenshot} fullscreen edit"; # Fn keys - "XF86MonBrightnessUp" = "exec ${setBrightness} up"; + "XF86MonBrightnessUp" = "exec ${setBrightness} up"; "XF86MonBrightnessDown" = "exec ${setBrightness} down"; - "XF86AudioRaiseVolume" = "exec ${setVolume} up"; - "XF86AudioLowerVolume" = "exec ${setVolume} down"; - "XF86AudioMute" = "exec ${setVolume} mute"; - "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; - "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; - "XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop"; - "XF86AudioMedia" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioRaiseVolume" = "exec ${setVolume} up"; + "XF86AudioLowerVolume" = "exec ${setVolume} down"; + "XF86AudioMute" = "exec ${setVolume} mute"; + "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; + "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; + "XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop"; + "XF86AudioMedia" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; }; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/waybar.nix b/users/guanranwang/home-manager/nixos/waybar.nix index 44827f3..1ded08f 100644 --- a/users/guanranwang/home-manager/nixos/waybar.nix +++ b/users/guanranwang/home-manager/nixos/waybar.nix @@ -4,10 +4,10 @@ settings = { mainBar = { "layer" = "top"; - "modules-left" = [ "custom/launcher" "sway/workspaces" "gamemode" ]; - "modules-center" = [ "sway/window" ]; - "modules-right" = [ "tray" "pulseaudio" "battery" "clock" ]; - "custom/launcher" = { "format" = ""; }; + "modules-left" = ["custom/launcher" "sway/workspaces" "gamemode"]; + "modules-center" = ["sway/window"]; + "modules-right" = ["tray" "pulseaudio" "battery" "clock"]; + "custom/launcher" = {"format" = "";}; "gamemode" = { "format" = "{glyph} {count}"; "glyph" = "󰊴"; @@ -50,7 +50,7 @@ "phone" = ""; "portable" = ""; "car" = ""; - "default" = [ "" "" ]; + "default" = ["" ""]; }; "scroll-step" = 5; "on-click" = "pavucontrol"; @@ -64,7 +64,7 @@ "critical" = 15; }; "format" = "{capacity}% {icon}"; - "format-icons" = [ "" "" "" "" "" ]; + "format-icons" = ["" "" "" "" ""]; "max-length" = 25; }; "clock" = { @@ -72,15 +72,15 @@ "format" = "{:%a %b %d %I:%M %p} "; "tooltip-format" = "{calendar}"; "calendar" = { - "mode" = "month"; - "mode-mon-col" = 3; - "on-scroll" = -1; - "format"."today" = "{}"; + "mode" = "month"; + "mode-mon-col" = 3; + "on-scroll" = -1; + "format"."today" = "{}"; }; "actions" = { - "on-click-right" = "mode"; - "on-scroll-up" = "shift_down"; - "on-scroll-down" = "shift_up"; + "on-click-right" = "mode"; + "on-scroll-up" = "shift_down"; + "on-scroll-down" = "shift_up"; }; }; "cava" = { @@ -92,7 +92,7 @@ "bar_delimiter" = 0; #"monstercat" = false; #"waves" = false; - "format-icons" = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; + "format-icons" = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; "actions"."on-click-right" = "mode"; }; }; @@ -179,4 +179,4 @@ } ''; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/xdg/default.nix b/users/guanranwang/home-manager/nixos/xdg/default.nix index f47c463..c893b86 100644 --- a/users/guanranwang/home-manager/nixos/xdg/default.nix +++ b/users/guanranwang/home-manager/nixos/xdg/default.nix @@ -1,9 +1,7 @@ -{ ... }: - -{ +{...}: { imports = [ ./xdg.nix ./xdg-mime.nix ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/home-manager/nixos/xdg/xdg-mime.nix b/users/guanranwang/home-manager/nixos/xdg/xdg-mime.nix index 53c4cd4..8331541 100644 --- a/users/guanranwang/home-manager/nixos/xdg/xdg-mime.nix +++ b/users/guanranwang/home-manager/nixos/xdg/xdg-mime.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { # Default application associstions, ro. xdg.mimeApps = { enable = true; diff --git a/users/guanranwang/home-manager/nixos/xdg/xdg.nix b/users/guanranwang/home-manager/nixos/xdg/xdg.nix index 8c6af7c..05fccec 100644 --- a/users/guanranwang/home-manager/nixos/xdg/xdg.nix +++ b/users/guanranwang/home-manager/nixos/xdg/xdg.nix @@ -1,6 +1,4 @@ -{ config, ... }: - -{ +{config, ...}: { xdg.enable = true; home = { @@ -13,4 +11,4 @@ "irssi" = "irssi -- config=${config.xdg.configHome}/irssi/config -- home=${config.xdg.dataHome}/irssi"; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/networking/default.nix b/users/guanranwang/nixos/networking/default.nix index 0bbacfc..5057fd7 100644 --- a/users/guanranwang/nixos/networking/default.nix +++ b/users/guanranwang/nixos/networking/default.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ +{...}: { imports = [ ./dns.nix ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/networking/dns.nix b/users/guanranwang/nixos/networking/dns.nix index 5ff1976..9085cdf 100644 --- a/users/guanranwang/nixos/networking/dns.nix +++ b/users/guanranwang/nixos/networking/dns.nix @@ -1,6 +1,4 @@ -{ lib, ... }: - -{ +{lib, ...}: { networking.nameservers = lib.mkForce [ ### AliDNS "223.5.5.5" @@ -8,4 +6,4 @@ "2400:3200::1" "2400:3200:baba::1" ]; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/presets/core.nix b/users/guanranwang/nixos/presets/core.nix index e90d762..fd44081 100644 --- a/users/guanranwang/nixos/presets/core.nix +++ b/users/guanranwang/nixos/presets/core.nix @@ -1,14 +1,16 @@ -{ pkgs, config, ... }: - { + pkgs, + config, + ... +}: { users.users."guanranwang" = { isNormalUser = true; description = "Guanran Wang"; extraGroups = [ - "wheel" # administrator - "networkmanager" # access to networkmanager - "tss" # access to tpm devices - "vboxusers" # access to virtualbox + "wheel" # administrator + "networkmanager" # access to networkmanager + "tss" # access to tpm devices + "vboxusers" # access to virtualbox "nix-access-tokens" # access to github tokens ]; hashedPasswordFile = config.sops.secrets."hashed-passwd".path; @@ -16,8 +18,6 @@ packages = []; }; - - imports = [ ### Overrides (overrides global config) ../networking @@ -30,10 +30,10 @@ users.groups."nix-access-tokens" = {}; sops = { defaultSopsFile = ../../secrets/secrets.yaml; - age.sshKeyPaths = [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ]; + age.sshKeyPaths = ["/nix/persist/system/etc/ssh/ssh_host_ed25519_key"]; gnupg.sshKeyPaths = []; secrets = { - "hashed-passwd".neededForUsers = true; # Hashed user password + "hashed-passwd".neededForUsers = true; # Hashed user password "wireless/home".path = "/var/lib/iwd/wangxiaobo.psk"; # Home wifi password "nix-access-tokens" = { group = config.users.groups."nix-access-tokens".name; @@ -41,4 +41,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/presets/core/clash-meta-client.nix b/users/guanranwang/nixos/presets/core/clash-meta-client.nix index 7168829..14e4842 100644 --- a/users/guanranwang/nixos/presets/core/clash-meta-client.nix +++ b/users/guanranwang/nixos/presets/core/clash-meta-client.nix @@ -1,9 +1,11 @@ -{ pkgs, config, inputs, ... }: - -let - etcDirectory = "clash-meta"; -in { + pkgs, + config, + inputs, + ... +}: let + etcDirectory = "clash-meta"; +in { imports = [ ../../../../../flakes/nixos/sops-nix.nix ]; @@ -12,7 +14,7 @@ in sops.secrets."clash-config" = { owner = config.users.users."clash-meta".name; group = config.users.groups."clash-meta".name; - restartUnits = [ "clash-meta.service" ]; + restartUnits = ["clash-meta.service"]; path = "/etc/${etcDirectory}/config.yaml"; }; @@ -29,15 +31,15 @@ in ### Proxy service systemd.services."clash-meta" = { description = "Clash.Meta Client"; - after = [ "network-online.target" ]; + after = ["network-online.target"]; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig = { Type = "simple"; WorkingDirectory = "/etc/${etcDirectory}"; - User = [ config.users.users."clash-meta".name ]; - Group = [ config.users.groups."clash-meta".name ]; + User = [config.users.users."clash-meta".name]; + Group = [config.users.groups."clash-meta".name]; ExecStart = "${pkgs.clash-meta}/bin/clash-meta -d /etc/${etcDirectory}"; Restart = "on-failure"; CapabilityBoundingSet = [ @@ -64,4 +66,4 @@ in # - clash-dashboard (buggy): # - https://clash.razord.top environment.etc."${etcDirectory}/metacubexd".source = inputs.metacubexd; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/presets/core/hysteria2-server.nix b/users/guanranwang/nixos/presets/core/hysteria2-server.nix index 0f5de3c..16f4fd3 100644 --- a/users/guanranwang/nixos/presets/core/hysteria2-server.nix +++ b/users/guanranwang/nixos/presets/core/hysteria2-server.nix @@ -1,25 +1,26 @@ -{ pkgs, config, ... }: - -let +{ + pkgs, + config, + ... +}: let etcDirectory = "hysteria"; port = 43956; -in -{ +in { imports = [ ../../../../../flakes/nixos/sops-nix.nix ]; ### Firewall networking.firewall = { - allowedTCPPorts = [ port 80 443 ]; - allowedUDPPorts = [ port 80 443 ]; + allowedTCPPorts = [port 80 443]; + allowedUDPPorts = [port 80 443]; }; #### sops-nix sops.secrets."hysteria-config" = { owner = config.users.users."hysteria".name; group = config.users.groups."hysteria".name; - restartUnits = [ "hysteria-server.service" ]; + restartUnits = ["hysteria-server.service"]; path = "/etc/${etcDirectory}/config.yaml"; }; @@ -33,15 +34,15 @@ in ### Proxy service systemd.services."hysteria-server" = { description = "Hysteria Server"; - after = [ "network.target" ]; + after = ["network.target"]; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig = { Type = "simple"; WorkingDirectory = "/etc/${etcDirectory}"; - User = [ config.users.users."hysteria".name ]; - Group = [ config.users.groups."hysteria".name ]; + User = [config.users.users."hysteria".name]; + Group = [config.users.groups."hysteria".name]; ExecStart = "${pkgs.hysteria}/bin/hysteria server --config /etc/${etcDirectory}/config.yaml"; Restart = "on-failure"; CapabilityBoundingSet = [ @@ -56,4 +57,4 @@ in ]; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/presets/core/juicity-server.nix b/users/guanranwang/nixos/presets/core/juicity-server.nix index bfed172..f4cb4d0 100644 --- a/users/guanranwang/nixos/presets/core/juicity-server.nix +++ b/users/guanranwang/nixos/presets/core/juicity-server.nix @@ -1,25 +1,26 @@ -{ pkgs, config, ... }: - -let +{ + pkgs, + config, + ... +}: let etcDirectory = "juicity"; port = "33829"; -in -{ +in { imports = [ ../../../../../flakes/nixos/sops-nix.nix ]; ### Firewall networking.firewall = { - allowedTCPPorts = [ port ]; - allowedUDPPorts = [ port ]; + allowedTCPPorts = [port]; + allowedUDPPorts = [port]; }; #### sops-nix sops.secrets."juicity-config" = { owner = config.users.users."juicity".name; group = config.users.groups."juicity".name; - restartUnits = [ "juicity-server.service" ]; + restartUnits = ["juicity-server.service"]; path = "/etc/${etcDirectory}/config.yaml"; }; @@ -33,15 +34,15 @@ in ### Proxy service systemd.services."juicity-server" = { description = "Juicity Server"; - after = [ "network.target" ]; + after = ["network.target"]; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig = { Type = "simple"; WorkingDirectory = "/etc/${etcDirectory}"; - User = [ config.users.users."juicity".name ]; - Group = [ config.users.groups."juicity".name ]; + User = [config.users.users."juicity".name]; + Group = [config.users.groups."juicity".name]; ExecStart = "${pkgs.juicity}/bin/juicity-server run -c /etc/${etcDirectory}/config.json"; Restart = "on-failure"; CapabilityBoundingSet = [ @@ -56,4 +57,4 @@ in ]; }; }; -} \ No newline at end of file +} diff --git a/users/guanranwang/nixos/presets/desktop.nix b/users/guanranwang/nixos/presets/desktop.nix index 9166e71..1189b5d 100644 --- a/users/guanranwang/nixos/presets/desktop.nix +++ b/users/guanranwang/nixos/presets/desktop.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { imports = [ ./core.nix @@ -11,4 +9,4 @@ ### home-manager home-manager.users.guanranwang = import ../../home-manager/nixos/presets/desktop.nix; -} \ No newline at end of file +}