cockpit-zfs-manager icon indicating copy to clipboard operation
cockpit-zfs-manager copied to clipboard

NixOS Compatibility?

Open acelinkio opened this issue 1 year ago • 2 comments

Would like to leverage this project with NixOS. Nix is a package manager that focuses on declarative configurations. NixOS is built on top of that approach to provide a declarative operating system.

Cockpit support was added to NixOS. This comment enabling support makes it sound like its reasonably low effort to extend offer support. https://github.com/NixOS/nixpkgs/pull/209192#issuecomment-1419331826

I am just getting started with NixOS. Interested to see if my idea of using NixOS/Cockpit+Extensions for managing a NAS.

acelinkio avatar Oct 25 '23 21:10 acelinkio

I got a version of it working here: https://github.com/45Drives/cockpit-zfs-manager/compare/master...leroycep:cockpit-zfs-manager:master

I haven't extensively tested it. I wasn't able to import a pool, but it could see the pool.

I also packaged it, though it might be better if I made cockpit-zfs-manager a nix flake: https://git.samsehu.perli.casa/Twins/server-configuration/src/branch/main/pkgs/cockpit-zfs-manager.nix

(Copied here for posterity:)

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
  pname = "cockpit-zfs-manager";
  version = "816af25099fccc46a3bff5f831b39d98ef33d514";

  src = fetchFromGitHub {
    owner = "leroycep";
    repo = "cockpit-zfs-manager";
    rev = "${version}";
    hash = "sha256-aLdsHHVVG6eJrvh3B4grZkDEbCZyDJjX2PuKkON8UcI=";
  };

  installPhase = ''
    mkdir -p $out/share/cockpit
    cp -r ${src}/zfs $out/share/cockpit/zfs
  '';
}

Then I add it to an overlay for nixpkgs and add it to environment.systemPackages.

leroycep avatar Jan 11 '24 04:01 leroycep

I got a version of it working here: master...leroycep:cockpit-zfs-manager:master

I haven't extensively tested it. I wasn't able to import a pool, but it could see the pool.

I also packaged it, though it might be better if I made cockpit-zfs-manager a nix flake: git.samsehu.perli.casa/Twins/server-configuration/src/branch/main/pkgs/cockpit-zfs-manager.nix

This is great! Thanks!

I copied your package (and also the tailscale one), and it works great! I don't need it to import pools or anything, since I have my filesystem mounts set up to do this.

Do you have any plans to make a PR to include your changes to this repo? I'd find that really useful, and if it still works on other platforms, that'd be great!

redxtech avatar Jan 28 '24 22:01 redxtech