From 7142cba4c281d33e833491dc211d8a6e94f0d2b2 Mon Sep 17 00:00:00 2001 From: Lilac Date: Sat, 12 Sep 2026 17:11:21 -0400 Subject: [PATCH] ahhhhh --- flake.nix | 13 +++- hosts/laptop/default.nix | 92 +++++++++++++++++++++++++ hosts/laptop/hardware-configuration.nix | 31 +++++++++ hosts/vps/default.nix | 2 +- modules/ssh.nix | 5 +- 5 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 hosts/laptop/default.nix create mode 100644 hosts/laptop/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 7989b5c..f15c0b3 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,15 @@ outputs = inputs@{ self, nixpkgs, deploy-rs, disko, home-manager, sops-nix, grasswren, ... }: { nixosConfigurations = { + laptop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + home-manager.nixosModules.home-manager + ./hosts/laptop/default.nix + ]; + }; + desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs; }; @@ -53,7 +62,7 @@ # nix run github:serokell/deploy-rs deploy.nodes = { vps = { - hostname = "10.0.0.3"; + hostname = "216.128.177.13"; sshUser = "root"; magicRollbackTimeout = 120; profiles.system = { @@ -64,7 +73,7 @@ }; desktop = { - hostname = "10.0.0.2"; + hostname = "192.168.1.133"; sshUser = "root"; magicRollbackTimeout = 120; profiles.system = { diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix new file mode 100644 index 0000000..aaf6bae --- /dev/null +++ b/hosts/laptop/default.nix @@ -0,0 +1,92 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + networking.hostName = "laptop"; + networking.networkmanager.enable = true; + + time.timeZone = "America/Toronto"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + services.xserver.enable = true; + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + users.users.lilac = { + isNormalUser = true; + group = "lilac"; + extraGroups = [ "networkmanager" "wheel" "render" "video" "input" "uinput" ]; + }; + users.groups.lilac = {}; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + users.lilac = import ../../home/lilac.nix; + }; + programs.zsh.enable = true; + users.users.lilac.shell = pkgs.zsh; + security.sudo.wheelNeedsPassword = false; + + environment.systemPackages = with pkgs; [ + vim + tor-browser + ]; + + networking = { + firewall = { + enable = true; + allowedUDPPorts = [ 51820 ]; + trustedInterfaces = [ "wg0" ]; + }; + + wireguard.interfaces."wg0" = { + ips = [ "10.0.0.1/24" ]; + generatePrivateKeyFile = true; + privateKeyFile = "/var/lib/wireguard/wg0.key"; + peers = [{ + publicKey = "Tst6SiqoGLSoOAF9l5vT2vvR2RGJ/mFcoBL3BL5n90k="; + allowedIPs = [ "10.0.0.0/24" ]; + endpoint = "216.128.177.13:51820"; + persistentKeepalive = 25; + }]; + }; + }; + + services.openssh.enable = true; + + nixpkgs.config.allowUnfree = true; + system.stateVersion = "26.05"; +} diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix new file mode 100644 index 0000000..e7943c8 --- /dev/null +++ b/hosts/laptop/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/379e6dd2-af45-4abc-8ff0-802791f76636"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D852-8C36"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/vps/default.nix b/hosts/vps/default.nix index 1b94704..a32e006 100644 --- a/hosts/vps/default.nix +++ b/hosts/vps/default.nix @@ -40,7 +40,7 @@ peers = [ { allowedIPs = [ "10.0.0.1/32" ]; - publicKey = "n+9eh8VUP9NCnjPL0Z/KPc0TQCQloXE2Ipc5+CBtJjU="; + publicKey = "guKFJGQW946HXWjca/biMYH1nJKw0fguLjzGXKZ7Bxw="; } { allowedIPs = [ "10.0.0.2/32" ]; diff --git a/modules/ssh.nix b/modules/ssh.nix index ff41c43..72de762 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -19,10 +19,9 @@ }; users.users.lilac.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKhCH6YN63AWFsR1wZ6wJdZ2jlTtYBSkY5FnLrWoLKeg" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE6kdpZqaqtyfGVNRxpA24sw37MGpXV/NUaALTEt98EK lilac@laptop" ]; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKhCH6YN63AWFsR1wZ6wJdZ2jlTtYBSkY5FnLrWoLKeg" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE6kdpZqaqtyfGVNRxpA24sw37MGpXV/NUaALTEt98EK lilac@laptop" ]; }