flake.nix: add support for more architectures + misc
This commit is contained in:
parent
d999d6710c
commit
36ddc59253
8
flake.lock
generated
8
flake.lock
generated
@ -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"
|
||||
}
|
||||
},
|
||||
|
47
flake.nix
47
flake.nix
@ -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 ];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user