From 28b5df52809a90d5f63721ec3502f797a3df85cc Mon Sep 17 00:00:00 2001 From: jiriks74 <jiri@stefka.eu> Date: Sat, 19 Apr 2025 23:07:40 +0200 Subject: [PATCH] test --- flake.lock | 34 -------------------------- flake.nix | 28 ++++------------------ module.nix | 36 ++++++++++++++++++++++++++++ modules/git.nix | 6 +++++ modules/kubernetes.nix | 22 +++++++++++++++++ modules/netTools.nix | 7 ++++++ packages.nix => modules/packages.nix | 13 ++++++++-- zsh.nix => modules/zsh.nix | 4 ++-- 8 files changed, 89 insertions(+), 61 deletions(-) create mode 100644 module.nix create mode 100644 modules/git.nix create mode 100644 modules/kubernetes.nix create mode 100644 modules/netTools.nix rename packages.nix => modules/packages.nix (71%) rename zsh.nix => modules/zsh.nix (98%) diff --git a/flake.lock b/flake.lock index 7f3bf8d..2550f70 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1742707865, @@ -34,24 +16,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 70db964..25c2752 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,10 @@ { description = "jiriks74's ZSH configuration"; - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - }; + # inputs = { + # }; - outputs = {nixpkgs, ...}: let + outputs = {self, nixpkgs, ...}: let # Supported systems for your flake packages, shell, etc. systems = [ "aarch64-linux" @@ -20,25 +19,8 @@ in { formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); homeManagerModules = { - default = { - config, - lib, - pkgs, - ... - }: { - inport = ./zsh.nix; - }; - withPackages = { - config, - lib, - pkgs, - ... - }: { - imports = [ - ./zsh.nix - ./packages.nix - ]; - }; + zsh = (import ./module.nix); + default = self.outputs.homeManagerModules.zsh; }; }; } diff --git a/module.nix b/module.nix new file mode 100644 index 0000000..7da6ef2 --- /dev/null +++ b/module.nix @@ -0,0 +1,36 @@ +# ~/.config/nixpkgs/modules/jiriks74/zsh/default.nix +{ config, lib, pkgs, ... }: + +let + cfg = config.jiriks74.zsh; + # Helper to get the path relative to this file + mkPath = path: ./modules + "/${path}"; +in { + options.jiriks74.zsh = { + # Option to enable the core Zsh configuration (like programs.zsh.enable) + enable = lib.mkEnableOption "Enable jiriks74's core zsh configuration"; + + # Option to include extra packages + qolPackages = lib.mkEnableOption "Enable QualityOfLife packages"; + }; + + # Conditionally import other Nix files based on the options + imports = + # Import core zsh settings if 'enable' is true + (lib.lists.optionals cfg.enable [ (mkPath "zsh.nix") ]) + + # Import packages if 'extraPackages' is true + ++ (lib.lists.optionals cfg.extraPackages [ (mkPath "packages.nix") ]) + + # Add more conditional imports here based on other options + # ++ (lib.lists.optionals cfg.keybindings [ (mkPath "keybindings.nix") ]) + # ++ (lib.lists.optionals cfg.plugins [ (mkPath "plugins.nix") ]) + ; + + # Base configuration that might always apply or depend on 'enable' + config = lib.mkMerge [ + # (lib.mkIf cfg.enable { + # programs.zsh.enable = true; + # }) + ]; +} diff --git a/modules/git.nix b/modules/git.nix new file mode 100644 index 0000000..7f1b24a --- /dev/null +++ b/modules/git.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + gh + tea + ]; +} diff --git a/modules/kubernetes.nix b/modules/kubernetes.nix new file mode 100644 index 0000000..b54fa75 --- /dev/null +++ b/modules/kubernetes.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + services.podman.enable = true; + + home.file.minikube = { + enable = true; + target = ".minikube/config/config.json"; + text = '' + { + "container-runtime": "containerd", + "driver": "podman", + "rootless": true + } + ''; + }; + + home.packages = with pkgs; [ + minikube + kubectl + kubectx + k9s + ]; +} diff --git a/modules/netTools.nix b/modules/netTools.nix new file mode 100644 index 0000000..b3410a0 --- /dev/null +++ b/modules/netTools.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + lsof + inetutils + iputils + ]; +} diff --git a/packages.nix b/modules/packages.nix similarity index 71% rename from packages.nix rename to modules/packages.nix index 7c0b3a4..876911d 100644 --- a/packages.nix +++ b/modules/packages.nix @@ -1,12 +1,21 @@ {pkgs, ...}: { home.packages = with pkgs; [ # asciinema - asciinema # Terminal recording + asciinema_3 # Terminal recording asciinema-agg # Convert asciinema recordings libnotify # Notifications - websocat # For asciinema v2 streams # ^ asciinema + curl + + # parsing + gawk + jq + yq + # ^ parsing + + python3 + # useful dev/everyday tools encfs file diff --git a/zsh.nix b/modules/zsh.nix similarity index 98% rename from zsh.nix rename to modules/zsh.nix index 05ee619..df56169 100644 --- a/zsh.nix +++ b/modules/zsh.nix @@ -147,7 +147,7 @@ localVariables = { YSU_MESSAGE_POSITION = "after"; - ASCIINEMA_API_URL = "https://asciinema.stefka.eu"; + # ASCIINEMA_API_URL = "https://asciinema.stefka.eu"; }; shellAliases = { @@ -218,7 +218,7 @@ home.packages = with pkgs; [ nix-zsh-completions - python312Packages.pygments # For antidote + python3Packages.pygments # For antidote # tools for aliases, etc. lsd