Simplification

This commit is contained in:
Daniel Ziltener 2024-09-17 10:38:18 +02:00
parent 5a554023fa
commit cd0756e4b1
Signed by: zilti
GPG key ID: B38976E82C9DAE42
2 changed files with 12 additions and 29 deletions

View file

@ -18,23 +18,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
} }
} }
}, },

View file

@ -3,18 +3,22 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
}; };
outputs = inputs @ { outputs = inputs @ {
self, self,
nixpkgs, nixpkgs,
systems,
... ...
}: let }: let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems); forAllSystems = lib.genAttrs [
pkgsFor = eachSystem (system: "aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
pkgsFor = forAllSystems (system:
import nixpkgs { import nixpkgs {
localSystem.system = system; localSystem.system = system;
overlays = with self.overlays; [chicken tcc-mob]; overlays = with self.overlays; [chicken tcc-mob];
@ -23,29 +27,24 @@
overlays = { overlays = {
default = self.overlays.chicken; default = self.overlays.chicken;
tcc-mob = final: prev: { chicken = final: prev: {
tcc-mob = final.callPackage ./nix/tinycc.nix { tcc-mob = final.callPackage ./nix/tinycc.nix {
stdenv = final.gcc13Stdenv; stdenv = final.gcc13Stdenv;
}; };
};
chicken = final: prev: {
chicken = final.callPackage ./nix/chicken.nix { chicken = final.callPackage ./nix/chicken.nix {
stdenv = final.gcc13Stdenv; stdenv = final.gcc13Stdenv;
}; };
}; };
}; };
devShells = eachSystem (system: { devShells = forAllSystems (system: {
default = let default = let
pkgs = import nixpkgs { pkgs = import nixpkgs {
overlays = [ self.overlays.tcc-mob self.overlays.chicken ]; overlays = [ self.overlays.chicken ];
}; };
in pkgs.mkShell { in pkgs.mkShell {
packages = with pkgs; [ tcc-mob chicken pkg-config ] packages = with pkgs; [ tcc-mob chicken pkg-config ]
++ (with pkgs.chickenPackages_5.chickenEggs; [ ++ (with pkgs.chickenPackages_5.chickenEggs; [
lsp-server
transducers
]); ]);
shellHook = '' shellHook = ''
export CC=${pkgs.tcc-mob}/bin/tcc export CC=${pkgs.tcc-mob}/bin/tcc