move env to a nix flake

This commit is contained in:
2026-09-27 10:18:24 +02:00
parent 52a53f773a
commit b773e55eb2
8 changed files with 97 additions and 45 deletions
+5 -12
View File
@@ -5,20 +5,13 @@ VERSION = 5.4-odweta
PREFIX = /usr PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man
X11INC = /usr/X11R6/include # compiler and linker flags
X11LIB = /usr/X11R6/lib X11INC = $(shell $(PKG_CONFIG) --cflags x11 xft xrandr xinerama fontconfig freetype2)
X11LIB = $(shell $(PKG_CONFIG) --libs x11 xft xrandr xinerama fontconfig freetype2)
# Xinerama, comment if you don't want it
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# includes and libs # includes and libs
INCS = -I$(X11INC) -I$(FREETYPEINC) INCS = $(X11INC)
LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) LIBS = $(X11LIB)
# flags # flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
+5 -8
View File
@@ -7,16 +7,13 @@ VERSION = 6.8-odweta
PREFIX = /usr PREFIX = /usr
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include # compiler and linker flags
X11LIB = /usr/X11R6/lib X11INC = $(shell $(PKG_CONFIG) --cflags x11 xft xrandr xinerama fontconfig freetype2)
X11LIB = $(shell $(PKG_CONFIG) --libs x11 xft xrandr xinerama fontconfig freetype2)
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# includes and libs # includes and libs
INCS = -I${X11INC} -I${FREETYPEINC} INCS = ${X11INC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} LIBS = ${X11LIB}
# flags # flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+10 -1
View File
@@ -1,7 +1,16 @@
PREFIX := /usr PREFIX := /usr
CC := cc CC := cc
CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
LDFLAGS := -lX11 LDFLAGS :=
PKG_CONFIG := pkg-config
# compiler and linker flags
X11INC = $(shell $(PKG_CONFIG) --cflags x11 xft xrandr xinerama fontconfig freetype2)
X11LIB = $(shell $(PKG_CONFIG) --libs x11 xft xrandr xinerama fontconfig freetype2)
CFLAGS += $(X11INC)
LDFLAGS += $(X11LIB)
# FreeBSD (uncomment) # FreeBSD (uncomment)
#LDFLAGS += -L/usr/local/lib -I/usr/local/include #LDFLAGS += -L/usr/local/lib -I/usr/local/include
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1790450978,
"narHash": "sha256-/eLCD/X9kaWJqPR47+fDozEC87Hjmm3i8gJbYmDAD7g=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5e2305d577ca00acbba631b05cb1094d172b29f3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+27
View File
@@ -0,0 +1,27 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
gcc
gnumake
pkg-config
libx11
libxft
libxext
libxrender
libxrandr
libxinerama
libxcrypt
fontconfig
freetype
];
};
};
}
+8 -4
View File
@@ -1,9 +1,13 @@
#1/usr/bin/env bash #!/usr/bin/env bash
set -e
install_module() { install_module() {
cd $1 cd "$1"
sudo make install clean make clean
cd - make
sudo make install clean
cd - >/dev/null
} }
install_module dmenu install_module dmenu
+7 -4
View File
@@ -7,12 +7,15 @@ VERSION = 1.6-odweta
PREFIX = /usr PREFIX = /usr
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include PKG_CONFIG := pkg-config
X11LIB = /usr/X11R6/lib
# compiler and linker flags
X11INC = $(shell $(PKG_CONFIG) --cflags x11 xft xrandr xinerama fontconfig freetype2)
X11LIB = $(shell $(PKG_CONFIG) --libs x11 xft xrandr xinerama fontconfig freetype2)
# includes and libs # includes and libs
INCS = -I. -I/usr/include -I${X11INC} INCS = ${X11INC}
LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr LIBS = -lc -lcrypt ${X11LIB}
# flags # flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
+8 -16
View File
@@ -1,29 +1,21 @@
# st version # st version
VERSION = 0.9.3-odweta VERSION = 0.9.3-odweta
# Customize below to fit your system
# paths # paths
PREFIX = /usr PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man
X11INC = /usr/X11R6/include CC = cc
X11LIB = /usr/X11R6/lib
PKG_CONFIG = pkg-config PKG_CONFIG = pkg-config
# includes and libs # compiler and linker flags
INCS = -I$(X11INC) \ X11INC = $(shell $(PKG_CONFIG) --cflags x11 xft xrandr xinerama fontconfig freetype2)
`$(PKG_CONFIG) --cflags fontconfig` \ X11LIB = $(shell $(PKG_CONFIG) --libs x11 xft xrandr xinerama fontconfig freetype2)
`$(PKG_CONFIG) --cflags freetype2`
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ INCS = $(X11INC)
`$(PKG_CONFIG) --libs fontconfig` \ LIBS = $(X11LIB) -lm -lrt -lutil
`$(PKG_CONFIG) --libs freetype2`
# flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS) STLDFLAGS = $(LDFLAGS) $(LIBS)
# compiler and linker
CC = cc