[feat] Restructure the repo

This commit is contained in:
uttarayan21
2024-03-13 23:04:54 +05:30
parent f5bcff9c73
commit 6961bb2733
125 changed files with 0 additions and 5411 deletions

208
nixos/configuration.nix Normal file
View File

@@ -0,0 +1,208 @@
# 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).
{ pkgs, device, ... }: {
imports = [
# Include the results of the hardware scan.
./ryu.nix
];
security.polkit.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
services.mullvad-vpn.enable = true;
services.resolved.enable = true;
services.devmon.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
services.gnome.gnome-keyring.enable = true;
nix.settings.auto-optimise-store = true;
nix.gc.automatic = true;
nix.gc.dates = "daily";
nix.gc.options = "--delete-older-than +5";
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
boot.plymouth.enable = true;
boot.plymouth.theme = "catppuccin-mocha";
boot.plymouth.themePackages = with pkgs;
[ (catppuccin-plymouth.override { variant = "mocha"; }) ];
services.greetd =
let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
hyprland-session = "${pkgs.hyprland}/share/wayland-sessions";
in
{
enable = true;
settings = {
default_session = {
command =
"${tuigreet} --time --remember --remember-session --sessions ${hyprland-session}";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
# services.wireplumber.configPackages = with pkgs; [ bluez ];
# environment.etc = {
# "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
# bluez_monitor.properties = {
# ["bluez5.enable-sbc-xq"] = true,
# ["bluez5.enable-msbc"] = true,
# ["bluez5.enable-hw-volume"] = true,
# ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
# }
# '';
# };
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
hardware.bluetooth.settings = {
General = {
Name = "Ryu";
Enable = "Source,Sink,Media,Socket";
};
};
# Bootloader.
boot.loader.systemd-boot.enable = pkgs.lib.mkForce false;
boot.loader.efi.canTouchEfiVariables = true;
boot.bootspec.enable = true;
networking.hostName = "ryu"; # Define your hostname.
networking.nameservers = [ "1.1.1.1" "8.8.8.8" ];
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
services.udev.packages =
[ pkgs.yubikey-personalization pkgs.yubikey-personalization-gui ];
services.yubikey-agent.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Asia/Kolkata";
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" ];
# Select internationalisation properties.
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";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.servius = {
isNormalUser = true;
description = "Uttarayan";
extraGroups = [ "networkmanager" "wheel" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
fonts.fontconfig.enable = true;
fonts.fontDir.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
hyprland
xorg.xhost
foot
git
fish
nushellFull
(pkgs.wrapFirefox
(pkgs.firefox-unwrapped.override { pipewireSupport = true; })
{ })
gnumake
python3
(nerdfonts.override { fonts = [ "FiraCode" "Hasklig" ]; })
];
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
};
programs = {
hyprland.enable = true;
hyprland.xwayland.enable = true;
yubikey-touch-detector.enable = true;
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# 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. Its 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.11"; # Did you read the comment?
nix.settings.extra-experimental-features = "nix-command flakes";
nix.settings.trusted-users = [ "root" "servius" ];
}

30
nixos/device.nix Normal file
View File

@@ -0,0 +1,30 @@
{ nixpkgs, devices, inputs, overlays, home-manager, nur, ... }:
builtins.listToAttrs (builtins.map (device: {
name = device.name;
value = nixpkgs.lib.nixosSystem {
system = device.system;
specialArgs = {
inherit device;
lanzaboote = inputs.lanzaboote;
};
modules = [
nur.nixosModules.nur
{ nixpkgs.overlays = overlays; }
./configuration.nix
home-manager.nixosModules.home-manager
inputs.lanzaboote.nixosModules.lanzaboote
{
nixpkgs.config.allowUnfree = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit device;
};
users.${device.user}.imports = [ ../common/home.nix ];
};
}
];
};
}) devices)

86
nixos/ryu.nix Normal file
View File

@@ -0,0 +1,86 @@
# 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") ];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc.
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
# hardware.bluetooth.settings = {
boot.initrd.availableKernelModules =
[ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/11d8beef-2a63-4231-af35-b9b8d3a17e9b";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4E27-DAC0";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/d0835bd2-62fd-48d3-a0d1-8ae659f2e727";
fsType = "ext4";
};
swapDevices = [ ];
# 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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}