Change:
<ins> { lib , stdenv , fetchzip , fetchurl , fetchFromGitHub , autoreconfHook , bashInteractive , cacert , coreutils , dbus , docbook_xml_dtd_43 , docbook_xsl , findutils , gettext , git , glib , glibc , glib-networking , gnused , gnutls , json-glib , krb5 , libssh , libxcrypt , libxslt , makeWrapper , nodejs , nixosTests , openssh , openssl , pam , pkg-config , polkit , python3Packages , ripgrep , runtimeShell , systemd , udev , xmlto }: let pythonWithGobject = python3Packages.python.withPackages (p: with p; [ pygobject3 ]); in stdenv.mkDerivation rec { pname = "cockpit"; version = "284"; src = fetchFromGitHub { owner = "cockpit-project"; repo = "cockpit"; rev = "80a7c7cfed9157915067666fe95b298896f2aea8"; sha256 = "sha256-iAIW6nVUk1FJD2dQvDMREPVqrq0JkExJ7lVio//ALts="; fetchSubmodules = true; }; nativeBuildInputs = [ autoreconfHook makeWrapper docbook_xml_dtd_43 docbook_xsl findutils gettext git (lib.getBin libxslt) nodejs openssl pam pkg-config pythonWithGobject.python python3Packages.setuptools systemd ripgrep xmlto ]; buildInputs = [ (lib.getDev glib) libxcrypt gnutls json-glib krb5 libssh polkit udev ]; patches = [ # Instead of requiring Internet access to do an npm install to generate the package-lock.json # it copies the package-lock.json already present in the node_modules folder fetched as a git # submodule. ./nerf-node-modules.patch # sysconfdir is $(prefix)/etc by default and it breaks the configuration file loading feature # changing sysconfdir to /etc breaks the build in this part of the makefile because it tries # to write to /etc inside the sandbox # this patch redirects it to write to $out/etc instead of /etc ./fix-makefiles.patch ]; postPatch = '' # instruct users with problems to create a nixpkgs issue instead of nagging upstream directly substituteInPlace configure.ac  --replace 'devel@lists.cockpit-project.org' 'https://github.com/NixOS/nixpkgs/issues/new?assignees=&labels=0.kind%3A+bug&template=bug_report.md&title=cockpit%25' patchShebangs  test/common/pixel-tests  test/common/run-tests  test/common/tap-cdp  test/static-code  tools/escape-to-c  tools/make-compile-commands  tools/node-modules  tools/termschutz  tools/webpack-make for f in node_modules/.bin/*; do patchShebangs $(realpath $f) done export HOME=$(mktemp -d) cp node_modules/.package-lock.json package-lock.json substituteInPlace src/systemd_ctypes/libsystemd.py  --replace libsystemd.so.0 ${systemd}/lib/libsystemd.so.0 for f in pkg/**/*.js pkg/**/*.jsx test/**/* src/**/*; do # some files substituteInPlace report as missing and it's safe to ignore them substituteInPlace "$(realpath "$f")"  --replace '"/usr/bin/' '"'  --replace '"/bin/' '"' || true done substituteInPlace src/common/Makefile-common.am  --replace 'TEST_PROGRAM += test-pipe' "" # skip test-pipe because it hangs the build substituteInPlace test/pytest/*.py  --replace "'bash" "'${bashInteractive}/bin/bash" echo "m4_define(VERSION_NUMBER, [${version}])" > version.m4 ''; configureFlags = [ "--enable-prefix-only=yes" "--sysconfdir=/etc" "--disable-pcp" # TODO: figure out how to package its dependency "--with-default-session-path=/run/wrappers/bin:/run/current-system/sw/bin" ]; enableParallelBuilding = true; preBuild = '' patchShebangs  tools/test-driver ''; postBuild = '' find | grep cockpit-bridge chmod +x  src/systemd/update-motd  src/tls/cockpit-certificate-helper  src/ws/cockpit-desktop patchShebangs  src/systemd/update-motd  src/tls/cockpit-certificate-helper  src/ws/cockpit-desktop PATH=${pythonWithGobject}/bin patchShebangs src/client/cockpit-client substituteInPlace src/ws/cockpit-desktop  --replace ' /bin/bash' ' ${runtimeShell}' ''; fixupPhase = '' runHook preFixup wrapProgram $out/libexec/cockpit-certificate-helper  --prefix PATH : ${lib.makeBinPath [ coreutils openssl ]}  --run 'cd $(mktemp -d)' wrapProgram $out/share/cockpit/motd/update-motd  --prefix PATH : ${lib.makeBinPath [ gnused ]} substituteInPlace $out/share/polkit-1/actions/org.cockpit-project.cockpit-bridge.policy  --replace /usr $out runHook postFixup ''; doCheck = true; checkInputs = [ bashInteractive cacert dbus glib-networking openssh python3Packages.pytest python3Packages.vulture ]; checkPhase = '' export GIO_EXTRA_MODULES=$GIO_EXTRA_MODULES:${glib-networking}/lib/gio/modules export G_DEBUG=fatal-criticals export G_MESSAGES_DEBUG=cockpit-ws,cockpit-wrapper,cockpit-bridge export PATH=$PATH:$(pwd) cockpit-bridge --version make pytest -j$NIX_BUILD_CORES || true make check  -j$NIX_BUILD_CORES || true test/static-code npm run eslint npm run stylelint ''; passthru.tests = { inherit (nixosTests) cockpit; }; meta = with lib; { description = "Web-based graphical interface for servers"; homepage = "https://cockpit-project.org/"; license = licenses.lgpl21; maintainers = with maintainers; [ lucasew ]; }; } </ins>

Discussion:
Cockpit is a server manager that makes it easy to administer your GNU/Linux servers via a web browser. Website: http://cockpit- Upstream: License: LGPL2.1 Arch Linux package: !
Could be a lot of effort to port: ... I have not looked at the code how many assumption it makes about the system, but in terms of system configuration nixos is a special snow flake.
Probably only a subset will work. But I think there is some stuff in cockpit that is helpful even on NixOS: View journald logs and systemd services Manage virtual machines via libvirt Get a shell terminal from the Web UI Some general system information like disk usage etc. It's mostly read only stuff but I'm not sure how easy it is to only use parts of cockpit that would work.
+1, would love to have this
Given that NixOS is pitched as a server os first, this would be very helpful. I already tried to but got stuck because it requires a few npm packages
try with
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . 3. Ask on the on .
I still think it would be good to have this in NixOS.
Well as pointed out, there will be quite a lot of patching up paths to do, as well as the NPM packages that need installing (try yarn2nix or npm2nix for that) Seeing as it's non-trivial, it will have to be packaged by someone with real interest in getting it, and we can assist (make a draft PR and tag us on questions)
node is only required for the dev environment I have made packaging cockpit,

it still fails to compile tho Any help would be greatly appreciated
building build flags: SHELL=/nix/store/5hplxs3kprdp6v62qk3di6a1m1s1paiq-bash-4.4-p23/bin/bash GEN src/ws/mock-dbus-tests.h Traceback (most recent call last): File "/nix/store/5zajbm8674d93nix4h8b0hxgglj2pbir-glib-2.64.3-dev/bin/gdbus-codegen", line 53, in <modulefrom codegen import codegenmain File "/nix/store/5zajbm8674d93nix4h8b0hxgglj2pbir-glib-2.64.3-dev/share/glib-", line 24, in <moduleimport argparse File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-", line 88, in <moduleimport re as _re File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-", line 145, in <moduleclass RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' make: * [Makefile:: src/ws/mock-dbus-tests.h] Error 1 error: --- Error
----------- nix-build error: --- Error --- nix-daemon builder for '/nix/store/mdiihwskfp862y17wp70skdy74kh33v5-cockpit-' failed with exit code 2; last 10 log lines: File "/nix/store/5zajbm8674d93nix4h8b0hxgglj2pbir-glib-2.64.3-dev/bin/gdbus-codegen", line 53, in <modulefrom codegen import codegenmain File "/nix/store/5zajbm8674d93nix4h8b0hxgglj2pbir-glib-2.64.3-dev/share/glib-", line 24, in <moduleimport argparse File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-", line 88,

in <moduleimport re as _re File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-", line 145, in <moduleclass RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' make: * [Makefile:: src/ws/mock-dbus-tests.h] Error 1 Seems like an error in the package itself.
The enum thing is due to a stray enum34 dependency in - enum34 is a backport of the enum module, and breaks things if it's installed on Python = 3.4. You'll need to look at why pyscss is pulling in enum34 - it's not immediately obvious to me from pyscss's , it looks correct. A pthread link error happens if that's fixed or if Python is removed from the deps entirely. That pthread link error is, I believe, a problem with the Cockpit makefiles; I made to fix it. With that change applied, I get I don't know anything about the Javascript packaging, so no idea how to progress from here. Good luck!
It compiles but gets stuck writing it's systemd.service files. I don't have much experience packaging applications which hook into systemd
How’s the effort? :crossedfingers: :crossedfingers: :crossed_fingers:
If this gonna work I could start replacing my with
I have updated nix to solve the issue of beside updating the version and it built successfully
I built the derivation posted by by including in my . It built successfully, producing . The output includes many things for like systemd units that do not get installed on the system - I'm wondering if these should be symlinked in as-is, or do they need to be converted to Nix? Most systemd units look OK but will need a fix to replace a reference to :
If is changed to (in patch below), and is to , the units get installed but are not enabled. The package also has references to and , please let me know if you know how best to patch these: I patched the reference to , and replaced with just due to build warning. Here's what I have, building entirely on what others have contributed to this thread:
I considered running the docker container, but it requires and proceeds to modify the host's PAM config.

Not something I personally like to see in a docker container... Back to the Nixpkgs. I was able to use so that has references to coreutils programs and patched the certificate paths to be . was because of patches to . Right now it fails running with SIGSEGV. I thought it might be systemd's setting, but it does the same outside invocation by systemd. I tried building newer versions of cockpit, but I kept running into There are some notes that might be helpful. Here's the latest packaging attempt: Even though I've posted like 4 times in a row, I think I'm done trying to do this. I hope someone else can pick up the effort.
I was able to get past this by changing the interpreter in from to . Note that, for some reason, doesn't work. You also have to run , because Nix resets its date and that breaks the "is packages- newer than " check. I also had to replace with in . What's odd is that all of the scripts run correctly when run from . When this is done, will just error with "Cannot find module stdio".
Spent some time learning nix by giving this a shot and actually ended up getting things to start. A lot of things are not working, but some might be possible to fix. For anyone interested I have left things here:
Another take on it Tested features: Logs Virtual Machines (cockpit-machines module, only managing works, creation of new VMs doesn't work) Services Terminal Code:
Tried to create a virtual machine, no luck, OS list is empty. Cannot create VM without choosing the operating system. I tried to fix it but I got the following error: !
I came across this discussion in the upstream project and figured it might be helpful to cross-reference:
You require libosinfo, and osinfo-db
I would to keep working on this issue, any hints you got for me would be welcomed. I do see any errors in my log
I am also working on this Here is what I have so far: It's building only. I was able to solve some documentation build bugs.
:eyes: !