Compare commits
No commits in common. "4e574a5e8f8db526c95796f31dec62a971bdbbd9" and "dd3a8016d3148681886c9a2bba465d5eab85a0ac" have entirely different histories.
4e574a5e8f
...
dd3a8016d3
16
flake.lock
16
flake.lock
|
@ -16,21 +16,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"my-flake": {
|
||||
"locked": {
|
||||
"lastModified": 1670879933,
|
||||
"narHash": "sha256-V45PH0cnFLilx66x4td5qQnWNn/V/6/6b7FQDIHvdyI=",
|
||||
"owner": "Jaculabilis",
|
||||
"repo": "my-flake",
|
||||
"rev": "2b2cd07a6d971b15fc5f65d6d963d0da551a5892",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Jaculabilis",
|
||||
"repo": "my-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1669833724,
|
||||
|
@ -50,7 +35,6 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"my-flake": "my-flake",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
|
49
flake.nix
49
flake.nix
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
inputs = {
|
||||
my-flake.url = "github:Jaculabilis/my-flake";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
|
@ -8,43 +7,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = { self, my-flake, nixpkgs, flake-compat }:
|
||||
outputs = { self, nixpkgs, flake-compat }:
|
||||
let
|
||||
systems = [ "aarch64-linux" "x86_64-linux" ];
|
||||
each = system:
|
||||
let
|
||||
pkgs = (import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
});
|
||||
in {
|
||||
packages.${system} = {
|
||||
default = self.packages.${system}.inquisitor;
|
||||
inquisitor = pkgs.inquisitor;
|
||||
env = pkgs.inquisitor.dependencyEnv;
|
||||
};
|
||||
|
||||
devShells.${system} = {
|
||||
default = self.devShells.${system}.inquisitor;
|
||||
inquisitor = pkgs.mkShell {
|
||||
buildInputs = [ (pkgs.python3.withPackages (p: [p.poetry])) ];
|
||||
shellHook = ''
|
||||
PS1="(inquisitor) $PS1"
|
||||
'';
|
||||
};
|
||||
sources = pkgs.mkShell {
|
||||
buildInputs = [ self.packages.${system}.env ];
|
||||
shellHook = ''
|
||||
PS1="(sources) $PS1"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in (my-flake.outputs-for each systems) // {
|
||||
overlays.default = final: prev: {
|
||||
inquisitor = final.poetry2nix.mkPoetryApplication {
|
||||
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])) ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -236,11 +236,6 @@ def command_help(args):
|
|||
return 0
|
||||
|
||||
|
||||
def nocommand(args):
|
||||
print("command required")
|
||||
return 0
|
||||
|
||||
|
||||
def main():
|
||||
"""CLI entry point"""
|
||||
# Enable piping
|
||||
|
@ -288,11 +283,8 @@ def main():
|
|||
add_logging_handler(verbose=args.verbose, log_filename=None)
|
||||
|
||||
# Execute command
|
||||
try:
|
||||
command = commands.get(args.command, nocommand)
|
||||
sys.exit(command(args.args))
|
||||
except BrokenPipeError:
|
||||
# See https://docs.python.org/3.10/library/signal.html#note-on-sigpipe
|
||||
devnull = os.open(os.devnull, os.O_WRONLY)
|
||||
os.dup2(devnull, sys.stdout.fileno())
|
||||
sys.exit(1)
|
||||
if args.command:
|
||||
sys.exit(commands[args.command](args.args))
|
||||
else:
|
||||
print("command required")
|
||||
sys.exit(0)
|
||||
|
|
|
@ -42,8 +42,7 @@ def read_config_file(config_path):
|
|||
"""
|
||||
# Parse the config file into key-value pairs
|
||||
if not os.path.isfile(config_path):
|
||||
|
||||
raise FileNotFoundError(f'No config file found at {config_path}, try setting {CONFIG_ENVVAR}')
|
||||
raise FileNotFoundError(f'No config file found at {config_path}')
|
||||
accumulated_configs = {}
|
||||
current_key = None
|
||||
with open(config_path, 'r', encoding='utf8') as cfg:
|
||||
|
|
Loading…
Reference in New Issue