change basically everything

It's a good thing that I'm not collaborating with anyone on this
repository, because this is REALLY bad practice.
This commit is contained in:
Kiana Sheibani 2025-11-23 22:43:24 -05:00
parent a3b53b180c
commit afb4b62827
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
24 changed files with 68 additions and 187 deletions

5
.gitignore vendored
View file

@ -1,3 +1,6 @@
result*
.direnv
.direnv/
flake.lock
!/flake.lock

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Kiana Sheibani
Copyright (c) 2025 Kiana Sheibani
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,43 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722073938,
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"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
}

View file

@ -10,8 +10,8 @@
packages = eachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
soe = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.soe;
hello = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.hello;
});
};
}

3
bash/nixpkgs/hello Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "Hello, World!"

View file

@ -1,10 +1,10 @@
{ stdenv
{ stdenvNoCC
, bash
}:
stdenv.mkDerivation {
pname = "soe";
version = "1.0";
stdenvNoCC.mkDerivation {
pname = "hello";
version = "0.1";
src = ./.;
@ -12,6 +12,6 @@ stdenv.mkDerivation {
installPhase = ''
mkdir -p $out/bin
cp soe $out/bin
cp hello $out/bin
'';
}

View file

@ -1,24 +0,0 @@
#!/usr/bin/env bash
echo -n "Primes up to: "
read num
echo
nums=()
for i in `seq 2 $num`; do
nums+=($i)
done
unset nums[-1]
while [ -n "$nums" ]; do
prime=${nums[0]}
echo -n "$prime "
nums_=()
for elem in "${nums[@]}"; do
[ $(( $elem % $prime )) -eq 0 ] || nums_+=($elem)
done
nums=(${nums_[@]})
done
echo

View file

@ -1,43 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722141560,
"narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"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
}

View file

@ -10,8 +10,8 @@
packages = eachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
soe = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.soe;
hello = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.hello;
});
};
}

3
fish/nixpkgs/hello Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env fish
echo "Hello, World!"

View file

@ -1,10 +1,10 @@
{ stdenv
{ stdenvNoCC
, fish
}:
stdenv.mkDerivation {
pname = "soe";
version = "1.0";
stdenvNoCC.mkDerivation {
pname = "hello";
version = "0.1";
src = ./.;
@ -12,6 +12,6 @@ stdenv.mkDerivation {
installPhase = ''
mkdir -p $out/bin
cp soe $out/bin
cp hello $out/bin
'';
}

View file

@ -1,19 +0,0 @@
#!/usr/bin/env fish
read -P "Primes up to: " num
echo
set nums (seq 2 $num)[..-2]
while test -n "$nums"
set prime $nums[1]
echo -n "$prime "
set -e nums_
for elem in $nums
test (math $elem % $prime) -eq 0 || set -a nums_ $elem
end
set nums $nums_
end
echo

View file

@ -1,5 +1,5 @@
{
description = "Templates of the Sieve of Eratosthenes implemented in various languages";
description = "Hello World flake templates for various languages and build systems";
outputs = { self, ... }:
let

View file

@ -1,3 +1,2 @@
#!/usr/bin/env bash
use flake ..#python
use flake

View file

@ -1,4 +0,0 @@
#!/usr/bin/env python
import soe
soe.main()

View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722141560,
"narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=",
"lastModified": 1763618868,
"narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160",
"rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942",
"type": "github"
},
"original": {

View file

@ -10,8 +10,14 @@
packages = eachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
soe = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.soe;
hello = pkgs.callPackage ./package.nix {};
default = self.packages.${system}.hello;
});
devShells = eachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.callPackage ./shell.nix {};
});
};
}

View file

@ -1,9 +1,13 @@
{ python3 }:
{ python3
}:
python3.pkgs.buildPythonApplication {
pname = "soe";
version = "1.0";
pname = "hello";
version = "0.1";
src = ./.;
pyproject = true;
build-system = [ python3.pkgs.setuptools ];
doCheck = false;
}

View file

@ -0,0 +1,10 @@
[project]
name = "hello"
version = "0.1.0"
[project.scripts]
hello = "hello:main"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

View file

@ -1,7 +0,0 @@
from setuptools import setup
setup(
name="soe",
version="1.0.0",
scripts=["bin/soe"]
)

View file

@ -1,3 +1,8 @@
{ python3 }:
{ mkShell
, python3
}:
python3.buildEnv.env
mkShell {
inputsFrom = [ python3.buildEnv.env ];
packages = [ python3.pkgs.python-lsp-server ];
}

View file

@ -1,18 +0,0 @@
def sieve_of_eratosthenes(n):
nums = list(range(2, n))
while nums:
prime = nums[0]
nums = [i for i in nums if i % prime]
yield prime
def main():
num = int(input("Primes up to: "))
print()
for i in sieve_of_eratosthenes(num):
print(i, end=" ")
print()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,6 @@
def main():
print("Hello, World!")
if __name__ == "__main__":
main()