Initial commit

This commit is contained in:
uzy lol 2024-11-12 14:29:05 -08:00
commit d307dc9186
43 changed files with 1427 additions and 0 deletions

253
flake.lock Normal file
View File

@ -0,0 +1,253 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1731235328,
"narHash": "sha256-NjavpgE9/bMe/ABvZpyHIUeYF1mqR5lhaep3wB79ucs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "60bb110917844d354f3c18e05450606a435d2d10",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"nixos-cli": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"zig-deps-fod": "zig-deps-fod"
},
"locked": {
"lastModified": 1724973941,
"narHash": "sha256-P4phJQjwMhxSxpdQN1PRJMo5ZRsOtt1zCcs0ocvTDFE=",
"owner": "water-sucks",
"repo": "nixos",
"rev": "0f1ba045c8029fd7c54e65e399b826fd119f0a34",
"type": "github"
},
"original": {
"owner": "water-sucks",
"repo": "nixos",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1731332224,
"narHash": "sha256-0ctfVp27ingWtY7dbP5+QpSQ98HaOZleU0teyHQUAw0=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "184687ae1a3139faa4746168baf071f60d0310c8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1721970117,
"narHash": "sha256-Hwm46lggqtihMaRuxbNaC1ACcU2a0jO/HXqrdjMatXk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "733453ac54a40997a6a690b60f3942d79560247c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1717284937,
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1731139594,
"narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-cli": "nixos-cli",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"spicetify-nix": "spicetify-nix"
}
},
"spicetify-nix": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1731298576,
"narHash": "sha256-l2m0LcSohbU7FXhdlJC/jbxt9PEvFfIcdEXQdSzbvL4=",
"owner": "Gerg-L",
"repo": "spicetify-nix",
"rev": "c503d1e7521af93013b6253a5f4899ea62a3c5a3",
"type": "github"
},
"original": {
"owner": "Gerg-L",
"repo": "spicetify-nix",
"type": "github"
}
},
"zig-deps-fod": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1720999842,
"narHash": "sha256-9G/mlNIbamhnTs1VGB0RlU+JcJGHw5bN0D9BcnQf+DM=",
"owner": "water-sucks",
"repo": "zig-deps-fod",
"rev": "f0a57cdf06f2100d7a045a4062592aeb89468868",
"type": "github"
},
"original": {
"owner": "water-sucks",
"repo": "zig-deps-fod",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

72
flake.nix Normal file
View File

@ -0,0 +1,72 @@
{
description = "NixOS Configuration";
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
#minegrub-world-sel-theme = {
# url = "github:Lxtharia/minegrub-world-sel-theme";
#};
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
nixos-cli = {
url = "github:water-sucks/nixos";
};
};
outputs = {
self,
nixpkgs,
home-manager,
spicetify-nix,
nixos-hardware,
nixos-cli,
...
} @ inputs: let
lib = nixpkgs.lib;
in {
nixosConfigurations = {
nixos = lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs;};
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.uzair = {
imports = [
./home/home.nix
];
};
}
#inputs.minegrub-world-sel-theme.nixosModules.default
nixos-hardware.nixosModules.dell-precision-5530
nixos-cli.nixosModules.nixos-cli
./system
];
};
};
};
}

6
home/desktop/default.nix Normal file
View File

@ -0,0 +1,6 @@
{
imports = [
./edge.nix
./spotify.nix
];
}

11
home/desktop/edge.nix Normal file
View File

@ -0,0 +1,11 @@
{
# Override Edge entry to always launch with Wayland
xdg.desktopEntries.microsoft-edge = {
name = "Microsoft Edge";
genericName = "Web Browser";
exec = "microsoft-edge --enable-features=UseOzonePlatform --ozone-platform=wayland %U";
categories = [ "Network" "WebBrowser" ];
mimeType = ["application/pdf" "application/rdf+xml" "application/rss+xml" "application/xhtml+xml" "application/xhtml_xml" "application/xml" "image/gif" "image/jpeg" "image/png" "image/webp" "text/html" "text/xml" "x-scheme-handler/http" "x-scheme-handler/https"];
icon = "microsoft-edge";
};
}

12
home/desktop/spotify.nix Normal file
View File

@ -0,0 +1,12 @@
{
# Override Spotify entry to always launch with Wayland
xdg.desktopEntries.spotify = {
name = "Spotify";
genericName = "Music Player";
icon = "spotify-client";
exec = "spotify --enable-features=UseOzonePlatform --ozone-platform=wayland %U";
terminal = false;
mimeType = [ "x-scheme-handler/spotify" ];
categories = [ "Audio" "Music" "Player" "AudioVideo" ];
};
}

85
home/home.nix Normal file
View File

@ -0,0 +1,85 @@
{ config, pkgs, ... }:
{
imports = [
./modules/default.nix
./desktop/default.nix
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "uzair";
home.homeDirectory = "/home/uzair";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/uzair/etc/profile.d/hm-session-vars.sh
#
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Stuff for virtualization
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
}

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
firefox-bin
microsoft-edge
];
}

12
home/modules/default.nix Normal file
View File

@ -0,0 +1,12 @@
{
imports = [
./git.nix
./shellConfig.nix
./devStuff.nix
./socials.nix
./misc.nix
./browsers.nix
./productivity.nix
./media.nix
];
}

128
home/modules/devStuff.nix Normal file
View File

@ -0,0 +1,128 @@
{pkgs, ...}: {
home.sessionVariables = {
EDITOR = "hx";
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
NIXOS_CONFIG = "/home/uzair/Documents/nixos-config";
};
programs.neovim = let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in {
enable = true;
plugins = with pkgs.vimPlugins; [
nvim-cmp
neoformat
rustaceanvim
telescope-fzf-native-nvim
cmp_luasnip
cmp-nvim-lsp
luasnip
friendly-snippets
nvim-web-devicons
vim-nix
copilot-vim
{
plugin = nvim-lspconfig;
config = toLuaFile ./nvimPlugins/lsp.lua;
}
{
plugin = comment-nvim;
config = toLua "require(\"Comment\").setup()";
}
{
plugin = catppuccin-nvim;
config = "colorscheme catppuccin-mocha";
}
{
plugin = telescope-nvim;
config = toLuaFile ./nvimPlugins/telescope.lua;
}
{
plugin = nvim-cmp;
config = toLuaFile ./nvimPlugins/cmp.lua;
}
{
plugin = lualine-nvim;
config = toLuaFile ./nvimPlugins/lualine.lua;
}
{
plugin = trouble-nvim;
# config = toLuaFile ./nvimPlugins/trouble.lua;
}
{
plugin = nvim-tree-lua;
config = toLuaFile ./nvimPlugins/tree.lua;
}
{
plugin = nvim-treesitter.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-json
p.tree-sitter-yaml
p.tree-sitter-typescript
p.tree-sitter-toml
p.tree-sitter-sql
p.tree-sitter-rust
p.tree-sitter-markdown
p.tree-sitter-make
p.tree-sitter-java
p.tree-sitter-kotlin
p.tree-sitter-html
p.tree-sitter-fish
p.tree-sitter-css
p.tree-sitter-cpp
p.tree-sitter-cmake
p.tree-sitter-c-sharp
p.tree-sitter-c
]);
config = toLuaFile ./nvimPlugins/treesitter.lua;
}
];
extraLuaConfig = ''
${builtins.readFile ./nvimPlugins/other.lua}
'';
extraPackages = with pkgs; [
wl-clipboard
ripgrep
];
};
programs.helix = {
enable = true;
};
home.packages = with pkgs; [
# GUI code editors
kdePackages.kate
vscode.fhs
# Utilities
wget
unzip
# IDE
jetbrains.idea-ultimate
# nix language server
nixd
# nix formatter
alejandra
# something for fish lol
fasd
];
}

21
home/modules/git.nix Normal file
View File

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
# Enable and configure Git
programs.git = {
enable = true;
aliases = {
s = "status";
};
userName = "Uzair Mohammed";
userEmail = "uzair.hamed@gmail.com";
extraConfig = {
# credential.helper = "oauth";
credential.credentialStore = "cache";
init.defaultBranch = "master";
};
};
programs.git-credential-oauth = {
enable = true;
};
}

18
home/modules/media.nix Normal file
View File

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nicotine-plus
];
programs.mpv.enable = true;
programs.obs-studio = {
enable = true;
plugins = with pkgs; [
obs-studio-plugins.obs-pipewire-audio-capture
obs-studio-plugins.obs-backgroundremoval
obs-studio-plugins.input-overlay
obs-studio-plugins.obs-vaapi
];
};
}

20
home/modules/misc.nix Normal file
View File

@ -0,0 +1,20 @@
{pkgs, ...}: {
home.packages = with pkgs; [
kdePackages.kdenlive
kdePackages.kget
kdePackages.kalgebra
keepassxc
pciutils
glxinfo
clinfo
wayland-utils
aha
fwupd
glaxnimate
ddcutil
galaxy-buds-client
];
}

View File

@ -0,0 +1,46 @@
local cmp = require('cmp')
local luasnip = require('luasnip')
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}

View File

@ -0,0 +1,49 @@
local on_attach = function(_, bufnr)
local bufmap = function(keys, func)
vim.keymap.set('n', keys, func, { buffer = bufnr })
end
bufmap('<leader>r', vim.lsp.buf.rename)
bufmap('<leader>a', vim.lsp.buf.code_action)
bufmap('gd', vim.lsp.buf.definition)
bufmap('gD', vim.lsp.buf.declaration)
bufmap('gI', vim.lsp.buf.implementation)
bufmap('<leader>D', vim.lsp.buf.type_definition)
bufmap('gr', require('telescope.builtin').lsp_references)
bufmap('<leader>s', require('telescope.builtin').lsp_document_symbols)
bufmap('<leader>S', require('telescope.builtin').lsp_dynamic_workspace_symbols)
bufmap('K', vim.lsp.buf.hover)
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, {})
end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('lspconfig').lua_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = function()
return vim.loop.cwd()
end,
cmd = { "lua-lsp" },
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
}
}
require('lspconfig').nixd.setup {
on_attach = on_attach,
capabilities = capabilities,
cmd = { "nixd" },
filetypes = { "nix" }
}

View File

@ -0,0 +1,41 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@ -0,0 +1,18 @@
-- Change leader key to space
vim.g.mapleader = ' '
vim.o.clipboard = 'unnamedplus'
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.termguicolors = true
-- vim.cmd.colorscheme "catppuccin"
require("Comment").setup()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })

View File

@ -0,0 +1,16 @@
require("telescope").setup(
{
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case" -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
)
require("telescope").load_extension("fzf")

View File

@ -0,0 +1,25 @@
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- empty setup using defaults
-- require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})

View File

@ -0,0 +1,9 @@
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}

View File

@ -0,0 +1,37 @@
return {
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>xX",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
kdePackages.arianna
obsidian
libreoffice-qt6-fresh
];
}

View File

@ -0,0 +1,74 @@
{pkgs, ...}: {
# Nvm lol - Enable ZSH instead of BASH
programs.zsh = {
enable = false;
autosuggestion.enable = true;
enableCompletion = true;
};
# Enable Fish instead of others
programs.fish = {
enable = true;
functions = {
gitignore = "touch .gitignore && curl -sL https://www.gitignore.io/api/$argv >> .gitignore";
finit = "nix flake init --template \"https://flakehub.com/f/the-nix-way/dev-templates/*#$argv\"";
};
generateCompletions = true;
plugins = [
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a";
sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh";
};
}
{
name = "fasd";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-fasd";
rev = "38a5b6b6011106092009549e52249c6d6f501fba";
sha256 = "06v37hqy5yrv5a6ssd1p3cjd9y3hnp19d3ab7dag56fs1qmgyhbs";
};
}
];
shellAbbrs = {
gs = "git status";
ga = "git add";
gc = "git commit -m";
};
shellInit = "set -g fish_greeting";
};
# Enable a better ls replacement
programs.eza = {
enable = true;
enableFishIntegration = true;
};
# Enable the starship prompt and use the default config
programs.starship = {
enable = true;
enableFishIntegration = true;
};
# Set aliases to replace ls with eza
home.shellAliases = {
ls = "eza --long --icons --git --git-repos --hyperlink --time-style relative --color --header";
tree = "eza --long --icons --git --git-repos --hyperlink --time-style relative --color --header --tree";
};
# Enable direnv
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

7
home/modules/socials.nix Normal file
View File

@ -0,0 +1,7 @@
{pkgs, ...}: {
home.packages = with pkgs; [
zoom-us
vesktop
thunderbird
];
}

5
system/default.nix Normal file
View File

@ -0,0 +1,5 @@
{
imports = [
./modules
];
}

View File

@ -0,0 +1,38 @@
{pkgs, ...}: {
# Disable systemd boot to enable Grub
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Copied from default configuration file
boot.initrd.luks.devices."luks-9b26825f-f463-4199-830b-7176055d5fe2".device = "/dev/disk/by-uuid/9b26825f-f463-4199-830b-7176055d5fe2";
# GRUB and MC theme disabled due to an issue - "nixos.png not found"
# Enable Grub and set required parameters to make system bootable
boot.loader.grub = {
enable = false;
# efiSupport = true;
# device = "nodev";
#
# # This does not work for some reason
# gfxmodeEfi = "1920x1080";
# gfxmodeBios = "1920x1080";
#
# # Enable the Minecraft world selection screen theme
# minegrub-world-sel = {
# enable = true;
# customIcons = [
# {
# name = "nixos";
# lineTop = "NixOS Vicuna (24/11/2024, 1:23)";
# lineBottom = "Survival Mode, No Cheats, Version: 24.11";
# # Icon: you can use an icon from the remote repo, or load from a local file
# imgName = "nixLogo";
# customImg = builtins.path {
# path = ./nixLogo.png;
# name = "nixLogo";
# };
# }
# ];
# };
};
}

View File

@ -0,0 +1,21 @@
{
imports = [
./bootloader.nix
./graphics.nix
./powerManagement.nix
./wireless.nix
#./hyprland.nix
./syncthing.nix
./kdePlasma.nix
./pulseAudio.nix
./suspendThenHibernate.nix
./spicetify.nix
./hardware-configuration.nix
./tzLocale.nix
./users.nix
./virt.nix
./miscNixStuff.nix
./nerdFonts.nix
./nixos-cli.nix
];
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
# Enable OpenGL
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-sdk
intel-ocl
intel-compute-runtime
];
};
}

View File

@ -0,0 +1,42 @@
# 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" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cf584cc6-1bdb-4270-85d3-02a2dbc7c8f8";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-6b99e05a-5ac8-4326-9f16-f5fe7db0bde4".device = "/dev/disk/by-uuid/6b99e05a-5ac8-4326-9f16-f5fe7db0bde4";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C134-D637";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/f08e1ad3-7ab7-4c60-ae91-508bb0f55b66"; }
];
# 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.wlp59s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -0,0 +1,60 @@
{pkgs, ...}: {
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORMTHEME = "qt5ct";
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
};
environment.systemPackages = with pkgs; [
# Default Hyprland terminal
kitty
alacritty
waybar
# Notification things
mako
libnotify
# For wallpapers
hyprpaper
# App launcher
rofi-wayland
networkmanagerapplet
playerctl
brightnessctl
# Screenshot and copy stuff
grim
slurp
wl-clipboard
# Needed to display workspaces in Waybar
hyprland-workspaces
# For night light
wlsunset
kdePackages.qt6ct
libsForQt5.qt5ct
catppuccin-qt5ct
wlogout
xfce.thunar
blueman
];
}

View File

@ -0,0 +1,21 @@
{pkgs, ...}: {
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
services.displayManager.sddm.wayland.enable = true;
environment.systemPackages = with pkgs; [
kdePackages.xdg-desktop-portal-kde
kdePackages.kdeconnect-kde
kdePackages.plasma-nm
kdePackages.qtwebsockets
kdePackages.qtmultimedia
plasmusic-toolbar
plasma-browser-integration
];
}

View File

@ -0,0 +1,17 @@
{
environment.sessionVariables = {
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
};
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true;
# 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 = "24.05"; # Did you read the comment?
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = [ "JetBrainsMono" "CascadiaCode" ]; })
];
}

BIN
system/modules/nixLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,19 @@
{
services.nixos-cli = {
enable = true;
config = {
aliases = {
genlist = ["generation" "list"];
switch = ["generation" "switch"];
rollback = ["generation" "rollback"];
gendel = ["generation" "delete"];
gendelall = ["generation" "delete" "--all"];
build = ["apply" "--no-activate" "--no-boot" "--output" "result"];
};
apply = {
imply_impure_with_tag = true;
};
};
};
}

View File

@ -0,0 +1,39 @@
{
powerManagement = {
enable = true;
powertop.enable = true;
};
services = {
# Conflict with auto-cpufreq
power-profiles-daemon.enable = false;
thermald.enable = true;
# List of governors:
# - performance
# - powersave
# - userspace
# - ondemand
# - conservative
# - schedutil
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# https://github.com/AdnanHodzic/auto-cpufreq/blob/v2.3.0/auto-cpufreq.conf-example
auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
# always, auto, never
turbo = "auto";
};
};
};
};
}

View File

@ -0,0 +1,17 @@
{
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
}

View File

@ -0,0 +1,29 @@
{
pkgs,
lib,
inputs,
...
}: let
unstable = import <nixos-unstable> {config = {allowUnfree = true;};};
spicetify-nix = inputs.spicetify-nix;
spicePkgs = spicetify-nix.packages.${pkgs.system}.default;
in {
imports = [
inputs.spicetify-nix.nixosModules.default
];
programs.spicetify = let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
enable = true;
enabledExtensions = with spicePkgs.extensions; [
adblock
beautifulLyrics
];
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";
enabledCustomApps = with spicePkgs.apps; [
lyricsPlus
];
};
}

View File

@ -0,0 +1,6 @@
{
systemd.sleep.extraConfig = ''
HibernateDelaySec=30s # very low value to test suspend-then-hibernate
SuspendState=mem # suspend2idle is buggy :(
'';
}

View File

@ -0,0 +1,31 @@
{pkgs, ...}: {
# Enable and set up Syncthing
services.syncthing = {
enable = true;
user = "uzair";
dataDir = "/home/uzair/Documents/syncthing";
configDir = "/home/uzair/Documents/syncthing/config";
overrideDevices = true;
overrideFolders = true;
settings = {
gui = {
user = "uzair";
password = "welcome@123";
};
devices = {
"uzairPhone" = {id = "NA6LMLH-LWJ3L4L-PMVSSCH-BFUHRUU-B7TXBGU-746NUWZ-P5F5DFK-QJQM2QD";};
"macMiniServer" = {id = "QC24M4F-TRQWXMF-NLRPLAI-LLELUIW-S7ISMPM-K5CPKX5-HSNUBEL-HIMNUAG";};
};
folders = {
"Music" = {
path = "/home/uzair/Music";
devices = ["macMiniServer"];
};
"Secrets" = {
path = "/home/uzair/shhSecret";
devices = ["macMiniServer"];
};
};
};
};
}

View File

@ -0,0 +1,25 @@
{
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# 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 = "";
};
}

7
system/modules/users.nix Normal file
View File

@ -0,0 +1,7 @@
{
users.users.uzair = {
isNormalUser = true;
description = "Uzair Mohammed";
extraGroups = ["networkmanager" "wheel"];
};
}

8
system/modules/virt.nix Normal file
View File

@ -0,0 +1,8 @@
{pkgs, ...}: {
users.users.uzair = {
extraGroups = ["libvirtd"];
};
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}

View File

@ -0,0 +1,49 @@
{
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable CUPS to print documents.
services.printing.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;
# Enable Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Syncthing network config
networking.firewall = {
allowedTCPPorts = [22000];
allowedUDPPorts = [22000 21027];
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
networking.firewall = {
enable = true;
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
} # KDE Connect
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
} # KDE Connect
];
};
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
}