mach-nix: Remove as dependency.

This commit is contained in:
Sarah 2021-11-03 19:35:06 +01:00
parent 11f8edbaad
commit 207cd4d0df
No known key found for this signature in database
GPG key ID: 708F7ACE058F0186
2 changed files with 36 additions and 98 deletions

View file

@ -31,57 +31,7 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1601282935,
"narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "588973065fce51f4763287f0fda87a174d78bf48",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"mach-nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs",
"pypi-deps-db": "pypi-deps-db"
},
"locked": {
"lastModified": 1635348539,
"narHash": "sha256-SXrwF/KPz8McBN8kN+HTfGphE1hiRSr1mtXSVjPJr8o=",
"owner": "DavHau",
"repo": "mach-nix",
"rev": "98d001727542bb6142d0ab554fc30bd591b07c73",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "mach-nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1622797669,
"narHash": "sha256-xIyWeoYExzF0KNaKcqfxEX58fN4JTIQxTJWbsAujllc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1ca6b0a0cc38dbba0441202535c92841dd39d1ae",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1635336330,
"narHash": "sha256-EPrCZTmuOEY1KLjUCu7rXCBxNemggIFJMDdfEqXQKGo=",
@ -97,28 +47,11 @@
"type": "github"
}
},
"pypi-deps-db": {
"flake": false,
"locked": {
"lastModified": 1622970040,
"narHash": "sha256-u//RFnae/XMIhoy83G2uH2Qu/1LiUhVCdwwY1xj4Ufs=",
"owner": "DavHau",
"repo": "pypi-deps-db",
"rev": "be6591698c67a86a69c81fef72167e38d038a9fc",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "pypi-deps-db",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"mach-nix": "mach-nix",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs"
}
}
},

View file

@ -8,42 +8,47 @@
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
mach-nix.url = "github:DavHau/mach-nix";
};
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }: {
outputs = { self, nixpkgs, flake-utils, ... }: {
nixosModules.peerix = import ./module.nix;
overlay = import ./overlay.nix { inherit self; };
} // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
packages.peerix = mach-nix.lib.${system}.buildPythonApplication {
pname = "peerix";
python = "python39";
src = ./.;
version = builtins.replaceStrings [ " " "\n" ] [ "" "" ] (builtins.readFile ./VERSION);
requirements = builtins.readFile ./requirements.txt;
propagatedBuildInputs = with pkgs; [
nix
nix-serve
];
};
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python39;
packages = map (pkg: python.pkgs.${pkg}) (builtins.filter (v: builtins.isString v && (builtins.stringLength v) > 0) (builtins.split "\n" (builtins.readFile ./requirements.txt)));
in {
packages = rec {
peerix-unwrapped = python.pkgs.buildPythonApplication {
pname = "peerix";
version = builtins.replaceStrings [ " " "\n" ] [ "" "" ] (builtins.readFile ./VERSION);
src = ./.;
defaultPackage = self.packages.${system}.peerix;
doCheck = false;
propagatedBuildInputs = with pkgs; [
nix
nix-serve
] ++ packages;
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nix-serve
niv
(mach-nix.lib.${system}.mkPython {
python = "python39";
requirements = ''
${builtins.readFile ./requirements.txt}
ipython
'';
})
];
};
peerix = pkgs.writeShellScriptBin "peerix" ''
PATH=${pkgs.nix}/bin:${pkgs.nix-serve}:$PATH
exec ${peerix-unwrapped}/bin/peerix "$@"
'';
};
defaultApp = { type = "app"; program = "${self.packages.${system}.peerix}/bin/peerix"; };
});
defaultPackage = self.packages.${system}.peerix;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nix-serve
niv
(python.withPackages (ps: packages))
];
};
defaultApp = { type = "app"; program = "${self.packages.${system}.peerix}/bin/peerix"; };
});
}