From 971216f1b3e496276c9c35fc4a8b85f2262c0f26 Mon Sep 17 00:00:00 2001 From: OCbwoy3 Date: Tue, 11 Mar 2025 22:25:47 +0200 Subject: [PATCH] a --- .gitignore | 2 +- flake.nix | 11 ++-- hosts/default/configuration.nix | 2 +- hosts/default/disko.nix | 73 ++++++++++++++++++++++++ hosts/default/hardware-configuration.nix | 57 ++++++++++++++++++ hosts/default/packages.nix | 6 +- install.sh | 6 ++ modules/nixos/nvidia.nix | 20 +++---- modules/nixos/programs.nix | 2 +- 9 files changed, 156 insertions(+), 23 deletions(-) create mode 100644 hosts/default/disko.nix create mode 100644 hosts/default/hardware-configuration.nix create mode 100644 install.sh diff --git a/.gitignore b/.gitignore index 577b0a0..b4f0da4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -hardware-configuration.nix +# hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 068aff9..c970d23 100644 --- a/flake.nix +++ b/flake.nix @@ -8,14 +8,14 @@ hyprland.url = "github:hyprwm/Hyprland"; hyprsysteminfo.url = "github:hyprwm/hyprsysteminfo"; ghostty.url = "github:ghostty-org/ghostty"; - - hyprpanel.url = "github:jas-singhfsu/hyprpanel"; - hyprpanel.inputs.nixpkgs.follows = "nixpkgs"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + disko.url = "github:nix-community/disko/latest"; + disko.inputs.nixpkgs.follows = "nixpkgs"; }; # Required by NixOS: @@ -31,13 +31,10 @@ inherit inputs; }; modules = [ - { - nixpkgs.overlays = [inputs.hyprpanel.overlay]; - } inputs.home-manager.nixosModules.default inputs.catppuccin.nixosModules.catppuccin inputs.nix-flatpak.nixosModules.nix-flatpak - /etc/nixos/hardware-configuration.nix + ./hosts/default/hardware-configuration.nix ./hosts/default/configuration.nix ]; }; diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 675c765..60f75a5 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -189,7 +189,7 @@ programs.chromium = { enable = true; - package = pkgs.brave; + package = pkgs.ungoogled-chromium; extensions = [ { id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # uBlock Origin { id = "enamippconapkdmgfgjchkhakpfinmaj"; } # DeArrow diff --git a/hosts/default/disko.nix b/hosts/default/disko.nix new file mode 100644 index 0000000..d8e3ac1 --- /dev/null +++ b/hosts/default/disko.nix @@ -0,0 +1,73 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-diskseq/1"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + # Subvolume name is different from mountpoint + "/root" = { + mountpoint = "/"; + }; + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + "/swap" = { + mountpoint = "/swap"; + swap = { + swapfile.size = "20M"; + swapfile2.size = "20M"; + swapfile2.path = "rel-path"; + }; + }; + }; + + mountpoint = "/partition-root"; + swap = { + swapfile = { + size = "20M"; + }; + swapfile1 = { + size = "20M"; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/hosts/default/hardware-configuration.nix b/hosts/default/hardware-configuration.nix new file mode 100644 index 0000000..f3ea889 --- /dev/null +++ b/hosts/default/hardware-configuration.nix @@ -0,0 +1,57 @@ +# 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 = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8efee6be-05b9-4349-966b-4cf924c644e4"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/8efee6be-05b9-4349-966b-4cf924c644e4"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/8efee6be-05b9-4349-966b-4cf924c644e4"; + fsType = "btrfs"; + options = [ "subvol=nix" "noatime" ]; + }; + + fileSystems."/swap" = + { device = "/dev/disk/by-uuid/8efee6be-05b9-4349-966b-4cf924c644e4"; + fsType = "btrfs"; + options = [ "subvol=swap" "noatime" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ { device = "/swap/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.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} \ No newline at end of file diff --git a/hosts/default/packages.nix b/hosts/default/packages.nix index d5ad93f..0454cf9 100644 --- a/hosts/default/packages.nix +++ b/hosts/default/packages.nix @@ -16,9 +16,10 @@ programs.seahorse.enable = true; + environment.variables.LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; + environment.systemPackages = with pkgs; [ inputs.hyprsysteminfo.packages.${pkgs.stdenv.hostPlatform.system}.hyprsysteminfo - hyprpanel # minecraft qemu (writeShellScriptBin "qemu-system-x86_64-uefi" '' @@ -26,7 +27,7 @@ -bios ${OVMF.fd}/FV/OVMF.fd \ "$@" '') - (writeShellScriptBin "regretevator" ''xdg-open https://www.roblox.com/games/4972273297/Regretevator-ELEVATOR-SIMULATOR'') + (writeShellScriptBin "regretevator" ''xdg-open roblox://placeId=4972273297'') libxkbcommon ffmpeg gnupg @@ -65,6 +66,7 @@ fontforge xclip gamescope + yt-dlp fontforge-gtk deno wofi diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..4a838fe --- /dev/null +++ b/install.sh @@ -0,0 +1,6 @@ +lsblk + +echo "Enter disk to install to: " +read vardisk + +sudo nix run 'github:nix-community/disko/latest#disko-install' --extra-experimental-features "nix-command flakes" -- --flake .#default --disk $vardisk \ No newline at end of file diff --git a/modules/nixos/nvidia.nix b/modules/nixos/nvidia.nix index 3cff203..a00b06a 100644 --- a/modules/nixos/nvidia.nix +++ b/modules/nixos/nvidia.nix @@ -7,17 +7,15 @@ options nvidia_drm modeset=1 fbdev=1 ''; - environment.variables = { - LIBVA_DRIVER_NAME = "nvidia"; - GBM_BACKEND = "nvidia-drm"; - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - NVD_BACKEND = "direct"; - EGL_PLATFORM = "wayland"; - VDPAU_DRIVER = "va_gl"; - WAYLAND_DISPLAY = "wayland-1"; - DISPLAY = ":0"; - XDG_CURRENT_DESKTOP = "Hyprland"; - }; + environment.variables.LIBVA_DRIVER_NAME = "nvidia"; + environment.variables.GBM_BACKEND = "nvidia-drm"; + environment.variables.__GLX_VENDOR_LIBRARY_NAME = "nvidia"; + environment.variables.NVD_BACKEND = "direct"; + environment.variables.EGL_PLATFORM = "wayland"; + environment.variables.VDPAU_DRIVER = "va_gl"; + environment.variables.WAYLAND_DISPLAY = "wayland-1"; + environment.variables.DISPLAY = ":0"; + environment.variables.XDG_CURRENT_DESKTOP = "Hyprland"; environment.sessionVariables = { NIXOS_OZONE_WL = 1; diff --git a/modules/nixos/programs.nix b/modules/nixos/programs.nix index a0168af..5ec337a 100644 --- a/modules/nixos/programs.nix +++ b/modules/nixos/programs.nix @@ -38,7 +38,7 @@ services.openssh = { enable = true; - banner = "What the fuck do you think you're doing here?\n"; + banner = "please fuck off\n"; }; services.dbus.packages = [ pkgs.gcr ];