flake.nix: add support for more architectures + misc
This commit is contained in:
parent
d999d6710c
commit
36ddc59253
|
@ -2,16 +2,16 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683014792,
|
"lastModified": 1714272655,
|
||||||
"narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=",
|
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1a411f23ba299db155a5b45d5e145b85a7aafc42",
|
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-23.11",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
47
flake.nix
47
flake.nix
|
@ -1,23 +1,42 @@
|
||||||
{
|
{
|
||||||
# inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
|
inputs.nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||||
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: let
|
outputs = { self, nixpkgs }: let
|
||||||
system = "x86_64-linux";
|
systems = [
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
"x86_64-linux"
|
||||||
inherit (pkgs) lib;
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in f system pkgs);
|
||||||
in {
|
in {
|
||||||
apps.${system} = let
|
apps = forAllSystems (system: pkgs: let
|
||||||
app = program: {
|
mkApp = program: {
|
||||||
type = "app";
|
type = "app";
|
||||||
inherit program;
|
inherit program;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
default = self.apps.${system}.worblehat;
|
default = mkApp self.packages.${system}.default;
|
||||||
worblehat = app "${self.packages.${system}.worblehat}/bin/worblehat";
|
});
|
||||||
};
|
|
||||||
|
|
||||||
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;
|
default = self.packages.${system}.worblehat;
|
||||||
worblehat = with pkgs.python3Packages; buildPythonPackage {
|
worblehat = with pkgs.python3Packages; buildPythonPackage {
|
||||||
pname = "worblehat";
|
pname = "worblehat";
|
||||||
|
@ -38,10 +57,6 @@
|
||||||
sqlalchemy
|
sqlalchemy
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
|
|
||||||
devShells.${system}.default = pkgs.mkShell {
|
|
||||||
packages = with pkgs; [ poetry sqlite ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue