Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(c): simplify the template config files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed May 7, 2024
1 parent 57769ca commit 8ca65bf
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 73 deletions.
2 changes: 0 additions & 2 deletions c/.gitattributes

This file was deleted.

4 changes: 1 addition & 3 deletions c/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ hello
# build
*.[aod]

# config
# language support
compile_commands.json
.pre-commit-config.yaml
.cache

# nix
.direnv
.envrc
result
29 changes: 0 additions & 29 deletions c/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ SRC += main.c
OBJ := $(SRC:.c=.o)

CFLAGS += @compile_flags.txt
CFLAGS += -ffunction-sections -fdata-sections

LDFLAGS := -fwhole-program -flto
LDFLAGS += -Wl,--gc-sections -s

RM ?= rm -f

Expand Down
10 changes: 0 additions & 10 deletions c/compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
-pipe

-Wall
-Wcast-qual
-Wconversion
-Werror=return-type
-Werror=vla-larger-than=0
-Wextra
-Wmissing-prototypes
-Wshadow
-Wstrict-prototypes
-Wwrite-strings

-O2
-march=native
-mtune=native
27 changes: 6 additions & 21 deletions c/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,22 @@
let
forAllSystems =
function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
"i686-linux"
"mipsel-linux"
"powerpc64le-linux"
] (system: function nixpkgs.legacyPackages.${system});
nixpkgs.lib.genAttrs
nixpkgs.lib.systems.flakeExposed
(system: function nixpkgs.legacyPackages.${system});
in
rec {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
hardeningDisable = [ "fortify" ];
inputsFrom = pkgs.lib.attrsets.attrValues packages;
inputsFrom = [ packages.${pkgs.system}.hello ];
};
});

packages = forAllSystems (pkgs: rec {
default = hello;
hello = pkgs.callPackage ./default.nix { };
hello = pkgs.callPackage ./hello.nix { };
});

overlays.default = final: prev: { hello = final.callPackage ./default.nix { }; };

apps = forAllSystems (pkgs: rec {
default = hello;
hello = {
program = "${packages.${pkgs.system}.hello}/bin/hello";
type = "app";
};
});
overlays.default = final: prev: { hello = prev.callPackage ./default.nix { }; };
};
}
File renamed without changes.
4 changes: 0 additions & 4 deletions c/tokei.toml

This file was deleted.

0 comments on commit 8ca65bf

Please sign in to comment.