diff --git a/flake.lock b/flake.lock index 2d83b29..add283b 100755 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -24,11 +40,11 @@ ] }, "locked": { - "lastModified": 1759573136, - "narHash": "sha256-ILSPD0Dm8p0w0fCVzOx98ZH8yFDrR75GmwmH3fS2VnE=", + "lastModified": 1759853171, + "narHash": "sha256-uqbhyXtqMbYIiMqVqUhNdSuh9AEEkiasoK3mIPIVRhk=", "owner": "nix-community", "repo": "home-manager", - "rev": "5f06ceafc6c9b773a776b9195c3f47bbe1defa43", + "rev": "1a09eb84fa9e33748432a5253102d01251f72d6d", "type": "github" }, "original": { @@ -56,11 +72,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1759591268, - "narHash": "sha256-vHzv4pDydTo44Gk4B13zxHrVhafPwdH2mzwiLjn6q3g=", + "lastModified": 1759948268, + "narHash": "sha256-PKfR49kBk6QWICMiiAZ1gTA6ns2AgJ4PR54POhApPEQ=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "80214ca44411421f49c4dd76864b88e87028b8a3", + "rev": "5fd3508b3552a5c0c28fb4a625b94c6e16253f45", "type": "github" }, "original": { @@ -72,11 +88,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1759590675, - "narHash": "sha256-GOt8U25/XPaSs7G/IurYt8/wsJeoN2WmGUHG6tb12/o=", + "lastModified": 1759949937, + "narHash": "sha256-XWl8nOFNrjJlYE7MjI1kI3u4X58cV+4JZ8KJr32E3RM=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "c620dc89083ad752a024e41aa0c3e2b4d500ce3d", + "rev": "b6adad21707caea42597e617f676d19a83f05bb9", "type": "github" }, "original": { @@ -124,13 +140,35 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1759833546, + "narHash": "sha256-rOfkgIiiZNPUbf61OqEym60wXEODeDG8XH+gV/SUoUc=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "7c0c0f4c3a51761434f18209fa9499b8579ff730", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1759381078, - "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", + "lastModified": 1759831965, + "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", + "rev": "c9b6fb798541223bbb396d287d16f43520250518", "type": "github" }, "original": { @@ -148,6 +186,7 @@ "homebrew-core": "homebrew-core", "nix-darwin": "nix-darwin", "nix-homebrew": "nix-homebrew", + "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs", "sops-nix": "sops-nix" } @@ -159,11 +198,11 @@ ] }, "locked": { - "lastModified": 1759188042, - "narHash": "sha256-f9QC2KKiNReZDG2yyKAtDZh0rSK2Xp1wkPzKbHeQVRU=", + "lastModified": 1759635238, + "narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "9fcfabe085281dd793589bdc770a2e577a3caa5d", + "rev": "6e5a38e08a2c31ae687504196a230ae00ea95133", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a57450f..27a7871 100755 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,10 @@ url = "github:nix-darwin/nix-darwin/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-wsl = { + url = "github:nix-community/NixOS-WSL/main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; homebrew-core = { url = "github:homebrew/homebrew-core"; flake = false; @@ -30,7 +34,7 @@ }; }; - outputs = inputs@{ self, nixpkgs, nix-darwin, nix-homebrew, homebrew-core, homebrew-cask, homebrew-bundle, home-manager, sops-nix }: { + outputs = inputs@{ self, nixpkgs, nix-darwin, nixos-wsl, nix-homebrew, homebrew-core, homebrew-cask, homebrew-bundle, home-manager, sops-nix }: { darwinConfigurations."Dens-MacBook" = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ @@ -59,5 +63,23 @@ ]; }; darwinPackages = self.darwinConfigurations."Dens-MacBook".pkgs; + + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nixos-wsl.nixosModules.default { + system.stateVersion = "25.05"; + wsl.enable = true; + } + /home/duumxh/Nix/wsl/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.duumxh = /home/duumxh/Nix/wsl/home.nix; + } + ]; + }; + }; }; } diff --git a/wsl/configuration.nix b/wsl/configuration.nix new file mode 100755 index 0000000..0e7253d --- /dev/null +++ b/wsl/configuration.nix @@ -0,0 +1,28 @@ +# 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`). + +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://github.com/nix-community/NixOS-WSL + +{ config, lib, pkgs, ... }: + +{ + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + wsl.defaultUser = "duumxh"; + + programs.zsh.enable = true; + + users.users.duumxh = { + isNormalUser = true; + shell = pkgs.zsh; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/wsl/home.nix b/wsl/home.nix new file mode 100755 index 0000000..bd32346 --- /dev/null +++ b/wsl/home.nix @@ -0,0 +1,195 @@ +{ config, pkgs, lib, ... }: + +{ + + home = { + packages = with pkgs; [ + rclone + talosctl + bat + teleport + ansible + kubectl + opentofu + nerd-fonts.jetbrains-mono + age + sops + deploy-rs + kubernetes-helm + kubectx + fzf-preview + zsh-fzf-tab + zsh-forgit + zsh-fzf-history-search + ]; + #sessionVariables = { + # SOPS_AGE_KEY_FILE = "/Users/duumxh/.config/sops/age/keys.txt"; + #}; + stateVersion = "25.11"; + }; + + programs = { + git = { + enable = true; + userName = "Den Afanasyev"; + userEmail = "ceo@furry.industries"; + }; + + zsh = { + enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + prezto = { + prompt = { + theme = "powerlevel10k"; + }; + enable = true; + }; + + autosuggestion = { + #highlight = "fg=#ff00ff,bg=cyan,bold,underline"; + #strategy = [ "completion" "history" ]; + enable = true; + }; + + plugins = [ + { + name = "fzf-tab"; + src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; + } + ]; + + history = { + append = true; + expireDuplicatesFirst = true; + }; + initContent = lib.mkOrder 500 '' + source ~/.p10k.zsh + export TELEPORT_ADD_KEYS_TO_AGENT=no + export K9S_SKIN="transparent" + echo "Hey there raccoon! ≡ƒª¥≡ƒìü" + ''; + #localVariables = {}; + + shellAliases = { + ssh-add = "ssh-add.exe"; + ssh = "ssh-add.exe -l > /dev/null || ssh-add.exe && ssh.exe"; + ls = "eza"; + cd = "z"; + cat = "bat"; + k = "kubectl"; + m = "micro"; + h = "helm"; + t = "teleport"; + tctl = "talosctl"; + }; + }; + + fzf = { + colors = { + fg = "-1"; + "fg+" = "#d0d0d0"; + bg = "-1"; + "bg+" = "#262626"; + hl = "#5f87af"; + "hl+" = "#5fd7ff"; + info = "#afaf87"; + marker = "#87ff00"; + prompt = "#d7005f"; + spinner = "#af5fff"; + pointer = "#af5fff"; + header = "#87afaf"; + border = "#262626"; + label = "#aeaeae"; + query = "#d9d9d9"; + }; + defaultOptions = [ + "--border=rounded" + "--border-label" + "--preview-window=border-rounded" + "--prompt=> " + "--marker=>" + "--pointer=◆" + "--separator=─" + "--scrollbar=│" + ]; + enableZshIntegration = true; + enable = true; + }; + + eza = { + enableZshIntegration = true; + enable = true; + }; + + bat = { + enable = true; + }; + + zoxide = { + enableZshIntegration = true; + enable = true; + }; + + micro = { + settings = { + colorscheme = "simple"; + scrollbar = true; + }; + enable = true; + }; + + k9s = { + skins = { + transparent = { + k9s = { + body.bgColor = "default"; + prompt.bgColor = "default"; + info.sectionColor = "default"; + dialog = { + bgColor = "default"; + labelFgColor = "default"; + fieldFgColor = "default"; + }; + frame = { + crumbs.bgColor = "default"; + title = { + bgColor = "default"; + counterColor = "default"; + }; + menu.fgColor = "default"; + }; + views = { + charts.bgColor = "default"; + table = { + bgColor = "default"; + header = { + fgColor = "default"; + bgColor = "default"; + }; + }; + xray.bgColor = "default"; + logs = { + bgColor = "default"; + indicator = { + bgColor = "default"; + toggleOnColor = "default"; + toggleOffColor = "default"; + }; + }; + yaml = { + colonColor = "default"; + valueColor = "default"; + }; + }; + }; + }; + }; + enable = true; + }; + + home-manager.enable = true; + }; + +}