Compare commits

..

No commits in common. "4e574a5e8f8db526c95796f31dec62a971bdbbd9" and "dd3a8016d3148681886c9a2bba465d5eab85a0ac" have entirely different histories.

4 changed files with 19 additions and 67 deletions

View File

@ -16,21 +16,6 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1669833724, "lastModified": 1669833724,
@ -50,7 +35,6 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"my-flake": "my-flake",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View File

@ -1,6 +1,5 @@
{ {
inputs = { inputs = {
my-flake.url = "github:Jaculabilis/my-flake";
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11"; nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
flake-compat = { flake-compat = {
url = "github:edolstra/flake-compat"; url = "github:edolstra/flake-compat";
@ -8,43 +7,21 @@
}; };
}; };
outputs = { self, my-flake, nixpkgs, flake-compat }: outputs = { self, nixpkgs, flake-compat }:
let let
systems = [ "aarch64-linux" "x86_64-linux" ]; system = "x86_64-linux";
each = system: pkgs = nixpkgs.legacyPackages.${system};
let in
pkgs = (import nixpkgs { {
inherit system; packages.${system}.default =
overlays = [ self.overlays.default ]; (pkgs.poetry2nix.mkPoetryApplication {
});
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 {
projectDir = ./.; projectDir = ./.;
}; }).dependencyEnv;
defaultPackage.${system} = self.packages.${system}.default;
devShell.${system} = pkgs.mkShell {
buildInputs = [ (pkgs.python3.withPackages (p: [p.poetry])) ];
}; };
}; };
} }

View File

@ -236,11 +236,6 @@ def command_help(args):
return 0 return 0
def nocommand(args):
print("command required")
return 0
def main(): def main():
"""CLI entry point""" """CLI entry point"""
# Enable piping # Enable piping
@ -288,11 +283,8 @@ def main():
add_logging_handler(verbose=args.verbose, log_filename=None) add_logging_handler(verbose=args.verbose, log_filename=None)
# Execute command # Execute command
try: if args.command:
command = commands.get(args.command, nocommand) sys.exit(commands[args.command](args.args))
sys.exit(command(args.args)) else:
except BrokenPipeError: print("command required")
# See https://docs.python.org/3.10/library/signal.html#note-on-sigpipe sys.exit(0)
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, sys.stdout.fileno())
sys.exit(1)

View File

@ -42,8 +42,7 @@ def read_config_file(config_path):
""" """
# Parse the config file into key-value pairs # Parse the config file into key-value pairs
if not os.path.isfile(config_path): if not os.path.isfile(config_path):
raise FileNotFoundError(f'No config file found at {config_path}')
raise FileNotFoundError(f'No config file found at {config_path}, try setting {CONFIG_ENVVAR}')
accumulated_configs = {} accumulated_configs = {}
current_key = None current_key = None
with open(config_path, 'r', encoding='utf8') as cfg: with open(config_path, 'r', encoding='utf8') as cfg: