diff options
| -rw-r--r-- | nixos/apps.nix | 39 | ||||
| -rw-r--r-- | nixos/boot.nix | 63 | ||||
| -rw-r--r-- | nixos/cachix.nix | 13 | ||||
| -rw-r--r-- | nixos/cachix/cuda-maintainers.nix | 13 | ||||
| -rw-r--r-- | nixos/cachix/nix-community.nix | 13 | ||||
| -rw-r--r-- | nixos/configuration.nix | 31 | ||||
| -rw-r--r-- | nixos/desktop-environment.nix | 23 | ||||
| -rw-r--r-- | nixos/environment.nix | 19 | ||||
| -rw-r--r-- | nixos/hardware-configuration.nix | 38 | ||||
| -rw-r--r-- | nixos/home.nix | 33 | ||||
| -rw-r--r-- | nixos/nvidia.nix | 26 | ||||
| -rw-r--r-- | nixos/nvim.nix | 46 | ||||
| -rw-r--r-- | nixos/services.nix | 53 | ||||
| -rw-r--r-- | nixos/tmux.nix | 14 |
14 files changed, 424 insertions, 0 deletions
diff --git a/nixos/apps.nix b/nixos/apps.nix new file mode 100644 index 0000000..1c1814b --- /dev/null +++ b/nixos/apps.nix @@ -0,0 +1,39 @@ +{ config, pkgs, ... }: +{ + # $ nix search wget + environment.systemPackages = with pkgs; [ + vscode + discord + localsend + bitwarden + obsidian + jetbrains.pycharm-professional + jetbrains.clion + wineWowPackages.stable + sqlite + libreoffice-qt6-fresh + + kdePackages.dolphin + yazi + # kio-extras + # ffmpegthumbs + # kdePackages.kdegraphics-thumbnailers + # kdePackages.kimageformats + + android-tools + scrcpy + ]; + + xdg = { + mime.enable = true; + + mime.defaultApplications = { + # don't use libreoffice draw for pdfs, use firefox + "application/pdf" = [ "firefox.desktop" ]; + }; + }; + + # for Localsend + networking.firewall.allowedTCPPorts = [ 53317 ]; + networking.firewall.allowedUDPPorts = [ 53317 ]; +} diff --git a/nixos/boot.nix b/nixos/boot.nix new file mode 100644 index 0000000..0380d33 --- /dev/null +++ b/nixos/boot.nix @@ -0,0 +1,63 @@ +{ config, pkgs, ... }: +{ + fileSystems."/boot".device = "/dev/nvme0n1p6"; + boot.loader = { + grub = { + enable = true; + efiSupport = true; + devices = ["nodev"]; + useOSProber = true; + extraEntries = '' + GRUB_SAVEDEFAULT=true + menuentry "Windows" { + insmod part_gpt + insmod fat + set root=(hd0,gpt1) + chainloader /EFI/Microsoft/Boot/bootmgfw.efi + } + menuentry "Reboot" { + reboot + } + menuentry "Poweroff" { + halt + } + ''; + default = "saved"; + theme = pkgs.stdenv.mkDerivation { + pname = "distro-grub-themes"; + version = "3.1"; + src = pkgs.fetchFromGitHub { + owner = "AdisonCavani"; + repo = "distro-grub-themes"; + rev = "v3.1"; + hash = "sha256-ZcoGbbOMDDwjLhsvs77C7G7vINQnprdfI37a9ccrmPs="; + }; + installPhase = "cp -r customize/hp $out"; + }; + }; + efi.canTouchEfiVariables = true; + systemd-boot.enable = false; + }; + + system.activationScripts.diff = { + supportsDryActivation = true; + text = '' + ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" + ''; + }; + + time.timeZone = "Asia/Kolkata"; + time.hardwareClockInLocalTime = true; + i18n.defaultLocale = "en_IN"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_IN"; + LC_IDENTIFICATION = "en_IN"; + LC_MEASUREMENT = "en_IN"; + LC_MONETARY = "en_IN"; + LC_NAME = "en_IN"; + LC_NUMERIC = "en_IN"; + LC_PAPER = "en_IN"; + LC_TELEPHONE = "en_IN"; + LC_TIME = "en_IN"; + }; +} diff --git a/nixos/cachix.nix b/nixos/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /dev/null +++ b/nixos/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use <name> +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.settings.substituters = ["https://cache.nixos.org/"]; +} diff --git a/nixos/cachix/cuda-maintainers.nix b/nixos/cachix/cuda-maintainers.nix new file mode 100644 index 0000000..b1d70d6 --- /dev/null +++ b/nixos/cachix/cuda-maintainers.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://cuda-maintainers.cachix.org" + ]; + trusted-public-keys = [ + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + ]; + }; + }; +} diff --git a/nixos/cachix/nix-community.nix b/nixos/cachix/nix-community.nix new file mode 100644 index 0000000..7fc4c65 --- /dev/null +++ b/nixos/cachix/nix-community.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..fe6eac0 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: +{ + imports = + [ + ./hardware-configuration.nix + ./boot.nix + ./services.nix + ./nvidia.nix + ./home.nix + ./environment.nix + ./nvim.nix + ./apps.nix + ./tmux.nix + <home-manager/nixos> + ]; + + networking.hostName = "aargh-omen"; + networking.networkmanager.enable = true; + + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = "nix-command flakes"; + + # 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 = "25.05"; # Did you read the comment? + +} diff --git a/nixos/desktop-environment.nix b/nixos/desktop-environment.nix new file mode 100644 index 0000000..3bfa07e --- /dev/null +++ b/nixos/desktop-environment.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: +let unstable = import <nixos-unstable> { config.allowUnfree = true; }; +in { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = false; + programs.hyprland.enable = true; + programs.hyprlock.enable = true; + programs.foot.enable = true; + programs.waybar.enable = true; # status bar + programs.sway.enable = true; # lock screen, idle management + programs.dconf.enable = true; # needed for gsettings + environment.systemPackages = with pkgs; [ + wofi # app launcher + adwaita-icon-theme + swaybg + wl-clipboard + mako + lm_sensors + grim + slurp + ]; +} diff --git a/nixos/environment.nix b/nixos/environment.nix new file mode 100644 index 0000000..a0eb145 --- /dev/null +++ b/nixos/environment.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + gcc + python311 + zoxide + starship + cmake + git-lfs + inetutils + btop + pipes + playerctl + libnotify + ]; + fonts.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + ]; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..fd119a3 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/56ef1a1d-db2f-45e9-b66a-f70f673596bf"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/nvme0n1p6"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.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..2f7fbf1 --- /dev/null +++ b/nixos/home.nix @@ -0,0 +1,33 @@ +{ config, pkgs, ... }: +{ + users.users.aargh = { + isNormalUser = true; + description = "Aargh"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + shell = pkgs.fish; + }; + programs.fish.enable = true; + home-manager.users.aargh = { pkgs, ... }: { + programs.firefox.enable = true; + home.stateVersion = "25.05"; + }; + home-manager.backupFileExtension = "hm-backup"; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 10d"; + }; + + + environment.systemPackages = with pkgs; [ + fastfetch + vim + wget + git + nmap + dust + gnome-tweaks + home-manager + ]; +} diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix new file mode 100644 index 0000000..c6f08a9 --- /dev/null +++ b/nixos/nvidia.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: +let unstable = import <nixos-unstable> { config.allowUnfree = true; }; +in { + hardware.graphics.enable = true; + hardware.nvidia = { + modesetting.enable = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + nvidiaSettings = true; + open = true; + }; + boot.kernelParams = [ "acpi_backlight=video" ]; + boot.initrd.kernelModules = [ "nvidia" "hp_wmi" ]; + services.xserver.videoDrivers = [ "nvidia" ]; + nixpkgs.config.cudaSupport = true; + + environment.systemPackages = with pkgs; [ + linuxPackages.nvidia_x11 + unstable.cudaPackages.cuda_cudart + unstable.cudaPackages.cudatoolkit + ]; + environment.sessionVariables = { + CUDA_HOME = "${pkgs.cudatoolkit}"; + CUDA_PATH = "${pkgs.cudatoolkit}"; + LD_LIBRARY_PATH = "${pkgs.linuxPackages.nvidia_x11}/lib"; + }; +} diff --git a/nixos/nvim.nix b/nixos/nvim.nix new file mode 100644 index 0000000..8eb0026 --- /dev/null +++ b/nixos/nvim.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: +let unstable = import <nixos-unstable> { config.allowUnfree = true; }; +in { + environment.systemPackages = with pkgs; [ + unstable.neovim + + go + gcc + cargo + python311 + nodejs_20 + lua + zig + lua53Packages.luarocks + lua53Packages.luafilesystem + beamMinimal27Packages.elixir + beamMinimal27Packages.erlang + + unzip + xsel + ripgrep + tree-sitter + + gopls + clang-tools + lua-language-server + vscode-langservers-extracted + rust-analyzer + zls + typescript-language-server + javascript-typescript-langserver + (pkgs.python3.withPackages (ps: with ps; [ + python-lsp-server + python-lsp-jsonrpc + python-lsp-black + python-lsp-ruff + pyls-isort + pyls-flake8 + ruff + black + isort + ])) + beamMinimal27Packages.elixir-ls + beamMinimal27Packages.erlang-ls + ]; +} diff --git a/nixos/services.nix b/nixos/services.nix new file mode 100644 index 0000000..1197d42 --- /dev/null +++ b/nixos/services.nix @@ -0,0 +1,53 @@ +{ config, pkgs, ... }: +{ + imports = + [ + ./desktop-environment.nix + ]; + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + services.printing.enable = true; + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.openssh.enable = true; + services.flatpak.enable = true; + services.mongodb = { + enable = true; + bind_ip = "127.0.0.1"; + package = pkgs.mongodb; + }; + services.ollama = { + enable = true; + acceleration = "cuda"; + }; + services.kanata = { + enable = true; + keyboards = { + "keyboard".config = '' + (defsrc + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] ret + caps a s d f g h j k l ; ' \ + lsft z x c v b n m , . / rsft + lctl lmet lalt spc ralt rmet rctl + ) + (deflayer qwerty + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] ret + esc a s d f g h j k l ; ' \ + lsft z x c v b n m , . / rsft + lctl lmet lalt spc ralt rmet rctl + ) + ''; + }; + }; +} diff --git a/nixos/tmux.nix b/nixos/tmux.nix new file mode 100644 index 0000000..f9ed249 --- /dev/null +++ b/nixos/tmux.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: +# let unstable = import <nixos-unstable> { config.allowUnfree = true; }; +{ + programs.tmux.enable = true; + programs.tmux.plugins = with pkgs.tmuxPlugins; [ + sensible + vim-tmux-navigator + tmux-which-key + tmux-powerline + tmux-fzf + gruvbox + yank + ]; +} |
