Custom NIX Home-Manager Modules For Personalized Setup

Sdílet
Vložit
  • čas přidán 14. 10. 2023
  • Discord server: / discord
    Donations: ko-fi.com/vimjoyer
    code from the video: github.com/vimjoyer/hm-module...
    full monitor module by Misterio77: github.com/Misterio77/nix-con...
  • Věda a technologie

Komentáře • 32

  • @izelnakri
    @izelnakri Před 8 měsíci +14

    A video covering home-manager lib functions(and how to extend them) next would be very useful, by perhaps using an existing flake that extends the lib as an example. I'll look into this as home-manager missed lib.nixGL wrapper which seems to be essential for non-nixOS systems running packages like alacritty, Hyprland, GNOME etc. Btw, ironbar seems to be the best compared to waybar and eww already :P

    • @izelnakri
      @izelnakri Před 8 měsíci

      Also I'd love to run GNOME on a non-nixOS system(for my arch computer, samsung z fold 5 or viture XR neckband) via home-manager afterwards. Seems particularly complicated. I got "$ dbus-run-session -- gnome-shell --display-server --wayland" running but it misses many things including files/folders, default applications etc.

  • @patomackcodes4093
    @patomackcodes4093 Před 8 měsíci +3

    Comically, I was just trying to do this and you released a video for it. Thank you!

    • @vaisakhkm783
      @vaisakhkm783 Před 8 měsíci

      fr... i too yesterday trying to do the same...

  • @ImAnInsect
    @ImAnInsect Před 7 měsíci +1

    Love your videos ! Recently switched to nix and I'm completly lost so your channel helps a lot.

  • @jaydelux2086
    @jaydelux2086 Před 7 měsíci +1

    Really well done video 🚀 so clear and concise. Thank you.

  • @elpitbullhouse
    @elpitbullhouse Před 8 měsíci +2

    This is 🔥 !! Thank you!

  • @francoisrobbertze
    @francoisrobbertze Před 8 měsíci +2

    Brilliant!

  • @ggorg0
    @ggorg0 Před 8 měsíci +7

    Switching to NixOS when I finally have time (high school...)!

  • @Aditya-ny8ur
    @Aditya-ny8ur Před 8 měsíci +1

    Common vimjoyer W :D

  • @hotdog2c
    @hotdog2c Před 7 měsíci +2

    can you do a video on running binaries with external dependencies?

  • @scottiecondon
    @scottiecondon Před 7 měsíci +1

    On the topic of multi monitor support, what would be the best way to define different monitors for different machines while still keeping the rest of the hyprland config the same without just copying and pasting to create different hyprland configs? In a similar vein, for wallpapers, what would be the best way to define different wallpapers dependent on what monitors are available? Say for a 1440p monitor have one wallpaper and for 1080p monitors have a different one?

    • @vimjoyer
      @vimjoyer  Před 7 měsíci +1

      Create a main home-manager module that will contain all of your other modules that you want to import on all machines. Then, make multiple 'home.nix' files, such as 'laptop.nix' and 'workmachine.nix'. Import the main module in both of those files and add them to your flake. This way, you will have two files with little to no differences, except for your wallpapers and monitors, for example. All other hyprland preferences will still be in the main nix file or one of its imports.

  • @minatonamikaze2637
    @minatonamikaze2637 Před 7 měsíci +1

    can you make a video on how to add our own package to nixpkgs for public use?

  • @aimpizza6823
    @aimpizza6823 Před 5 měsíci

    For me there are two issues:
    1. rebuild complains about config being undefined
    2. swww daemon would need to be initiated first, right? I solved this by putting '/path/to/swww init && ...' before setting the wallpaper
    but for now, the path only works hardcoded :[

  • @richardbennett4365
    @richardbennett4365 Před 7 měsíci +1

    Another thing that confuses me is rofi and rofi-unwrapped and the corresponding rofi-wayland and rofi-wayland-unwrapped. These packages seem to install programs with the same names, namely rofi, rofi-theme-selector, and rofi-sensible-terminal.
    Would this mean that NixOS could not install both rofi and rofi-wayland, for example, for the case a user would want to switch between a Wayland session and an X11 session?
    It seems the trend for Gnome and KDE is to move away from X11 and move to Wayland, and true, I would like to use waybar, but it seems there's a reason why I am on X11. I feel there must be some program or application I am using that requires X11.
    It seems like it must be possible with Home Manager to set up a test---
    IF session = Wayland, THEN
    load Wayland-specific environment and load Wayland-specific packages
    ELSE # session is X11
    load X11 environment and X11-specific packages
    Is it too difficult to master, or is this easy to do, Sir?

    • @vimjoyer
      @vimjoyer  Před 7 měsíci +1

      It's extremely easy to conditionally add packages with home-manager or NixOS. Just create a module that exposes a bool option for you, and then use lib.mkIf with packages to add one or the other. Another way is to use NixOS specialisations, and get multiple slightly different variants of your system get added to your version history on every rebuild.

  • @richardbennett4365
    @richardbennett4365 Před 7 měsíci +1

    There's a stylistic set of iosevka available. I want to use ss08 stylistic set. I'm trying to follow your instructions perhaps from another video on how to import a package not available in the nix store (repository). I understand how to find the sha256 string for the package. I just need to get it done.

    • @vimjoyer
      @vimjoyer  Před 7 měsíci +1

      There are many ways to fetch something:
      1.Use nix-prefetch to get the sha hash.
      2. Let it run with any random hash, and nix will fail and give you the correct one.
      3. Let flakes fetch the source and manage the hash for you.
      and some more

    • @richardbennett4365
      @richardbennett4365 Před 7 měsíci +1

      ​​@@vimjoyeryes, I can fetch it. I just need to decide whether to install it for all users or use home manager for a user-by-user case basis. I think I'd like it available for all users, so I'll put the code into /etc/nixos/configuration.nix or have that file import the module from a separate file.
      By the way, I'd like to pass you a compliment that I hope passes from my mouth to God's ears. Your teaching style is perfect for me. You go fast and don't treat us as elementary users, but as intelligent people. Well, that didn't come out very elegant, but your teaching style meshes well with my teaching and learning styles. You also have an amazing, soothing voice I can listen to for hours. 🙂

  • @braaitongs
    @braaitongs Před 4 měsíci +1

    Mabye you can help me. I made a home.nix file in /etx/nixos and then imported into my configuration.nix. But When I try nixos-rebuild switch, it give me an error that says : The option 'home' does not exist. In the home.nix. I specify to enable the home-manager and also specify some home.packages [ ]. What am I missing?

    • @vimjoyer
      @vimjoyer  Před 4 měsíci

      The option home does not exist because you have to import home-manager nixos module. You can do it with a flake or with channels.

    • @braaitongs
      @braaitongs Před 4 měsíci

      That was the part I was missing. I found it evenutally was needed in the configuration.nix. @@vimjoyer

  • @Philopater-Phoneix
    @Philopater-Phoneix Před 8 měsíci +5

    make a video on the nix language syntax or just how to use it

    • @vimjoyer
      @vimjoyer  Před 8 měsíci +2

      Sure will, that video idea is already on the list

  • @starving207
    @starving207 Před 7 měsíci +1

  • @doozku450
    @doozku450 Před 7 měsíci +1

    Good video! I was wondering if you could make a video about setting up some sort of terminal email client like neomutt using NixOS?

    • @vimjoyer
      @vimjoyer  Před 7 měsíci

      I personally don't use any terminal email clients, but I know that home-manager includes a very nice way to configure neomutt by default. I'll think about it.
      Nice PFP btw.

    • @doozku450
      @doozku450 Před 7 měsíci

      @@vimjoyer ty so much king, if you don't use any terminal email clients, then what email client do you use? I used to use mu4e emacs before I switched over to NixOS and decided to go full vim and terminal for text editing, but the one thing I miss from emacs is that sweet email client that I could navigate utilizing just the keyboard.

  • @prodiptushar6680
    @prodiptushar6680 Před 7 měsíci +1

    please share how you make this kind of animated video

    • @vimjoyer
      @vimjoyer  Před 7 měsíci

      this: motioncanvas.io/

  • @QWERD195
    @QWERD195 Před 8 měsíci +1

    instalike, will watch later