45Drives / cockpit-zfs-manager

Cockpit ZFS Manager is an interactive ZFS on Linux admin package for Cockpit.
GNU Lesser General Public License v3.0
306 stars 26 forks source link

NixOS Compatibility? #27

Open acelinkio opened 10 months ago

acelinkio commented 10 months ago

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.

leroycep commented 8 months ago

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.

redxtech commented 7 months ago

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!