There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

kbin.life

SexualPolytope , to asklemmy in The specific thing you spend the most time doing instead of the actual job you're being paid to do is your new profession. What's your new job title?
@SexualPolytope@lemmy.sdf.org avatar

Sysadmin cosplayer or Barista.

JadenSmith , to nostupidquestions in Why are weather apps so bad at telling you the current weather?

I went to Amsterdam over the weekend. The weather apps said it was gonna rain, did it fuck. I brought my puffer jacket and was almost dying from the heat until I got to the hotel room. Never had to wear it during the trip.

velox_vulnus , to asklemmy in [Solved] Help remembering a song.

Is it “I’ll Kill Her” by Soko?

So, of course, you were supposed to call me tonight

You were supposed to call me tonight

We would have gone to the cinema

And, after, to the restaurant, the one you like in your street

hperrin OP ,

Yes! That’s the one! Oh my god, thank you!

QuizzaciousOtter , to linuxmemes in Have you tried NixOS?

I mean, it’s like a fucking drug. The learning curve is steep AF but past some point, when it starts making sense, it’s just incredible. I’m currently moving my whole setup to NixOS and I’m in love.

Laser ,

Even when using in a basic way, I think it has one very tangible advantage: the fact that you can “compartmentalize” different aspects of your configuration.

Let’s say I set up a specific web service that I want to put behind a reverse proxy, and it uses a specific folder that doesn’t exist yet, like Navidrome which is a web-based audio player. It requires a set of adjustments of different system parts. My nix file for it looks like this:


<span style="color:#323232;">{ config, ... }:
</span><span style="color:#323232;">
</span><span style="color:#323232;">let
</span><span style="color:#323232;">  domain = "music." + toString config.networking.domain;
</span><span style="color:#323232;">in
</span><span style="color:#323232;">  {
</span><span style="color:#323232;">    services.navidrome = {
</span><span style="color:#323232;">      enable = true;
</span><span style="color:#323232;">      settings = {
</span><span style="color:#323232;">        Address = "127.0.0.1";
</span><span style="color:#323232;">        Port = 4533;
</span><span style="color:#323232;">        MusicFolder = "/srv/music";
</span><span style="color:#323232;">        BaseUrl = "https://" + domain;
</span><span style="color:#323232;">        EnableSharing = true;
</span><span style="color:#323232;">        Prometheus.Enabled = true;
</span><span style="color:#323232;">        LogLevel = "debug";
</span><span style="color:#323232;">        ReverseProxyWhitelist = "127.0.0.1/32";
</span><span style="color:#323232;">      };
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">
</span><span style="color:#323232;">    services.nginx = {
</span><span style="color:#323232;">      upstreams = {
</span><span style="color:#323232;">        navidrome = {
</span><span style="color:#323232;">          servers = {
</span><span style="color:#323232;">            "127.0.0.1:${toString config.services.navidrome.settings.Port}" = {};
</span><span style="color:#323232;">          };
</span><span style="color:#323232;">        };
</span><span style="color:#323232;">      };
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">
</span><span style="color:#323232;">    services.nginx.virtualHosts."${domain}" = {
</span><span style="color:#323232;">      onlySSL = true;
</span><span style="color:#323232;">      useACMEHost = config.networking.domain;
</span><span style="color:#323232;">      extraConfig = ''
</span><span style="color:#323232;">        include ${./authelia/server.conf};
</span><span style="color:#323232;">      '';
</span><span style="color:#323232;">      locations."/" = {
</span><span style="color:#323232;">        proxyPass = "http://navidrome";
</span><span style="color:#323232;">        recommendedProxySettings = false;
</span><span style="color:#323232;">        extraConfig = ''
</span><span style="color:#323232;">          include ${./authelia/proxy.conf};
</span><span style="color:#323232;">          include ${./authelia/location.conf};
</span><span style="color:#323232;">        '';
</span><span style="color:#323232;">      };
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">
</span><span style="color:#323232;">    systemd.tmpfiles.settings."navidrome-music-dir"."${toString config.services.navidrome.settings.MusicFolder}" = {
</span><span style="color:#323232;">      d = {
</span><span style="color:#323232;">        user = "laser";
</span><span style="color:#323232;">        mode = "0755";
</span><span style="color:#323232;">      };
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">    systemd.services.navidrome.serviceConfig.BindReadOnlyPaths = ["/run/systemd/resolve/stub-resolv.conf"];
</span><span style="color:#323232;">      
</span><span style="color:#323232;">    security.acme.certs."${config.networking.domain}".extraDomainNames = [ "${domain}" ];
</span><span style="color:#323232;">  }
</span>

All settings related to the service are contained in a single file. Don’t want it anymore? Comment it out from my main configuration (or whereever it’s imported from) and most traces of it are gone, the exception being the folder that was created using systemd.tmpfiles. No manually deleting the link from sites-available or editing the list of domains for my certificate. The next generation will look like the service never existed.

And in my configuration, at least the port could be changed and everything would still work – I guess there is room for improvement, but this does what I want pretty well.

tux7350 ,

Hey this is a great web server example! Instead of commenting it out to enable or disable you can actually turn it into a full module. Check out this example of a nix module. Basically, you can take your code you pasted and put it under the config set. Then create an option to enable that set of code. Now you can always have this nix file imported, but enable the option only when you need it with another declaration. Really, that’s how all the declarations work you’re just getting the nix files from github and nixpkgs.

Laser ,

Thanks for the answer; I do have at least one module in my config, but usually, I don’t enable or disable services like that, it was more of an example of how the configuration is split up and what the advantage of that is. In the end, if the only option is to enable the module, you’re not gaining that much if you need to import and enable it instead of just importing the configuration straight is my opinion.

sunstoned ,

Love the example here!

I’m still learning about available references (ex config.services.navidrome.settings.Port). What resources did you find to be the best for learning that kind of thing?

I’ll accept RTFM if that’s applicable :)

tux7350 ,

Use nix repl! That stands for Read Eval Print Loop. You can evaluate a nix expression and see all the attributes inside. For example, on a non-flake system, use :l <nixpkgs/nixos> inside the repl to load the current system. Then you can hit the tab key to show whats inside of the current attribute set, make sure you have a . at the end. Then you can press enter to evaluate and see the declaration. For example when you set networking.hostName in configuration.nix you can actually find it under options.networking.hostName.value evaluating that in the repl.

sunstoned ,

Amazing! I’ve used that before but just to look for packages offline. I’ll definitely check that out.

Laser ,

Well, a lot of it is just trying stuff out, but let’s say you want to setup Navidrome because you read about it somewhere. My first step is always to go to search.nixos.org/options? and search for it, it’ll show you the options available. If you want to know how it’s implemented under the hood, press the “Declared in” link where it shows you the source code of the module, this can sometimes be helpful.

Other than that, read the wiki for examples, and remember that nix is a full language and not just a configuration, so you can keep it flexible.

suction ,

They’re not in a single file though, you got includes

Laser ,

Technically correct, but the settings in there are not service specific. However, if there’s something worthy of reworking it’s probably the Authelia part

DeltaTangoLima , to piracy in How big is YOUR collection?
@DeltaTangoLima@reddrefuge.com avatar
  • About 1,400 movies: 6.7TB
  • About 15,100 episodes: 10.9TB

Spread across a couple of NASes, each with 4 x 4TB drives in RAID5.

synapse1278 , to android in Buying a Pixel 7 Pro, install Custom ROM or stay on default?
@synapse1278@lemmy.world avatar

If you dislike bloatware, the GrapheneOS is for you. My favorite smartphone experience ever, really.

Staubsaugernasenmann ,

I’m loving it too! I am finaly feeling as if I am (mostly) in controll of my phone

Mwa , to linuxmemes in Have you tried NixOS?
@Mwa@thelemmy.club avatar

i used it when i was a newbie

Septimaeus , to asklemmy in What is the best low MB mobile game that you ever played ?

Not sure how we’re weighting size, but by ratio of MB to hours of idle enjoyment, I bet this one’s up there.

old Nokia phone with snake game playing

DJDarren , to asklemmy in The specific thing you spend the most time doing instead of the actual job you're being paid to do is your new profession. What's your new job title?

Huh, I now get paid to waste time staring at the internet. Neat, I guess?

tetris11 ,
@tetris11@lemmy.ml avatar

Urgh, better than being paid to start online fights. Your mother?

DJDarren ,

MY MOTHER’S A SAINT

EnderMB , to linuxmemes in Have you tried NixOS?

I tried it, and while I was really excited about its proposition, it felt like at times any prior knowledge of Linux was a bit wasted. I also had some significant problems with needing to pin packages.

I don’t doubt that it’s a great option for many, if you’ve got the time to learn it. I’m finding myself in the position where I stick my flag to one distro and keep it there for as long as it doesn’t piss me off.

nickwitha_k ,

Yeah. I had a similar experience. My first successful install, following the docs, didn’t have a network stack. It turns out that the docs are not representative of what’s considered best practices at this point. I also don’t care for needing a new DSL for a single use case.

So, for me, it’s a non-starter. Fedora Atomic is meeting my needs nicely at this point. NixOS has brought some excellent ideas to the forefront and is a great match for some people. I’ll pass until I can use my JSON/YAML/TOML and the docs are useable.

Aurenkin , to asklemmy in TV nerds: what should I watch

Band of Brothers

urda , to newcommunities in Weekly active communities promotion thread
@urda@lebowski.social avatar

!achievers is your Big Lebowski Oasis in the fediverse

hperrin , to nostupidquestions in Why are stories that take place in another world where everyone is white and Asian are normal, but it's "woke" if they are all black?

Because (among the political right) woke is just a coded term racists use for things they don’t like.

beeng , to linux in More Linux libertarian shitposting 🦅🇺🇸🦅

Less US centric shit in here the better please…

hperrin , to nostupidquestions in what is with child names like Aiden, Braiden etc?

You forgot the best one, Okayden.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines