From bbd634536412d3bf663073e38d837ad33d5b14cd Mon Sep 17 00:00:00 2001 From: coast Date: Tue, 30 Sep 2025 22:09:17 +0330 Subject: [PATCH] suicide --- nixos/configuration.nix | 125 ++++++++++++++ nixos/flake.lock | 62 +++++++ nixos/flake.nix | 20 +++ nixos/hardware-configuration.nix | 41 +++++ nixos/home.nix | 275 +++++++++++++++++++++++++++++++ 5 files changed, 523 insertions(+) create mode 100644 nixos/configuration.nix create mode 100644 nixos/flake.lock create mode 100644 nixos/flake.nix create mode 100644 nixos/hardware-configuration.nix create mode 100644 nixos/home.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..276b1fe --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,125 @@ +{ config, pkgs, ... }: +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader = { + grub.enable = true; + grub.efiSupport = true; + grub.device = "nodev"; + systemd-boot.enable = false; + efi.canTouchEfiVariables = true; + }; + + boot.plymouth = { + enable = true; + theme = "blahaj"; + themePackages = [ pkgs.plymouth-blahaj-theme ]; + }; + + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; + + networking.hostName = "core"; + networking.networkmanager.enable = true; + networking.enableIPv6 = false; + + time.timeZone = "Asia/Tehran"; + + i18n.defaultLocale = "en_US.UTF-8"; + + services.xserver.enable = true; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + services.printing.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + wireplumber.enable = true; + }; + + services.libinput.enable = true; + programs.nano.enable = false; + security.sudo.enable = false; + security.doas = { + enable = true; + extraRules = [{ users = [ "coast" ]; keepEnv = true; persist = true; }]; + }; + + programs.zsh.enable = true; + programs.zsh.syntaxHighlighting.enable = true; + + users.users.coast = { + isNormalUser = true; + description = "coast"; + extraGroups = [ "networkmanager" "wheel" "video" "audio" ]; + shell = pkgs.zsh; + }; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + services.flatpak.enable = true; + services.jellyfin.enable = true; + programs.steam.enable = true; + programs.sway.enable = true; + + hardware.graphics.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; + + boot.kernelParams = [ "nvidia_drm.modeset=0" ]; + boot.blacklistedKernelModules = [ "nouveau" ]; + + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + pcmanfm wayland-utils + wl-clipboard git + neovim wget nekoray alsa-utils nerd-fonts.ubuntu + (pkgs.runCommand "vim-wrapper" { } '' + mkdir -p $out/bin + ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim + '') + ]; + + fonts.packages = with pkgs; [ + ubuntu-sans + ubuntu_font_family + nerd-fonts._0xproto + nerd-fonts.droid-sans-mono + ]; + + programs.nekoray = { + enable = true; + tunMode.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; + # }; + + services.openssh.enable = true; + networking.firewall.enable = false; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = "25.05"; + +} diff --git a/nixos/flake.lock b/nixos/flake.lock new file mode 100644 index 0000000..da9bdf8 --- /dev/null +++ b/nixos/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1759172751, + "narHash": "sha256-E8W8sRXfrvkFW26GuuiWq6QfReU7m5+cngwHuRo/3jc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "12fa8548feefa9a10266ba65152fd1a787cdde8f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1758690382, + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixos/flake.nix b/nixos/flake.nix new file mode 100644 index 0000000..a98ac0d --- /dev/null +++ b/nixos/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + }; + + outputs = { self, nixpkgs, home-manager }: { + nixosConfigurations.core = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ./home.nix + home-manager.nixosModules.home-manager + ]; + }; + }; +} + diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..08b2508 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/69901137-d68b-4d12-916b-973ba1c725f9"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5AE2-A8DF"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/45403b2e-c5a6-430f-bab3-31dd60e85279"; } + ]; + + # 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/home.nix b/nixos/home.nix new file mode 100644 index 0000000..d5af8c5 --- /dev/null +++ b/nixos/home.nix @@ -0,0 +1,275 @@ +{ config, pkgs, ... }: + +{ + home-manager.users.coast = { + home.username = "coast"; + home.homeDirectory = "/home/coast"; + home.stateVersion = "25.05"; + + programs.vesktop.enable = true; + + home.file.".config/qutebrowser/config.py".text = '' + config.load_autoconfig() + c.content.blocking.enabled = True + config.set("content.geolocation", False) + c.url.searchengines = { + 'DEFAULT': 'https://www.google.com/search?q={}', + 'ddg': 'https://duckduckgo.com/?q={}', + 'wiki': 'https://en.wikipedia.org/w/index.php?search={}', + 'gh': 'https://github.com/search?q={}', + } + c.url.start_pages = ['https://www.google.com'] + ''; + + home.packages = with pkgs; [ + zsh-autosuggestions + blueman + brave + neofetch + hyfetch + nix-search-cli + appimage-run + krita + python3 + hyprshot + starship + dysk + ranger + mako + libnotify + kitty + mpv + qbittorrent + gcc + ruby + pciutils + lm_sensors + htop + tealdeer + ]; + + home.file.".config/kitty/kitty.conf".text = '' + font_family family="Ubuntu Mono" + font_size 20 + bold_font auto + italic_font auto + bold_italic_font auto + background_opacity 0.9 + window_padding_width 8 + confirm_os_window_close 0 + + background #1d1d1d + foreground #deddda + + selection_background #303030 + selection_foreground #c0bfbc + + url_color #1a5fb4 + + wayland_titlebar_color system + macos_titlebar_color system + + cursor #deddda + cursor_text_color #1d1d1d + + active_border_color #4f4f4f + inactive_border_color #282828 + bell_border_color #ed333b + visual_bell_color none + + active_tab_background #242424 + active_tab_foreground #fcfcfc + inactive_tab_background #303030 + inactive_tab_foreground #b0afac + tab_bar_background none + tab_bar_margin_color none + + color0 #1d1d1d + color1 #ed333b + color2 #57e389 + color3 #ff7800 + color4 #62a0ea + color5 #9141ac + color6 #5bc8af + color7 #deddda + + color8 #9a9996 + color9 #f66151 + color10 #8ff0a4 + color11 #ffa348 + color12 #99c1f1 + color13 #dc8add + color14 #93ddc2 + color15 #f6f5f4 + ''; + + home.file.".config/sway/config".text = '' + input "1267:12448:ELAN0709:00_04F3:30A0_Touchpad" { + dwt enabled + tap enabled + middle_emulation enabled + } + + seat * xcursor_theme ModernXP 32 + + gaps inner 5 + gaps outer 2 + + set $mod Mod4 + set $left h + set $down j + set $up k + set $right l + set $term kitty + set $filemgr kitty -e ranger + set $menu wmenu-run -f "UbuntuMono 15" -N "#1c1c1c" -n "#B0B0B0" -S "#2d2d2d" -s "#ffffff" -l 10 + set $browser brave + + output eDP-1 disable + output HDMI-A-1 pos 1920 0 + + output * bg /home/coast/Pictures/nature3.png stretch + output HDMI-A-1 resolution 1920x1080 position 1920,0 + + exec swayidle -w \ + timeout 300 'swaylock -f -c 000000' \ + timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + before-sleep 'swaylock -f -c 000000' + + input * { + xkb_options caps:escape + } + + default_border pixel 4 + default_floating_border pixel 4 + + for_window [class=".*"] border pixel 4 + + client.focused #666666 #000000 #ffffff #666666 #666666 + client.unfocused #444444 #000000 #ffffff #444444 #444444 + client.focused_inactive #444444 #000000 #ffffff #444444 #444444 + client.urgent #ff0000 #000000 #ffffff #ff0000 #ff0000 + + + bindsym $mod+Return exec $term + + bindsym $mod+s kill + + bindsym $mod+r exec $menu + + bindsym $mod+Shift+b exec $browser + + floating_modifier $mod normal + + bindsym $mod+Shift+c reload + + bindsym $mod+Shift+q exec 'swaymsg exit' + + bindsym $mod+Shift+f exec $filemgr + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + + bindsym $mod+b splith + bindsym $mod+v splitv + + bindsym $mod+Shift+s layout stacking + bindsym $mod+Shift+w layout tabbed + bindsym $mod+Shift+e layout toggle split + + bindsym $mod+f fullscreen + + bindsym Print exec 'hyprshot -m region -o /home/coast/Pictures/Screenshots/' + + bindsym $mod+space floating toggle + + bindsym $mod+Shift+space focus mode_toggle + + bindsym $mod+a focus parent + + bindsym $mod+Shift+u exec 'pkill waybar; waybar &' + + bindsym $mod+Shift+minus move scratchpad + + bindsym $mod+minus scratchpad show + mode "resize" { + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + bindsym Right resize shrink width 10px + bindsym Up resize grow height 10px + bindsym Down resize shrink height 10px + bindsym Left resize grow width 10px + + bindsym Return mode "default" + bindsym Escape mode "default" + } + bindsym $mod+Shift+d mode "resize" + + bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle + bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% + bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5% + bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle + bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- + bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ + + bar { + position top + font pango:Ubuntu 12 + + status_command while date +'%I:%M %p'; do sleep 1; done + status_command while $HOME/.local/bin/sway-status; do sleep 1; done + + tray_output primary + + colors { + statusline #ffffff + background #1c1c1c + inactive_workspace #1c1c1c #1c1c1c #aaaaaa + focused_workspace #2d2d2d #262626 #ffffff + urgent_workspace #aa0000 #ff0000 #ffffff + } + } + + include /etc/sway/config.d/* + for_window [app_id="foot"] opacity 0.9 + ''; + }; +} +