Move package def to flake and update to 22.11

This commit is contained in:
Jaculabilis 2022-12-10 20:48:00 +00:00
parent 37e1d6e182
commit 4b2d488dbb
4 changed files with 53 additions and 21 deletions

View File

@ -1,8 +1,11 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/2ebb6c1e5ae402ba35cca5eec58385e5f1adea04.tar.gz") {}
}:
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
let
app = pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
};
in app.dependencyEnv

View File

@ -1,23 +1,40 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1646588256,
"narHash": "sha256-ZHljmNlt19nSm0Mz8fx6QEhddKUkU4hhwFmfNmGn+EY=",
"lastModified": 1669833724,
"narHash": "sha256-/HEZNyGbnQecrgJnfE8d0WC5c1xuPSD2LUpB6YXlg4c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2ebb6c1e5ae402ba35cca5eec58385e5f1adea04",
"rev": "4d2b37a84fad1091b9de401eb450aae66f1a741e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "refs/tags/22.11",
"repo": "nixpkgs",
"rev": "2ebb6c1e5ae402ba35cca5eec58385e5f1adea04",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs"
}
}

View File

@ -1,14 +1,27 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?rev=2ebb6c1e5ae402ba35cca5eec58385e5f1adea04";
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs }:
{
packages."x86_64-linux".default =
outputs = { self, nixpkgs, flake-compat }:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in pkgs.callPackage ./default.nix {};
defaultPackage.x86_64-linux = self.packages."x86_64-linux".default;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.default =
(pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
}).dependencyEnv;
defaultPackage.${system} = self.packages.${system}.default;
devShell.${system} = pkgs.mkShell {
buildInputs = [ (pkgs.python3.withPackages (p: [p.poetry])) ];
};
};
}

View File

@ -1,9 +1,8 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/405d762a1a05ffed2ac820eb4bae4bc49bc3abf2.tar.gz") {}
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/2ebb6c1e5ae402ba35cca5eec58385e5f1adea04.tar.gz") {}
}:
pkgs.mkShell {
buildInputs = [
pkgs.python3
pkgs.poetry
(pkgs.python3.withPackages (p: [p.poetry]))
];
}