[–] [S] 2 points 2 days ago (1 child)

You know, if i can setup btrfs from the graphical install that might be the better way to go. I could then make different sub-volumes for @home @nix , etc. If I really want the quotas that can be enforced on the sub volumes.

  • source
  • parent
  • context
  • [–] 2 points 2 days ago (1 child)

    I use ZFS on top of LUKS with the same three-way root/nix/home breakout and a separate SWAP partition.

    Works pretty well and sidesteps the partition-sizing issue entirely, since the pools don’t have to be a fixed size.

  • source
  • [–] 1 point 2 days ago* (last edited 2 days ago) (3 children)

    I just checked my main PC which I use for playing games and development (Android and Rust), and it uses 45GB for /nix just after nh clean all which deletes all profiles but the current one. 50GB might be a bit tight during a rebuild where you inevitably have two copies of the software, but outside of that, it seems good enough.

  • source
  • parent
  • context
  • [–] [S] 1 point 2 days ago (4 children)

    Thanks for the info. I was only going to seperate /home onto a different partition, but then I took a look at sudo du -hs /nix and saw it was 17GB by itself on my current laptop. I was aware of the gc daily thing since i have automatic updates enabled, but I was not aware of the other two storage optimization things.

    I am a pretty standard desktop user, but i do need some dev tools like androidsdk, flutter, java, and rust.

  • source
  • parent
  • context
  • [–] 1 point 2 days ago* (last edited 2 days ago) (5 children)

    I suppose you are aiming for impermanence? 50GB seems good enough if you're not installing too many tools. If you haven't already, take a look at nix.* options because they have some storage optimisation options. That and CLI tool called nh, which cleans stuff up for you.

    {
      nix = {
        settings = {
          auto-optimise-store = true;
        };
        gc = {
          automatic = true;
          dates = "daily";
          options = "--delete-older-than 10d";
        };
        optimise = {
          automatic = true;
          dates = [ "weekly" ];
        };
      };
    }
    
  • source
  • [–] 6 points 3 days ago* (last edited 2 days ago) (4 children)

    Impermanence

    Edit: sorry I didn’t link. It has been an incredible overnight upgrade to security for me. I have all of my stateful directories LUKS encrypted and copying on write to a btrfs subvolume that gets cloned over at boot to each time and as a result, I have a minuscule attack surface. On top of that, all of the machines on my network are fully impermanent and write their state to a local NAS. It’s pretty elegant. I highly recommend rehearsing the switch to impermanent via a QEMU VM and not fully making the switch until your data is backed up.

    I did a rehearsal on my home directory that took a few iterations to catch all of the files I needed to declare. A diff on the two btrfs directories each reboot made that fairly easy. I wish I could share the config but it would dox the shit out of me!

  • source
  • [–] 10 points 3 days ago

    i love that, for homelabbing, NixOS does a lot of secure things by default. firewall ports are opened explicitly and declaratively and services run under their own user with their own data directory. everything, even on the same local machine, communicates over HTTPS.

    also, IMO the way people should have been running agents from the beginning: agents get their own user and a pared down list of tools and specific directories with specific read/write access and their own git clone of whatever code i’m working on (i hate working on the same files as an agent). (running a local Qwen 27B with Hermes)

    other than that the normal stuff like fail2ban, random SSH port, VPN for remote access, Adguard, etc.

  • source
  • [–] [S] 4 points 3 days ago

    That's only on me. I've enjoyed putting emojis in READMEs and commit messages since I've been programming in 2009, even in with yahoo and MSN messages before that. It was the tech fad at the time and I just never grew out of it, nor making my graphics overly colorful. I relish that LLMs mimic that trend from their training data, like some kind of lingering graffiti or watermark we imparted on the corpus of AI data sets.

  • source
  • parent
  • context
  • [–] 3 points 1 week ago (2 children)

    Okay, this is going to depend on whether or not you are on Nixos.

    If you are not on NixOS, then this shell.nix works for me, although you will need libstdc++ installed on your host. Also, I cut out some of the packages, because the default nix shell provides ldd and gcc already, so there is no need to specifically include them.

    { pkgs ? import <nixpkgs> {} }:
    
    let packages = [
      pkgs.cargo
      pkgs.cmake		# Cmake
      pkgs.git		# Git version control system
      pkgs.pkg-config    # often needed for C dependencies
      pkgs.rustc          # Nix’s rustc (matches the store layout)
      pkgs.libcxx
      pkgs.gccNGPackages_15.libstdcxx
    ];
    
    in
    
    pkgs.mkShell {
      nativeBuildInputs = packages;
    
      LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath packages;
    
      # Optional – tell Rust to prefer lld for Rust‑only code, but fall back to gcc
      # for build‑script / C‑linking steps.
      RUSTFLAGS = "-C link-arg=-fuse-ld=lld -C link-arg=-Wl,-rpath,/usr/lib -C link-arg=-Wl,-dynamic-linker,/lib64/ld-linux-x86-64.so.2";
      RUST_BACKTRACE = 1;
    }
    

    But if you are on NixOS, then things get a bit different. NixOS won't put some of the stuff that the rust compiler is expecting to be there by default, but not there. For the NixOS version, remove this part -C link-arg=-Wl,-dynamic-linker,/lib64/ld-linux-x86-64.so.2 from RUSTFLAGS.

    You will probably have to either run it from the shell, or create a nix package for it.

  • source
  • [–] 10 points 2 weeks ago*

    Might be worth migrating your php apps to containerized builds to help avoid this issue

    You can probably mount the same data into the container, depending on the apps configuration

    Doesn’t help if you build a nix flake based app yourself though, but with that you can manually pin a build.

  • source
  • view more: next ›