From 1b99070718c33c111f75753af3035caab4274a15 Mon Sep 17 00:00:00 2001 From: js0ny Date: Tue, 21 Oct 2025 15:36:02 +0100 Subject: [PATCH] minor refractor --- .../dot_config/nvim/lua/plugins/fileutils.lua | 8 +- .../plugins/lang/markdown/obsidian-nvim.lua | 79 ++++----- home/dot_config/nvim/lua/plugins/mod/fzf.lua | 43 ++--- .../nvim/lua/plugins/mod/snacks-nvim.lua | 17 +- nixcfgs/flake.nix | 160 +++++++++--------- nixcfgs/hosts/zephyrus/configuration.nix | 126 -------------- nixcfgs/hosts/zephyrus/default.nix | 12 +- nixcfgs/modules/home/dev/c.nix | 4 + nixcfgs/modules/home/programs/nvim.nix | 7 +- nixcfgs/modules/home/programs/starship.nix | 2 +- nixcfgs/modules/home/programs/vscode.nix | 7 +- nixcfgs/modules/home/programs/zoxide.nix | 13 +- nixcfgs/modules/nixos/desktop/kde.nix | 10 +- nixcfgs/modules/nixos/exp.nix | 5 + nixcfgs/modules/nixos/obs-studio.nix | 7 +- nixcfgs/modules/nixos/udev/basys3.nix | 6 + nixcfgs/users/js0ny/programs/distrobox.nix | 5 +- nixcfgs/users/js0ny/programs/emacs.nix | 16 ++ nixcfgs/users/js0ny/programs/mime.nix | 7 + nixcfgs/users/js0ny/programs/shell.nix | 2 - nixcfgs/users/js0ny/programs/vscode.nix | 7 +- nixcfgs/users/js0ny/zephyrus.nix | 3 +- 22 files changed, 248 insertions(+), 298 deletions(-) delete mode 100644 nixcfgs/hosts/zephyrus/configuration.nix create mode 100644 nixcfgs/modules/nixos/exp.nix create mode 100644 nixcfgs/modules/nixos/udev/basys3.nix create mode 100644 nixcfgs/users/js0ny/programs/emacs.nix diff --git a/home/dot_config/nvim/lua/plugins/fileutils.lua b/home/dot_config/nvim/lua/plugins/fileutils.lua index d78119a..a9fe512 100644 --- a/home/dot_config/nvim/lua/plugins/fileutils.lua +++ b/home/dot_config/nvim/lua/plugins/fileutils.lua @@ -3,12 +3,14 @@ return { "rmagatti/auto-session", event = "BufReadPre", cmd = { - "SessionSearch", - "SessionSave", + "AutoSession", }, opts = { suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, }, + keys = { + { "ps", "AutoSession search", desc = "List all sessions" }, + }, }, -- { import = "plugins.mod.nvim-tree" }, -- { import = "plugins.mod.telescope" }, @@ -35,5 +37,5 @@ return { -- "Neogit", -- }, -- }, - { import = "plugins.mod.neo-tree" } + { import = "plugins.mod.neo-tree" }, } diff --git a/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua b/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua index 032d574..e340cd0 100644 --- a/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua +++ b/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua @@ -1,12 +1,11 @@ local uuid = function() - local template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' - return string.gsub(template, '[xy]', function(c) - local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb) - return string.format('%x', v) + local template = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" + return string.gsub(template, "[xy]", function(c) + local v = (c == "x") and math.random(0, 0xf) or math.random(8, 0xb) + return string.format("%x", v) end) end - return { "obsidian-nvim/obsidian.nvim", version = "*", -- recommended, use latest release instead of latest commit @@ -83,45 +82,47 @@ return { yesterday = function() return os.date("%Y-%m-%d", os.time() - 86400) end, - uuid = uuid() + uuid = uuid(), }, }, ---@return table - note_frontmatter_func = function(note) - -- Add the title of the note as an alias. - if note.title then - note:add_alias(note.title) - end - - -- Force to use UUID as the note id. - local note_id - if note.metadata then - note_id = note.id - else - note_id = uuid() - end - - local out = { - id = note_id, - aliases = note.aliases, - tags = note.tags, - title = note.id, - date = os.date( - "%Y-%m-%dT00:00:00"), - } - - -- `note.metadata` contains any manually added fields in the frontmatter. - -- So here we just make sure those fields are kept in the frontmatter. - if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then - for k, v in pairs(note.metadata) do - out[k] = v + frontmatter = { + func = function(note) + -- Add the title of the note as an alias. + if note.title then + note:add_alias(note.title) end - end - -- Force to update mtime. - out.mtime = os.date("%Y-%m-%dT%H:%M:%S") - return out - end, + -- Force to use UUID as the note id. + local note_id = uuid() + if note.metadata.id == nil then + note_id = uuid() + else + note_id = note.metadata.id + end + + local out = { + -- id = note_id, + aliases = note.aliases, + tags = note.tags, + title = note.id, + -- date = os.date("%Y-%m-%dT00:00:00"), + -- mtime = os.date("%Y-%m-%dT%H:%M:%S"), + } + + -- `note.metadata` contains any manually added fields in the frontmatter. + -- So here we just make sure those fields are kept in the frontmatter. + if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then + for k, v in pairs(note.metadata) do + out[k] = v + end + end + + -- Force to update mtime. + out.mtime = os.date("%Y-%m-%dT%H:%M:%S") + return out + end, + }, daily_notes = { folder = "_Global/Periodic", date_format = "%Y-%m-%d", diff --git a/home/dot_config/nvim/lua/plugins/mod/fzf.lua b/home/dot_config/nvim/lua/plugins/mod/fzf.lua index 63a970c..23f5ef1 100644 --- a/home/dot_config/nvim/lua/plugins/mod/fzf.lua +++ b/home/dot_config/nvim/lua/plugins/mod/fzf.lua @@ -3,28 +3,29 @@ return { -- optional for icon support dependencies = { "nvim-tree/nvim-web-devicons" }, cmd = "FzfLua", + --stylua: ignore start keys = { - { "", "FzfLua files", desc = "Find Files" }, - { "fc", "FzfLua files cwd=~/.config/nvim", desc = "Edit configs" }, - { "/", "FzfLua live_grep", desc = "Grep Files" }, - { ";", "FzfLua", desc = "Show Telescope Commands" }, - { "ui", "FzfLua colorschemes", desc = "Change colorscheme" }, - -- find_files { "pp", "FzfLua projects", desc = "Listfind_files all Projects" }, - { "pd", "FzfLua zoxide", desc = "List recent directories" }, - -- { "pg", "FzfLua projects", desc = "List all Git Projects" }, - { "ps", "FzfLua session-lens", desc = "List all sessions" }, - { "gs", "FzfLua git_status", desc = "Git Status" }, - { "gt", "FzfLua git_branches", desc = "Git Branches" }, - { "gc", "FzfLua git_commits", desc = "Show commits" }, - { "fb", "FzfLua buffers", desc = "List Buffers" }, - { "ff", "FzfLua fd", desc = "Find Files" }, - { "fh", "FzfLua oldfiles", desc = "Recent Files" }, - { "ce", "FzfLua diagnostics", desc = "Navigate errors/warnings" }, - { "cs", "FzfLua treesitter", desc = "Search symbols" }, - { "cS", "FzfLua grep_string", desc = "Search current symbol" }, - { "bB", "FzfLua buffers", desc = "List Buffers" }, - { "fl", "FzfLua filetypes", desc = "Set Filetype/Lang to ..." }, - { "R", "FzfLua resume", desc = "Resume FzfLua" }, + { "", function() require("fzf-lua").files() end, desc = "Find Files" }, + { "fc", function() require("fzf-lua").files({ cwd="~/.dotfiles/home/dot_config/nvim"}) end, desc = "Edit configs" }, + { "/", function() require("fzf-lua").live_grep() end, desc = "Grep Files" }, + { ";", function() require("fzf-lua").commands() end, desc = "Show Telescope Commands" }, + { "ui", function() require("fzf-lua").colorschemes() end, desc = "Change colorscheme" }, + -- find_files { "pp", require("fzf-lua").projects, des c = "Listfind_files all Projects" }, + { "pd", function() require("fzf-lua").zoxide() end, desc = "List recent directories" }, + -- { "pg", require("fzf-lua").projects, desc = "List all Git Projects" }, + { "gs", function() require("fzf-lua").git_status() end, desc = "Git Status" }, + { "gt", function() require("fzf-lua").git_branches() end, desc = "Git Branches" }, + { "gc", function() require("fzf-lua").git_commits() end, desc = "Show commits" }, + { "fb", function() require("fzf-lua").buffers() end, desc = "List Buffers" }, + { "ff", function() require("fzf-lua").files() end, desc = "Find Files" }, + { "fh", function() require("fzf-lua").oldfiles() end, desc = "Recent Files" }, + -- { "ce", require("fzf-lua").diagnostics(), desc = "Navi gate errors/warnings" }, + { "cs", function() require("fzf-lua").treesitter() end, desc = "Search symbols" }, + { "cS", function() require("fzf-lua").grep_visual() end, desc = "Search current symbol" }, + { "bB", function() require("fzf-lua").buffers() end, desc = "List Buffers" }, + { "fl", function() require("fzf-lua").filetypes() end, desc = "Set Filetype/Lang to ..." }, + { "R", function() require("fzf-lua").resume() end, desc = "Resume FzfLua" }, }, + --stylua: ignore end opts = {}, } diff --git a/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua b/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua index ee398cc..6b8f720 100644 --- a/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua +++ b/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua @@ -10,15 +10,16 @@ return { dashboard = { enabled = true, preset = { + -- stylua: ignore start keys = { -- { key = "p", icon = "󰈞 ", desc = "查找项目", action = "Telescope projects" }, - { key = "h", icon = " ", desc = "历史文件", action = "FzfLua oldfiles" }, - { key = "l", icon = " ", desc = "加载会话", action = "SessionSearch" }, + { key = "h", icon = " ", desc = "历史文件", action = function () require("fzf-lua").oldfiles() end }, + { key = "l", icon = " ", desc = "加载会话", action = "AutoSession search" }, { key = "c", icon = " ", desc = "转到设置", - action = "FzfLua files cwd=~/.config/nvim", + action = function() require("fzf-lua").files({ cwd = "~/.dotfiles/home/dot_config/nvim" }) end, }, { key = "q", icon = "󱊷 ", desc = "退出", action = "qa" }, }, @@ -69,19 +70,21 @@ return { { section = "startup" }, }, }, + -- stylua: ignore end -- explorer = { -- }, indent = { enabled = true }, - -- input = { enabled = true }, + input = { enabled = true }, notifier = { enabled = true }, - -- quickfile = { enabled = true }, + quickfile = { enabled = true }, scope = { enabled = true }, - -- scroll = { enabled = true }, + scroll = { enabled = true }, statuscolumn = { enabled = true }, -- words = { enabled = true }, image = { enabled = true, - img_dirs = { "90 - System/Assets" } + -- See: ../lang/markdown/obsidian-nvim.lua + img_dirs = { "90 - System/Assets" }, }, }, keys = { diff --git a/nixcfgs/flake.nix b/nixcfgs/flake.nix index 2bf3302..efef870 100644 --- a/nixcfgs/flake.nix +++ b/nixcfgs/flake.nix @@ -27,87 +27,95 @@ }; }; - outputs = { - self, - nixpkgs, - nix-flatpak, - nix-darwin, - home-manager, - plasma-manager, - nur, - winboat, - caelestia-shell, - ... - } @ inputs: let - overlays = [ - nur.overlays.default - (final: prev: { - winboat = winboat.packages.x86_64-linux.winboat; - caelestia-shell = caelestia-shell.packages.x86_64-linux.caelestia-shell; - }) - ]; - forSystem = system: - import nixpkgs { - inherit system overlays; - config.allowUnfree = true; - }; - specialArgs = {inherit inputs overlays;}; - nixosHosts = [ - "zp" - "zephyrus" - "nixvirt" - ]; - - mkNixosSystem = hostname: - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - inherit specialArgs; - modules = [./hosts/${hostname} {nixpkgs.overlays = overlays;}]; - }; - in { - # This will automatically generate nixOS config for `nixosHosts' - # Include the module ./hosts/${hostname} by default. - nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem; - - darwinConfigurations."zen" = nix-darwin.lib.darwinSystem { - system = "aarch64-darwin"; - inherit specialArgs; - modules = [ - ./hosts/zen + outputs = + { + self, + nixpkgs, + nix-flatpak, + nix-darwin, + home-manager, + plasma-manager, + nur, + winboat, + caelestia-shell, + ... + }@inputs: + let + overlays = [ + nur.overlays.default + (final: prev: { + winboat = winboat.packages.x86_64-linux.winboat; + caelestia-shell = caelestia-shell.packages.x86_64-linux.caelestia-shell; + }) + ]; + forSystem = + system: + import nixpkgs { + inherit system overlays; + config.allowUnfree = true; + }; + specialArgs = { inherit inputs overlays; }; + nixosHosts = [ + "zp" + "zephyrus" + "nixvirt" ]; - }; - homeConfigurations = { - js0ny = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; + mkNixosSystem = + hostname: + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + inherit specialArgs; + modules = [ + ./hosts/${hostname} + { nixpkgs.overlays = overlays; } + ]; + }; + in + { + # This will automatically generate nixOS config for `nixosHosts' + # Include the module ./hosts/${hostname} by default. + nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem; + + darwinConfigurations."zen" = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + inherit specialArgs; modules = [ - ./users/js0ny + ./hosts/zen ]; }; - "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; - modules = [ - ./users/js0ny/zephyrus.nix - plasma-manager.homeModules.plasma-manager - nix-flatpak.homeManagerModules.nix-flatpak - ]; - }; - "js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "x86_64-linux"; - extraSpecialArgs = specialArgs; - modules = [ - ./users/js0ny/nixvirt.nix - ]; - }; - "js0ny@zen" = home-manager.lib.homeManagerConfiguration { - pkgs = forSystem "aarch64-darwin"; - extraSpecialArgs = specialArgs; - modules = [ - ./users/js0ny/zen.nix - ]; + + homeConfigurations = { + js0ny = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny + ]; + }; + "js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny/zephyrus.nix + plasma-manager.homeModules.plasma-manager + nix-flatpak.homeManagerModules.nix-flatpak + ]; + }; + "js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "x86_64-linux"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny/nixvirt.nix + ]; + }; + "js0ny@zen" = home-manager.lib.homeManagerConfiguration { + pkgs = forSystem "aarch64-darwin"; + extraSpecialArgs = specialArgs; + modules = [ + ./users/js0ny/zen.nix + ]; + }; }; }; - }; } diff --git a/nixcfgs/hosts/zephyrus/configuration.nix b/nixcfgs/hosts/zephyrus/configuration.nix deleted file mode 100644 index 9ff3b0e..0000000 --- a/nixcfgs/hosts/zephyrus/configuration.nix +++ /dev/null @@ -1,126 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -{ config, lib, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Use latest kernel. - boot.kernelPackages = pkgs.linuxPackages_latest; - - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "Europe/London"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - # }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - - - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # services.pulseaudio.enable = true; - # OR - # 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’. - users.users.js0ny = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - tree - ]; - }; - - # programs.firefox.enable = true; - - # List packages installed in system profile. - # You can use https://search.nixos.org/ to find more packages (and options). - 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 - ]; - - # 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; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = 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.05"; # Did you read the comment? - -} - diff --git a/nixcfgs/hosts/zephyrus/default.nix b/nixcfgs/hosts/zephyrus/default.nix index 1b5a302..735eb7a 100644 --- a/nixcfgs/hosts/zephyrus/default.nix +++ b/nixcfgs/hosts/zephyrus/default.nix @@ -1,5 +1,5 @@ # ~/.config/nixcfgs/hosts/zephyrus/default.nix -{config, ...}: { +{...}: { imports = [ ../../modules/nixos ../../modules/nixos/host-machine.nix @@ -14,7 +14,9 @@ ../../modules/nixos/chromium.nix ../../modules/nixos/obs-studio.nix ../../modules/nixos/wine.nix + ../../modules/nixos/exp.nix ../../modules/nixos/gnome-keyring.nix + ../../modules/nixos/udev/basys3.nix ../../modules/nixos/desktop/kde.nix ../../modules/nixos/desktop/hyprland.nix ../../modules/nixos/display-manager/sddm.nix @@ -25,14 +27,6 @@ nixpkgs.config.allowUnfree = true; networking.hostName = "zephyrus"; - hardware.enableRedistributableFirmware = true; - boot.extraModulePackages = with config.boot.kernelPackages; [ - v4l2loopback - ]; networking.modemmanager.enable = false; - # Xilinx Artix-7 Basys 3 - services.udev.extraRules = '' - ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="dialout", SYMLINK+="basys3" - ''; system.stateVersion = "25.05"; } diff --git a/nixcfgs/modules/home/dev/c.nix b/nixcfgs/modules/home/dev/c.nix index 2deac84..8b42d7f 100644 --- a/nixcfgs/modules/home/dev/c.nix +++ b/nixcfgs/modules/home/dev/c.nix @@ -3,4 +3,8 @@ gcc llvmPackages_21.clang-tools # clangd ]; + + programs.vscode.profiles.default.extensions = with pkgs.vscode-extensions; [ + llvm-vs-code-extensions.vscode-clangd + ]; } diff --git a/nixcfgs/modules/home/programs/nvim.nix b/nixcfgs/modules/home/programs/nvim.nix index 043a17d..f528d83 100644 --- a/nixcfgs/modules/home/programs/nvim.nix +++ b/nixcfgs/modules/home/programs/nvim.nix @@ -1,6 +1,11 @@ -{pkgs, ...}: { +{...}: let + alias = {"v" = "nvim";}; +in { programs.neovim = { enable = true; defaultEditor = true; }; + programs.fish.shellAbbrs = alias; + programs.bash.shellAliases = alias; + programs.zsh.shellAliases = alias; } diff --git a/nixcfgs/modules/home/programs/starship.nix b/nixcfgs/modules/home/programs/starship.nix index 1fdda19..ef1d8d6 100644 --- a/nixcfgs/modules/home/programs/starship.nix +++ b/nixcfgs/modules/home/programs/starship.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{...}: { programs.starship = { enable = true; enableBashIntegration = true; diff --git a/nixcfgs/modules/home/programs/vscode.nix b/nixcfgs/modules/home/programs/vscode.nix index 68ed43b..b66ec33 100644 --- a/nixcfgs/modules/home/programs/vscode.nix +++ b/nixcfgs/modules/home/programs/vscode.nix @@ -1,6 +1,11 @@ -{pkgs, ...}: { +{pkgs, ...}: let + alias = {"c" = "codium";}; +in { programs.vscode = { package = pkgs.vscodium; enable = true; }; + programs.fish.shellAbbrs = alias; + programs.bash.shellAliases = alias; + programs.zsh.shellAliases = alias; } diff --git a/nixcfgs/modules/home/programs/zoxide.nix b/nixcfgs/modules/home/programs/zoxide.nix index 053ac16..dfe37bb 100644 --- a/nixcfgs/modules/home/programs/zoxide.nix +++ b/nixcfgs/modules/home/programs/zoxide.nix @@ -1,8 +1,19 @@ -{pkgs, ...}: { +{...}: let + zoxideAliases = { + ".." = "z .."; + "..." = "z ../.."; + "...." = "z ../../.."; + "....." = "z ../../../.."; + "......" = "z ../../../../.."; + }; +in { programs.zoxide = { enable = true; enableBashIntegration = true; enableZshIntegration = true; enableFishIntegration = true; }; + programs.fish.shellAliases = zoxideAliases; + programs.bash.shellAliases = zoxideAliases; + programs.zsh.shellAliases = zoxideAliases; } diff --git a/nixcfgs/modules/nixos/desktop/kde.nix b/nixcfgs/modules/nixos/desktop/kde.nix index 2fdeb09..233c652 100644 --- a/nixcfgs/modules/nixos/desktop/kde.nix +++ b/nixcfgs/modules/nixos/desktop/kde.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - -{ +{pkgs, ...}: { services.desktopManager.plasma6.enable = true; + environment.systemPackages = with pkgs.kdePackages; [ + akonadi + korganizer + kdepim-addons + ]; } - diff --git a/nixcfgs/modules/nixos/exp.nix b/nixcfgs/modules/nixos/exp.nix new file mode 100644 index 0000000..5bf5e5a --- /dev/null +++ b/nixcfgs/modules/nixos/exp.nix @@ -0,0 +1,5 @@ +{...}: { + # services.forgejo.enable = true; + services.syncthing.enable = true; + services.tailscale.enable = true; +} diff --git a/nixcfgs/modules/nixos/obs-studio.nix b/nixcfgs/modules/nixos/obs-studio.nix index 07821dd..c6e4b43 100644 --- a/nixcfgs/modules/nixos/obs-studio.nix +++ b/nixcfgs/modules/nixos/obs-studio.nix @@ -1,5 +1,8 @@ -{ pkgs, ... }: -{ +{config, ...}: { + hardware.enableRedistributableFirmware = true; + boot.extraModulePackages = with config.boot.kernelPackages; [ + v4l2loopback + ]; programs.obs-studio = { enable = true; enableVirtualCamera = true; diff --git a/nixcfgs/modules/nixos/udev/basys3.nix b/nixcfgs/modules/nixos/udev/basys3.nix new file mode 100644 index 0000000..a6eabd1 --- /dev/null +++ b/nixcfgs/modules/nixos/udev/basys3.nix @@ -0,0 +1,6 @@ +{...}: { + # Xilinx Artix-7 Basys 3 + services.udev.extraRules = '' + ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="dialout", SYMLINK+="basys3" + ''; +} diff --git a/nixcfgs/users/js0ny/programs/distrobox.nix b/nixcfgs/users/js0ny/programs/distrobox.nix index a12dea2..a10d7a6 100644 --- a/nixcfgs/users/js0ny/programs/distrobox.nix +++ b/nixcfgs/users/js0ny/programs/distrobox.nix @@ -1,12 +1,11 @@ -{ config, ... }: -{ +{config, ...}: { programs.distrobox = { enable = true; containers = { Xilinx = { # Container to run Xilinx Vivado Toolchain 2022.2 image = "ubuntu:22.04"; - additional_packages = "libncurses5-dev libtinfo5 ncurses-compat-libs lsb-release graphviz openssl xscreensaver gcc c++ xvfb xorg-dev libwebkit2gtk-4.0-37 libgtk-3-dev libgtk-4-dev libgvfsdbus gvfs libwayland-client0 libwayland-cursor0"; + additional_packages = "libncurses5-dev libtinfo5 ncurses-compat-libs lsb-release graphviz openssl xscreensaver gcc c++ xvfb xorg-dev libwebkit2gtk-4.0-37 libgtk-3-dev libgtk-4-dev libgvfsdbus gvfs libwayland-client0 libwayland-cursor0 x11-utils"; home = "${config.home.homeDirectory}/.local/distrobox/Xilinx"; init_hooks = [ "sudo chown $USER:$USER /opt" diff --git a/nixcfgs/users/js0ny/programs/emacs.nix b/nixcfgs/users/js0ny/programs/emacs.nix new file mode 100644 index 0000000..b80e70f --- /dev/null +++ b/nixcfgs/users/js0ny/programs/emacs.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + programs.emacs = { + enable = true; + package = pkgs.emacs-pgtk; + extraPackages = epkgs: + with epkgs; [ + evil + telega + beancount + counsel + ]; + }; + home.packages = with pkgs; [ + tdlib + ]; +} diff --git a/nixcfgs/users/js0ny/programs/mime.nix b/nixcfgs/users/js0ny/programs/mime.nix index 29dae43..ab43f62 100644 --- a/nixcfgs/users/js0ny/programs/mime.nix +++ b/nixcfgs/users/js0ny/programs/mime.nix @@ -1,4 +1,5 @@ { + xdg.configFile."mimeapps.list".force = true; xdg.mime.enable = true; xdg.mimeApps = { enable = true; @@ -8,6 +9,12 @@ "text/x-csrc" = "nvim-qt.desktop"; "text/x-chdr" = "nvim-qt.desktop"; "inode/directory" = "org.kde.dolphin.desktop"; + "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; + "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; + }; + associations.added = { + "x-scheme-handler/tg" = "org.telegram.desktop.desktop"; + "x-scheme-handler/tonsite" = "org.telegram.desktop.desktop"; }; }; } diff --git a/nixcfgs/users/js0ny/programs/shell.nix b/nixcfgs/users/js0ny/programs/shell.nix index 490116a..c0aad1a 100644 --- a/nixcfgs/users/js0ny/programs/shell.nix +++ b/nixcfgs/users/js0ny/programs/shell.nix @@ -1,11 +1,9 @@ {config, ...}: let commonAliases = { - v = "nvim"; g = "lazygit"; ni = "touch"; cls = "clear"; ii = "open"; - c = "code"; aic = "aichat -s"; aicc = "aichat -c"; nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs"; diff --git a/nixcfgs/users/js0ny/programs/vscode.nix b/nixcfgs/users/js0ny/programs/vscode.nix index 6e319c9..3f499cf 100644 --- a/nixcfgs/users/js0ny/programs/vscode.nix +++ b/nixcfgs/users/js0ny/programs/vscode.nix @@ -1,4 +1,6 @@ -{pkgs, ...}: { +{pkgs, ...}: let + alias = {"c" = "code";}; +in { programs.vscode = { package = pkgs.vscode; enable = true; @@ -14,4 +16,7 @@ vspacecode.whichkey ]; }; + programs.fish.shellAbbrs = alias; + programs.bash.shellAliases = alias; + programs.zsh.shellAliases = alias; } diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix index fabb2c4..d48b5bb 100644 --- a/nixcfgs/users/js0ny/zephyrus.nix +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -8,7 +8,8 @@ ./packages/fonts.nix ./packages/catppuccin.nix ./programs/chromium.nix - ./programs/gnome.nix + ./programs/emacs.nix + # ./programs/gnome.nix ./programs/plasma.nix ./programs/shell.nix ./programs/vscode.nix