feat: nixified

This commit is contained in:
2024-12-27 17:04:25 +01:00
parent 2827b6f7f9
commit 261eac2d36
5 changed files with 71 additions and 21 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ dwm-msg
config.h
patches.h
.legacy/
.direnv/

View File

@@ -1,21 +0,0 @@
{ stdenv, fetchurl, libX11, libXft, libXinerama }:
stdenv.mkDerivation {
name = "dwm-HEAD";
src = builtins.filterSource
(path: type: (toString path) != (toString ./.git)) ./.;
buildInputs = [ libX11 libXft libXinerama ];
prePatch = ''
substituteInPlace config.mk --replace '/usr/local' $out
'';
meta = with stdenv.lib; {
description = "Dynamic window manager for X";
homepage = http://dwm.suckless.org/;
license = licenses.mit;
platforms = platforms.all;
};
}

23
flake.lock generated Normal file
View File

@@ -0,0 +1,23 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"path": "/nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

46
flake.nix Normal file
View File

@@ -0,0 +1,46 @@
{
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system}.dwm = pkgs.stdenv.mkDerivation rec {
pname = "dwm";
version = "custom";
src = ./.;
buildInputs = with pkgs; [
xorg.libX11
xorg.libXft
xorg.libXinerama
];
makeFlags = [ "CC=${pkgs.gcc}/bin/gcc" ];
installPhase = ''
mkdir -p $out/bin
cp dwm $out/bin/
'';
meta = with pkgs.lib; {
description = "Dynamic Window Manager";
license = licenses.mit;
maintainers = [ ];
};
};
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
gcc
xorg.libX11
xorg.libX11.dev
xorg.libXft
xorg.libXinerama
];
shellHook = ''
echo "Development shell for dwm ready."
'';
};
};
}