flake.nix: add support for more architectures + misc

main
Oystein Kristoffer Tveit 2024-04-29 00:15:03 +02:00
parent d999d6710c
commit 36ddc59253
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 35 additions and 20 deletions

View File

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1683014792,
"narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=",
"lastModified": 1714272655,
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1a411f23ba299db155a5b45d5e145b85a7aafc42",
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"ref": "nixos-23.11",
"type": "indirect"
}
},

View File

@ -1,23 +1,42 @@
{
# inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "nixpkgs/nixos-23.11";
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in f system pkgs);
in {
apps.${system} = let
app = program: {
apps = forAllSystems (system: pkgs: let
mkApp = program: {
type = "app";
inherit program;
};
in {
default = self.apps.${system}.worblehat;
worblehat = app "${self.packages.${system}.worblehat}/bin/worblehat";
};
default = mkApp self.packages.${system}.default;
});
packages.${system} = {
devShells = forAllSystems (_: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
poetry
sqlite
];
shellHook = ''
poetry install
poetry shell && exit
'';
};
});
overlays.default = final: prev: self.packages.${final.system};
packages = forAllSystems (system: pkgs: {
default = self.packages.${system}.worblehat;
worblehat = with pkgs.python3Packages; buildPythonPackage {
pname = "worblehat";
@ -38,10 +57,6 @@
sqlalchemy
];
};
};
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ poetry sqlite ];
};
});
};
}