Also make sure you allocate enough space on your root partition so you don't have to run garbage collection all the time.
Being able to switch between wildly different possible system configurations like xorg+i3 and wayland+sway by executing a few commands and having version control while doing so is incredible.
However one thing I'm struggling with now is "overlays". Simply trying to get "electrum" to install but nixpkgs has 3.3.8, I am looking to build 4.0.0a from HEAD of master. This should be simple to do with something like overlaying this portion from file electrum/default.nix [0]
src = fetchurl {
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
sha256 = "1g00cj1pmckd4xis8r032wmraiv3vd3zc803hnyxa2bnhj8z3bg2";
};
with something like: fetchFromGitHub {
owner = "spesmilo";
repo = "electrum";
sha256 = "LATESTHASH";
};
But for the life of me, I can't figure out how to do this overlay stuff. ( In fact I'd appreciate any help on this otherwise at this point I'm even jokingly considering an Arch container :) )Python, NodeJS and Ruby development might also be slightly frustrating if you are used to installing things globally.
[0] https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio...
you can do something like this:
let
new_electrum = pkgs.electrum.overrideAttrs (oldAttrs: rec {
name = "${oldAttrs.pname}-${version}";
version = "4.0.0a";
src = fetchurl {
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
sha256=pkgs.lib.fakeSha256;
};
})
in
<then use "new_electrum">
Unfortunately there is no https://download.electrum.org/4.0.0a/Electrum-4.0.0a.tar.gz so I don't have the hash. So you would need to perhaps correct it. You could invoke this it will fail with an error that hash is wrong and will provide the file hash, then just replace pkgs.lib.fakeSha256 with the hash in quotes.[1] https://nixos.org/nixpkgs/manual/#sec-pkg-overrideAttrs
Edit: looks like the version is on GitHub, and after I posted seems like you already figured it out, but maybe it can help someone else, typically that's the way to override.
There is no version 4.0.0a of Electrum, it has not been released, it is misleading to refer to it.
self: super:
let
callPackage = super.callPackage;
in {
darktable = callPackage
./pkgs/darktable { inherit (super) darktable; };
}
And my default.nix in pkgs/darktabele looks like this: { darktable, fetchurl, ... }:
darktable.overrideAttrs (_: rec {
version = "3.0.0";
src = fetchurl {
url = "https://github.com/darktable-org/darktable/releases/download/release-${version}/darktable-${version}.tar.xz";
sha256 = "7195a5ff7ee95ab7c5a57e4e84f8c90cc4728b2c917359203c21293ab754c0db";
};
}) self: super:
{
electrum = super.electrum.overrideAttrs(old: rec {
preBuild = old.preBuild + ''
# Patch unnecessarily tight dependency on ecdsa version
substituteInPlace ./contrib/requirements/requirements.txt --replace 'ecdsa>=0.14' 'ecdsa>=0.13'
additionalInputs = with super.python37Packages; [
python-jsonrpc-server
];
propagatedBuildInputs = old.propagatedBuildInputs ++ additionalInputs;
src = super.fetchFromGitHub {
owner = "spesmilo";
repo = "electrum";
rev = "223b62554ead397bb94013c0d9c95b63a0708ea6";
sha256 = "05djndhdggsw0r9pqn3gnb31nvzghgcsg05r3f7b6hwz84zbl22r";
fetchSubmodules = true;
};
});
} boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
boot.extraModprobeConfig = "options vfio-pci ids=10de:1e04,10de:10f7,10de:1ad6,10de:1ad7";
boot.kernelParams = [ "amd_iommu=on" /*"video=efifb:off" if you have only one GPU and want to keep the vBIOS intact*/ ];
virtualisation = {
lxc.enable = true;
lxd.enable = true;
libvirtd = {
enable = true;
qemuOvmf = true;
qemuVerbatimConfig = ''
namespaces = []
dynamic_ownership = 0
'';
};
};
Make sure your environment.systemPackages include qemu-kvm and virtmanager.And that's about it really. All you need to do after this is to go to virt-manager and create a new VM and add your GPU.