From b85918d3b1cf0735751a03e29bcf2ab357fdfb96 Mon Sep 17 00:00:00 2001 From: max_ag Date: Mon, 21 Jul 2025 10:03:04 +0200 Subject: [PATCH] Added dev environments through flakes + edit and flake nushell commands --- assets/oh-my-posh-shadow-backup.toml | 165 --------------------------- assets/reeee.toml | 74 ------------ assets/shadow-cli.png | Bin 564 -> 0 bytes configuration/configuration.nix | 1 - flake.lock | 116 +++++++++---------- flake.nix | 4 - flakes/flake.lock | 48 ++++++++ flakes/flake.nix | 47 ++++++++ home/modules/programming.nix | 4 - home/modules/shells.nix | 29 ++++- 10 files changed, 179 insertions(+), 309 deletions(-) delete mode 100644 assets/oh-my-posh-shadow-backup.toml delete mode 100644 assets/reeee.toml delete mode 100644 assets/shadow-cli.png create mode 100644 flakes/flake.lock create mode 100644 flakes/flake.nix diff --git a/assets/oh-my-posh-shadow-backup.toml b/assets/oh-my-posh-shadow-backup.toml deleted file mode 100644 index 942a8e2..0000000 --- a/assets/oh-my-posh-shadow-backup.toml +++ /dev/null @@ -1,165 +0,0 @@ -console_title_template = '{{ .Shell }} in {{ .Folder }}' -version = 3 -final_space = true - -[palette] - black = '#262B44' - blue = '#4B95E9' - green = '#59C9A5' - orange = '#303C68' - red = '#D81E5B' - white = '#E0DEF4' - yellow = '#92D4FE' - -[secondary_prompt] - template = '<,p:yellow> >  ' - foreground = 'p:black' - background = 'transparent' - -[transient_prompt] - template = '<,p:yellow> {{ .Folder }}  ' - foreground = 'p:black' - background = 'transparent' - -[upgrade] - source = 'cdn' - interval = '168h' - auto = false - notice = false - -[[tooltips]] - leading_diamond = '' - trailing_diamond = '' - template = '  {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ' - foreground = 'p:white' - background = 'p:orange' - type = 'aws' - style = 'diamond' - tips = ['aws'] - - [tooltips.properties] - display_default = true - -[[tooltips]] - leading_diamond = '' - trailing_diamond = '' - template = '  {{ .Name }} ' - foreground = 'p:white' - background = 'p:blue' - type = 'az' - style = 'diamond' - tips = ['az'] - - [tooltips.properties] - display_default = true - -[[blocks]] - type = 'prompt' - alignment = 'left' - - [[blocks.segments]] - leading_diamond = '' - trailing_diamond = '' - template = ' {{ if .SSHSession }} {{ end }}{{ .UserName }} ' - foreground = 'p:black' - background = 'p:yellow' - type = 'session' - style = 'diamond' - - [[blocks.segments]] - template = '  {{ path .Path .Location }} ' - foreground = 'p:white' - powerline_symbol = '' - background = 'p:orange' - type = 'path' - style = 'powerline' - - [blocks.segments.properties] - style = 'folder' - - [[blocks.segments]] - template = ' {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} ' - foreground = 'p:black' - powerline_symbol = '' - background = 'p:green' - type = 'git' - style = 'powerline' - foreground_templates = ['{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}', '{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}', '{{ if gt .Ahead 0 }}p:white{{ end }}'] - background_templates = ['{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}', '{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}', '{{ if gt .Ahead 0 }}#49416D{{ end }}', '{{ if gt .Behind 0 }}#7A306C{{ end }}'] - - [blocks.segments.properties] - branch_template = '{{ trunc 25 .Branch }}' - fetch_status = true - fetch_upstream_icon = true - - [[blocks.segments]] - template = '  ' - foreground = 'p:white' - powerline_symbol = '' - background = 'p:yellow' - type = 'root' - style = 'powerline' - - [[blocks.segments]] - leading_diamond = '' - trailing_diamond = '' - template = ' {{ if gt .Code 0 }}{{ else }}{{ end }} ' - foreground = 'p:white' - background = 'p:blue' - type = 'status' - style = 'diamond' - background_templates = ['{{ if gt .Code 0 }}p:red{{ end }}'] - - [blocks.segments.properties] - always_enabled = true - -[[blocks]] - type = 'rprompt' - - [[blocks.segments]] - template = ' ' - foreground = 'p:green' - background = 'transparent' - type = 'node' - style = 'plain' - - [blocks.segments.properties] - display_mode = 'files' - fetch_package_manager = false - home_enabled = false - - [[blocks.segments]] - template = ' ' - foreground = 'p:blue' - background = 'transparent' - type = 'go' - style = 'plain' - - [blocks.segments.properties] - fetch_version = false - - [[blocks.segments]] - template = ' ' - foreground = 'p:yellow' - background = 'transparent' - type = 'python' - style = 'plain' - - [blocks.segments.properties] - display_mode = 'files' - fetch_version = false - fetch_virtual_env = false - - [[blocks.segments]] - template = 'in {{ .Name }} ' - foreground = 'p:white' - background = 'transparent' - type = 'shell' - style = 'plain' - - [[blocks.segments]] - template = 'at {{ .CurrentDate | date "15:04:05" }}' - foreground = 'p:white' - background = 'transparent' - type = 'time' - style = 'plain' diff --git a/assets/reeee.toml b/assets/reeee.toml deleted file mode 100644 index 7edb6f0..0000000 --- a/assets/reeee.toml +++ /dev/null @@ -1,74 +0,0 @@ -#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json - -version = 2 -final_space = true -console_title_template = '{{ .Shell }} in {{ .Folder }}' - -[[blocks]] - type = 'prompt' - alignment = 'left' - newline = true - - [[blocks.segments]] - type = 'path' - style = 'plain' - background = 'transparent' - foreground = 'blue' - template = '{{ .Path }}' - - [blocks.segments.properties] - style = 'full' - - [[blocks.segments]] - type = 'git' - style = 'plain' - foreground = 'p:grey' - background = 'transparent' - template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} {{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}' - - [blocks.segments.properties] - branch_icon = '' - commit_icon = '@' - fetch_status = true - -[[blocks]] - type = 'rprompt' - overflow = 'hidden' - - [[blocks.segments]] - type = 'executiontime' - style = 'plain' - foreground = 'yellow' - background = 'transparent' - template = '{{ .FormattedMs }}' - - [blocks.segments.properties] - threshold = 5000 - -[[blocks]] - type = 'prompt' - alignment = 'left' - newline = true - - [[blocks.segments]] - type = 'text' - style = 'plain' - foreground_templates = [ - "{{if gt .Code 0}}red{{end}}", - "{{if eq .Code 0}}magenta{{end}}", - ] - background = 'transparent' - template = '❯' - -[transient_prompt] - foreground_templates = [ - "{{if gt .Code 0}}red{{end}}", - "{{if eq .Code 0}}magenta{{end}}", - ] - background = 'transparent' - template = '❯ ' - -[secondary_prompt] - foreground = 'magenta' - background = 'transparent' - template = '❯❯ ' diff --git a/assets/shadow-cli.png b/assets/shadow-cli.png deleted file mode 100644 index e3ecc9eaeb8a57df666413489da445590ff01cc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 564 zcmeAS@N?(olHy`uVBq!ia0y~yU=U|uV36iuV_;yI{zBw70|NtNage(c!@6@aFBupZ z-+8(?hIn+&4PBUb$3dWW_Ow=))k7Zo_IcToyW{jRx97-5+k)!z3$Gu-~H2%Dhf?dn&sfJPAHq{mY!2%e^;?h-uaC$ z!%q1a3*7u_D^}U(I*n#8kw$q>iH?Y{@A4~2r=2+7=0Ee6z(W=B%}Z6>oCFU3PHE{jIk@EZ_k>NS a>(iODkGz`S+sDAbz~JfX=d#Wzp$PzC6alXQ diff --git a/configuration/configuration.nix b/configuration/configuration.nix index 9fbab68..15f4c1f 100644 --- a/configuration/configuration.nix +++ b/configuration/configuration.nix @@ -13,7 +13,6 @@ config.allowUnfree = true; overlays = [ - inputs.rust-overlay.overlays.default inputs.dolphin-overlay.overlays.default ]; }; diff --git a/flake.lock b/flake.lock index fc2ff88..097b54c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1751740947, - "narHash": "sha256-35040CHH7P3JGmhGVfEb2oJHL/A5mI2IXumhkxrBnao=", + "lastModified": 1752743471, + "narHash": "sha256-4izhj1j7J4mE8LgljCXSIUDculqOsxxhdoC81VhqizM=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "dfc1db15a08c4cd234288f66e1199c653495301f", + "rev": "e31b575d19e7cf8a8f4398e2f9cffe27a1332506", "type": "github" }, "original": { @@ -150,6 +150,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "ref": "refs/heads/main", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "revCount": 92, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -275,11 +291,11 @@ ] }, "locked": { - "lastModified": 1752286566, - "narHash": "sha256-A4nftqiNz2bNihz0bKY94Hq/6ydR6UQOcGioeL7iymY=", + "lastModified": 1753056897, + "narHash": "sha256-AVVMBFcuOXqIgmShvRv9TED3fkiZhQ0ZvlhsPoFfkNE=", "owner": "nix-community", "repo": "home-manager", - "rev": "392ddb642abec771d63688c49fa7bcbb9d2a5717", + "rev": "13a83d1b6545b7f0e8f7689bad62e7a3b1d63771", "type": "github" }, "original": { @@ -296,11 +312,11 @@ ] }, "locked": { - "lastModified": 1743604125, - "narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=", + "lastModified": 1752603129, + "narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=", "owner": "nix-community", "repo": "home-manager", - "rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a", + "rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b", "type": "github" }, "original": { @@ -354,11 +370,11 @@ ] }, "locked": { - "lastModified": 1751808145, - "narHash": "sha256-OXgL0XaKMmfX2rRQkt9SkJw+QNfv0jExlySt1D6O72g=", + "lastModified": 1752149140, + "narHash": "sha256-gbh1HL98Fdqu0jJIWN4OJQN7Kkth7+rbkFpSZLm/62A=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "b841473a0bd4a1a74a0b64f1ec2ab199035c349f", + "rev": "340494a38b5ec453dfc542c6226481f736cc8a9a", "type": "github" }, "original": { @@ -383,11 +399,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1752337367, - "narHash": "sha256-kEumflYEdQSrZZQEr7kik2sBfFohEx0TsJB1rBVAQy4=", + "lastModified": 1753033360, + "narHash": "sha256-OwTaEBF/ZXl5RyVPmsCoomunVJdDzpOSFwfvwtzdNxY=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "d0f58baf296a2cdd5df0f82212fe17dfbef8438e", + "rev": "462729d8655a3a37ba19fe254d8ecb6677963563", "type": "github" }, "original": { @@ -530,11 +546,11 @@ ] }, "locked": { - "lastModified": 1751888065, - "narHash": "sha256-F2SV9WGqgtRsXIdUrl3sRe0wXlQD+kRRZcSfbepjPJY=", + "lastModified": 1752252310, + "narHash": "sha256-06i1pIh6wb+sDeDmWlzuPwIdaFMxLlj1J9I5B9XqSeo=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "a8229739cf36d159001cfc203871917b83fdf917", + "rev": "bcabcbada90ed2aacb435dc09b91001819a6dc82", "type": "github" }, "original": { @@ -555,11 +571,11 @@ ] }, "locked": { - "lastModified": 1751881472, - "narHash": "sha256-meB0SnXbwIe2trD041MLKEv6R7NZ759QwBcVIhlSBfE=", + "lastModified": 1751897909, + "narHash": "sha256-FnhBENxihITZldThvbO7883PdXC/2dzW4eiNvtoV5Ao=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "8fb426b3e5452fd9169453fd6c10f8c14ca37120", + "rev": "fcca0c61f988a9d092cbb33e906775014c61579d", "type": "github" }, "original": { @@ -600,11 +616,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1751792365, - "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=", + "lastModified": 1752687322, + "narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb", + "rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251", "type": "github" }, "original": { @@ -616,11 +632,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1751984180, - "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", + "lastModified": 1752950548, + "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", + "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", "type": "github" }, "original": { @@ -648,11 +664,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1743448293, - "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", + "lastModified": 1752480373, + "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", + "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", "type": "github" }, "original": { @@ -689,6 +705,7 @@ }, "nvf": { "inputs": { + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", "flake-utils": "flake-utils", "mnw": "mnw", @@ -696,11 +713,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1752180730, - "narHash": "sha256-aSmib/P5DWXrpOdwFOo+lxuupUlNTGUDsLVSxJwWfUg=", + "lastModified": 1753013169, + "narHash": "sha256-ZhhHGYEuBiHgWjAvFcvjiNyWDz2b3WsYoW+xw92LiYs=", "owner": "notashelf", "repo": "nvf", - "rev": "8ea010d7e3bf00c2a1f24d52da88afaed87d96f5", + "rev": "da1fed218b2dda294190e004da4d5bec7d43ec34", "type": "github" }, "original": { @@ -739,31 +756,10 @@ "hyprland": "hyprland", "nixpkgs": "nixpkgs_3", "nvf": "nvf", - "rust-overlay": "rust-overlay", "stylix": "stylix", "zen-browser": "zen-browser" } }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1752288212, - "narHash": "sha256-f2PMqtf61mWAM11QoIfGv3hjD2AsJrij4FCzftepuaE=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "678296525a4cce249c608749b171d0b2ceb8b2ff", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "stylix": { "inputs": { "base16": "base16", @@ -785,11 +781,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1752250117, - "narHash": "sha256-zCPV1a8w9hRn5ukOQwaAggA3X5cMmVsZVBYo8wLfLuU=", + "lastModified": 1753055255, + "narHash": "sha256-t7jZUPQSqlNA3wdIhmZuz7CPAMXCo6CsoAGyrR++jXA=", "owner": "danth", "repo": "stylix", - "rev": "0da583a359fd911d5cbfd2c789424b888b777a4b", + "rev": "c32c82e460b9022c4c20cf51014db1665e866ffb", "type": "github" }, "original": { @@ -971,11 +967,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1752488611, - "narHash": "sha256-z10DN88OItOH58fDuC7LsChdwRU6Ut/01fU6/IQt1sg=", + "lastModified": 1753069499, + "narHash": "sha256-YtgY0ueqKNrBma4Euu8WH23BhUkBujirJDMDE1KujnU=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "0af030205dcbc89c7de5ebc7fc4a10cbf1134c62", + "rev": "c64b94235ae24e3b9e01a08f0331d8bb0e5b037a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index dbedce0..b7a2c91 100644 --- a/flake.nix +++ b/flake.nix @@ -5,10 +5,6 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nvf.url = "github:notashelf/nvf"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; home-manager = { url = "github:nix-community/home-manager"; diff --git a/flakes/flake.lock b/flakes/flake.lock new file mode 100644 index 0000000..50d9ab6 --- /dev/null +++ b/flakes/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1752950548, + "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752979888, + "narHash": "sha256-qRRP3QavbwW0o+LOh31QNEfCgPlzK5SKlWALUJL6T7E=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "95719de18aefa63a624bf75a1ff98744b089ec12", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flakes/flake.nix b/flakes/flake.nix new file mode 100644 index 0000000..34f5e52 --- /dev/null +++ b/flakes/flake.nix @@ -0,0 +1,47 @@ +{ + description = "My rust development shell"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = {nixpkgs, ...} @ inputs: let + system = "x86_64-linux"; + overlays = [(import inputs.rust-overlay)]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in { + devShells."${system}" = { + c = pkgs.mkShell { + buildInputs = with pkgs; [ + gcc + gnumake + ]; + }; + rust = pkgs.mkShell { + buildInputs = with pkgs; [ + gcc + gnumake + rust-bin.beta.latest.default + ]; + }; + c-sharp = pkgs.mkShell { + buildInputs = with pkgs; [ + dotnetCorePackages.sdk_9_0-bin + ] + } + rice = pkgs.mkShell { + buildInputs = with pkgs; [ + cmatrix + asciiquarium + lavat + cbonsai + pipes + ]; + }; + }; + }; +} diff --git a/home/modules/programming.nix b/home/modules/programming.nix index 2944235..08030bf 100644 --- a/home/modules/programming.nix +++ b/home/modules/programming.nix @@ -1,9 +1,5 @@ {pkgs, ...}: { home.packages = with pkgs; [ - rust-bin.stable.latest.default - dotnetCorePackages.sdk_8_0_3xx-bin - gcc - gnumake godot ]; } diff --git a/home/modules/shells.nix b/home/modules/shells.nix index 2503da3..6e29c5e 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -34,6 +34,33 @@ clear fastfetch } + + def flake [ + shell?: string + --edit (-e) + --command (-c): string + ] { + if $edit { + nvim ~/.nix-config/flakes/flake.nix + } else { + match $command { + null => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)"} + _ => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)" --command bash -c $"($command)"} + } + } + } + + def edit [file: path] { + match ($file | path parse | get extension) { + "rs" => { + flake rust -c $"nvim ($file)" + } + "c" | "c++" => { + flake c -c $"nvim ($file)" + } + _ => {nvim $file} + } + } ''; settings = { @@ -43,7 +70,7 @@ shellAliases = { zel = "zellij"; rebuild = "sudo nixos-rebuild switch --flake /home/maxag/.nix-config"; - flake = "nvim /home/maxag/.nix-config/flake.nix"; + system = "nvim /home/maxag/.nix-config/flake.nix"; home = "nvim /home/maxag/.nix-config/home/home.nix"; config = "nvim /home/maxag/.nix-config/configuration/configuration.nix"; projects = "cd /mnt/removable/Projekty";