walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs
About | Files | Commits | Refs | License
fix support in nix
Author: pixel2175
Date: 2025-06-05 20:10
commit: 45f3b15c
Stat
| M | Makefile | 19 | +7 | -12 |
| M | flake.nix | 31 | +29 | -2 |
Diff
diff --git a/Makefile b/Makefile
index 56a5207..975f357 100644
--- a/Makefile
+++ b/Makefile
@@ -14,20 +14,15 @@ install: build
sudo install -m644 walrs.1 /usr/share/man/man1/
bash ./autocomplete.sh
-nix: build
- install -Dm755 target/release/walrs $(PREFIX)/bin/walrs
- mkdir -p $(PREFIX)/etc/walrs/templates/ $(PREFIX)/etc/walrs/scripts/ $(PREFIX)/etc/walrs/colorschemes/
- cp -r templates/* $(PREFIX)/etc/walrs/templates/
- cp -r scripts/* $(PREFIX)/etc/walrs/scripts/
- cp -r colorschemes/* $(PREFIX)/etc/walrs/colorschemes/
- install -Dm644 walrs.1 $(PREFIX)/share/man/man1/
- bash ./autocomplete.sh
-
-uninstall:
- sudo rm -rf /usr/bin/walrs /etc/walrs ~/.config/walrs/ /usr/share/man/man1/walrs.1
...
Show all
Show less
diff --git a/Makefile b/Makefile
index 56a5207..975f357 100644
--- a/Makefile
+++ b/Makefile
@@ -14,20 +14,15 @@ install: build
sudo install -m644 walrs.1 /usr/share/man/man1/
bash ./autocomplete.sh
-nix: build
- install -Dm755 target/release/walrs $(PREFIX)/bin/walrs
- mkdir -p $(PREFIX)/etc/walrs/templates/ $(PREFIX)/etc/walrs/scripts/ $(PREFIX)/etc/walrs/colorschemes/
- cp -r templates/* $(PREFIX)/etc/walrs/templates/
- cp -r scripts/* $(PREFIX)/etc/walrs/scripts/
- cp -r colorschemes/* $(PREFIX)/etc/walrs/colorschemes/
- install -Dm644 walrs.1 $(PREFIX)/share/man/man1/
- bash ./autocomplete.sh
-
-uninstall:
- sudo rm -rf /usr/bin/walrs /etc/walrs ~/.config/walrs/ /usr/share/man/man1/walrs.1
...
diff --git a/Makefile b/Makefile
index 56a5207..975f357 100644
--- a/Makefile
+++ b/Makefile
@@ -14,20 +14,15 @@ install: build
sudo install -m644 walrs.1 /usr/share/man/man1/
bash ./autocomplete.sh
-nix: build
- install -Dm755 target/release/walrs $(PREFIX)/bin/walrs
- mkdir -p $(PREFIX)/etc/walrs/templates/ $(PREFIX)/etc/walrs/scripts/ $(PREFIX)/etc/walrs/colorschemes/
- cp -r templates/* $(PREFIX)/etc/walrs/templates/
- cp -r scripts/* $(PREFIX)/etc/walrs/scripts/
- cp -r colorschemes/* $(PREFIX)/etc/walrs/colorschemes/
- install -Dm644 walrs.1 $(PREFIX)/share/man/man1/
- bash ./autocomplete.sh
-
-uninstall:
- sudo rm -rf /usr/bin/walrs /etc/walrs ~/.config/walrs/ /usr/share/man/man1/walrs.1
-clean:
+nix:
+ nix build
+ sudo cp ./result/bin/walrs /usr/bin/walrs
+ sudo mkdir -p /etc/walrs
+ sudo cp -r ./result/etc/walrs/* /etc/walrs/
+ sudo cp ./result/share/man/man1/walrs.1 /usr/share/man/man1/walrs.1clean:
cargo clean
+
.PHONY: all build install uninstall clean nix
diff --git a/flake.nix b/flake.nix
index 215226c..41b2498 100644
--- a/flake.nix
+++ b/flake.nix
@@ -15,7 +15,6 @@
src = ./.;
cargoHash = "sha256-ItjbG/fPAW1mDJI5JXZ73L4c3UeDZzjBdADsyWhqzm8=";
-
nativeBuildInputs = with pkgs; [ bash ];
# Allow unstable Rust features
@@ -23,8 +22,9 @@
export RUSTC_BOOTSTRAP=1
'';
- # Let rustPlatform handle the binary, we just add the extra files
+ # Install everything to the Nix store first
postInstall = ''
+ # Install config files to result/
mkdir -p $out/etc/walrs/{templates,scripts,colorschemes}
if [ -d "templates" ]; then
@@ -37,6 +37,7 @@
cp -r colorschemes/* $out/etc/walrs/colorschemes/ || true
fi
+ # Install man page
if [ -f "walrs.1" ]; then
install -Dm644 walrs.1 $out/share/man/man1/walrs.1
fi
@@ -48,5 +49,31 @@
homepage = "https://github.com/pixel2175/walrs";
};
};
+
+ # Create installer that copies from result/ to system locations
+ packages.install-system = pkgs.writeShellScriptBin "walrs-install-system" ''
+ set -e
+ WALRS_PACKAGE="${self.packages.${system}.default}"
+
+ echo "Installing walrs from Nix store to system locations..."
+
+ # Install binary
+ sudo install -m755 "$WALRS_PACKAGE/bin/walrs" /usr/local/bin/walrs
+
+ # Install config files from result/etc/walrs/ to /etc/walrs/
+ sudo mkdir -p /etc/walrs
+ if [ -d "$WALRS_PACKAGE/etc/walrs" ]; then
+ sudo cp -r "$WALRS_PACKAGE/etc/walrs"/* /etc/walrs/
+ fi
+
+ # Install man page
+ if [ -f "$WALRS_PACKAGE/share/man/man1/walrs.1" ]; then
+ sudo install -Dm644 "$WALRS_PACKAGE/share/man/man1/walrs.1" /usr/share/man/man1/walrs.1
+ fi
+
+ echo "✓ walrs installed to /usr/local/bin/walrs"
+ echo "✓ Configuration files installed to /etc/walrs/"
+ echo "✓ Man page installed to /usr/share/man/man1/walrs.1"
+ '';
});
}