Compare commits

..

No commits in common. "71c309a2b0ba4b3b45228c7a5bd4b3c54dbc9df5" and "3b25f74fa1624279fcef5f83787c0f55cc7e7c62" have entirely different histories.

25 changed files with 721 additions and 59 deletions

View file

@ -11,6 +11,7 @@
imports = [ imports = [
./nix ./nix
./anti-features.nix ./anti-features.nix
./networking.nix
inputs.self.darwinModules.default inputs.self.darwinModules.default
inputs.home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager

View file

@ -0,0 +1,9 @@
{
networking.dns = [
### AliDNS
"223.5.5.5"
"223.6.6.6"
"2400:3200::1"
"2400:3200:baba::1"
];
}

View file

@ -10,11 +10,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721560199, "lastModified": 1721398837,
"narHash": "sha256-XQVh+i9/m2J2AfwuqJcKpm3GM67Top8mHKgaJ7lL1l0=", "narHash": "sha256-RnBEAbH8a6CogvyjV3d4c+LI/udbygrsGOtZfbRRaUc=",
"owner": "ezKEa", "owner": "ezKEa",
"repo": "aagl-gtk-on-nix", "repo": "aagl-gtk-on-nix",
"rev": "cdb74c540af1d365ea799ba5d2200df707e31090", "rev": "d57b317f94c290f5720fa38fd16c926a8929143e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -30,11 +30,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721842668, "lastModified": 1721322122,
"narHash": "sha256-k3oiD2z2AAwBFLa4+xfU+7G5fisRXfkvrMTCJrjZzXo=", "narHash": "sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd+g=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf", "rev": "8a68b987c476a33e90f203f0927614a75c3f47ea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721871128, "lastModified": 1721417620,
"narHash": "sha256-NyWVCnSeePnJHGJxZ0l3zdGQGrVjUcx2IJbV8KIsPf0=", "narHash": "sha256-6q9b1h8fI3hXg2DG6/vrKWCeG8c5Wj2Kvv22RCgedzg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "55e874b9c14764cb791e5740f0e92202e41393fc", "rev": "bec6e3cde912b8acb915fecdc509eda7c973fb42",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -145,11 +145,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721852138, "lastModified": 1721534365,
"narHash": "sha256-JH8N5uoqoVA6erV4O40VtKKHsnfmhvMGbxMNDLtim5o=", "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "304a011325b7ac7b8c9950333cd215a7aa146b0e", "rev": "635563f245309ef5320f80c7ebcb89b2398d2949",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -184,6 +184,9 @@
"flake-parts": [ "flake-parts": [
"flake-parts" "flake-parts"
], ],
"flake-utils": [
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -195,11 +198,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721581642, "lastModified": 1721501207,
"narHash": "sha256-Bd9ujkwkxwAYCnYKEKeY1fjsvD4vyiFjFS20Lxr/FD4=", "narHash": "sha256-umzgs8hXYUyQe6wJm7AnJ3kx8M/h0/WXR2OemAZs3Qs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lanzaboote", "repo": "lanzaboote",
"rev": "f3b4ade14392861388265e949b7007a8b62e21dc", "rev": "60e4578feca3d894f1474a9b08780c9a5433ad08",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -244,11 +247,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721719500, "lastModified": 1721550066,
"narHash": "sha256-nnkqjv4Y37Hydjh6HE9wW4kSkV5Q7q4iIXlL5lwUFOw=", "narHash": "sha256-wr6sSb+VpXy8HCvBqU6xvhpaARzWUbEK7uN5tLnqYDg=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "884f3fe6d9bf056ba0017c132c39c1f0d07d4fec", "rev": "33bf7df5bbfcbbb49e6559b0c96c9e3b26d14e58",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -321,15 +324,16 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1721911538, "lastModified": 1721750544,
"narHash": "sha256-5OrkPJsiZmNe99C6+KX0qx9sphoVLvldFjuqDYAZ8GQ=", "narHash": "sha256-u0aiWIcd95vRQdGjia3X5V6tP618r68gbvjuaIwUBgw=",
"owner": "NixOS", "owner": "Guanran928",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "d3c993c851ad40bbab7e08d566138ff72cd8744f", "rev": "d24b6083f8101c3b91d6327c06e5bb24f50f18ba",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "Guanran928",
"ref": "lenovo-thinkpad-x1-12th-gen",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"type": "github" "type": "github"
} }
@ -351,11 +355,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1721782431, "lastModified": 1721497942,
"narHash": "sha256-UNDpwjYxNXQet/g3mgRLsQ9zxrbm9j2JEvP4ijF3AWs=", "narHash": "sha256-EDPL9qJfklXoowl3nEBmjDIqcvXKUZInt5n6CCc1Hn4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4f02464258baaf54992debfd010a7a3662a25536", "rev": "d43f0636fc9492e83be8bbb41f9595d7a87106b8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -422,11 +426,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1721922390, "lastModified": 1721555153,
"narHash": "sha256-Q34pkPhh8fRaHS1vZcam00dYv/BNhUR/+jb9O21PsbY=", "narHash": "sha256-e0JMfSfyj2bpScc4KFBAgTq42IL6OankV85H/HCIMBQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "029365c3e7a6349a706df71cc29dc8a0c1e909f8", "rev": "d7cc4f32fe9233dcecbe5f7dfee84d7d0cb899bd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -503,11 +507,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721873995, "lastModified": 1721528458,
"narHash": "sha256-HyFmp6rktJQMxG+BZEjcQoCFKMek855Cc/dQk2YDac0=", "narHash": "sha256-uruH/EV8Rpa/CRxn8CiMzhoA6tJe8qO5c8NdgP1g0rM=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "33a7853f54f1797b029739297c4593bd96077c20", "rev": "0b2b2da1dad1c675c45d9e23c75674de969de83b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -542,11 +546,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721688883, "lastModified": 1721531171,
"narHash": "sha256-9jsjsRKtJRqNSTXKj9zuDFRf2PGix30nMx9VKyPgD2U=", "narHash": "sha256-AsvPw7T0tBLb53xZGcUC3YPqlIpdxoSx56u8vPCr6gU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "aff2f88277dabe695de4773682842c34a0b7fd54", "rev": "909e8cfb60d83321d85c8d17209d733658a21c95",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -562,11 +566,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721888498, "lastModified": 1721263500,
"narHash": "sha256-O5/s8e6CL99AQoKEn8k6F99UoJdAzQ8z9LZ7SxFJ3c4=", "narHash": "sha256-6l0+MciXkktANuZ+Rwc6BZJxtMi7jHZRiSnzG+xpwyk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "srvos", "repo": "srvos",
"rev": "27b3a9b23847cb2e716334ee6ad58b82ddc3f7a7", "rev": "ef4f2248e1bbd84a0dd269ab31b9927d9c0bf2e6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -597,11 +601,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721769617, "lastModified": 1721458737,
"narHash": "sha256-6Pqa0bi5nV74IZcENKYRToRNM5obo1EQ+3ihtunJ014=", "narHash": "sha256-wNXLQ/ATs1S4Opg1PmuNoJ+Wamqj93rgZYV3Di7kxkg=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "8db8970be1fb8be9c845af7ebec53b699fe7e009", "rev": "888bfb10a9b091d9ed2f5f8064de8d488f7b7c97",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -36,6 +36,7 @@
inputs.crane.follows = "crane"; inputs.crane.follows = "crane";
inputs.flake-compat.follows = "flake-compat"; inputs.flake-compat.follows = "flake-compat";
inputs.flake-parts.follows = "flake-parts"; inputs.flake-parts.follows = "flake-parts";
inputs.flake-utils.follows = "flake-utils";
inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks-nix"; inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks-nix";
inputs.rust-overlay.follows = "rust-overlay"; inputs.rust-overlay.follows = "rust-overlay";
}; };
@ -51,7 +52,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware"; url = "github:Guanran928/nixos-hardware/lenovo-thinkpad-x1-12th-gen";
}; };
nixos-sensible = { nixos-sensible = {
url = "github:Guanran928/nixos-sensible"; url = "github:Guanran928/nixos-sensible";
@ -185,6 +186,7 @@
### NixOS ### NixOS
nixosConfigurations = { nixosConfigurations = {
"aristotle" = mkNixOS "x86_64-linux" [./hosts/aristotle];
"blacksteel" = mkNixOS "x86_64-linux" [./hosts/blacksteel]; "blacksteel" = mkNixOS "x86_64-linux" [./hosts/blacksteel];
"dust" = mkNixOS "x86_64-linux" [./hosts/dust]; "dust" = mkNixOS "x86_64-linux" [./hosts/dust];
}; };

View file

@ -0,0 +1,33 @@
{lib, ...}: {
nixpkgs.config = {
allowAliases = false;
allowNonSource = false;
allowNonSourcePredicate = pkg:
lib.elem (lib.getName pkg) [
"adoptopenjdk-hotspot-bin"
"cargo-bootstrap"
"cef-binary"
"dart"
"osu-lazer-bin"
"rustc-bootstrap"
"rustc-bootstrap-wrapper"
"sof-firmware"
"temurin-bin"
];
allowUnfree = false;
allowUnfreePredicate = pkg:
lib.elem (lib.getName pkg) [
"fcitx5-pinyin-minecraft"
"fcitx5-pinyin-moegirl"
"libXNVCtrl"
"nvidia-x11"
"osu-lazer-bin"
"steam"
"steam-original"
"steam-run"
"xow_dongle-firmware"
];
};
}

168
hosts/aristotle/default.nix Normal file
View file

@ -0,0 +1,168 @@
{
lib,
pkgs,
...
}: {
imports = [
../../nixos/profiles/opt-in/mihomo
../../nixos/profiles/opt-in/wireless
./anti-feature.nix
./disko.nix
./hardware-configuration.nix
./impermanence.nix
./lanzaboote.nix
];
networking.hostName = "aristotle";
time.timeZone = "Asia/Shanghai";
system.stateVersion = "23.11";
home-manager.users.guanranwang = import ./home;
services.tailscale = {
enable = true;
openFirewall = true;
};
environment.systemPackages = with pkgs; [
yubikey-manager
localsend
];
programs.adb.enable = true;
programs.anime-game-launcher.enable = true;
programs.seahorse.enable = true;
programs.steam.enable = true;
programs.kdeconnect = {
enable = true;
package = pkgs.valent;
};
services.power-profiles-daemon.enable = true;
services.gvfs.enable = true;
services.gnome = {
gnome-keyring.enable = true;
gnome-online-accounts.enable = true;
sushi.enable = true;
};
# https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth
hardware.xone.enable = true; # via wired or wireless dongle
hardware.xpadneo.enable = true; # via Bluetooth
# yubikey
services.pcscd.enable = true;
services.udev.packages = [pkgs.yubikey-personalization];
fonts = {
enableDefaultPackages = false;
packages = with pkgs; [
(nerdfonts.override {
fonts = ["NerdFontsSymbolsOnly"];
})
(inter.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fonts/truetype/ InterVariable*.ttf
runHook postInstall
'';
})
(jetbrains-mono.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fonts/truetype/ fonts/variable/*.ttf
runHook postInstall
'';
})
(source-sans.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm444 VF/*.otf -t $out/share/fonts/variable
runHook postInstall
'';
})
(source-serif.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm444 VAR/*.otf -t $out/share/fonts/variable
runHook postInstall
'';
})
source-han-sans-vf-otf
source-han-serif-vf-otf
noto-fonts-color-emoji
];
fontconfig.defaultFonts = {
emoji = [
"Noto Color Emoji"
];
# Append emoji font for Qt apps, they might use the monochrome emoji
monospace = [
"JetBrains Mono"
"Source Han Sans SC VF"
"Symbols Nerd Font"
"Noto Color Emoji"
];
sansSerif = [
"Inter Variable"
"Source Han Sans SC VF"
"Noto Color Emoji"
];
serif = [
"Source Serif 4 Variable"
"Source Han Serif SC VF"
"Noto Color Emoji"
];
};
};
console = {
earlySetup = true;
keyMap = "dvorak";
};
services.greetd = {
enable = true;
settings.default_session.command = "${lib.getExe pkgs.greetd.tuigreet} --cmd sway";
};
# polkit
security.polkit.enable = true;
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"];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
security.pam.services.swaylock = {};
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
wlr.enable = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk];
# https://gitlab.archlinux.org/archlinux/packaging/packages/sway/-/blob/main/sway-portals.conf
config."sway" = {
default = "gtk";
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
"org.freedesktop.impl.portal.Screenshot" = "wlr";
"org.freedesktop.impl.portal.Inhibit" = "none";
};
};
### Removes debounce time
# https://www.reddit.com/r/linux_gaming/comments/ku6gth
environment.etc."libinput/local-overrides.quirks".text = ''
[Never Debounce]
MatchUdevType=mouse
ModelBouncingKeys=1
'';
}

78
hosts/aristotle/disko.nix Normal file
View file

@ -0,0 +1,78 @@
let
disks = ["/dev/nvme0n1"];
# compress-force: https://t.me/archlinuxcn_group/3054167
mountOptions = ["defaults" "compress-force=zstd" "noatime"];
cryptSettings = {
allowDiscards = true;
bypassWorkqueues = true;
};
in {
disko.devices = {
disk = {
"one" = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "gpt";
partitions = {
"esp" = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["defaults" "umask=007"];
};
};
"cryptroot" = {
end = "-16G";
content = {
type = "luks";
name = "cryptroot";
settings = cryptSettings;
content = {
type = "btrfs";
subvolumes = {
"/@nix" = {
mountpoint = "/nix";
inherit mountOptions;
};
"/@persist" = {
mountpoint = "/persist";
inherit mountOptions;
};
};
};
};
};
"cryptswap" = {
size = "100%";
content = {
type = "luks";
name = "cryptswap";
settings = cryptSettings;
content = {
type = "swap";
resumeDevice = true;
};
};
};
};
};
};
};
nodev = {
"/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
"size=2G"
"mode=755"
"nodev"
"nosuid"
];
};
};
};
}

View file

@ -0,0 +1,45 @@
{inputs, ...}: {
imports = [
inputs.nixpkgs.nixosModules.notDetected
inputs.nixos-hardware.nixosModules.lenovo-legion-y530-15ich
];
services.hdapsd.enable = false;
services.thermald.enable = true;
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
hardware.bluetooth = {
enable = true;
settings.General.FastConnectable = true;
};
# nouveou
services.xserver.videoDrivers = [];
# novideo
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;
# hardware.nvidia.nvidiaSettings = false;
# environment.sessionVariables."MOZ_ENABLE_WAYLAND" = "0";
# networking.networkmanager.enable = false;
# services.xserver.desktopManager.gnome.enable = true;
# services.xserver.displayManager.gdm.enable = true;
# # https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562
# services.udev.extraRules = ''
# ENV{DEVNAME}=="/dev/dri/card1", TAG+="mutter-device-preferred-primary"
# '';
boot.loader.timeout = 0;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
boot.kernelModules = ["kvm-intel"];
nixpkgs.hostPlatform = "x86_64-linux";
}

View file

@ -0,0 +1,62 @@
{
pkgs,
inputs,
...
}: {
imports =
[
./theme.nix
./xdg-mime.nix
]
++ map (n: ../../../home/applications/${n}) [
"fcitx5"
"firefox"
"foot"
"go"
"mpv"
"nautilus"
"nix"
"sway"
"thunderbird"
"ydict"
];
# https://wiki.archlinux.org/title/Fish#Start_X_at_login
programs.fish.loginShellInit = ''
if test -z "$DISPLAY" -a "$XDG_VTNR" = 1
exec sway
end
'';
home.packages =
(with pkgs; [
amberol
dconf-editor
file-roller
fractal
gnome-calculator
hyperfine
loupe
mousai
seahorse
(prismlauncher.override {
glfw = glfw-wayland-minecraft;
gamemodeSupport = false;
})
mumble
osu-lazer-bin
])
++ (with inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.scripts; [
lofi
]);
home.sessionVariables = {
# https://github.com/ppy/osu-framework/pull/6292
"OSU_SDL3" = "1";
};
programs.mangohud.enable = true;
programs.obs-studio.enable = true;
services.ssh-agent.enable = true;
}

View file

@ -0,0 +1,52 @@
{
pkgs,
config,
lib,
...
}: {
home.pointerCursor = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
size = 24;
gtk.enable = true;
};
gtk = {
enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
gtk3.bookmarks = [
"file://${config.home.homeDirectory}/Documents/Projects/flake"
];
iconTheme = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
"color-scheme" = "prefer-dark";
};
# Make GTK listen to fontconfig
"org/gnome/desktop/wm/preferences" = {
"titlebar-font" = "Sans Bold 11";
};
"org/gnome/desktop/interface" = {
"font-name" = "Sans 11";
"document-font-name" = "Sans 11";
"monospace-font-name" = "Monospace 10";
};
};
# ??? this commit broke nautilus's spacing ???
# https://github.com/nix-community/home-manager/commit/e9b9ecef4295a835ab073814f100498716b05a96
xdg.configFile."gtk-4.0/gtk.css".text = lib.mkForce config.gtk.gtk4.extraCss;
}

View file

@ -0,0 +1,46 @@
{lib, ...}: {
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
xdg.mimeApps = {
enable = true;
defaultApplications =
{
"inode/directory" = ["org.gnome.Nautilus.desktop"];
}
### Browser
// lib.genAttrs [
"text/html"
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/about"
"x-scheme-handler/unknown"
] (_n: ["firefox.desktop"])
### Audio player
// lib.genAttrs [
"audio/aac"
"audio/flac"
"audio/mpeg"
"audio/ogg"
"audio/wav"
] (_n: ["io.bassi.Amberol.desktop"])
### Image viewer
// lib.genAttrs [
"image/gif"
"image/jpeg"
"image/png"
"image/webp"
] (_n: ["org.gnome.Loupe.desktop"])
### Video player
// lib.genAttrs [
"video/mp4"
"video/mpeg"
"video/webm"
] (_n: ["mpv.desktop"])
### Code editor
// lib.genAttrs [
"text/css"
"text/html"
"text/javascript"
"text/plain"
] (_n: ["nvim.desktop"]);
};
}

View file

@ -0,0 +1,46 @@
{lib, ...}: {
sops.age.sshKeyPaths = lib.mkForce ["/persist/etc/ssh/ssh_host_ed25519_key"];
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib"
"/etc/secureboot"
];
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
users.guanranwang = {
directories = [
"Desktop"
"Documents"
"Downloads"
"Music"
"Pictures"
"Videos"
#"Public"
#"Templates"
".ssh"
".mozilla/firefox"
".thunderbird"
".cache"
".local/share"
".local/state"
".config/gh"
".config/Mumble"
".config/fcitx5"
".config/obs-studio"
];
files = [
".config/sops/age/keys.txt"
];
};
};
}

View file

@ -0,0 +1,7 @@
{pkgs, ...}: {
environment.systemPackages = [pkgs.sbctl];
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
}

View file

@ -5,9 +5,11 @@
allowNonSource = false; allowNonSource = false;
allowNonSourcePredicate = pkg: allowNonSourcePredicate = pkg:
lib.elem (lib.getName pkg) [ lib.elem (lib.getName pkg) [
"adoptopenjdk-hotspot-bin"
"cargo-bootstrap" "cargo-bootstrap"
"cef-binary" "cef-binary"
"dart" "dart"
"osu-lazer-bin"
"rustc-bootstrap" "rustc-bootstrap"
"rustc-bootstrap-wrapper" "rustc-bootstrap-wrapper"
"sof-firmware" "sof-firmware"
@ -19,6 +21,13 @@
lib.elem (lib.getName pkg) [ lib.elem (lib.getName pkg) [
"fcitx5-pinyin-minecraft" "fcitx5-pinyin-minecraft"
"fcitx5-pinyin-moegirl" "fcitx5-pinyin-moegirl"
"libXNVCtrl"
"nvidia-x11"
"osu-lazer-bin"
"steam"
"steam-original"
"steam-run"
"xow_dongle-firmware"
]; ];
}; };
} }

View file

@ -35,6 +35,7 @@
programs.adb.enable = true; programs.adb.enable = true;
programs.localsend.enable = true; programs.localsend.enable = true;
programs.seahorse.enable = true; programs.seahorse.enable = true;
programs.steam.enable = true;
programs.kdeconnect = { programs.kdeconnect = {
enable = true; enable = true;
package = pkgs.valent; package = pkgs.valent;
@ -48,6 +49,10 @@
sushi.enable = true; sushi.enable = true;
}; };
# https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth
hardware.xone.enable = true; # via wired or wireless dongle
hardware.xpadneo.enable = true; # via Bluetooth
# yubikey # yubikey
services.pcscd.enable = true; services.pcscd.enable = true;
services.udev.packages = [pkgs.yubikey-personalization]; services.udev.packages = [pkgs.yubikey-personalization];
@ -154,4 +159,12 @@
"org.freedesktop.impl.portal.Inhibit" = "none"; "org.freedesktop.impl.portal.Inhibit" = "none";
}; };
}; };
### Removes debounce time
# https://www.reddit.com/r/linux_gaming/comments/ku6gth
environment.etc."libinput/local-overrides.quirks".text = ''
[Never Debounce]
MatchUdevType=mouse
ModelBouncingKeys=1
'';
} }

View file

@ -4,11 +4,15 @@
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-12th-gen inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-12th-gen
]; ];
services.hdapsd.enable = false;
services.thermald.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
}; };
@ -21,8 +25,6 @@
boot.loader.timeout = 0; boot.loader.timeout = 0;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = ["ia32_emulation=0"];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];

View file

@ -28,7 +28,8 @@
end end
''; '';
home.packages = with pkgs; [ home.packages =
(with pkgs; [
amberol amberol
dconf-editor dconf-editor
file-roller file-roller
@ -38,9 +39,24 @@
loupe loupe
mousai mousai
seahorse seahorse
inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.scripts.lofi
];
(prismlauncher.override {
glfw = glfw-wayland-minecraft;
gamemodeSupport = false;
})
mumble
osu-lazer-bin
])
++ (with inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.scripts; [
lofi
]);
home.sessionVariables = {
# https://github.com/ppy/osu-framework/pull/6292
"OSU_SDL3" = "1";
};
programs.mangohud.enable = true;
programs.obs-studio.enable = true; programs.obs-studio.enable = true;
services.ssh-agent.enable = true; services.ssh-agent.enable = true;
} }

View file

@ -34,6 +34,7 @@
".local/state" ".local/state"
".config/gh" ".config/gh"
".config/Mumble"
".config/fcitx5" ".config/fcitx5"
".config/obs-studio" ".config/obs-studio"
]; ];

View file

@ -3,10 +3,11 @@
imports = [ imports = [
../../darwin/profiles/desktop ../../darwin/profiles/desktop
../../darwin/profiles/common/opt-in/mihomo.nix ../../darwin/profiles/common/opt-in/mihomo.nix
./hardware-configuration.nix
]; ];
networking.hostName = "plato"; networking.hostName = "plato";
time.timeZone = "Asia/Shanghai"; time.timeZone = "Asia/Shanghai";
system.stateVersion = 4; system.stateVersion = 4;
nixpkgs.hostPlatform = "x86_64-darwin";
} }

View file

@ -0,0 +1,13 @@
# iMac 18,3 (2017)
{
networking.knownNetworkServices = [
"Ethernet"
"Wi-Fi"
"Thunderbolt Bridge"
"Thunderbolt Bridge 2"
"iPhone USB"
];
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "x86_64-darwin";
}

View file

@ -0,0 +1,5 @@
# About this device
### Description
`blacksteel`, but running macOS. Creative, I know.

View file

@ -2,10 +2,11 @@
imports = [ imports = [
../../darwin/profiles/desktop ../../darwin/profiles/desktop
../../darwin/profiles/common/opt-in/mihomo.nix ../../darwin/profiles/common/opt-in/mihomo.nix
./hardware-configuration.nix
]; ];
networking.hostName = "whitesteel"; networking.hostName = "whitesteel";
time.timeZone = "Asia/Shanghai"; time.timeZone = "Asia/Shanghai";
system.stateVersion = 4; system.stateVersion = 4;
nixpkgs.hostPlatform = "x86_64-darwin";
} }

View file

@ -0,0 +1,10 @@
{
networking.knownNetworkServices = [
"Wi-Fi"
"Bluetooth PAN"
"Thunderbolt Bridge"
];
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "x86_64-darwin";
}

View file

@ -14,6 +14,15 @@ use: &use
- flyairport - flyairport
- spcloud - spcloud
use-backup: &use-backup
type: select
use:
- ermaozi
- jsnzkpg
- pawdroid
convert: &convert "https://sub.maoxiongnet.com/sub?target=clash&list=true&url="
port: 7890 port: 7890
external-controller: 127.0.0.1:9090 external-controller: 127.0.0.1:9090
log-level: warning log-level: warning
@ -37,9 +46,32 @@ proxy-providers:
<<: *fetch <<: *fetch
url: "@clash/proxy-providers/spcloud@" url: "@clash/proxy-providers/spcloud@"
# Free servers that I dont really care about
ermaozi:
<<: *fetch
url: "@ermaozi@"
jsnzkpg:
<<: *fetch
url: "@jsnzkpg@"
pawdroid:
<<: *fetch
url: "@pawdroid"
proxy-groups: proxy-groups:
- { name: PROXY, type: select, proxies: [自动选择, lightsail, DIRECT] } - {
name: PROXY,
type: select,
proxies: [自动选择, 备用自动选择, DIRECT, lightsail],
}
- { name: 自动选择, <<: *use, tolerance: 2, type: url-test } - { name: 自动选择, <<: *use, tolerance: 2, type: url-test }
- { name: 备用自动选择, <<: *use-backup, tolerance: 2, type: url-test }
# 分隔,下面是地区分组
#- { name: 香港, <<: *use, type: url-test, filter: "(?i)港|hk|hongkong|hong kong" }
- { name: 台湾, <<: *use, type: url-test, filter: "(?i)台|tw|taiwan" }
#- { name: 日本, <<: *use, type: url-test, filter: "(?i)日本|jp|japan" }
#- { name: 美国, <<: *use, type: url-test, filter: "(?i)美|us|unitedstates|united states" }
#- { name: 新加坡, <<: *use, type: url-test, filter: "(?i)(新|sg|singapore)" }
rules: rules:
- GEOIP, lan, DIRECT, no-resolve - GEOIP, lan, DIRECT, no-resolve

View file

@ -40,6 +40,7 @@
# why not substituteAll? see https://github.com/NixOS/nixpkgs/issues/237216 # why not substituteAll? see https://github.com/NixOS/nixpkgs/issues/237216
sops.templates."clash.yaml".file = let sops.templates."clash.yaml".file = let
convert = url: "https://sub.maoxiongnet.com/sub?target=clash&list=true&url=${url}";
substituteV2 = {src, ...} @ args: let substituteV2 = {src, ...} @ args: let
args' = lib.removeAttrs args ["src"]; args' = lib.removeAttrs args ["src"];
in in
@ -58,5 +59,10 @@
"clash/proxy-providers/flyairport" "clash/proxy-providers/flyairport"
"clash/proxy-providers/spcloud" "clash/proxy-providers/spcloud"
; ;
# Free servers that I dont really care about
pawdroid = convert "https://cdn.jsdelivr.net/gh/Pawdroid/Free-servers@main/sub";
ermaozi = convert "https://cdn.jsdelivr.net/gh/ermaozi/get_subscribe@main/subscribe/v2ray.txt";
jsnzkpg = convert "https://cdn.jsdelivr.net/gh/Jsnzkpg/Jsnzkpg@Jsnzkpg/Jsnzkpg";
}; };
} }