commit 6491e91ec586d36db831f04d51a8bff4e8d7a8e4 Author: Ifrahim Ansari Date: Sun Feb 15 11:10:32 2026 -0500 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/desktop/configuration.nix b/desktop/configuration.nix new file mode 100644 index 0000000..d6e896e --- /dev/null +++ b/desktop/configuration.nix @@ -0,0 +1,127 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ../disk-config.nix + ]; + + environment.shellAliases = { + rebuild = "sudo nixos-rebuild switch --flake ~/nixos/.#nvidia"; + c = "nix-shell ~/nixos/shells/c.nix"; + js = "nix-shell ~/nixos/shells/js.nix"; + nix = "nix-shell ~/nixos/shells/nix.nix"; + rust = "nix-shell ~/nixos/shells/rust.nix"; + python = "nix-shell ~/nixos/shells/python.nix"; + }; + + programs.steam.enable = true; + + nixpkgs.config.allowUnfree = true; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "iamhome"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/New_York"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Enable Desktop Environment. + services.displayManager.cosmic-greeter.enable = true; + services.desktopManager.cosmic.enable = true; + + services.flatpak.enable = true; + hardware.graphics.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.cups-pdf.enable = true; + services.printing.webInterface = false; + services.printing.drivers = with pkgs; [ brlaser ]; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + # Enable sound. + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; + + programs.bash.enable = true; + programs.bash.completion.enable = true; + + users.users.ifrahim = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + initialPassword = "Smsia2004"; + }; + + environment.systemPackages = with pkgs; [ + home-manager + ]; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ + 631 + 22 + ]; + + # /etc/nixos/configuration.nix snippet + + virtualisation.docker.enable = true; # or podman + + # OCI Container configuration + virtualisation.oci-containers = { + backend = "docker"; # or "podman" + containers = { + my-nginx = { + image = "nginx:latest"; + autoStart = true; + ports = [ + "8080:80" # Host:Container port mapping + ]; + }; + }; + }; + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/desktop/hardware-configuration.nix b/desktop/hardware-configuration.nix new file mode 100644 index 0000000..5596e66 --- /dev/null +++ b/desktop/hardware-configuration.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "ahci" "thunderbolt" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/disk-config.nix b/disk-config.nix new file mode 100644 index 0000000..5978a1a --- /dev/null +++ b/disk-config.nix @@ -0,0 +1,33 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..387ddb1 --- /dev/null +++ b/flake.lock @@ -0,0 +1,71 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768920986, + "narHash": "sha256-CNzzBsRhq7gg4BMBuTDObiWDH/rFYHEuDRVOwCcwXw4=", + "owner": "nix-community", + "repo": "disko", + "rev": "de5708739256238fb912c62f03988815db89ec9a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "latest", + "repo": "disko", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770260404, + "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771043024, + "narHash": "sha256-O1XDr7EWbRp+kHrNNgLWgIrB0/US5wvw9K6RERWAj6I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3aadb7ca9eac2891d52a9dec199d9580a6e2bf44", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "disko": "disko", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1420c93 --- /dev/null +++ b/flake.nix @@ -0,0 +1,64 @@ +{ + description = "A very basic flake"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + disko = { + url = "github:nix-community/disko/latest"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + disko, + home-manager, + nixpkgs, + ... + }: + let + system = "x86_64-linux"; + + serverModules = [ + disko.nixosModules.disko + ]; + + commonModules = [ + disko.nixosModules.disko + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.ifrahim = import ./home.nix; + } + ]; + in + { + nixosConfigurations = { + + # Black Server Configuration + black = nixpkgs.lib.nixosSystem { + inherit system; + modules = serverModules ++ [ ./servers/black/configuration.nix ]; + }; + + # Laptop Configuration + laptop = nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules ++ [ ./laptop/configuration.nix ]; + }; + + nvidia = nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules ++ [ + ./nvidia/nvidia.nix + ./desktop/configuration.nix + ]; + }; + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..75b81e9 --- /dev/null +++ b/home.nix @@ -0,0 +1,45 @@ +{ pkgs, ... }: + +{ + home.username = "ifrahim"; + home.homeDirectory = "/home/ifrahim"; + home.stateVersion = "25.11"; # Match your initial install version + + # This is where your user-specific packages go now + home.packages = with pkgs; [ + fd + nil + nixd + unzip + ghostty + flatpak + zed-editor + openconnect + networkmanager + nixos-generators + thunderbird-latest + nerd-fonts.jetbrains-mono + wl-clipboard + ripgrep + lazygit + htop + curl + wget + ]; + + fonts.fontconfig.enable = true; + + programs.git = { + enable = true; + settings.user = { + name = "Ifrahim Ansari"; + email = "iam@ifrahim.dev"; + }; + }; + + home.file.".config/nvim" = { + source = ./nvim; # Nix implicitly converts local paths to store paths + recursive = true; + force = true; + }; +} diff --git a/iso/iso.nix b/iso/iso.nix new file mode 100644 index 0000000..eba98ba --- /dev/null +++ b/iso/iso.nix @@ -0,0 +1,52 @@ +{ + pkgs, + modulesPath, + lib, + config, + ... +}: +{ + imports = [ + "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" + ]; + + users.users.root = { + initialPassword = "password"; + }; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + services.openssh.enable = true; + + # supported filesystems + boot.supportedFilesystems = lib.mkForce [ + "btrfs" + "reiserfs" + "vfat" + "f2fs" + "xfs" + "ntfs" + "cifs" + ]; + + # use the latest Linux kernel + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.initrd.availableKernelModules = [ + "nvme" + "ahci" + "thunderbolt" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "iwlwifi" + ]; + boot.extraModulePackages = [ ]; +} diff --git a/laptop/configuration.nix b/laptop/configuration.nix new file mode 100644 index 0000000..1ec72f1 --- /dev/null +++ b/laptop/configuration.nix @@ -0,0 +1,109 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ../disk-config.nix + ]; + + environment.shellAliases = { + rebuild = "sudo nixos-rebuild switch --flake ~/nixos/.#laptop"; + c = "nix-shell ~/nixos/shells/c.nix"; + js = "nix-shell ~/nixos/shells/js.nix"; + nix = "nix-shell ~/nixos/shells/nix.nix"; + rust = "nix-shell ~/nixos/shells/rust.nix"; + python = "nix-shell ~/nixos/shells/python.nix"; + }; + + fonts.fontconfig.enable = true; + + fonts.packages = with pkgs; [ nerd-fonts.jetbrains-mono ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "whoami"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + networking.networkmanager.wifi.powersave = false; + + # Set your time zone. + time.timeZone = "America/New_York"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Gnome Desktop. + services.desktopManager.gnome.enable = true; + services.displayManager.gdm.enable = true; + services.gnome.gnome-software.enable = true; + services.gnome.core-apps.enable = true; + services.gnome.games.enable = false; + + services.flatpak.enable = true; + hardware.graphics.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound. + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + programs.bash.enable = true; + programs.bash.completion.enable = true; + users.defaultUserShell = pkgs.bash; + + users.users.ifrahim = { + isNormalUser = true; + extraGroups = [ + "networkmanager" + "wheel" + ]; # Enable ‘sudo’ for the user. + initialPassword = "Smsia2004"; + }; + + environment.systemPackages = with pkgs; [ + home-manager + curl + wget + btop + ]; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + networking.firewall.enable = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/laptop/hardware-configuration.nix b/laptop/hardware-configuration.nix new file mode 100644 index 0000000..1bef748 --- /dev/null +++ b/laptop/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nvidia/nvidia.nix b/nvidia/nvidia.nix new file mode 100644 index 0000000..ce283b4 --- /dev/null +++ b/nvidia/nvidia.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + hardware.graphics = { + enable = true; + }; + + services.xserver.videoDrivers = [ + "nvidia" + ]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; + +} diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..8466edc --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,3 @@ +require("ifrahim.init") +require("config.lazy") +require("lsp.init") diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..3c11869 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,26 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + import = "plugins" + }, + change_detection = { + notify = false + } + +}) diff --git a/nvim/lua/ifrahim/init.lua b/nvim/lua/ifrahim/init.lua new file mode 100644 index 0000000..551b3c5 --- /dev/null +++ b/nvim/lua/ifrahim/init.lua @@ -0,0 +1,30 @@ +vim.g.mapleader = " " + +vim.opt.mouse = "" +vim.opt.list = false +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.expandtab = true +vim.opt.shiftwidth = 2 +vim.opt.tabstop = 2 +vim.opt.clipboard = "unnamedplus" +vim.opt.updatetime = 200 +vim.opt.termguicolors = true +vim.opt.fillchars = { eob = " " } + +vim.opt.swapfile = false +vim.opt.smartindent = true +vim.opt.laststatus = 3 + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 +vim.g.loaded_python3_provider = 0 +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 + +vim.opt.backup = false +vim.opt.writebackup = false + +vim.keymap.set("n", "nh", ":nohlsearch", { silent = true }) +vim.keymap.set("n", "nh", ":nohlsearch", { silent = true }) +vim.keymap.set("t", "", "", { noremap = true, silent = true }) diff --git a/nvim/lua/lsp/init.lua b/nvim/lua/lsp/init.lua new file mode 100644 index 0000000..0fc585b --- /dev/null +++ b/nvim/lua/lsp/init.lua @@ -0,0 +1,20 @@ +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +vim.lsp.config("cssls", { + capabilities = capabilities, +}) + +vim.lsp.enable("lua_ls") +vim.lsp.enable("gopls") +vim.lsp.enable("docker_compose_language_service") +vim.lsp.enable("docker_language_server") +vim.lsp.enable("ts_ls") +vim.lsp.enable("pylsp") +vim.lsp.enable("fish_lsp") +vim.lsp.enable("css_modules") +vim.lsp.enable("css_variables") +vim.lsp.enable("cssls") +vim.lsp.enable("nginx_language_server") +vim.lsp.enable("nil_ls") +vim.lsp.enable("nixd") diff --git a/nvim/lua/lsp/lua_ls.lua b/nvim/lua/lsp/lua_ls.lua new file mode 100644 index 0000000..d4f5fe1 --- /dev/null +++ b/nvim/lua/lsp/lua_ls.lua @@ -0,0 +1,27 @@ +return { + cmd = { "lua-language-server" }, + filetypes = { "lua" }, + root_markers = { + ".lua", + ".emmyrc.json", + ".luarc.json", + ".luarc.jsonc", + ".luacheckrc", + ".stylua.toml", + "stylua.toml", + "selene.toml", + "selene.yml", + ".git", + }, + settings = { + Lua = { + codeLens = { + enable = true, + }, + hint = { + enable = true, + semicolon = "Disable", + }, + }, + }, +} diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..a5110d9 --- /dev/null +++ b/nvim/lua/plugins/conform.lua @@ -0,0 +1,21 @@ +return { + "stevearc/conform.nvim", + opts = { + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, + formatters_by_ft = { + nginx = { "nginx-config-formatter" }, + kdl = { "kdlfmt" }, + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { "isort", "black" }, + -- You can customize some of the format options for the filetype (:help conform.format) + rust = { "rustfmt", lsp_format = "fallback" }, + -- Conform will run the first available formatter + javascript = { "prettierd", "prettier", stop_after_first = true }, + }, + }, +} diff --git a/nvim/lua/plugins/cursor.lua b/nvim/lua/plugins/cursor.lua new file mode 100644 index 0000000..22c0eed --- /dev/null +++ b/nvim/lua/plugins/cursor.lua @@ -0,0 +1,6 @@ +return { + "sphamba/smear-cursor.nvim", + opts = { + legacy_computing_symbols_support = true, + }, +} diff --git a/nvim/lua/plugins/everforest.lua b/nvim/lua/plugins/everforest.lua new file mode 100644 index 0000000..1e1f05f --- /dev/null +++ b/nvim/lua/plugins/everforest.lua @@ -0,0 +1,11 @@ +return { + 'sainnhe/everforest', + lazy = false, + priority = 1000, + config = function() + -- Optionally configure and load the colorscheme + -- directly inside the plugin declaration. + vim.g.everforest_enable_italic = true + vim.cmd.colorscheme('everforest') + end + } diff --git a/nvim/lua/plugins/indent-blackline.lua b/nvim/lua/plugins/indent-blackline.lua new file mode 100644 index 0000000..eedcf26 --- /dev/null +++ b/nvim/lua/plugins/indent-blackline.lua @@ -0,0 +1,17 @@ +local highlight = { "CursorColumn", "Whitespace" } + +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = { + indent = { + highlight = { "CursorColumn", "Whitespace" }, + char = "", + }, + whitespace = { + highlight = { "CursorColumn", "Whitespace" }, + remove_blankline_trail = false, + }, + scope = { enabled = false }, + }, +} diff --git a/nvim/lua/plugins/lazygit.lua b/nvim/lua/plugins/lazygit.lua new file mode 100644 index 0000000..d8b5a38 --- /dev/null +++ b/nvim/lua/plugins/lazygit.lua @@ -0,0 +1,20 @@ +return { + "kdheepak/lazygit.nvim", + lazy = false, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "lg", "LazyGit", desc = "LazyGit" }, + }, +} diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..7c74184 --- /dev/null +++ b/nvim/lua/plugins/mason.lua @@ -0,0 +1,4 @@ +return { + "mason-org/mason.nvim", + opts = {}, +} diff --git a/nvim/lua/plugins/mini.lua b/nvim/lua/plugins/mini.lua new file mode 100644 index 0000000..bdf8cc7 --- /dev/null +++ b/nvim/lua/plugins/mini.lua @@ -0,0 +1,45 @@ +return { + "nvim-mini/mini.nvim", + version = "*", + lazy = false, + keys = { + { "ff", "Pick files", { silent = true } }, + { "fb", "Pick buffers", { silent = true } }, + }, + config = function() + require("mini.basics").setup({ + options = { + basic = true, + extra_ui = true, + win_borders = "auto", + }, + + -- Mappings. Set field to `false` to disable. + mappings = { + basic = true, + option_toggle_prefix = [[\]], + windows = true, + move_with_alt = false, + }, + + -- Autocommands. Set field to `false` to disable + autocommands = { + basic = true, + relnum_in_visual_mode = true, + }, + -- Whether to disable showing non-error feedback + silent = true, + }) + require("mini.cmdline").setup() + require("mini.completion").setup() + require("mini.icons").setup() + require("mini.diff").setup() + require("mini.git").setup() + require("mini.pairs").setup() + require("mini.surround").setup() + require("mini.statusline").setup() + require("mini.tabline").setup() + require("mini.pick").setup() + require("mini.notify").setup() + end, +} diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..69799bf --- /dev/null +++ b/nvim/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1 @@ +return { "https://github.com/neovim/nvim-lspconfig" } diff --git a/nvim/lua/plugins/nvim-ts-autotag.lua b/nvim/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..ce88da4 --- /dev/null +++ b/nvim/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1,3 @@ +return { + "windwp/nvim-ts-autotag" +} diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..aee260c --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,14 @@ +return { + "stevearc/oil.nvim", + keys = { + { "-", "Oil", { silent = true } }, + }, + opts = { + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + prompt_save_on_select_new_entry = false, + watch_for_changes = true, + }, + dependencies = { { "nvim-mini/mini.icons", opts = {} } }, + lazy = false, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..a760ad0 --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,27 @@ +return { + "nvim-treesitter/nvim-treesitter", + lazy = false, + build = ":TSUpdate", + opts = { + install_dir = vim.fn.stdpath("data") .. "/site", + }, + config = function() + -- Install specified languages for Treesitter + require("nvim-treesitter").install({ "rust", "javascript", "python", "fish", "ssh_config" }):wait(300000) + + -- Enable Treesitter highlighting for specified file types + vim.api.nvim_create_autocmd("FileType", { + pattern = { "javascript", "rust", "python", "lua" }, + callback = function() + vim.treesitter.start() -- Start Treesitter highlighting + end, + }) + + -- Set up Treesitter-based folding + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + vim.wo.foldmethod = "expr" + + -- Enable Treesitter-based indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +} diff --git a/nvim/lua/plugins/zone.lua b/nvim/lua/plugins/zone.lua new file mode 100644 index 0000000..b33751c --- /dev/null +++ b/nvim/lua/plugins/zone.lua @@ -0,0 +1,3 @@ +return { + "tamton-aquib/zone.nvim", +} diff --git a/servers/black/configuration.nix b/servers/black/configuration.nix new file mode 100644 index 0000000..6679593 --- /dev/null +++ b/servers/black/configuration.nix @@ -0,0 +1,146 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ./disk-config.nix + ]; + + environment.shellAliases = { + rebuild = "sudo nixos-rebuild switch --flake ~/nixos/.#black"; + }; + + environment.systemPackages = with pkgs; [ + nil + nixd + docker + lazygit + ]; + + nixpkgs.config.allowUnfree = true; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "black"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/New_York"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + hardware.graphics.enable = true; + + programs.git = { + enable = true; + config = { + user = { + name = "Ifrahim Ansari"; + email = "iam@ifrahim.dev"; + }; + }; + }; + + users.users.black = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + initialPassword = "Smsia2004"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDeD8k/xQ1cL6y05CHv3X3xESN58hxq833O05LiZaAY ifrahim@whoami" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB/TG85rh2yB4kErVSnYMOffjBMB28uULlCKj5QI0NfL ifrahim@iamhome" + ]; + }; + + services.nginx = { + enable = true; + virtualHosts = { + "git.ifrahim.dev" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://192.168.1.3:3000"; + }; + }; + }; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "iam@ifrahim.dev"; + }; + + # Forgejo Server + services.forgejo = { + enable = true; + settings = { + service = { + DISABLE_REGISTRATION = true; + }; + server = { + ROOT_URL = "https://git.ifrahim.dev"; + SSH_PORT = 2222; + }; + }; + }; + + virtualisation.docker.enable = true; + + # OCI Container configuration + # virtualisation.oci-containers = { + # backend = "docker"; # or "podman" + # containers = { + # nginx = { + # image = "nginx:latest"; + # autoStart = true; + # ports = [ + # "8080:80" # Host:Container port mapping + # ]; + # }; + # }; + # }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ + 22 + 80 + 443 + 2222 + ]; + + nix.gc = { + automatic = true; + dates = "daily"; + }; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/servers/black/disk-config.nix b/servers/black/disk-config.nix new file mode 100644 index 0000000..1b66a29 --- /dev/null +++ b/servers/black/disk-config.nix @@ -0,0 +1,33 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/servers/black/hardware-configuration.nix b/servers/black/hardware-configuration.nix new file mode 100644 index 0000000..f42048f --- /dev/null +++ b/servers/black/hardware-configuration.nix @@ -0,0 +1,26 @@ +# 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" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/shells/c.nix b/shells/c.nix new file mode 100644 index 0000000..4476982 --- /dev/null +++ b/shells/c.nix @@ -0,0 +1,26 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + buildInputs = with pkgs; [ + xz + gcc + gtk4 + libadwaita + gtk-layer-shell + gtk3 + cmake + meson + ninja + clang-tools + libxml2 + libyaml + systemd + gperf + libstemmer + gobject-introspection + curlWithGnuTls + pkg-config + ]; +} diff --git a/shells/js.nix b/shells/js.nix new file mode 100644 index 0000000..e69de29 diff --git a/shells/nix.nix b/shells/nix.nix new file mode 100644 index 0000000..49c3962 --- /dev/null +++ b/shells/nix.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + buildInputs = with pkgs; [ + nil + nixd + nixfmt + ]; +} diff --git a/shells/python.nix b/shells/python.nix new file mode 100644 index 0000000..49ede60 --- /dev/null +++ b/shells/python.nix @@ -0,0 +1,10 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + buildInputs = with pkgs; [ + python3 + uv + ]; +} diff --git a/shells/rust.nix b/shells/rust.nix new file mode 100644 index 0000000..ae5b347 --- /dev/null +++ b/shells/rust.nix @@ -0,0 +1,16 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + buildInputs = with pkgs; [ + rustup + ]; + + shellHook = '' + rustup default stable + rustup component add rustfmt + rustup component add clippy + rustup component add rust-analyzer + ''; +} diff --git a/wallpapers/wallpaper.png b/wallpapers/wallpaper.png new file mode 100644 index 0000000..a9ec716 Binary files /dev/null and b/wallpapers/wallpaper.png differ