non important commit

This commit is contained in:
maxstrb 2026-01-02 21:27:24 +01:00
parent 2b909bfb6a
commit 4320816d34

View file

@ -1,10 +1,12 @@
{pkgs, ...}: { {
pkgs,
lib,
...
}: let
blueprints = ./. + "/project-blueprints";
in {
home.packages = [ home.packages = [
(pkgs.writeScriptBin "create-project" (pkgs.writeScriptBin "create-project" ''
/*
nu
*/
''
#!${pkgs.nushell}/bin/nu #!${pkgs.nushell}/bin/nu
def main [ def main [
@ -12,6 +14,7 @@
name?: string name?: string
--local (-l) --local (-l)
] { ] {
if $name == null or $type == null { if $name == null or $type == null {
print "Usage: create-project <name> <type> [Options: -l]" print "Usage: create-project <name> <type> [Options: -l]"
exit 1 exit 1
@ -27,7 +30,9 @@
exit 1 exit 1
} }
if ($"~/.nix-config/home/modules/create-project/project-blueprints/($type)" | path type) != "dir" { let blueprint_dir = "${blueprints}/($type)"
if ($blueprint_dir | path type) != "dir" {
print "This project type doesn't exist" print "This project type doesn't exist"
exit 1 exit 1
} }
@ -35,12 +40,12 @@
mkdir $name mkdir $name
cd $name cd $name
if ($"~/.nix-config/home/modules/create-project/project-blueprints/($type)" | path expand | ls $in | length) > 0 { if ($blueprint_dir | path expand | ls $in | length) > 0 {
glob $"~/.nix-config/home/modules/create-project/project-blueprints/($type)/*" | each { |file| cp $file . } glob $"($blueprint_dir)/*" | each { |file| cp $file . }
} }
if ($"./init.sh" | path type) == "file" { if ("./init.sh" | path type) == "file" {
bash $"./init.sh" $name bash "./init.sh" $name
rm "init.sh" rm "init.sh"
} }
@ -56,7 +61,7 @@
exit 0 exit 0
} }
${pkgs.tea} repos create --name $name ${lib.getExe pkgs.tea} repos create --name $name
git remote add origin $"https://git.stribrny.org/max_ag/($name).git" git remote add origin $"https://git.stribrny.org/max_ag/($name).git"
git push -u origin main git push -u origin main