refactor: use nix flake instead venv
This commit is contained in:
parent
e63074a903
commit
e7abbd0891
6 changed files with 128 additions and 6 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
output
|
||||
.venv
|
||||
venv-install
|
||||
cache
|
||||
__pycache__
|
||||
.direnv
|
||||
plugins
|
||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,6 +1,3 @@
|
|||
[submodule "theme"]
|
||||
path = theme
|
||||
url = https://git.epha.se/ephase/attila_pelican_theme.git
|
||||
[submodule "plugins"]
|
||||
path = plugins
|
||||
url = https://github.com/getpelican/pelican-plugins
|
||||
|
|
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1716361217,
|
||||
"narHash": "sha256-mzZDr00WUiUXVm1ujBVv6A0qRd8okaITyUp4ezYRgc4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "46397778ef1f73414b03ed553a3368f0e7e33c2f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-23.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
64
flake.nix
Normal file
64
flake.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
description = "Development shell for Personal blog";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs , flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
pelicanplugins-neighbors = ( with pkgs; stdenv.mkDerivation {
|
||||
pname = "pelicanplugins-neighbors";
|
||||
version = "1.2.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "pelican-plugins";
|
||||
repo = "neighbors";
|
||||
rev = "60649ac6f3494d01a37b9c6d3d455f9dc2502d55";
|
||||
hash = "sha256-c6etuRqve9xj6NhGRAim2A0ae8xv6mI/yez+suQuZ8U=";
|
||||
};
|
||||
installPhase = ''
|
||||
cp -r $src/pelican/plugins/neighbors $out
|
||||
'';
|
||||
});
|
||||
pelicanplugins-md_include = ( with pkgs; stdenv.mkDerivation {
|
||||
pname = "pelicanplugins-md_include";
|
||||
version = "1.0.4";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "pelican-plugins";
|
||||
repo = "markdown-include";
|
||||
rev = "df0b3e55c45471283ca62d6e157b61a8caa35e37";
|
||||
hash = "sha256-y0dIvyEYLbYqkm+6yJOUYI3apzEMJ/N/JUwWTqjdsNg=";
|
||||
};
|
||||
installPhase = ''
|
||||
cp -r $src/pelican/plugins/md_include $out
|
||||
'';
|
||||
});
|
||||
in {
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
lefthook
|
||||
go-task
|
||||
convco
|
||||
typos
|
||||
shellcheck
|
||||
shfmt
|
||||
python3
|
||||
python3Packages.pelican
|
||||
python3Packages.markdown-include
|
||||
];
|
||||
shellHook = ''
|
||||
mkdir -p plugins
|
||||
ln -snf "${pelicanplugins-neighbors}" "plugins/neighbors"
|
||||
ln -snf "${pelicanplugins-md_include}" "plugins/md_include"
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
1
plugins
1
plugins
|
@ -1 +0,0 @@
|
|||
Subproject commit aef91ac09a57ab61518a35b4b11fe711ee74e5e2
|
Loading…
Add table
Add a link
Reference in a new issue