Skip to content

Commit

Permalink
feat: working flake build
Browse files Browse the repository at this point in the history
  • Loading branch information
smsegal committed May 8, 2023
1 parent 5768ae0 commit c5a2a53
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 75 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blah blah
12 changes: 0 additions & 12 deletions cnc/config.json

This file was deleted.

8 changes: 4 additions & 4 deletions cnc/main.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from email.policy import default
import subprocess
from pathlib import Path
from time import sleep
from typing import NewType, Optional, Type, TypeVar

import click
import yaml
from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel
from rich.console import Console
from typing_extensions import Self
from xdg_base_dirs import xdg_config_home

console = Console()

CONFIG_DIR = xdg_config_home() / "cnc"
CONFIG_DIR = Path.home() / ".config/cnc"
CONFIG_FILE = CONFIG_DIR / "config.yml"

CONFIG_DIR.mkdir(parents=True, exist_ok=True)


HostKey = NewType("HostKey", str)

Expand Down
35 changes: 0 additions & 35 deletions devenv.nix.bak

This file was deleted.

3 changes: 0 additions & 3 deletions devenv.yaml.bak

This file was deleted.

70 changes: 69 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 17 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
devenv.url = "github:cachix/devenv";
flake-utils.url = "github:numtide/flake-utils";
poetry2nix.url = "github:nix-community/poetry2nix";
};

outputs = { self, nixpkgs, devenv, flake-utils, ... } @ inputs:
outputs = { self, nixpkgs, devenv, flake-utils, poetry2nix, ... } @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
let
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
pkgs = nixpkgs.legacyPackages.${system};
python310 = pkgs.python310Full;
in
{
devShell.x86_64-linux = devenv.lib.mkShell {
packages = {
cnc = mkPoetryApplication {
projectDir = ./.;
python = python310;
preferWheel = true;
};
default = self.packages.${system}.cnc;
};
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({ pkgs, ... }: {

packages = [
pkgs.git
pkgs.nodePackages.pyright
Expand All @@ -23,8 +35,8 @@
languages.python = {
enable = true;
poetry.enable = true;
package = python310;
};

})
];
};
Expand Down
16 changes: 2 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
rich = "^13.3.5"
xdg-base-dirs = "^6.0.0"
pydantic = "^1.10.7"
pyyaml = "^6.0"
click = "^8.1.3"
Expand Down

0 comments on commit c5a2a53

Please sign in to comment.