about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.lock18
-rw-r--r--flake.nix10
-rwxr-xr-xtest.sh103
3 files changed, 15 insertions, 116 deletions
diff --git a/flake.lock b/flake.lock
index f0c5f50..a3610e9 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,11 +3,11 @@
     "flake-compat": {
       "flake": false,
       "locked": {
-        "lastModified": 1627913399,
-        "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
+        "lastModified": 1641205782,
+        "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
         "owner": "edolstra",
         "repo": "flake-compat",
-        "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
+        "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
         "type": "github"
       },
       "original": {
@@ -19,11 +19,11 @@
     },
     "flake-utils": {
       "locked": {
-        "lastModified": 1638122382,
-        "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
+        "lastModified": 1644229661,
+        "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
+        "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
         "type": "github"
       },
       "original": {
@@ -35,11 +35,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1638366923,
-        "narHash": "sha256-Sh6+Pm0ShdtqW+BGynIJX+F12Lqs0xJq6qWmDkZN2uA=",
+        "lastModified": 1645013224,
+        "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "1fbcb733eb9daf23ab9e70e58e76fa0b767dc033",
+        "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970",
         "type": "github"
       },
       "original": {
diff --git a/flake.nix b/flake.nix
index 985cc57..39a96f9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -68,7 +68,9 @@
               ]);
           };
       in {
-        defaultPackage = project false;
+        packages.${name} = project false;
+
+        defaultPackage = self.packages.${system}.${name};
 
         checks.preCommit = pre-commit-hooks.lib.${system}.run {
           src = ./.;
@@ -102,7 +104,7 @@
         };
 
         devShell = self.devShells.${system}.dev;
-      }) // {
-        overlay = _: _: { ${name} = self.defaultPackage; };
-      };
+
+        overlay = _: _: { ${name} = self.defaultPackage.${system}; };
+      });
 }
diff --git a/test.sh b/test.sh
deleted file mode 100755
index 3fe68f2..0000000
--- a/test.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env bash
-
-################################################################################
-usage() {
-	cat <<EOF
-Usage: run-in-xephyr.sh [options]
-
-  -d NxN  Set the screen size to NxN
-  -h      This message
-  -n NUM  Set the internal DISPLAY to NUM
-  -s NUM  Set the number of screens to NUM
-EOF
-}
-
-################################################################################
-ARCH=$(uname -m)
-OS=$(uname -s | tr '[:upper:]' '[:lower:]')
-SCREENS=1
-SCREEN_SIZE="800x600"
-DISPLAY_NUMBER=5
-
-################################################################################
-while getopts "hs:" o; do
-	case "${o}" in
-	d)
-		SCREEN_SIZE=$OPTARG
-		;;
-
-	h)
-		usage
-		exit
-		;;
-
-	n)
-		DISPLAY_NUMBER=$OPTARG
-		;;
-
-	s)
-		SCREENS=$OPTARG
-		;;
-
-	*)
-		echo
-		usage
-		exit 1
-		;;
-	esac
-done
-
-shift $((OPTIND - 1))
-
-################################################################################
-if [ -d .stack-work ]; then
-	echo "stack build detected"
-	options=""
-	[ "${NIX_PATH:-NO}" = "NO" ] || options="--nix"
-	BIN_PATH=$(stack path $options --dist-dir)/build/xmonad-ng
-elif [ -d dist-newstyle ]; then
-	echo "cabal build detected"
-	BIN_PATH=$(find dist-newstyle/ -type f -executable -name xmonad-ng -printf '%h')
-else
-	echo "you need to build xmonad-ng first, see README for instructions"
-	exit 1
-fi
-
-RAW_BIN=$BIN_PATH/xmonad-ng
-ARCH_BIN=$BIN_PATH/xmonad-$ARCH-$OS
-
-################################################################################
-cp -p "$RAW_BIN" "$ARCH_BIN"
-
-################################################################################
-XMONAD_CONFIG_DIR=$(pwd)/state/config
-XMONAD_CACHE_DIR=$(pwd)/state/cache
-XMONAD_DATA_DIR=$(pwd)/state/data
-export XMONAD_CONFIG_DIR XMONAD_CACHE_DIR XMONAD_DATA_DIR
-
-mkdir -p "$XMONAD_CONFIG_DIR" "$XMONAD_CACHE_DIR" "$XMONAD_DATA_DIR"
-echo "xmonad will store state files in $(pwd)/state"
-
-################################################################################
-SCREEN_COUNTER=0
-SCREEN_OPTS=""
-X_OFFSET_CURRENT="0"
-X_OFFSET_ADD=$(echo "$SCREEN_SIZE" | cut -dx -f1)
-
-while expr "$SCREEN_COUNTER" "<" "$SCREENS"; do
-	SCREEN_OPTS="$SCREEN_OPTS -origin ${X_OFFSET_CURRENT},0 -screen ${SCREEN_SIZE}+${X_OFFSET_CURRENT}"
-	SCREEN_COUNTER=$(("$SCREEN_COUNTER" + 1))
-	X_OFFSET_CURRENT=$(("$X_OFFSET_CURRENT" + "$X_OFFSET_ADD"))
-done
-
-(
-	# shellcheck disable=SC2086
-	Xephyr $SCREEN_OPTS +xinerama +extension RANDR \
-		-ac -br -reset -terminate -verbosity 10 \
-		-softCursor ":$DISPLAY_NUMBER" &
-
-	export DISPLAY=":$DISPLAY_NUMBER"
-	echo "Waiting for windows to appear..." && sleep 2
-
-	$ARCH_BIN
-)

Consider giving Nix/NixOS a try! <3