ragnarwm: init at 1.3.1

This commit is contained in:
Sigmanificient 2023-08-08 11:53:51 +02:00
parent e936aa35a7
commit 0482394fe0
6 changed files with 142 additions and 0 deletions

View file

@ -35,6 +35,7 @@ in
./openbox.nix
./pekwm.nix
./notion.nix
./ragnarwm.nix
./ratpoison.nix
./sawfish.nix
./smallwm.nix

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.windowManager.ragnarwm;
in
{
###### interface
options = {
services.xserver.windowManager.ragnarwm = {
enable = mkEnableOption (lib.mdDoc "ragnarwm");
package = mkOption {
type = types.package;
default = pkgs.ragnarwm;
defaultText = literalExpression "pkgs.ragnarwm";
description = lib.mdDoc ''
The ragnar package to use.
'';
};
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
};
meta.maintainers = with lib.maintainers; [ sigmanificient ];
}

View file

@ -667,6 +667,7 @@ in {
rabbitmq = handleTest ./rabbitmq.nix {};
radarr = handleTest ./radarr.nix {};
radicale = handleTest ./radicale.nix {};
ragnarwm = handleTest ./ragnarwm.nix {};
rasdaemon = handleTest ./rasdaemon.nix {};
readarr = handleTest ./readarr.nix {};
redis = handleTest ./redis.nix {};

32
nixos/tests/ragnarwm.nix Normal file
View file

@ -0,0 +1,32 @@
import ./make-test-python.nix ({ lib, ...} : {
name = "ragnarwm";
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
};
nodes.machine = { pkgs, lib, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.defaultSession = lib.mkForce "ragnar";
services.xserver.windowManager.ragnarwm.enable = true;
# Setup the default terminal of Ragnar
environment.systemPackages = [ pkgs.alacritty ];
};
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
with subtest("ensure we can open a new terminal"):
# Sleeping a bit before the test, as it may help for sending keys
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
})

View file

@ -0,0 +1,73 @@
{ lib
, stdenv
, fetchFromGitHub
, writeText
, fontconfig
, libX11
, libXft
, libXcursor
, libXcomposite
, conf ? null
, nixosTests
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ragnarwm";
version = "1.3.1";
src = fetchFromGitHub {
owner = "cococry";
repo = "Ragnar";
rev = finalAttrs.version;
hash = "sha256-SZWhmFNmS2oLdO9BnPzimoind1452v/EEQzadc5A+bI";
};
prePatch = ''
substituteInPlace Makefile \
--replace '/usr/bin' "$out/bin" \
--replace '/usr/share' "$out/share"
'';
postPatch =
let
configFile =
if lib.isDerivation conf || builtins.isPath conf
then conf else writeText "config.h" conf;
in
lib.optionalString (conf != null) "cp ${configFile} config.h";
buildInputs = [
fontconfig
libX11
libXft
libXcursor
libXcomposite
];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
enableParallelBuilding = true;
preInstall = ''
mkdir -p $out/bin
mkdir -p $out/share/applications
'';
postInstall = ''
install -Dm644 $out/share/applications/ragnar.desktop $out/share/xsessions/ragnar.desktop
'';
passthru = {
tests.ragnarwm = nixosTests.ragnarwm;
providedSessions = [ "ragnar" ];
};
meta = with lib; {
description = "Minimal, flexible & user-friendly X tiling window manager";
homepage = "https://ragnar-website.vercel.app";
changelog = "https://github.com/cococry/Ragnar/releases/tag/${finalAttrs.version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ sigmanificient ];
mainProgram = "ragnar";
platforms = platforms.linux;
};
})

View file

@ -33926,6 +33926,8 @@ with pkgs;
qemacs = callPackage ../applications/editors/qemacs { };
ragnarwm = callPackage ../applications/window-managers/ragnarwm {};
rime-cli = callPackage ../applications/office/rime-cli { };
roxctl = callPackage ../applications/networking/cluster/roxctl {