Added sqlfmt as python wheel derivation

* Removed personal packages repo import for sqlfmt and poetry2nix
* Removed homeConfigurations section from flake.nix
* Updated home.packages in home/common/core/nixvim/default.nix to include sqlfmt
* Added sqlfmt package in pkgs/default.nix and pkgs/sqlfmt/default.nix
* Removed unused imports in hosts/common/users/sam/default.nix
This commit is contained in:
Sam 2024-06-23 12:29:49 +01:00
parent 5c7a624c94
commit 13bed86ae6
6 changed files with 28 additions and 248 deletions

View File

@ -145,42 +145,6 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -349,28 +313,6 @@
"type": "github"
}
},
"nix-github-actions_2": {
"inputs": {
"nixpkgs": [
"sqlfmt",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-secrets": {
"flake": false,
"locked": {
@ -466,22 +408,6 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1719036971,
"narHash": "sha256-t1g+Iq3wRWLkB1VAvdqmud9gjhedqgoaaRHd7YsC0JA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "165dfa10e2983708c5eae03a1f02674b5d03208a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
@ -547,31 +473,6 @@
"type": "github"
}
},
"poetry2nix_2": {
"inputs": {
"flake-utils": "flake-utils_4",
"nix-github-actions": "nix-github-actions_2",
"nixpkgs": [
"sqlfmt",
"nixpkgs"
],
"systems": "systems_6",
"treefmt-nix": "treefmt-nix_3"
},
"locked": {
"lastModified": 1718881664,
"narHash": "sha256-ZULRSiURptz6Da+yECzQDS30IIEAEOYyIAv5rs+p9Fg=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "5392004e2b350afda0dd5e92ccd53ab9b1261947",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
@ -584,8 +485,7 @@
"nixvim": "nixvim",
"nur": "nur",
"poetry2nix": "poetry2nix",
"sops-nix": "sops-nix",
"sqlfmt": "sqlfmt"
"sops-nix": "sops-nix"
}
},
"sops-nix": {
@ -609,28 +509,6 @@
"type": "github"
}
},
"sqlfmt": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3",
"poetry2nix": "poetry2nix_2"
},
"locked": {
"dir": "sqlfmt",
"lastModified": 1717438253,
"narHash": "sha256-esXZz2AE95t/D8lptEVORys0g68wVuIrFrqmdXsSbXI=",
"ref": "refs/heads/master",
"rev": "5d1d966349841b18d7933843ed96a5a4fb300075",
"revCount": 1,
"type": "git",
"url": "https://git.bitlab21.com/sam/flake-packages?dir=sqlfmt"
},
"original": {
"dir": "sqlfmt",
"type": "git",
"url": "https://git.bitlab21.com/sam/flake-packages?dir=sqlfmt"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -675,50 +553,6 @@
"type": "indirect"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@ -760,28 +594,6 @@
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_3": {
"inputs": {
"nixpkgs": [
"sqlfmt",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1718522839,
"narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View File

@ -9,10 +9,6 @@
# NUR
nur.url = "github:nix-community/NUR";
# Import personal packages repo
sqlfmt.url = "git+https://git.bitlab21.com/sam/flake-packages?dir=sqlfmt";
poetry2nix.url = "github:nix-community/poetry2nix";
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
@ -21,10 +17,7 @@
# Nixvim
nixvim = {
#url = "github:nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of nixvim.
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -57,7 +50,6 @@
{ self
, nixpkgs
, home-manager
, poetry2nix
, ...
} @ inputs:
let
@ -69,7 +61,6 @@
specialArgs = { inherit inputs outputs; };
in
{
poetry2nix = forAllSystems (system: nixpkgs.legacyPackages.${system}.extend poetry2nix.overlays.default);
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = import ./overlays { inherit inputs; };
@ -125,27 +116,4 @@
];
};
};
# # Standalone home-manager configuration entrypoint
# # Available through 'home-manager --flake .#your-username@your-hostname'
# homeConfigurations = {
# # FIXME replace with your username@hostname
# "sam@nixdev" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# "admin@fileserver" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs ;};
# modules = [
# # > Our main home-manager configuration file <
# ./home/nixdev.nix
# ];
# };
# };
};
}

View File

@ -1,4 +1,5 @@
{ inputs, pkgs, ... }: {
{ inputs, pkgs, ... }:
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins
@ -8,13 +9,11 @@
];
# Install home packages needed for nixvim
home.packages = builtins.attrValues {
inherit (pkgs)
nixpkgs-fmt
prettierd
;
};
home.packages = [
pkgs.nixpkgs-fmt
pkgs.prettierd
pkgs.sqlfmt
];
programs.nixvim = {
enable = true;
enableMan = true; # install man pages for nixvim options

View File

@ -134,6 +134,6 @@ in
};
environment.systemPackages = [
inputs.sqlfmt.packages.x86_64-linux.sqlfmt
#inputs.sqlfmt.packages.x86_64-linux.sqlfmt
];
}

View File

@ -4,4 +4,5 @@ pkgs: {
dwmblocks = pkgs.callPackage ./dwmblocks { };
dmenu = pkgs.callPackage ./dmenu { };
nsxiv = pkgs.callPackage ./nsxiv { };
sqlfmt = pkgs.callPackage ./sqlfmt { };
}

View File

@ -1,24 +1,24 @@
{ pkgs ? import <nixpkgs> { }
, ...
, fetchurl ? pkgs.fetchurl
, buildPythonPackage ? pkgs.python311Packages.buildPythonPackage
}:
buildPythonPackage {
pname = "shandy-sqlfmt";
version = "0.21.3";
format = "wheel";
let
name = "hello_poetry2nix";
rev = "4431812218e1963fd34f4d9d22dcd688a4c33fb4";
hash = "sha256-iHqzA/HJ+vb7O5vpGpA1eR3BcoGDPE2QOqQQpOp0zFQ=";
src = pkgs.fetchFromGitHub {
inherit rev hash;
owner = "wilsonehusin";
repo = "hello-poetry2nix";
src = fetchurl {
url = "https://github.com/tconbeer/sqlfmt/releases/download/v0.21.3/shandy_sqlfmt-0.21.3-py3-none-any.whl";
sha256 = "sha256-gb/gLAcGD7F/0LL6WllfX1CW4Tug//jNDA0v9O5tedA=";
};
in
pkgs.poetry2nix.mkPoetryApplication {
inherit name src;
pname = name;
version = rev;
projectDir = src;
doCheck = false;
propagatedBuildInputs = with pkgs.python311Packages; [
black
flake8
mypy
tqdm
jinja2
];
}