diff --git a/flake.nix b/flake.nix index 3e5fd00..22cb198 100644 --- a/flake.nix +++ b/flake.nix @@ -75,7 +75,10 @@ nixosModules.lyc = import ./nixos/modules; nixosConfigurations = nixpkgs.lib.genAttrs - (map (f: nixpkgs.lib.removeSuffix ".nix" f) (builtins.attrNames (builtins.readDir nixosConfigDir))) + (map (f: nixpkgs.lib.removeSuffix ".nix" f) [ + "adrastea" + "metis" + ]) ( hostName: nixpkgs.lib.nixosSystem { diff --git a/nixos/configurations/aplaz/cross.nix b/nixos/configurations/aplaz/cross.nix deleted file mode 100644 index 7e7b30a..0000000 --- a/nixos/configurations/aplaz/cross.nix +++ /dev/null @@ -1,41 +0,0 @@ -# Specify cross-builds on aplaz. -{ - pkgs, - inputs, - lib, - config, - ... -}: -let - pkgsX86Cross = import pkgs.path { - crossSystem.system = "aarch64-linux"; - localSystem.system = "x86_64-linux"; - overlays = [ inputs.nixos-apple-silicon.overlays.apple-silicon-overlay ]; - }; -in -{ - nix.buildMachines = [ - { - hostName = "metis"; - system = "x86_64-linux"; - protocol = "ssh"; - supportedFeatures = [ - "nixos-test" - "benchmark" - "big-parallel" - "kvm" - ]; - mandatoryFeatures = [ ]; - } - ]; - - nix.distributedBuilds = true; - - # Use x86_64 linux cross-compiled kernel. - boot.kernelPackages = lib.mkForce ( - pkgsX86Cross.linux-asahi.override { - _kernelPatches = config.boot.kernelPatches; - withRust = config.hardware.asahi.withRust; - } - ); -} diff --git a/nixos/configurations/aplaz/default.nix b/nixos/configurations/aplaz/default.nix deleted file mode 100644 index 0cae7ef..0000000 --- a/nixos/configurations/aplaz/default.nix +++ /dev/null @@ -1,161 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ inputs, pkgs, ... }: - -let - proxy = "socks5://localhost:8899"; -in -{ - imports = [ - # Include the results of the hardware scan. - ./cross.nix - ./hardware-configuration.nix - ./wireguard.nix - inputs.nixos-apple-silicon.nixosModules.apple-silicon-support - ]; - - networking.proxy.default = proxy; - networking.proxy.allProxy = proxy; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot = { - enable = true; - configurationLimit = 5; - }; - - boot.loader.efi.canTouchEfiVariables = false; - - boot.kernel.sysctl = { - "vm.swappiness" = 100; - "net.ipv4.ip_forward" = 1; - "net.ipv6.conf.all.forwarding" = "1"; - }; - - networking.hostName = "aplaz"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - services.clash = { - enable = true; - rule.enable = true; - allowTUN = true; - }; - - services.resolved.enable = true; - - # Set your time zone. - time.timeZone = "Asia/Shanghai"; - - boot.kernelParams = [ "hid_apple.fnmode=2" ]; - - systemd.oomd.enableRootSlice = true; - systemd.oomd.enableUserSlices = true; - - inclyc.gui.enable = true; - inclyc.user.enable = true; - inclyc.user.zsh = true; - inclyc.development.rust.enable = true; - - i18n = { - defaultLocale = "C.UTF-8"; - extraLocaleSettings = { - LC_MESSAGES = "en_US.UTF-8"; - LC_TIME = "C.UTF-8"; - LC_CTYPE = "zh_CN.UTF-8"; - }; - }; - - zramSwap.enable = true; - - services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = 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 - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? - - environment.systemPackages = with pkgs; [ - gnumake - qemu - - gdb - file - patchelf - btop - stdenv.cc - - valgrind - kcachegrind - - sops - age - ssh-to-age - - vim - neovim - - neofetch - - meson - cmake - lldb - llvmPackages_16.clang - llvmPackages_16.bintools - rr - ninja - (hiPrio clang-tools_16) - - python3 - - man-pages - man-pages-posix - - chromium - - libreoffice-qt - bubblewrap - tigervnc - - fluent-icon-theme - - nodejs - yarn - ]; - - hardware.bluetooth.enable = true; - - security.pam.u2f = { - enable = true; - cue = true; - authFile = pkgs.writeText "u2f_keys" '' - lyc:4FV+6pMkst1elJXq+dbVIjapuEvIFkE+ts0mM11kSn1rzatMixRaf5oqiyPpjA/bm9T+pgypwETVQ+VOahX5vv////k=,z3zXcGMPB3UNyuHPPBb6q4LTJyOd5ZyN4KhhypiG5lMYvVOkrMbfQDJrZDO836EnoayPCNQDuoKvSU7kTTavmg==,es256,+presence - ''; - }; - - security.pam.services = { - login.u2fAuth = true; - sudo.u2fAuth = true; - }; - - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - - virtualisation.podman.enable = true; -} diff --git a/nixos/configurations/aplaz/hardware-configuration.nix b/nixos/configurations/aplaz/hardware-configuration.nix deleted file mode 100644 index b5fc234..0000000 --- a/nixos/configurations/aplaz/hardware-configuration.nix +++ /dev/null @@ -1,66 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ lib, modulesPath, ... }: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ "usb_storage" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/16a487e5-aef5-46b2-a98b-28f1bd4e7a3b"; - fsType = "btrfs"; - options = [ - "subvol=root" - "compress=zstd" - ]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/16a487e5-aef5-46b2-a98b-28f1bd4e7a3b"; - fsType = "btrfs"; - options = [ - "subvol=home" - "compress=zstd" - ]; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/16a487e5-aef5-46b2-a98b-28f1bd4e7a3b"; - fsType = "btrfs"; - options = [ - "subvol=nix" - "compress=zstd" - "noatime" - ]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/BB05-1B0A"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; - - swapDevices = [ { device = "/swapfile"; } ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; - - hardware.asahi.peripheralFirmwareDirectory = /boot/asahi; - - hardware.asahi.useExperimentalGPUDriver = true; -} diff --git a/nixos/configurations/aplaz/wireguard.nix b/nixos/configurations/aplaz/wireguard.nix deleted file mode 100644 index 8b75c8c..0000000 --- a/nixos/configurations/aplaz/wireguard.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, ... }: -{ - sops.secrets."wireguard/privkeys/aplaz" = { - owner = config.users.users.systemd-network.name; - }; - - environment.systemPackages = with pkgs; [ wireguard-tools ]; - - systemd.network.enable = true; - - systemd.network.netdevs = { - "10-wg0" = { - netdevConfig = { - Kind = "wireguard"; - Name = "wg0"; - MTUBytes = "1300"; - }; - wireguardConfig = { - PrivateKeyFile = config.sops.secrets."wireguard/privkeys/aplaz".path; - ListenPort = 9918; - }; - wireguardPeers = [ - { - wireguardPeerConfig = { - PublicKey = "CMb1V4DaIsYRY5dNxZSzQZD6Xnd5/DNyDPJoRtosfgs="; - AllowedIPs = [ "10.231.0.1/16" ]; - Endpoint = "llvmws.inclyc.cn:20125"; - PersistentKeepalive = 25; - }; - } - ]; - }; - }; - - systemd.network.networks = { - wg0 = { - matchConfig.Name = "wg0"; - address = [ "10.231.0.3/16" ]; - DHCP = "no"; - networkConfig = { - IPv6AcceptRA = false; - }; - }; - }; -} diff --git a/nixos/configurations/rhea/default.nix b/nixos/configurations/rhea/default.nix deleted file mode 100644 index 583fe1e..0000000 --- a/nixos/configurations/rhea/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ modulesPath, pkgs, ... }: -{ - imports = [ (modulesPath + "/installer/sd-card/sd-image-aarch64.nix") ]; - - boot.kernelPackages = pkgs.linuxPackages_latest; - - nixpkgs.hostPlatform = "aarch64-linux"; - - nixpkgs.overlays = [ - (final: super: { - zfs = super.zfs.overrideAttrs (_: { - meta.platforms = [ ]; - }); - }) - ]; - - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - - networking.hostName = "rhea"; - - networking.networkmanager.enable = true; - - inclyc.user.enable = true; - - users.users.hgh = { - isNormalUser = true; - description = "Guanghui Hu"; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDXqYq0LKuSGBNafT2/WrAhHtqBsu4He54V4o3oiOWyP1+mR8iJqHfvZAKGwtrv994ROAAE2GYeJoT46kTJGJkqL9DHfWtw8UbmjgQJLTl+h6LlhQWMuCoRzsjxV7N+bDiTK7vWA1hh2vb3JJHdoOmv7H+Wwitr8VRab8jGf2+FO8S4aJ287LGO8Cr0BschDDEmfXGqZ7X+cneV27FatUPIKCSaAY2X90pMZWHDrItz3Lc5ZvYsMKiyBMG3fkpbfBaki7YdtYgWXPyL2KxldmmZA/qm1WMLmcBc+2KukUluXzAzpwVnPjowIBajXSij76Lh4vqIoH0uBo10qAOmxZIZV8MdwyOH//2FBfWZ5d/ipAJbSxkk6a0Lxv+0vkvZ+zdLa8GkwQ2KQP6Y51Xj4Z9MdXm2GNQM7xd4TIzlEi1++74LfaPTZXp+BG+OyujS+nTruEOLJ5hzF7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