flake: format everything using alejandra

This commit is contained in:
Guanran Wang 2023-11-04 18:14:42 +08:00
parent 811c92adb6
commit 98dbc82d27
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
117 changed files with 843 additions and 1024 deletions

View file

@ -1,8 +1,6 @@
{ ... }:
{
{...}: {
imports = [
./dns.nix
./proxy.nix
];
}
}

View file

@ -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"
];
}
}

View file

@ -1,9 +1,7 @@
{ ... }:
{
{...}: {
imports = [
./flake.nix
./nix.nix
./gc.nix
];
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
# Enable Flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = ["nix-command" "flakes"];
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
nix = {
### Auto hard linking
settings.auto-optimise-store = true;

View file

@ -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"

View file

@ -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 @@
'';
};
};
}
}

View file

@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
imports = [
./core.nix
./fonts.nix
./homebrew.nix
./unfree.nix
];
}
}

View file

@ -1,7 +1,5 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; })
(nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];})
];
}
}

View file

@ -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
];
};
}
}

View file

@ -1,9 +1,8 @@
{ lib, ... }:
{
{lib, ...}: {
# Allow unfree applications
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"spotify"
"keka"
];
}
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"spotify"
"keka"
];
}

View file

@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
imports = [
./networking
./nix
./packages
./system
];
}
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
homebrew.casks = [
"steam"
];
}
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
imports = [
./system.nix
];
}
}

View file

@ -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;
};
};
}
}

View file

@ -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": {

View file

@ -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

View file

@ -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 ???
};
}
}

View file

@ -1,7 +1,5 @@
{ inputs, ... }:
{
{inputs, ...}: {
nixpkgs.overlays = [
inputs.berberman.overlays.default
];
}
}

View file

@ -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";

View file

@ -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 ???
};
}
}

View file

@ -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;
};
}
}

View file

@ -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"
];
};
}
}

View file

@ -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";
};
}
}

View file

@ -1,5 +1,3 @@
{ inputs, ... }:
{
imports = [ inputs.sops-nix.nixosModules.sops ];
{inputs, ...}: {
imports = [inputs.sops-nix.nixosModules.sops];
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
imports = [
./hardware.nix
];
}
}

View file

@ -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";
}
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
imports = [
./hardware.nix
];
}
}

View file

@ -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

View file

@ -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
}
_module.args.disks = ["/dev/nvme0n1"]; # Disko
boot.initrd.systemd.enable = true; # LUKS TPM unlocking
}

View file

@ -1,9 +1,8 @@
{ ... }:
{...}:
# Logitech
{
hardware.logitech.wireless = {
enable = true;
enableGraphical = true;
};
}
}

View file

@ -1,9 +1,8 @@
{ ... }:
{...}:
# Xbox accessories
{
hardware = {
xone.enable = true;
xpadneo.enable = true;
};
}
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
boot.kernelModules = [ "kvm-intel" ];
{...}: {
boot.kernelModules = ["kvm-intel"];
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
}
}

View file

@ -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}"
];
}
}

View file

@ -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];
};
}
}

View file

@ -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
};
}
}

View file

@ -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;
};
};
}
}

View file

@ -1,5 +1,4 @@
{ lib, ... }:
{lib, ...}:
# Audio system (pipewire)
{
security.rtkit.enable = true;
@ -14,4 +13,4 @@
support32Bit = true;
};
};
}
}

View file

@ -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 = {

View file

@ -1,5 +1,4 @@
{ ... }:
{...}:
# OpenGL
{
hardware = {
@ -9,4 +8,4 @@
driSupport32Bit = true;
};
};
}
}

View file

@ -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

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
imports = [
./hardware.nix
];
}
}

View file

@ -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;
}
}

View file

@ -1,6 +1,4 @@
{ lib, ... }:
{
{lib, ...}: {
boot = {
consoleLogLevel = lib.mkDefault 3;
loader = {

View file

@ -1,9 +1,7 @@
{ ... }:
{
{...}: {
imports = [
./boot.nix
./plymouth.nix
./sysctl.nix
];
}
}

View file

@ -1,5 +1,3 @@
{ lib, ... }:
{
{lib, ...}: {
boot.plymouth.enable = lib.mkDefault true; # mkDefault for headless devices, check out server.nix
}
}

View file

@ -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";
};
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./dns.nix
./firewall.nix

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
networking.nameservers = [
### Google DNS
"8.8.8.8"
@ -8,4 +6,4 @@
"2001:4860:4860::8888"
"2001:4860:4860::8844"
];
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
networking.firewall = {
enable = true;
# Open ports in the firewall.

View file

@ -1,5 +1,3 @@
{ lib, ... }:
{
{lib, ...}: {
networking.wireless.iwd.enable = lib.mkDefault true;
}
}

View file

@ -1,9 +1,7 @@
{ ... }:
{
{...}: {
imports = [
./flake.nix
./nix.nix
./gc.nix
];
}
}

View file

@ -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;

View file

@ -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"];
};
};
}

View file

@ -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

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./hardware.nix # TODO: move this somewhere else?

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./display-server

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./display-server.nix
./input.nix

View file

@ -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;
};
};
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.xserver = {
libinput = {
enable = true;

View file

@ -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

View file

@ -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
'';
}
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
services = {
# GNOME applications
gvfs.enable = true; # nautilus

View file

@ -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 @@
};
};
};
}
}

View file

@ -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
};
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
hardware = {
enableRedistributableFirmware = true;
#enableAllFirmware = true;
@ -12,4 +10,4 @@
thermald.enable = true; # Prevents overheating
fwupd.enable = true; # Firmware update
};
}
}

View file

@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
imports = [
./nautilus.nix
./sway.nix
./prismlauncher.nix
./ydict.nix
];
}
}

View file

@ -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")
];
});
}
)
];
};
}
}

View file

@ -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")
];
});
};
});
};
}
)
];
};
}
}

View file

@ -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=";
})
];
});
}
)
];
};
}
}

View file

@ -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=";
})
];
});
}
)
];
};
}
}

View file

@ -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=";
})
];
});
}
)
];
};
}
}

View file

@ -1,7 +1,5 @@
{ ... }:
{
{...}: {
imports = [
./unfree.nix
];
}
}

View file

@ -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"
];
}

View file

@ -1,5 +1,3 @@
{ ... }:
{
{...}: {
powerManagement.cpuFreqGovernor = "performance";
}
}

View file

@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
imports = [
./cpu-governor.nix
./system76-scheduler.nix
#./tlp.nix # ] Conflicts with each other, only choose one
./power-profiles-daemon.nix # ]
];
}
}

View file

@ -1,5 +1,3 @@
{ ... }:
{
{...}: {
services.power-profiles-daemon.enable = true;
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
# Auto-configure CFS and process priorities for improved desktop responsiveness
services.system76-scheduler.enable = true;
}
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.tlp = {
enable = true;
settings = {
@ -16,4 +14,4 @@
CPU_MAX_PERF_ON_BAT = 20;
};
};
}
}

View file

@ -1,5 +1,4 @@
{ config, ... }:
{config, ...}:
# Imported by default, check out ./desktop.nix or ./server.nix
{
imports = [

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
boot.loader = {
grub.enable = true;
grub.device = "/dev/vda"; # or "nodev" for efi only

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
networking.networkmanager = {
enable = true;
wifi.backend = "iwd";

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
networking = {
networkmanager = {
enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{
{...}: {
boot.loader.timeout = 0;
}
}

View file

@ -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";
}
}

View file

@ -1,10 +1,8 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./core.nix
../packages/graphical
];
boot.kernelPackages = pkgs.linuxPackages_zen;
}
}

View file

@ -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");
#};
}
}

View file

@ -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. '";
};
};
}
}

View file

@ -1,5 +1,3 @@
{ ... }:
{
{...}: {
virtualisation.virtualbox.host.enable = true;
}
}

View file

@ -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
};
}
}

View file

@ -1,9 +1,8 @@
{ ... }:
{...}:
# no i dont actually own a server
{
imports = [
./core.nix
];
boot.plymouth.enable = false;
}
}

View file

@ -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 @@
};
};
};
}
}

View file

@ -1,8 +1,6 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
users = {
knownUsers = [ "guanranwang" ];
knownUsers = ["guanranwang"];
users."guanranwang" = {
createHome = true;
description = "Guanran Wang";
@ -11,4 +9,4 @@
uid = 501;
};
};
}
}

View file

@ -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;
}
}

View file

@ -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
}
}

View file

@ -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

View file

@ -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;
};
};
}
}

View file

@ -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 @@
};
};
};
}
}

View file

@ -1,9 +1,7 @@
{ ... }:
{
{...}: {
imports = [
../../common/home.nix
../home.nix
../dotfiles.nix
];
}
}

View file

@ -1,7 +1,5 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
prismlauncher
];
}
}

Some files were not shown because too many files have changed in this diff Show more