2 Commits

Author SHA1 Message Date
06dfce68d9 flake.nix: disable fortify hardening (results in compiler warnings)
Without this change, I see the following (harmless but annoying)
compiler warnings when building i3 after `meson setup build`:

    [3/106] Compiling C object libi3.a.p/libi3_g_utf8_make_valid.c.o
    In file included from /nix/store/gi4cz4ir3zlwhf1azqfgxqdnczfrwsr7-glibc-2.40-66-dev/include/bits/libc-header-start.h:33,
                     from /nix/store/gi4cz4ir3zlwhf1azqfgxqdnczfrwsr7-glibc-2.40-66-dev/include/stdio.h:28,
                     from ../include/libi3.h:17,
                     from ../libi3/g_utf8_make_valid.c:20:
    /nix/store/gi4cz4ir3zlwhf1azqfgxqdnczfrwsr7-glibc-2.40-66-dev/include/features.h:422:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
      422 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
          |    ^~~~~~~
2025-12-29 11:06:18 +01:00
81cb064058 declare a development shell in flake.nix
This makes it possible to build i3 (for development)
on any system on which Nix can be installed (= most Linux systems).

For example, I start Emacs using `nix develop --command emacs`
and that Emacs process is in an environment with all i3 build deps.

See also:
https://michael.stapelberg.ch/posts/2025-07-27-dev-shells-with-nix-4-quick-examples/

This file is provided best-effort, but PRs are welcome.

While users can already run `nix develop nixpkgs#i3`,
for nix-direnv integration it is required to declare a flake.nix
in the project directory (otherwise direnv cannot find it).

similar to https://github.com/i3/i3lock/pull/372

related to https://github.com/i3/i3/pull/6549
2025-12-23 18:01:22 +01:00