gomp

joined 1 year ago
[–] [email protected] 9 points 6 days ago (1 children)

I think I can sense your love/hate relationship with nixos from here :) you are not alone

[–] [email protected] 3 points 6 days ago (1 children)

I thought you could still go Centos Stream 9?

Anyway, I'm pretty sure almalinux-deploy allows migration from Centos Stream 8... it's your second chance to be done with fickle management decisions from RedHat/IBM: don't miss it this time :)

[–] [email protected] 7 points 6 days ago (2 children)

What is that you care to preserve? Can't you just register a new account and kill the old one? (genuinely curious)

[–] [email protected] 28 points 3 weeks ago (2 children)

Isn't the purpose getting views on youtube?

[–] [email protected] 3 points 3 weeks ago

IDK about OP, but I would really love a CAPTCHA of sorts to screen all the spam/scam calls

[–] [email protected] 6 points 3 weeks ago

Today will be another productive day!

[–] [email protected] 1 points 3 weeks ago (1 children)

Never used powershell (thanks heavens, I've not touched windows since windows 7). Is it similar to nushell?

[–] [email protected] 1 points 3 weeks ago

Well, it's not like by learning fish you'll automatically forget bash :) but I do agree that you should learn bash first, then plain sh and only after those go explore other shells.

I love how "radical shells" sounds! :)

[–] [email protected] 5 points 4 weeks ago (3 children)

Powershell does this on Windows. May also work on Linux?

Yes: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux

Should you choose to install it, it will bring the total of people running powershell on linux to one :)

(I'm kidding, of course, more or less)

[–] [email protected] 18 points 4 weeks ago (2 children)

beware fish shell syntax works drastically differently from other POSIX shells

Come on, that's scaremongering :)

On interactive, day-to-day use, fish syntax is basically the same as bash or any other shell: you type your commands, hit enter and the command is run. Only when it comes to scripting (or writing complex one-liners, or copy-pasting stuff from the web) are there appreciable differences. In those cases, until one is accustomed to fish, running the command/script in bash is still an option.

Let me be 100% clear: yes, fish will complain if a wildcard doesn't expand to anything, and there are other minor things that may impact typical interactive use. I'm just saying there is basically zero learning curve if you want to try fish and that you can just fire up bash if you hit a wall in a moment when you can't afford to investigate because you need stuff done.

If I had to say, the most hassle with fish is that people assume you are running POSIX shell and so you have to know how to adapt instructions to your shell. For example, someone may say "add expor SOME_VAR=some_value to your .bashrc" and you need to be able to translate that to fish. Also, there is very specific software (in my system, it's just sdkman, an utility that manages which java development tools are installed/available in a shell session) that only works in POSIX shells and needs some adapter for fish.

[–] [email protected] 16 points 1 month ago

There's AsteroidOS but I couldn't find any of the supported watches (all quite old IIRC) at a reasonable price.

Gadgetbridge with some proprietary watch is fine privacy-wise (I had an Amazfit GTR3 pro, I needed to register an account with the Zapp app and use it once, but then uninstalled it once I got the required password and used Gadgetbridge exclusively).

Bangle and the Pine Watch are low-res and IMHO quite ugly compared to alternatives from big brands.

[–] [email protected] 3 points 1 month ago (1 children)

But you don’t have to develop anything.

I interpreted your "look for ways to do things separately" as "look for separate tools that do the various things" (and you have to integrate), but I see now that you meant "look for ways to do things differently". My bad.

 

After years of my desktop environment (kde) being configured the same way, I tried enabling auto-hiding in my panel and I quite like the extra screen estate.

Now, the only reasons why I have a panel in the first place are the clock and the system tray (I don't use the ~~start~~ applications menu and I don't care for the task manager) so I've started wondering if I could completely dispose of the panel.

Do you know of any launcher (I use krunner but switching to something else is fine) that satisfies (or can be configured to satisfy) the following?

  1. shows the current date/time
  2. integrates a system tray
  3. launches applications
  4. does math, unit conversion and currency conversion
 

While updating home-manager I got a notice that freeimage-unstable-2021-11-01 is marked as unsafe.

Since chances are it's used by something I never use, I'd like to know what I'm using that depends on it... any idea how to do it?

Also.. any idea why I have 4 copies of the freeimage stuff in my /nix/store? (I just run nix-collect-garbage -d and the 4 seem to be actually different):

❱ md5sum /nix/store/*freeimage*/lib/libfreeimage.a
67a0ce1cb5dd562473e27d7c88e8a9bd  /nix/store/6gi6hm57zngqnxb6p5dnxhjjcbr96lrk-freeimage-unstable-2021-11-01/lib/libfreeimage.a
5995e0affbfa28b63da7e997cb4dbe63  /nix/store/09nwykzzksc0zknflsyxyah5b67c2rsn-freeimage-unstable-2021-11-01/lib/libfreeimage.a
67a0ce1cb5dd562473e27d7c88e8a9bd  /nix/store/ikfiv4gpmcpyir7lsj45by653qcnvgyx-freeimage-unstable-2021-11-01/lib/libfreeimage.a
213a408e3c1fbb5dfa4491deebe05984  /nix/store/q2sc85f2hclgwl8m3qdw8rpbs44gzmah-freeimage-unstable-2021-11-01/lib/libfreeimage.a
 

I've been looking for something to replace the google chromecast that is attached to our TV.

I've tried Kodi out, but the main use case for the TV set is a 70+ yo person watching netflix and there is just no way they will be better off with Kodi than with the stock netflix app.

Besides supporting netflix, being easy to use, and providing significantly better privacy than the chromecast does, the device would ideally:

  • support other mainstream streaming (amazon, disney, ...) for when my people get tired of netflix
  • support a DVB-T2 usb stick (directly, or through IPTV: I can put the stick in a different machine)
  • support youtube without ads (through an adblocker and possibly sponsorblock, or maybe using invidious)
  • possibly, support local public TV streaming (eg. BBC)

I have a PC set aside that should be more than capable enough (intel N100), but I'm open to getting new hardware if needed. Also, it doesn't matter if the system is not very user friendly to setup (eg. if it needs to be nixos), but once it's setup it should be easy to use and relatively straightforward to update/maintain.

I guess a FOSS android TV would be ideal, but.. is there any? (I see Lineage supports the Google ADT-3, but that is basically unobtanium, at least where I live).

 

The app at my gym sucks: there is no checklist of what exercises you have done and no tracking of how much weight you used. Plus, for whatever reason, it wants access to my location.

I've found a number of alternatives on F-Droid, but each of the six or so I tried was completely unusable (some seemed unfinished alphas, others are probably too old for my android version).

Is there one app that you use and would recommend?

What I'm looking for is:

  • At home: I setup my programs (different ones for different days)
  • At the gym: I can select a program, check off the exercises while I do them (the order I do them on depends on where there is fewer people at the gym), and log things like if I managed all the sets/reps, how much weight I used, and how long I exercised for (for things like the tapis roulant).
  • Bonus points if I can also track my weight in the same app, and if the app can export/sync the data or produce some kind of graphs/statistics based on it.

Thanks!

 

This may be OT since strictly speaking it's about hardware... I trust it is ok to post it given the spirit of the community, but have my apologies and feel free to remove it if it's not.

I'm looking to replace my old Bose QC25, since they have recently died (after a long a fulfilling life), but it seems everything nowadays is bluetooth (which I don't mind) and require some proprietary app to turn ANC on/off (which I do mind... are physical buttons/switches become too expensive to include in your overpriced earbuds?).

Anyway... do you know of any headphones/earbuds that meet the following?

  1. can be powered via wire or have batteries that last 12+hrs (long-haul flights)
  2. have decent noise cancelling
  3. don't require me to install a apps or can be used with some open source app (possibly with full functionality and straightforward to setup)
  4. are not overly expensive (I have to buy 2 pairs and I'll only use them a few times a year when I fly)
 

I want to call the escapeSystemdPath (defined in nixpgs at nixos/lib/utils.nix) to derive the name of a systemd mount unit from the target path (eg. srv-my-dir.mount from /srv/my/dir), but I can't figure out how I can reference it... any ideas?

5
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]
 

I'm playing around with nixos in a few VMs and at some point I realized I must have lost the swap configuration in one of my refactorings.

To my surprise, however, the VMs do use the swap partitions I had set up.

There is no mention on "swap" in my nix configuration (or in fstab) and no .swap units in /etc/systemd/system; I do however have a swap partition labelled "swap".

Turns out there is a systemd unit (albeit not a corresponding file) that sets up swap:

[root@vm1:~]# free -hw
               total        used        free      shared     buffers       cache   available
Mem:           2.8Gi       664Mi       955Mi       4.0Mi       3.0Mi       1.3Gi       2.0Gi
Swap:          3.7Gi          0B       3.7Gi

[root@vm1:~]# systemctl list-dependencies swap.target 
swap.target
● └─dev-disk-by\x2ddiskseq-1\x2dpart3.swap

I'm wondering where the unit comes from? Can I rely on this and never configure swap ever again?

 

Is there an extension that warns you when you are wasting time reading ai-generated crap?

Case in point, I was reading an article that claimed to compare kubernetes distros and wasted some good minutes before realizing it was full of crap.

 

I have an option that must be left with the default value when a certain flag (another option) is false.

I didn't find any example (let alone documentation) on how to implement this, so I've come up with two ideas:

option-that-errors-out-if-set-when-flag-is-false =
let
  default = if config.some-flag
          then "some default value for when flag is true"
          else "value that should not be changed when flag is false";
in lib.mkOption {
  type = lib.types.str;
  inherit default;
  apply = v: assert assertMsg (config.some-flag || v == default) "Do not set this option unless 'flag' is true";
          v;
};
option-that-ignores-value-when-flag-is-false =
let
  default = if config.some-flag
          then "some default value for when flag is true"
          else "value that should not be changed when flag is false";
in lib.mkOption {
  type = lib.types.str;
  inherit default;
  apply = v: if config.some-flag then v else default;
};

Which one do you think is "best" (cleaner, more idiomatic, etc..)?

Is apply the "right" place to validate options? Should I make a custom type instead? Should I approach this in some different way?

5
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]
 

I'd like to set a "global" option from within a submodule, but the config I return is grafted into the "global" under the submodule "path" rather than at the root... any idea if it's somehow possible?

Er... I guess I didn't make a great job at explaining what I want to do... Some code will hopefully help.

In mymodule.nix I have:

{ lib, config, ... }: {

  options.myoption = lib.mkOption {
      type = lib.types.attrsOf (lib.types.submodule (
        import ./mysubmodule.nix
      ));
  };

}

and mysubmodule.nix is:

{ name, lib, config, ... }: {

options.mysubmoduleoption = {
  type = lib.types.str;
};

config = {
  # here I want to set a "global" option, say "systemd.mounts"
  # based on the value of "mymodule.name.mysubmoduleoption"
  # but it seems I can only set values under "mymodule.name" 
};

}
8
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]
 

I'm trying to debug a module I'm writing with builtins.trace, but it's being more complicated than I anticipated.

Let's say I have a module:

{ config, lib, pkgs, modulesPath, ... }:

{

  config =
  let
    some-list = lib.attrsets.mapAttrsToList (n: v: {
        some-attr = "${n} ${v}";
    }) { n1 = "v1"; n2 = "v2"; };
  in {
    users.mutableUsers = builtins.trace (some-list) false;
  };

}

This will print

trace: [ <code> <code> ]

because builtins.trace (for whatever reason?) evaluates its first argument only shallowly.

Changing the trace expression to:

builtins.trace (builtins.toJSON some-list) false;

helps a lot, but as soon as one tries to print a long list or a structure with some complexity the output is completely unreadable, and it's not like it can easily be piped into jq (I mean... &amp;| grep ^trace: | sed 's/trace: //' | jq works*, but there must be a "better" way?)

(*) in fish shell, IDK about bash

edit: It's not like I specifically want JSON output: any format will do (ideally, nix would be nice)

view more: next ›