5 ms·
I made the switch from Arch about a week ago. So far, great experience. I love the fact that my system state is reproducible and if I use version control on my
by therein 7y ago
I made the switch from Arch about a week ago. So far, great experience. I love the fact that my system state is reproducible and if I use version control on my dotfiles, I basically have a full backup of the look and feel of my workstation. VFIO with GPU passthrough works flawlessly. Setting up FDE with LUKS during and after the install was a breeze as well. Really enjoyed the whole experience.
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/applications/misc/electrum/default.nix https://github.com/NixOS/nixpkgs/blob/master/pkgs/applicatio...
- rtu8lu 7y agoI have something like this in my overlays.nix: 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"; }; })
- therein 7y agoThank you. I was able to move forward similarly as well. Good to see the solution I arrived at isn't too far from yours. 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; }; }); }
- iso-8859-1 7y agohow do you know the dependency bound is too tight?
- takeda 7y agoyes, it's possible that there was reason for requiring newer version, especially since it is a bitcoin wallet and this looks like a cryptographic library. The better way would be to also update that package to required version.
- dmix 7y agoHow well does Gnome work with NixOS? Ideally newer versions...
- takeda 7y agoWhat you are trying to do doesn't look like an overlay, but an override[1]. 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 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 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.
- iso-8859-1 7y agoYou can use GitHub's automatic generation of archives even for specific git commits. There is no version 4.0.0a of Electrum, it has not been released, it is misleading to refer to it.
- takeda 7y agoThere's actually fetchFromGitHub which takes care of it, looks like parent already figured it out: https://news.ycombinator.com/item?id=22883382 https://news.ycombinator.com/item?id=22883382 He also needed to change some dependencies so it's more complex than what I wrote.
- brotherjerky 7y agoCan you share the passthrough setup?
- therein 7y agoOf course. Here it is. 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.