setup for nix

This commit is contained in:
Tobias Berger 2024-01-12 21:31:29 +01:00
parent fd263041a0
commit 6c94b91f27
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
6 changed files with 73 additions and 0 deletions

6
.envrc Normal file
View file

@ -0,0 +1,6 @@
watch_file shell.nix
watch_file flake.lock
# try to use flakes, if it fails use normal nix (ie. shell.nix)
use flake || use nix
eval "$shellHook"

2
.gitignore vendored
View file

@ -4,3 +4,5 @@ dwl
*-protocol.h *-protocol.h
.ccls-cache .ccls-cache
config.h config.h
.direnv
custom_dwl.patch

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1704722960,
"narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "317484b1ead87b9c1b8ac5261a8d2dd748a0492d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

17
flake.nix Normal file
View file

@ -0,0 +1,17 @@
{
description = "ToDooDoo";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = nixpkgs.legacyPackages;
in {
devShells = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./shell.nix { };
});
};
}

1
generate_patch.sh Executable file
View file

@ -0,0 +1 @@
git diff v0.5 > custom_dwl.patch

20
shell.nix Normal file
View file

@ -0,0 +1,20 @@
{ pkgs ? import <nixpkgs> { }, lib }:
let packages = with pkgs; [
pkg-config
wayland
wayland-protocols
wlroots
libxkbcommon
libinput
pixman
];
in
pkgs.mkShell {
inherit packages;
nativeBuildInputs = packages;
buildInputs = packages;
env = {
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
LD_LIBRARY_PATH = "${lib.makeLibraryPath packages}";
};
}