added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 236b8c2a6b
907 changed files with 70990 additions and 0 deletions

32
nyx/flake/args.nix Normal file
View file

@ -0,0 +1,32 @@
{inputs, ...}: {
perSystem = {
config,
system,
...
}: {
imports = [
{
_module.args = {
pkgs = config.legacyPackages;
pins = import ./npins;
};
}
];
legacyPackages = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
config.allowUnsupportedSystem = true;
overlays = [];
};
};
flake = {
# extended nixpkgs library, contains my custom functions
# such as system builders
lib = import (inputs.self + /lib) {inherit inputs;};
# add `pins` to self so that the flake may refer it freely
pins = import ./npins;
};
}

63
nyx/flake/deployments.nix Normal file
View file

@ -0,0 +1,63 @@
{
inputs,
self,
lib,
...
}: let
includedNodes = ["enyo" "helios"];
mkNode = name: cfg: let
inherit (cfg.pkgs.stdenv.hostPlatform) system;
deployLib = inputs.deploy-rs.lib.${system};
in {
# this looks pretty goofy, I should get a simpler domain
# it's actually hostname.namespace.domain.tld but my domain and namespace are the same
hostname = "${name}.notashelf.notashelf.dev";
sshOpts = ["-p" "30"];
skipChecks = true;
# currently only a single profile system
profilesOrder = ["system"];
profiles.system = {
sshUser = "root";
user = "root";
path = deployLib.activate.nixos cfg;
};
};
nodes = lib.mapAttrs mkNode (lib.filterAttrs (name: _: lib.elem name includedNodes) self.nixosConfigurations);
in {
flake = {
deploy = {
autoRollback = true;
magicRollback = true;
inherit nodes;
};
};
perSystem = {
pkgs,
system,
...
}: let
deployPkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.deploy-rs.overlay
(_: prev: {
deploy-rs = {
inherit (pkgs) deploy-rs;
inherit (prev.deploy-rs) lib;
};
})
];
};
in {
# evaluation of deployChecks is slow
# checks = (deployPkgs.deploy-rs.lib.deployChecks self.deploy)
apps.deploy = {
type = "app";
program = pkgs.writeShellScriptBin "deploy" ''
${deployPkgs.deploy-rs.deploy-rs}/bin/deploy --skip-checks
'';
};
};
}

40
nyx/flake/fmt.nix Normal file
View file

@ -0,0 +1,40 @@
{
perSystem = {
inputs',
config,
pkgs,
...
}: {
# provide the formatter for `nix fmt`
formatter = config.treefmt.build.wrapper;
# configure treefmt
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra = {
enable = true;
package = inputs'.nyxpkgs.packages.alejandra-no-ads;
};
shellcheck.enable = true; # cannot be configured, errors on basic bash convention
prettier = {
enable = true;
package = pkgs.prettierd;
excludes = ["*.age"];
settings = {
editorconfig = true;
};
};
shfmt = {
enable = true;
# https://flake.parts/options/treefmt-nix.html#opt-perSystem.treefmt.programs.shfmt.indent_size
indent_size = 2; # set to 0 to use tabs
};
};
};
};
}

27
nyx/flake/iso-images.nix Normal file
View file

@ -0,0 +1,27 @@
{
inputs,
self,
...
}: let
installerModule = "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix";
in {
# ISO images based on available hosts. We avoid basing ISO images
# on active (i.e. desktop) hosts as they likely have secrets set up.
# Images below are designed specifically to be used as live media
# and can be built with `nix build .#images.<hostname>`
# alternatively hosts can be built with `nix build .#nixosConfigurations.hostName.config.system.build.isoImage`
flake.images = let
gaea = self.nixosConfigurations."gaea";
erebus = self.nixosConfigurations."erebus";
atlas = self.nixosConfigurations."atlas".extendModules {modules = [installerModule];};
in {
# Installation iso
gaea = gaea.config.system.build.isoImage;
# air-gapped VM
erebus = erebus.config.system.build.isoImage;
# Raspberry Pi 400
atlas = atlas.config.system.build.sdImage;
};
}

View file

@ -0,0 +1,43 @@
{self, ...}: let
mkFlakeModule = path:
if builtins.isPath path
then self + path
else builtins.throw "${path} is not a real path! Are you stupid?";
in {
flake = {
# set of modules exposed by my flake to be consumed by others
# those can be imported by adding this flake as an input and then importing the nixosModules.<moduleName>
# i.e imports = [ inputs.nyx.nixosModules.steam-compat ]; or modules = [ inputs.nyx.nixosModules.steam-compat ];
nixosModules = {
# extends the steam module from nixpkgs/nixos to add a STEAM_COMPAT_TOOLS option
# moved to nix-gaming
# steam-compat = /modules/extra/shared/nixos/steam;
# a module for the comma tool that wraps it with nix-index and disabled the command-not-found integration
comma-rewrapped = mkFlakeModule /modules/extra/shared/nixos/comma;
# an open source implementation of wakatime server
wakapi = mkFlakeModule /modules/extra/shared/nixos/wakapi;
# we do not want to provide a default module
default = builtins.throw "There is no default module, sorry!";
};
homeManagerModules = {
# now available in home-manager
# xplr = mkModule /modules/extra/shared/home-manager/xplr;
# a home-baked module for gtklock
# allows definning extra modules and the stylesheet
# FIXME: gtklock is currently broken thanks to the deprecation of the necessary wayland protocol
gtklock = mkFlakeModule /modules/extra/shared/home-manager/gtklock;
vifm = mkFlakeModule /modules/extra/shared/home-manager/vifm;
transience = mkFlakeModule /modules/extra/shared/home-manager/transience;
# again, we do not want to provide a default module
default = builtins.throw "There is no default module, sorry!";
};
};
}

View file

@ -0,0 +1,67 @@
# Generated by npins. Do not modify; will be overwritten regularly
let
data = builtins.fromJSON (builtins.readFile ./sources.json);
version = data.version;
mkSource = spec:
assert spec ? type; let
path =
if spec.type == "Git"
then mkGitSource spec
else if spec.type == "GitRelease"
then mkGitSource spec
else if spec.type == "PyPi"
then mkPyPiSource spec
else if spec.type == "Channel"
then mkChannelSource spec
else builtins.throw "Unknown source type ${spec.type}";
in
spec // {outPath = path;};
mkGitSource = {
repository,
revision,
url ? null,
hash,
...
}:
assert repository ? type;
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
# In the latter case, there we will always be an url to the tarball
if url != null
then
(builtins.fetchTarball {
inherit url;
sha256 = hash; # FIXME: check nix version & use SRI hashes
})
else
assert repository.type == "Git";
builtins.fetchGit {
url = repository.url;
rev = revision;
# hash = hash;
};
mkPyPiSource = {
url,
hash,
...
}:
builtins.fetchurl {
inherit url;
sha256 = hash;
};
mkChannelSource = {
url,
hash,
...
}:
builtins.fetchTarball {
inherit url;
sha256 = hash;
};
in
if version == 3
then builtins.mapAttrs (_: mkSource) data.pins
else throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"

View file

@ -0,0 +1,53 @@
{
"pins": {
"hmts.nvim": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "calops",
"repo": "hmts.nvim"
},
"pre_releases": false,
"version_upper_bound": null,
"version": "v1.2.2",
"revision": "14fd941d7ec2bb98314a1aacaa2573d97f1629ab",
"url": "https://api.github.com/repos/calops/hmts.nvim/tarball/v1.2.2",
"hash": "09f403w6gglfycghjzx4dc5gv71wqb6ywnmcvm15n1ldxasb6jwd"
},
"nixpkgs": {
"type": "Channel",
"name": "nixpkgs-unstable",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre562963.e1fa12d4f6c6/nixexprs.tar.xz",
"hash": "16wdn7j17y9yradygdbdlhlcpqa432hp5ah49cm3b0caqymbgw6h"
},
"slides.nvim": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "notashelf",
"repo": "slides.nvim"
},
"pre_releases": false,
"version_upper_bound": null,
"version": "v0.1.0",
"revision": "768fde54ac9de657887b605ee93f11993b26c9c2",
"url": "https://api.github.com/repos/notashelf/slides.nvim/tarball/v0.1.0",
"hash": "19pzmwpjdsmyy9ygk6ln1i18qihdffp6dgx4vvccyvvz3shabvhx"
},
"smart-splits.nvim": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "mrjones2014",
"repo": "smart-splits.nvim"
},
"pre_releases": false,
"version_upper_bound": null,
"version": "v1.2.4",
"revision": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362",
"url": "https://api.github.com/repos/mrjones2014/smart-splits.nvim/tarball/v1.2.4",
"hash": "0hxy3fv6qp7shwh9wgf20q5i8ba2pzng2dd1dvw27aabibk43ba3"
}
},
"version": 3
}

View file

@ -0,0 +1,26 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation rec {
pname = "anime4k";
version = "4.0.1";
src = fetchzip {
url = "https://github.com/bloc97/Anime4K/releases/download/v${version}/Anime4K_v4.0.zip";
stripRoot = false;
sha256 = "18x5q7zvkf5l0b2phh70ky6m99fx1pi6mhza4041b5hml7w987pl";
};
installPhase = ''
mkdir $out
cp *.glsl $out
'';
meta = {
description = "A High-Quality Real Time Upscaler for Anime Video";
homepage = "https://github.com/bloc97/Anime4K";
license = lib.licenses.mit;
};
}

View file

@ -0,0 +1,38 @@
{
stdenv,
lib,
makeWrapper,
box64,
x64-bash,
pkg,
deps,
bins ? "${lib.getBin pkg}/bin/*",
entry ? "${box64}/bin/box64",
extraWrapperArgs ? [],
}:
stdenv.mkDerivation rec {
name = "box64-wrapped-${pkg.name}";
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [makeWrapper];
buildInputs = deps;
installPhase = ''
runHook preInstall
for bin in ${bins}; do
mkdir -p $out/bin
makeWrapper ${entry} $out/bin/"$(basename "$bin")" \
--set BOX64_BASH ${lib.getBin x64-bash}/bin/bash \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} \
${lib.strings.concatStringsSep " " extraWrapperArgs}\
--add-flags "$bin"
done
runHook postInstall
'';
}

View file

@ -0,0 +1,21 @@
{inputs, ...}: {
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = {pkgs, ...}: let
inherit (pkgs) callPackage;
in {
packages = {
schizofox-startpage = callPackage ./startpage {};
plymouth-themes = callPackage ./plymouth-themes.nix {};
anime4k = callPackage ./anime4k.nix {};
spotify-wrapped = callPackage ./spotify-wrapped.nix {};
nicksfetch = callPackage ./nicksfetch.nix {};
present = callPackage ./present.nix {};
modprobed-db = callPackage ./modprobed-db.nix {};
nixfmt-rfc = callPackage ./nixfmt-rfc.nix {inherit inputs;};
};
};
}

View file

@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
libevdev,
kmod,
sudo,
withSudo ? false,
}:
stdenv.mkDerivation rec {
pname = "modprobed-db";
version = "2.44";
src = fetchFromGitHub {
owner = "graysky2";
repo = pname;
rev = "v${version}";
sha256 = "sha256-APvA96NoYPtUyuzqGWCqOpB73Vz3qhkMvHWExHXhkKM=";
};
nativeBuildInputs = [pkg-config];
buildInputs =
[kmod libevdev]
++ lib.optional withSudo sudo;
postPatch = ''
substituteInPlace ./common/modprobed-db.in --replace "/usr/share" "$out/share"
'';
installFlags = ["DESTDIR=$(out)" "PREFIX="];
meta = {
homepage = "https://github.com/graysky2/modprobed-db";
description = "useful utility for users wishing to build a minimal kernel via a make localmodconfig";
longDescription = ''
Keeps track of EVERY kernel module that has ever been probed.
Useful for those of us who make localmodconfig :)'';
license = lib.licenses.mit;
maintainers = with lib.maintainers; [NotAShelf];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,53 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
bash,
makeWrapper,
pciutils,
x11Support ? true,
ueberzug,
}:
stdenvNoCC.mkDerivation {
pname = "nicksfetch";
version = "unstable-2021-12-10";
src = fetchFromGitHub {
owner = "dylanaraps";
repo = "neofetch";
rev = "ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f";
sha256 = "sha256-9MoX6ykqvd2iB0VrZCfhSyhtztMpBTukeKejfAWYW1w=";
};
patches = [
./patches/0002-nicksfetch.patch
];
outputs = ["out" "man"];
strictDeps = true;
buildInputs = [bash];
nativeBuildInputs = [makeWrapper];
postPatch = ''
patchShebangs --host neofetch
'';
postInstall = ''
wrapProgram $out/bin/neofetch \
--prefix PATH : ${lib.makeBinPath ([pciutils] ++ lib.optional x11Support ueberzug)}
'';
makeFlags = [
"PREFIX=${placeholder "out"}"
"SYSCONFDIR=${placeholder "out"}/etc"
];
meta = {
description = "A fast, highly customizable system info script";
homepage = "https://github.com/dylanaraps/neofetch";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [alibabzo konimex notashelf];
mainProgram = "neofetch";
};
}

View file

@ -0,0 +1,12 @@
{
inputs,
nixfmt-rfc-style,
...
}:
nixfmt-rfc-style.overrideAttrs (self: let
pname = "nixfmt-rfc";
version = "${self.version}-${inputs.nixfmt.shortRev}";
in {
inherit pname version;
src = inputs.nixfmt;
})

View file

@ -0,0 +1,25 @@
From 0eaef67b683683fb423fcb2d5096b3cdf9a4a9cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
Date: Sun, 22 Mar 2020 12:26:10 +0100
Subject: [PATCH] Patch plugindir to output
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 50edb74..639ee86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ])
PKG_CHECK_MODULES([cairo], [cairo])
PKG_CHECK_MODULES([rofi], [rofi >= 1.5.4])
-[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`"
+[rofi_PLUGIN_INSTALL_DIR]="`echo $out/lib/rofi`"
AC_SUBST([rofi_PLUGIN_INSTALL_DIR])
LT_INIT([disable-static])
--
2.25.1

View file

@ -0,0 +1,90 @@
diff --git a/neofetch b/neofetch
index 48b96d21..a2270c9a 100755
--- a/neofetch
+++ b/neofetch
@@ -46,7 +46,7 @@ LC_ALL=C
LANG=C
# Fix issues with gsettings.
-export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
+[[ -z $GIO_EXTRA_MODULES ]] && export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
# Neofetch default config.
read -rd '' config <<'EOF'
@@ -999,6 +999,13 @@ get_distro() {
*) distro="OS Elbrus $(< /etc/mcst_version)"
esac
+ elif [[ -f /etc/NIXOS ]]; then
+ case $distro_shorthand in
+ on) distro="Nick's OS $(nixos-version | awk '{print substr($1,0,5),$2}')" ;;
+ tiny) distro="NixOS" ;;
+ *) distro="Nick's OS $(nixos-version)" ;;
+ esac
+
elif type -p pveversion >/dev/null; then
case $distro_shorthand in
on|tiny) distro="Proxmox VE" ;;
@@ -8951,29 +8958,38 @@ EOF
"nixos_old"*)
set_colors 4 6
read -rd '' ascii_data <<'EOF'
-${c1} ::::. ${c2}'::::: ::::'
-${c1} '::::: ${c2}':::::. ::::'
-${c1} ::::: ${c2}'::::.:::::
-${c1} .......:::::..... ${c2}::::::::
-${c1} ::::::::::::::::::. ${c2}:::::: ${c1}::::.
- ::::::::::::::::::::: ${c2}:::::. ${c1}.::::'
-${c2} ..... ::::' ${c1}:::::'
-${c2} ::::: '::' ${c1}:::::'
-${c2} ........::::: ' ${c1}:::::::::::.
-${c2}::::::::::::: ${c1}:::::::::::::
-${c2} ::::::::::: ${c1}.. ${c1}:::::
-${c2} .::::: ${c1}.::: ${c1}:::::
-${c2} .::::: ${c1}::::: ${c1}''''' ${c2}.....
- ::::: ${c1}':::::. ${c2}......:::::::::::::'
- ::: ${c1}::::::. ${c2}':::::::::::::::::'
-${c1} .:::::::: ${c2}'::::::::::
-${c1} .::::''::::. ${c2}'::::.
-${c1} .::::' ::::. ${c2}'::::.
-${c1} .:::: :::: ${c2}'::::.
-EOF
- ;;
-
- "NixOS"*)
+${c1} ____ ${c2}_______ ____
+${c1} /####\ ${c2}\######\ /####\
+${c1} ######\ ${c2}\######\ /#####/
+${c1} \######\ ${c2}\######\ /#####/
+${c1} \######\ ${c2}\######\/#####/ ${c1}/\
+${c1} \######\ ${c2}\###########/ ${c1}/##\
+${c1} ________\######\______${c2}\#########/ ${c1}/####\
+${c1} /#######################${c2}\#######/ ${c1}/######
+${c1} /#########################${c2}\######\ ${c1}/######/
+${c1} /###########################${c2}\######\ ${c1}/######/
+${c1} ¯¯¯¯¯¯¯¯¯¯¯¯${c2}/######/${c1}¯¯¯¯¯¯¯¯¯${c2}\######${c1}/######/
+${c2} /######/ ${c2}\####${c1}/######/________
+${c2} _____________/######/ ${c2}\##${c1}/################\
+${c2} /###################/ ${c2}\${c1}/##################\
+${c2} \##################/${c1}\ /###################/
+${c2} \################/${c1}##\ /######/¯¯¯¯¯¯¯¯¯¯¯¯¯
+${c2} ¯¯¯¯¯¯¯¯/######/${c1}####\ /######/
+${c2} /######/${c1}######\${c2}_________${c1}/######/${c2}____________
+${c2} /######/ ${c1}\######\${c2}###########################/
+${c2} /######/ ${c1}\######\${c2}#########################/
+${c2} ######/ ${c1}/#######\${c2}#######################/
+${c2} \####/ ${c1}/#########\${c2}¯¯¯¯¯¯\######\¯¯¯¯¯¯¯¯
+${c2} \##/ ${c1}/###########\${c2} \######\
+${c2} \/ ${c1}/#####/\######\${c2} \######\
+${c1} ${c1}/#####/ \######\${c2} \######\
+${c1} ${c1}/#####/ \######\${c2} \######
+${c1} ${c1}\####/ \######\${c2} \####/
+${c1} ${c1}¯¯¯¯ ¯¯¯¯¯¯¯${c2} ¯¯¯¯
+EOF
+ ;;
+
+ "Nicks OS"*)
set_colors 4 6
read -rd '' ascii_data <<'EOF'
${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖

View file

@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
pack ? 2,
theme ? "green_blocks",
...
}:
stdenv.mkDerivation rec {
pname = "plymouth-themes";
version = "1.0.0";
strictDeps = true;
src = fetchFromGitHub {
owner = "adi1090x";
repo = "plymouth-themes";
rev = "bf2f570bee8e84c5c20caac353cbe1d811a4745f";
sha256 = "sha256-VNGvA8ujwjpC2rTVZKrXni2GjfiZk7AgAn4ZB4Baj2k=";
};
configurePhase = ''
runHook preConfigure
mkdir -p $out/share/plymouth/themes
runHook postConfigure
'';
installPhase = ''
runHook preInstall
cp -r ./pack_${toString pack}/${theme} $out/share/plymouth/themes
sed -i 's;/usr/share;${placeholder "out"}/share;g' \
$out/share/plymouth/themes/${theme}/${theme}.plymouth
runHook postInstall
'';
meta = {
description = "A collection of plymouth themes ported from Android.";
inherit (src.meta) homepage;
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,15 @@
# yoinked from https://github.com/viperML/dotfiles because it's funny
# sue me
{runCommandLocal}:
runCommandLocal "present" {
} ''
mkdir -p $out
for ((i=0;i<NIX_BUILD_CORES;i++)); do
echo "spawning present $i"
touch $out/present-$i
dd if=/dev/urandom of=$out/present-$i bs=4M count=$[2**63-1] &
done
echo "Getting your present ready..."
wait
''

View file

@ -0,0 +1,214 @@
{
fetchurl,
lib,
stdenv,
squashfsTools,
xorg,
alsa-lib,
makeShellWrapper,
wrapGAppsHook,
openssl,
freetype,
glib,
pango,
cairo,
atk,
gdk-pixbuf,
gtk3,
cups,
nspr,
nss_latest,
libpng,
libnotify,
libgcrypt,
systemd,
fontconfig,
dbus,
expat,
ffmpeg_4,
curlWithGnuTls,
zlib,
gnome,
at-spi2-atk,
at-spi2-core,
libpulseaudio,
libdrm,
mesa,
libxkbcommon,
harfbuzz,
curl,
libgnurl,
# High-DPI support: Spotify's --force-device-scale-factor argument
# not added if `null`, otherwise, should be a number.
deviceScaleFactor ? null,
}: let
# TO UPDATE: just execute the ./update.sh script (won't do anything if there is no update)
# "rev" decides what is actually being downloaded
# If an update breaks things, one of those might have valuable info:
# https://aur.archlinux.org/packages/spotify/
# https://community.spotify.com/t5/Desktop-Linux
version = "1.2.11.916.geb595a67";
# To get the latest stable revision:
# curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=stable' | jq '.download_url,.version,.last_updated'
# To get general information:
# curl -H 'Snap-Device-Series: 16' 'https://api.snapcraft.io/v2/snaps/info/spotify' | jq '.'
# More examples of api usage:
# https://github.com/canonical-websites/snapcraft.io/blob/master/webapp/publisher/snaps/views.py
rev = "67";
deps = [
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
curlWithGnuTls
dbus
expat
ffmpeg_4 # Requires libavcodec < 59 as of 1.2.9.743.g85d9593d
fontconfig
freetype
gdk-pixbuf
glib
gtk3
harfbuzz
libdrm
libgcrypt
libnotify
libpng
libpulseaudio
libxkbcommon
mesa
nss_latest
pango
stdenv.cc.cc
systemd
xorg.libICE
xorg.libSM
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXScrnSaver
xorg.libxshmfence
xorg.libXtst
zlib
curl
];
in
stdenv.mkDerivation {
pname = "spotify";
inherit version;
# fetch from snapcraft instead of the debian repository most repos fetch from.
# That is a bit more cumbersome. But the debian repository only keeps the last
# two versions, while snapcraft should provide versions indefinitely:
# https://forum.snapcraft.io/t/how-can-a-developer-remove-her-his-app-from-snap-store/512
# This is the next-best thing, since we're not allowed to re-distribute
# spotify ourselves:
# https://community.spotify.com/t5/Desktop-Linux/Redistribute-Spotify-on-Linux-Distributions/td-p/1695334
src = fetchurl {
url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap";
sha512 = "3d5a9fda88a076a22bb6d0b6b586334865f03a4e852ca8e022468e3dd3520a81dea314721e26e54ba9309603e08f66588f005ee8970e73eccbf805ff70e89dca";
};
nativeBuildInputs = [wrapGAppsHook makeShellWrapper squashfsTools];
dontStrip = true;
dontPatchELF = true;
unpackPhase = ''
runHook preUnpack
unsquashfs "$src" '/usr/share/spotify' '/usr/bin/spotify' '/meta/snap.yaml'
cd squashfs-root
if ! grep -q 'grade: stable' meta/snap.yaml; then
# Unfortunately this check is not reliable: At the moment (2018-07-26) the
# latest version in the "edge" channel is also marked as stable.
echo "The snap package is marked as unstable:"
grep 'grade: ' meta/snap.yaml
echo "You probably chose the wrong revision."
exit 1
fi
if ! grep -q '${version}' meta/snap.yaml; then
echo "Package version differs from version found in snap metadata:"
grep 'version: ' meta/snap.yaml
echo "While the nix package specifies: ${version}."
echo "You probably chose the wrong revision or forgot to update the nix version."
exit 1
fi
runHook postUnpack
'';
# Prevent double wrapping
dontWrapGApps = true;
installPhase = ''
runHook preInstall
libdir=$out/lib/spotify
mkdir -p $libdir
mv ./usr/* $out/
cp meta/snap.yaml $out
# Work around Spotify referring to a specific minor version of
# OpenSSL.
ln -s ${lib.getLib openssl}/lib/libssl.so $libdir/libssl.so.1.0.0
ln -s ${lib.getLib openssl}/lib/libcrypto.so $libdir/libcrypto.so.1.0.0
ln -s ${nspr.out}/lib/libnspr4.so $libdir/libnspr4.so
ln -s ${nspr.out}/lib/libplc4.so $libdir/libplc4.so
ln -s ${ffmpeg_4.lib}/lib/libavcodec.so* $libdir
ln -s ${ffmpeg_4.lib}/lib/libavformat.so* $libdir
rpath="$out/share/spotify:$libdir"
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/share/spotify/spotify
librarypath="${lib.makeLibraryPath deps}:$libdir"
wrapProgramShell $out/share/spotify/spotify \
''${gappsWrapperArgs[@]} \
${lib.optionalString (deviceScaleFactor != null) ''
--add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \
''} \
--prefix LD_LIBRARY_PATH : "$librarypath" \
--prefix PATH : "${gnome.zenity}/bin" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
# fix Icon line in the desktop file (#48062)
sed -i "s:^Icon=.*:Icon=spotify-client:" "$out/share/spotify/spotify.desktop"
# Desktop file
mkdir -p "$out/share/applications/"
cp "$out/share/spotify/spotify.desktop" "$out/share/applications/"
# Icons
for i in 16 22 24 32 48 64 128 256 512; do
ixi="$i"x"$i"
mkdir -p "$out/share/icons/hicolor/$ixi/apps"
ln -s "$out/share/spotify/icons/spotify-linux-$i.png" \
"$out/share/icons/hicolor/$ixi/apps/spotify-client.png"
done
runHook postInstall
'';
meta = {
homepage = "https://www.spotify.com/";
description = "Play music from the Spotify music service";
sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [eelco ftrvxmtrx sheenobu mudri timokau ma27];
platforms = ["x86_64-linux"];
};
}

View file

@ -0,0 +1,25 @@
{
lib,
stdenvNoCC,
}: let
name = "schizofox-startpage";
version = "2023-12-29-unstable";
in
stdenvNoCC.mkDerivation {
inherit name version;
src = ./src;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rv $src/* $out
runHook postInstall
'';
meta = {
description = "My personal startpage";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [NotAShelf];
};
}

View file

@ -0,0 +1,17 @@
module.exports = {
env: {
es2021: true,
},
extends: "eslint:recommended",
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,88 @@
<html>
<head>
<!--<link rel="shortcut icon" href="img\opera-multi-size.ico">-->
<link rel="stylesheet" type="text/css" href="style.css">
<title>Startpage</title>
</head>
<body>
<div id=stripe>
<div id="Title">notashelf@nyx ~ $ > ls</div>
<input
id="searchbox"
placeholder="Options: | -a | -h | -m | -w | -y |"
type="text"
autofocus="true"
autocomplete="true">
</input>
<div id=mainframe>
<div id=linkblock style="background-image:url(assets/planet.png)">
<ul>
<!-- General -->
<li><a href="https://google.com">> Google</a></li>
<li><a href="https://youtube.com">> Youtube</a></li>
<li><a href="https://monkeytype.com/">> Monkeytype</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/flowers.png);">
<ul>
<!-- Social -->
<li><a href="https://twitter.com/">> Twitter</a></li>
<li><a href="https://web.telegram.org">> Telegram</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/logs.png);">
<ul>
<!-- Reddit -->
<li><a href="https://www.reddit.com/r/android">> r/android</a></li>
<li><a href="https://www.reddit.com/r/sysadmin">> r/sysadmin</a></li>
<li><a href="https://www.reddit.com/r/linux">> r/linux</a></li>
<li><a href="https://www.reddit.com/r/unixporn">> r/unixporn</a></li>
<li><a href="https://www.reddit.com/r/hyprland">> r/hyprland</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/blossom.png);">
<ul>
<!-- 4chan -->
<li><a href="https://www.4chan.org/a/">> /a/</a></li>
<li><a href="https://www.4chan.org/ck/">> /ck/</a></li>
<li><a href="https://www.4chan.org/g/">> /g/</a></li>
<li><a href="https://www.4chan.org/w/">> /w/</a></li>
<li><a href="https://www.4chan.org/wg/">> /wg/</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/malachite.png);">
<ul>
<!-- Dev -->
<li><a href="https://github.com">> Github</a></li>
<li><a href="http://forum.xda-developers.com">> XDA Developers</a></li>
<li><a href="https://www.archlinux.org/">> Archwiki</a></li>
<li><a href="https://go.dev/doc/">> Golang Docs</a></li>
<li><a href="https://crates.io/">> Crate Registry</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/sway.png);">
<!-- Nix -->
<ul>
<li>
<a href="https://nixos.org/manual/nixos/unstable/">> NixOS Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nixpkgs/ustable/">> Nixpkgs Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nix/unstable/">> Nix Manual</a>
</li>
<li>
<a href="https://noogle.dev/">> noogle</a>
</li>
</ul>
</div>
</div>
</div>
<div id=footer>
<a href="secondary.html">o</a>
</div>
</body>
<script src="search.js" type="text/javascript"></script>
</html>

View file

@ -0,0 +1,78 @@
String.prototype.replaceChars = function (character, replacement) {
return this.split(character).join(replacement);
};
function search(query) {
const searchPrefix = query.substring(0, 2);
query = query.substring(3);
switch (searchPrefix) {
case "-a":
window.location = `http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-y":
window.location = `https://www.youtube.com/results?search_query=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-w":
window.location = `https://en.wikipedia.org/w/index.php?search=${query.replaceChars(
" ",
"%20",
)}`;
break;
case "-m":
window.location = `http://www.wolframalpha.com/input/?i=${query.replaceChars(
"+",
"%2B",
)}`;
break;
case "-h":
window.location = `http://alpha.wallhaven.cc/search?q=${query}&categories=111&purity=100&resolutions=1920x1080&sorting=relevance&order=desc`;
break;
default:
window.location = `https://search.notashelf.dev/search?q=${query.replaceChars(
" ",
"+",
)}&categories=general`;
}
}
window.onload = function () {
const searchInput = document.getElementById("searchbox");
if (searchInput) {
searchInput.addEventListener("keypress", function (event) {
if (event.keyCode === 13) {
search(this.value);
}
});
}
};
//
// To add a new search provider, paste the following between the last "break;" and "default:" (Line 39 & 40)
//
// case "-a":
// query = query.substr(3);
// window.location =
// "https://en.website.com/" +
// query.replaceChars(" ", "%20");
// break;
//
// -a on ln68 should be replaced with a "-letter" of your choice. You can also change it to !a, .a, /a etc.
// https://en.website.com/ on ln70 should be replaced with the search page of the website. To find this, make a few searches on your website.
//Try to identify where your search is in the URL. If you're not sure, post in the thread and someone should help you out
//
// You can use the above two to modify an existing rule
//
// If you wish to change the number of characters in a "case", you need to change the line below, changing query.substr() to n+1, n being the number of characters.
// This ensures that when you search for something, the whole of your idenfier and the space between the identifier and query are removed.

View file

@ -0,0 +1,130 @@
body {
background-color: #11111b;
color: #cdd6f4;
}
#Title {
font-family: "Malgun Gothic";
text-align: center;
color: #cdd6f4;
margin-top: 75px;
}
#searchbox {
width: 500;
height: 4%;
border: none;
border-radius: 2px;
outline: none;
padding-left: 15px;
text-align: left;
background-color: #1e1e2e;
color: #cdd6f4;
font-size: 15px;
font-family: "Malgun Gothic", sans-serif;
display: block;
margin: auto;
margin-top: 50px;
}
#stripe {
width: 100%;
vertical-align: middle;
}
#mainframe {
text-align: center;
position: absolute;
top: 25%;
left: 16%;
right: 11%;
}
#footer {
position: absolute;
bottom: 0;
right: 0;
text-align: right;
padding: 10px;
font-size: 30%;
}
#linkblock {
width: 20%;
height: 140px;
margin-left: 25px;
margin-right: 30px;
margin-top: 30px;
margin-bottom: 40px;
padding-left: 67px;
padding-right: 1px;
padding-top: 0px;
padding-bottom: 5px;
color: #cdd6f4;
text-align: left;
background-position: top 0px left 0px;
background-repeat: no-repeat;
font-family: "Malgun Gothic";
font-size: 100%;
display: inline-block;
vertical-align: top;
border-left: 3px solid #181825;
transition: 0.5s;
}
ul {
list-style-type: none;
padding-left: 0;
}
a:link {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:visited {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:hover {
text-decoration: none;
font-weight: normal;
color: #b4befe;
}
a:active {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:focus {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
#footer a:link {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:visited {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:hover {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:active {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:focus {
text-decoration: none;
font-weight: normal;
color: #101010;
}

53
nyx/flake/pre-commit.nix Normal file
View file

@ -0,0 +1,53 @@
{inputs, ...}: {
imports = [inputs.pre-commit-hooks.flakeModule];
perSystem = {
config,
pkgs,
...
}: let
# configure a general exclude list
excludes = ["flake.lock" "r'.+\.age$'" "r'.+\.sh$'"];
# mkHook just defaults failfast to true
# and sets the description from the name
mkHook = name: prev:
{
inherit excludes;
description = "pre-commit hook for ${name}";
fail_fast = true; # running hooks if this hook fails
verbose = true;
}
// prev;
in {
pre-commit = {
check.enable = true;
settings = {
# inherit the global exclude list
inherit excludes;
# hooks that we want to enable
hooks = {
alejandra = mkHook "Alejandra" {enable = true;};
actionlint = mkHook "actionlint" {enable = true;};
luacheck = mkHook "luacheck" {enable = true;};
treefmt = mkHook "treefmt" {enable = true;};
editorconfig-checker = mkHook "editorconfig" {
enable = false;
always_run = true;
};
prettier = mkHook "prettier" {
enable = true;
settings = {
binPath = "${pkgs.prettierd}/bin/prettierd";
write = true;
};
};
};
};
};
};
}

42
nyx/flake/shell.nix Normal file
View file

@ -0,0 +1,42 @@
{
perSystem = {
inputs',
config,
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
name = "nyx";
meta.description = "The default development shell for my NixOS configuration";
shellHook = ''
${config.pre-commit.installationScript}
'';
# tell direnv to shut up
DIRENV_LOG_FORMAT = "";
# packages available in the dev shell
packages = with pkgs; [
inputs'.agenix.packages.default # provide agenix CLI within flake shell
inputs'.deploy-rs.packages.default # provide deploy-rs CLI within flake shell
config.treefmt.build.wrapper # treewide formatter
nil # nix ls
alejandra # nix formatter
git # flakes require git, and so do I
glow # markdown viewer
statix # lints and suggestions
deadnix # clean up unused nix code
nodejs # for ags and eslint_d
(pkgs.writeShellApplication {
name = "update";
text = ''
nix flake update && git commit flake.lock -m "flake: bump inputs"
'';
})
];
inputsFrom = [config.treefmt.build.devShell];
};
};
}

View file

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.c]
ident_style = space
ident_size = 4
[Makefile*]
ident_style = tab
ident_size = 4

3
nyx/flake/templates/c/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# ignore build artifacts
result
build

View file

@ -0,0 +1,9 @@
{clangStdenv}:
clangStdenv.mkDerivation {
pname = "sample-c-cpp";
version = "0.0.1";
src = ./.;
makeFlags = ["PREFIX=$(out)"];
}

View file

@ -0,0 +1,25 @@
{
description = "C/C++ Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
...
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
};
}

View file

@ -0,0 +1,42 @@
PREFIX ?= /usr/local # this is overriden by the derivation makeFlags
BIN_DIR ?= $(PREFIX)/bin
TARGET_EXEC ?= foo-bar
BUILD_DIR ?= ./build
SRC_DIRS ?= ./src
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CPPFLAGS ?= $(INC_FLAGS) -MMD -MP
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
# c source
$(BUILD_DIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
# c++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY: clean install run
clean:
rm -r $(BUILD_DIR)
install: $(BUILD_DIR)/$(TARGET_EXEC)
install -Dt $(BIN_DIR) $<
run: $(BUILD_DIR)/$(TARGET_EXEC)
./$<
-include $(DEPS)

View file

@ -0,0 +1,36 @@
{
callPackage,
clang-tools,
gnumake,
cmake,
bear,
libcxx,
cppcheck,
llvm,
gdb,
glm,
SDL2,
SDL2_gfx,
}: let
mainPkg = callPackage ./default.nix {};
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
clang-tools # fix headers not found
gnumake # builder
cmake # another builder
bear # bear.
libcxx # stdlib for cpp
cppcheck # static analysis
llvm.lldb # debugger
gdb # another debugger
llvm.libstdcxxClang # LSP and compiler
llvm.libcxx # stdlib for C++
# libs
glm
SDL2
SDL2_gfx
]
++ (oa.nativeBuildInputs or []);
})

View file

@ -0,0 +1,7 @@
#include <iostream>
int main() {
std::cout << "Hello, World!";
return 0;
}

View file

@ -0,0 +1,23 @@
_: {
flake.templates = {
c = {
path = ./c; # C/C++
description = "Development environment for C/C++";
};
rust = {
path = ./rust; # Rust
description = "Development environment for Rust";
};
node = {
path = ./node; # NodeJS
description = "Development environment for NodeJS";
};
go = {
path = ./go; # golang
description = "Development environment for Golang";
};
};
}

View file

@ -0,0 +1,11 @@
{buildGoModule}:
buildGoModule {
pname = "sample-go";
version = "0.0.1";
src = ./.;
vendorHash = "";
ldflags = ["-s" "-w"];
}

View file

@ -0,0 +1,26 @@
{
description = "Golang Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -0,0 +1,3 @@
module notashelf.dev/sample
go 1.20

View file

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}

View file

@ -0,0 +1,15 @@
{
callPackage,
gopls,
go,
}: let
mainPkg = callPackage ./default.nix {};
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
gopls
go
]
++ (oa.nativeBuildInputs or []);
})

3
nyx/flake/templates/node/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
result
build
node_modules

View file

@ -0,0 +1,12 @@
{
lib,
buildNpmPackage,
}:
buildNpmPackage {
pname = "foo-bar";
version = "0.1.0";
src = ./.;
npmDepsHash = lib.fakeSha256;
}

View file

@ -0,0 +1,26 @@
{
description = "NodeJS Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -0,0 +1,19 @@
{
"name": "sample-nodejs",
"version": "0.0.1",
"description": "Sample node program",
"bin": {
"sample-node": "build/index.js"
},
"scripts": {
"build": "tsc",
"start": "npm run build && node build/index.js"
},
"author": "NotAShelf",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.1.2",
"typescript": "^5.0.4",
"typescript-language-server": "^3.3.2"
}
}

View file

@ -0,0 +1,24 @@
{
callPackage,
writeShellScriptBin,
eslint_d,
prettierd,
}: let
mainPkg = callPackage ./default.nix {};
mkNpxAlias = name: writeShellScriptBin name "npx ${name} \"$@\"";
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
eslint_d
prettierd
(mkNpxAlias "tsc")
(mkNpxAlias "tsserver")
]
++ (oa.nativeBuildInputs or []);
shellHook = ''
eslint_d start # start eslint daemon
eslint_d status # inform user about eslint daemon status
'';
})

View file

@ -0,0 +1 @@
console.log("Hello world!");

View file

@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es2016",
"lib": ["es6"],
"module": "commonjs",
"rootDir": "src",
"resolveJsonModule": true,
"allowJs": true,
"outDir": "build",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": true
}
}

View file

@ -0,0 +1 @@
use flake . --builders ""

View file

@ -0,0 +1,24 @@
{
lib,
python3Packages,
doCheck ? false,
...
}:
python3Packages.buildPythonApplication {
pname = "sample-python-project";
version = "0.0.1";
src = ./.;
propagatedBuildInputs = with python3Packages; [];
nativeCheckInputs = [
python3Packages.pytest
];
checkPhase = lib.optionals doCheck ''
runHook preCheck
pytest
runHook postCheck
'';
}

View file

@ -0,0 +1,26 @@
{
description = "Python Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -0,0 +1,13 @@
{
callPackage,
mkShellNoCC,
python3,
...
}: let
defaultPackage = callPackage ./default.nix;
in
mkShellNoCC {
packages = [
(python3.withPackages defaultPackage.propagatedBuildInputs)
];
}

View file

@ -0,0 +1,5 @@
[package]
name = "sample-rust"
version = "0.0.1"
license = "MIT"
edition = "2021"

View file

@ -0,0 +1,8 @@
{rustPlatform}:
rustPlatform.buildRustPackage {
pname = "sample-rust";
version = "0.0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
}

View file

@ -0,0 +1,26 @@
{
description = "Rust Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -0,0 +1,20 @@
{
callPackage,
rust-analyzer,
rustfmt,
clippy,
cargo,
}: let
mainPkg = callPackage ./default.nix {};
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
# Additional rust tooling
rust-analyzer
rustfmt
clippy
cargo
]
++ (oa.nativeBuildInputs or []);
})

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}