Best NixOS Way to Write Your Scripts

  Рет қаралды 20,653

Vimjoyer

Vimjoyer

10 ай бұрын

Discord server: / discord
Nix-index database:
github.com/nix-community/nix-...
script in the video:
```
{ pkgs }:
pkgs.writeShellScriptBin "my-awesome-script"''
echo "hello world" | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat
''
```

Пікірлер: 40
@iynaix644
@iynaix644 10 ай бұрын
I prefer writeShellApplication over writeShellScriptBin. writeShellApplication also runs your shell script through shellcheck, great for people like me who write sloppy shell scripts. You can also specify runtime dependencies by doing runtimeInputs = [ cowsay ];, that way you can just write cowsay without having to reference the path to cowsay explicitly within the script :)
@BartekBroniszewski
@BartekBroniszewski 10 ай бұрын
NixOS is fun, the other day I installed it on Gnome Boxes with Gnome env. After that I changed the config to KDE and was blown away that there was no Gnome leftover apps. After sometime I switched generations and got back to Gnome with all of my apps and data intact. Pure greatness🎉
@phantasm4037
@phantasm4037 3 ай бұрын
ok this BLEW MY MIND i did not know this was possible, this is insanely cool!
@vimjoyer
@vimjoyer 3 ай бұрын
I know, right? So many cool use cases
@stephenflee7989
@stephenflee7989 2 ай бұрын
Hey man! Just wanted to shout out and join the others by saying thanks for the awesome content!
@stephenflee7989
@stephenflee7989 2 ай бұрын
Thanks so much! Your content has helped a ton.
@briainodriscoll
@briainodriscoll 10 ай бұрын
Thanks for these videos. They're great for prepping to install. I would be great if you could create a Matrix bridge to your Discord server!
@vimjoyer
@vimjoyer 10 ай бұрын
I will, but I don't use matrix myself, so I'll do it once I have time
@briainodriscoll
@briainodriscoll 10 ай бұрын
@@vimjoyer thanks, it's nicer to use [a matrix client like Element or Neochat] than Discord imho. Glad you got you mic working better too ;)
@vimjoyer
@vimjoyer 10 ай бұрын
@@briainodriscoll This mic is still not perfect, and I have to rerecord 1/3 of the audio. If the channel grows, I'll buy a new one.
@unknown-otter
@unknown-otter 10 ай бұрын
Thank you!
@Doomsdayparade
@Doomsdayparade 3 ай бұрын
I keep trying to NOT use nixos, but the little tism goblin in my head won't let me.
@reihanboo
@reihanboo 2 ай бұрын
I lost already. A week on arch and every pacman -S I do damages my soul
@user-wl6up8fb5h
@user-wl6up8fb5h 10 ай бұрын
Thank You!
@fulsomenko
@fulsomenko 10 ай бұрын
nice
@ibm450
@ibm450 10 ай бұрын
Yeh this is how I created my own system wide scripts. I mount and unmount my mnt drives alot. Linux in general has really terrible mounting issues after it comes out of sleep or hibernation and I found Dolphin freezes and hangs for awhile so I umount all my mnt points before it goes into powerrsave mode .
@vimjoyer
@vimjoyer 10 ай бұрын
That's a good use case
@theglowpt3
@theglowpt3 10 ай бұрын
This sounds really cool, if the user has one of these packages installed in user space will it use that, or still create a separate version for the script?
@vimjoyer
@vimjoyer 10 ай бұрын
if it's the same version then yes. If user then deletes it, it will still stay in nix store for this script.
@theglowpt3
@theglowpt3 10 ай бұрын
@@vimjoyer How do you specify version for the package in the script?
@vimjoyer
@vimjoyer 10 ай бұрын
@@theglowpt3 you need to have a specific version of nixpkgs defined in your flake. There some tools to make it easier, and I'll make a video about them later.
@theglowpt3
@theglowpt3 10 ай бұрын
@@vimjoyer Ahh I see, thanks!
@gbember3470
@gbember3470 10 ай бұрын
Hi! I heard nix has more packages than even the aur, but still there's a applicatoon that's not on the repos, would it be too hard to package it?
@vimjoyer
@vimjoyer 10 ай бұрын
It depends... generally packaging applications for nixos is not hard. You can also use flatpak on NixOS.
@gbember3470
@gbember3470 10 ай бұрын
@@vimjoyer I would rather use regular packages, but the application is question is also available as a appimage, thanks!
@vimjoyer
@vimjoyer 10 ай бұрын
@@gbember3470 nice, so you can always have plan B. packaging is easy once you get to know nix.
@drog
@drog 10 ай бұрын
​@@vimjoyersounds like a theme for the next video. Please 🙏
@kajelvobot2634
@kajelvobot2634 10 ай бұрын
you dont do packages but derivations :) if you are able to compile it manualy then you are almost done...
@apsotik
@apsotik 10 ай бұрын
hey love you videos! Can you make a video to setup nix in vmware/virtualbox with hyprland. I am on windows host and really struggling to get it work, kitty alacritty does NOT work although foot works still need for support to run application on hyprland. Running firefox freezes everything
@vimjoyer
@vimjoyer 10 ай бұрын
Yes, some people have also reported that those terminals don't work with virtualbox. Maybe hyprland is not quite ready for that use case.
@apsotik
@apsotik 10 ай бұрын
@@vimjoyer currently switching to awesomewm + nixOS but I really wanted to use hyprland. Anyways love your content and waiting for the next vid 💕
@vimjoyer
@vimjoyer 10 ай бұрын
@@apsotik I was using it with awesome before hyprland, my favorite X window manager
@zperk13
@zperk13 Ай бұрын
But what if you didn't already have cowsay and lolcat in your nix store
@vimjoyer
@vimjoyer Ай бұрын
it will download them
@geowhat
@geowhat 10 ай бұрын
I really want to get NixOS mainly due to its stability. However i do lots of os dev stuff and i dont know how i might be able to build a cross compiler thats a huge part of os dev. can someone help me please? i cant seem to find any useful info online
@vimjoyer
@vimjoyer 10 ай бұрын
If you know what you are doing, NixOS is easier and better for development.
@geowhat
@geowhat 10 ай бұрын
@@vimjoyer i have been using arch (btw) for my work and i kinda got sick of it after grub got bricked ig ill have to look into it more
@mgord9518
@mgord9518 7 ай бұрын
Have you looked into Zig? It's a language but comes with a REALLY good C cross-compilation toolchain.
NixOS: Sddm, Gtk, QT5 Simple Theming Guide
8:17
Vimjoyer
Рет қаралды 19 М.
Ultimate NixOS Guide | Flakes | Home-manager
15:30
Vimjoyer
Рет қаралды 110 М.
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 6 МЛН
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,6 МЛН
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 12 МЛН
Countries Treat the Heart of Palestine #countryballs
00:13
CountryZ
Рет қаралды 26 МЛН
NixOS: Everything Everywhere All At Once
15:10
No Boilerplate
Рет қаралды 268 М.
The ULTIMATE guide to Nixpkgs
7:43
IogaMaster
Рет қаралды 1,9 М.
NixOS tutorial - Nix Packages
18:30
Why Does Nothing Work
Рет қаралды 1,7 М.
Nix and NeoVim
13:38
ThePrimeTime
Рет қаралды 116 М.
We may have killed p10k, so I found the perfect replacement.
19:48
Dreams of Autonomy
Рет қаралды 67 М.
How To Use The Context Package In Golang?
17:03
Anthony GG
Рет қаралды 52 М.
NixOS is Mindblowing
12:02
Chris Titus Tech
Рет қаралды 667 М.
Matthew Croughan - Use flake.nix, not Dockerfile - MCH2022
17:25
Matthew Croughan
Рет қаралды 43 М.
Nixos and Hyprland - Best Match Ever
7:13
Vimjoyer
Рет қаралды 137 М.
Full NixOS Guide: Everything You Need to Know in One Place!
30:11
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 6 МЛН