Compare commits

..

No commits in common. "main" and "myputer" have entirely different histories.

98 changed files with 2695 additions and 4138 deletions

1
.gitignore vendored Normal file → Executable file
View file

@ -2,4 +2,3 @@ ISSUES/
secrets/ secrets/
result result
rebuild*.log

25
DEVDOC.md Normal file
View file

@ -0,0 +1,25 @@
## Users
#### me
My main personal account, used on my PC and laptop.
Contains a hyprland graphical environment by default.
#### ae
Primary account on my servers. Contains the bare
essentials for my work, no graphical environment.
#### friends
A simple account I let me friends connect to.
Limited functionality, mostly just for letting
them test small things or for giving them files.
## Setup Guide
##### Adding a New Server
Enable an ssh server on the remote host, then on the
local machine set `.ssh/config` to have a profile for
your desired host and have a key pair that's authorised
to your desired user.
NOTE: these keys must have permission 600 (only readable/writable by you)

3
DEV_ENV Normal file
View file

@ -0,0 +1,3 @@
- [ ] Stop colmena adding inputs for unmanaged nodes
- [ ] Use latest commit for colmena
- [ ] Program colmena to have an option that adds `--no-check-sigs` to `nix copy`

8
INSPIRATION Executable file
View file

@ -0,0 +1,8 @@
Godlike
https://github.com/end-4/dots-hyprland
Gorgeous
https://github.com/prasanthrangan/hyprdots
Very nice
https://github.com/linuxmobile/hyprland-dots

52
README.md Normal file → Executable file
View file

@ -1,8 +1,11 @@
## My NixOS Flake
### Philosophy ### Philosophy
> [!TODO] My philosophy has kinda changed since the beginning I try to use Home Manager as little as possible. When I first started with NixOS I found
it distracting and confusing. NixOS already handles system wide and user packages, so having
another user level package management method was baffling. Obviously I understand now how
it can be useful (so I do use it). But where possible I will instead use the functionality
of Nix rather than Home Manager.
### Repo Structure ###### Structuring Modules
Modules are organised into groups (ie "Core"), from here a module is structured as either: Modules are organised into groups (ie "Core"), from here a module is structured as either:
1. a single `.nix` file (ie bluetooth.nix). I do this when I won't implement an alternative 1. a single `.nix` file (ie bluetooth.nix). I do this when I won't implement an alternative
2. a directory (ie `sound`) containing a set of alternative implementations and a `default.nix` 2. a directory (ie `sound`) containing a set of alternative implementations and a `default.nix`
@ -10,19 +13,15 @@ that simply imports one of the implementations. For the `sound` example I curren
to default to `pipewire.nix`. I haven't made alternatives yet but the idea is that it is HIGHLY likely to default to `pipewire.nix`. I haven't made alternatives yet but the idea is that it is HIGHLY likely
I do in future. I do in future.
### Security Considerations
###### Hashing
For services where password hashing is done infrequently (ie my forgejo instance with signups disabled)
use argon2 (argon2id) with default `argon2$2$65536$8$50` (typically). Otherwise bcrypt is preferred.
### TODO ### TODO
There are a lot of commented `# TODO: ...` items in this repository. There are a lot of `TODO` items in this repository. To improve these dotfiles
All (most) of my commented directives can be found via this pattern: I should run a command to find files containing "TODO" and then implement the
```sh recommendation I left behind :)
grep -rnE '^\s*(//|#)\s*[A-Z]*:\s*.+$' --exclude-dir=.git 2>/dev/null
```
### Random Explanation of Fonts
##### Small Explanation of Fonts
There are four types of fonts (to my knowledge at least): There are four types of fonts (to my knowledge at least):
1. serif (funny squigles / small elegant strokes included) 1. serif (funny squigles / small elegant strokes included)
2. sans-serif (meaning "without serifs") 2. sans-serif (meaning "without serifs")
@ -34,9 +33,19 @@ Fun fact: on Android, the emojis you are seeing are part of the noto-emoji font
For finding a font for programming I highly recommend trying https://www.codingfont.com/ For finding a font for programming I highly recommend trying https://www.codingfont.com/
### Links ### My config
#### Inspiration
##### Explaining my Vision with r/unixporn posts Font:
Iosevka nerd font set as default/prefered font
Terminal uses IosevkaTerm nerd font
Home-Manager:
I just to use home-manager standalone and not as a NixOS module, thus allowing
my dotfiles to also work on non-NixOS systems.
### Explaining my Vision with r/unixporn posts
I want the side panel from https://www.reddit.com/r/unixporn/comments/12wpvyf/hyprland_eww_is_all_i_need/ I want the side panel from https://www.reddit.com/r/unixporn/comments/12wpvyf/hyprland_eww_is_all_i_need/
but not the colour scheme and I'm 50/50 on the bar being on th eleft side lol. Also I love the volume bar on the right! but not the colour scheme and I'm 50/50 on the bar being on th eleft side lol. Also I love the volume bar on the right!
@ -55,22 +64,15 @@ Their window decorations and bar are great, also being able to hide everything u
https://www.reddit.com/r/unixporn/comments/vkcasz/i3gaps_i_prefer_light_mode/ https://www.reddit.com/r/unixporn/comments/vkcasz/i3gaps_i_prefer_light_mode/
If their colour scheme was a little less white I'd love it but overall one of my favourites every If their colour scheme was a little less white I'd love it but overall one of my favourites every
##### Other Inspiring Shtuff
1. https://github.com/sabrehagen/desktop-environment
#### Wallpaper Sources ### Wallpaper Sources
1. https://www.wallpaperflare.com/ 1. https://www.wallpaperflare.com/
2. https://alphacoders.com 2. https://alphacoders.com
especially this one person: https://alphacoders.com/users/profile/69089/robokoboto especially this one person: https://alphacoders.com/users/profile/69089/robokoboto
and also the lofi category: https://alphacoders.com/lofi and also the lofi category: https://alphacoders.com/lofi
#### Teach Yourself Nix
1. https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles)
Really good security oriented NixOS stuff
2. https://jade.fyi/blog/flakes-arent-real/
Interesting blog post on using flakes
#### Credits ### Credits
1. https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles 1. https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles
The simplicity of their layout is amazing, was really good to pick out small modules and learn how something works / is configured. The simplicity of their layout is amazing, was really good to pick out small modules and learn how something works / is configured.
2. https://github.com/Misterio77/nix-starter-configs 2. https://github.com/Misterio77/nix-starter-configs

91
TODO Executable file
View file

@ -0,0 +1,91 @@
Get Utilities:
1. httpie
2. curlie
3. zoxide
4. doggo
1. Get helix editor
2. Custom helix
3. Complete helix tutorial
Get nixcord working
Get thunar working
Set a GTK theme & icon theme
Get better wallpapers
Get hyprcursor working with Bibata-Modern-Ice
Get a GRUB theme working
Get SDDM and a theme working
Make a custom hyprlock screen
Get AGS working
Make an applauncher in AGS
Remove hyprland splash screen on init
Made lolcathost home modular
Overtime just install more programs that I need regularly: ie
- btop/htop/etc
Get GTK Bibata Cursors to be the same size as my system cursor (NOT SURE WHAT I DID...)
Get waybar (or another bar) working
Get a QT theme
Fix pipewire audio sometimes working and sometimes not :(
Bind new terminal to SUPER+Enter instead of SUPER+Q
Join Rio Terminal's discord and ask if they support nerdfonts or if I'm doing something wrong
Change Dell loading screen (Boot Graphics Resource Table, aka BGRT)
Fix: your 131072x1 screen size is bogus. expect trouble
Search for all "TODO" items in my nix dotfiles
Push nixdots to github
Check out the Ekala Project (I joined their discord server)
Create a program that enables/disables passwordless sudo access
(add to github too)
Learn to package my own home-manager modules
Ideal Features:
1. AI assistant
2. searching can also be used to calculate stuff (like I do on my iPad)
Fork nixcord and fix documentation (the installation is confusing)
But firstly the first code snippet is wrong...
```nix
inputs.nixcord = {
url = "github:kaylorben/nixcord"
};
```
Should actually be
```nix
inputs.nixcord = {
url = "github:kaylorben/nixcord"; # dont forget the semicolon
};
```

3
TODO_UI Executable file
View file

@ -0,0 +1,3 @@
1. Create more themes for my applauncher
2. Create more themes for hyprlock
check out: https://github.com/MrVivekRajan/Hyprlock-Styles

51
deploy
View file

@ -1,15 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
# TODO: use `nixos-rebuild build-vm`
usage="Usage: $(basename $0) [OPTIONS] usage="Usage: $(basename $0) [OPTIONS]
Options: Options:
-f, --fresh Remove old content in the nixstore (good for debugging) -f, --fresh Remove old content in the nixstore (good for debugging)
-b, --bootloader Reinstall the bootloader -b, --bootloader Reinstall the bootloader
-r, --remote Locally build and remotely deploy Colmena hive
--show-trace Show nix stack trace on error
-h, --help Show this message (^_^)" -h, --help Show this message (^_^)"
# delete all cached entries # delete all cached entries
@ -20,45 +16,20 @@ collect_garbage () {
rebuild_flake () { rebuild_flake () {
# make sure all changes are visible to nixos # make sure all changes are visible to nixos
# (--intent-to-add tracks files but DOES NOT stage them)
git add . --intent-to-add --verbose
local FLAGS=
if [ "$1" = "reinstall-bootloader" ]; then
FLAGS="--install-bootloader"
# sudo nixos-rebuild switch --flake . --install-bootloader
# STC_DISPLAY_ALL_UNITS=1 (verbose, show output of all units)
fi
# LOG="$(mktemp /tmp/rebuild-XXXXXXXX)"
LOG="./rebuild.log"
echo "[*] Logging to $LOG"
sudo nixos-rebuild switch --flake . $FLAGS $EXTRA_FLAGS 2>&1 | tee "$LOG"
#nixos-rebuild build --flake .# --cores 8 -j 1
}
deploy_hive () {
echo "[+] Adding keys to ssh-agent"
ssh-add ~/.ssh/id_hyrule
printf "\n"
git add . --verbose git add . --verbose
# Deploy to all Colmena hives if [ "$1" = "reinstall-bootloader" ]; then
colmena build --experimental-flake-eval $EXTRA_FLAGS sudo nixos-rebuild switch --flake . --install-bootloader
colmena apply --experimental-flake-eval $EXTRA_FLAGS else
# colmena apply --on hyrule --experimental-flake-eval sudo nixos-rebuild switch --flake .
#nixos-rebuild build --flake .# --cores 8 -j 1
fi
} }
# check which flags were given # check which flags were given
flag_fresh=false flag_fresh=false
flag_bootloader=false flag_bootloader=false
flag_remote=false
flag_trace=false
for flag in "$@"; do for flag in "$@"; do
case "$flag" in case "$flag" in
-r|--remote)
flag_remote=true ;;
--show-trace)
flag_trace=true ;;
-f|--fresh) -f|--fresh)
flag_fresh=true ;; flag_fresh=true ;;
-b|--bootloader) -b|--bootloader)
@ -72,16 +43,6 @@ for flag in "$@"; do
esac esac
done done
EXTRA_FLAGS=""
if [ "$flag_trace" = true ]; then
EXTRA_FLAGS="$EXTRA_FLAGS --show-trace"
fi
if [ "$flag_remote" = true ]; then
deploy_hive
exit 0
fi
# delete cached items in nixstore # delete cached items in nixstore
if [ "$flag_fresh" = true ]; then if [ "$flag_fresh" = true ]; then
collect_garbage collect_garbage

13
deploy-remote Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e # terminate if any command fails
echo "[+] Adding keys to ssh-agent"
ssh-add ~/.ssh/id_hyrule
printf "\n"
git add .
# Deploy to all Colmena hives
colmena build --experimental-flake-eval
colmena apply --experimental-flake-eval
# colmena apply --on hyrule --experimental-flake-eval

849
flake.lock generated Normal file → Executable file

File diff suppressed because it is too large Load diff

185
flake.nix Normal file → Executable file
View file

@ -1,106 +1,147 @@
{ {
description = "im gonna cry again ;-;"; description = "Emile's Nix Dotfiles";
inputs = { inputs = {
systems.url = "github:nix-systems/default"; # nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
#nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; #home-manager = {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; # url = "github:nix-community/home-manager";
# inputs.nixpkgs.follows = "nixpkgs";
#};
home-manager = { spicetify-nix = {
url = "github:nix-community/home-manager/release-25.05"; url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
cerulean = { nixcord.url = "github:kaylorben/nixcord";
# url = "github:emilelcb/Cerulean";
url = "/home/me/agribit/nexus/Cerulean";
inputs = {
systems.follows = "systems";
nixpkgs.follows = "nixpkgs";
nixpkgs-unstable.follows = "nixpkgs-unstable";
};
};
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.7.0"; grub2-themes.url = "github:vinceliuice/grub2-themes";
grub2-themes = {
url = "github:vinceliuice/grub2-themes";
inputs.nixpkgs.follows = "nixpkgs";
};
nixcord = { # is this necessary? (aren't I enabling it in `configuration.nix` anyways?)
url = "github:FlameFlag/nixcord"; hyprland.url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
dobutterfliescry-net = { swww.url = "github:LGFae/swww";
url = "git+https://forge.dobutterfliescry.net/cry/site";
inputs = { # TODO: declarative flatpak management
nixpkgs.follows = "nixpkgs"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
nixpkgs-unstable.follows = "nixpkgs-unstable";
systems.follows = "systems"; ags.url = "github:Aylur/ags";
};
}; hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
# colmena.url = "github:zhaofengli/colmena";
colmena.url = "github:zhaofengli/colmena/?rev=47b6414d800c8471e98ca072bc0835345741a56a";
# alternative to colmena (currently in testing)
#deploy-rs.url = "github:serokell/deploy-rs";
#wishlist.url = "path:/home/me/nixdots/flakes/wishlist";
}; };
outputs = { outputs = {
cerulean, self,
home-manager, nixpkgs,
#home-manager,
hyprland,
grub2-themes, grub2-themes,
nixcord,
colmena,
#deploy-rs,
... ...
}: let } @ inputs: let
groups = {
cryde = {}; # oh frick i cried again
server = {};
};
in
cerulean.mkNexus ./. {
nexus = {
inherit groups;
overlays = import ./overlays;
nodes = {
# my laptop <3 :3
lolcathost = {
system = "x86_64-linux"; system = "x86_64-linux";
groups = [groups.cryde];
extraModules = [ pkgs = import nixpkgs {
home-manager.nixosModules.default inherit system;
config = {
allowUnfree = true;
};
};
# TODO: come back to this its really cool
# this is just something I'm experimenting with
PROJECT_ROOT = builtins.toString ./.;
in {
# `nix develop` shell
devShells."x86_64-linux".default = pkgs.mkShell {
buildInputs = [
#colmena-new
];
};
nixosConfigurations = {
# i be on my puter fr
myputer = nixpkgs.lib.nixosSystem {
# nix passes these to every single module
specialArgs = {inherit inputs pkgs;};
modules = [
./hosts/myputer
grub2-themes.nixosModules.default grub2-themes.nixosModules.default
]; ];
}; };
# i be on my puter frfr # my laptop 0w0
myputer = { lolcathost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; specialArgs = {inherit inputs pkgs;};
groups = [groups.cryde];
extraModules = [ modules = [
home-manager.nixosModules.default ./hosts/lolcathost
grub2-themes.nixosModules.default grub2-themes.nixosModules.default
]; ];
}; };
# courtesy of aurora <3 # meine vps
butterfly = { # hyrule = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; # # manually set system architecture since
groups = [groups.server]; # # this is for a remote deployment
deploy.ssh.host = "dobutterfliescry.net"; # system = "x86_64-linux";
# specialargs = {inherit inputs pkgs;};
#
# modules = [
# ./hosts/hyrule
# ];
# };
}; };
# pls dont sue me im broke # remote deployment with deploy-rs
hyrule = { # deploy.nodes.hyrule = {
# hostname = "imbored.dev";
# # create a primary profile called "system"
# profiles.system = {
# user = "root"; # user to deploy to
# path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.hyrule;
#
# # ssh configuration for reaching the server
# sshUser = "ae";
# #interactiveSudo = true; # TODO: use this and revoke passwordless sudo for ae
# sshOpts = ["-i" "/home/me/.ssh/id_hyrule"];
# remoteBuild = false; # build locally then deploy to remote host
# };
# };
# remote deployment to my servers!!
colmenaHive = colmena.lib.makeHive {
meta = {
# set nixpkgs global
nixpkgs = pkgs;
# set nixpkgs per server
nodeNixpkgs = {
hyrule = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
groups = [groups.server]; config.allowUnfree = false;
deploy.ssh.host = "hyrule.dobutterfliescry.net"; };
}; };
# call me a statistician the way she spreads in my sheets # we can use `specialArgs.inputs` to inject wishlist into hyrule's module
matcha = { #specialArgs.inputs = with inputs; {inherit wishlist;};
system = "x86_64-linux";
groups = [groups.server];
deploy.ssh.host = "bedroom.dobutterfliescry.net";
};
}; };
# meine vps
hyrule = import ./hosts/hyrule;
}; };
}; };
} }

31
flakes/wishlist/README Normal file
View file

@ -0,0 +1,31 @@
#### wishlist.nix
This is a simple Nix flake defining a service from which
wishlist can run automatically. This flake runs wishlist-0.15.1
and lacks configurability unfortunately. However this was an
intentional choice, allowing wishlist to read from the user's
`~/.ssh/config` file, which can be configured seperately using
the something akin to the follow home-manager snippet:
```nix
programs.ssh = {
enable = true;
addKeysToAgent = "yes"; # always add keys to ssh-agent
matchBlocks = {
hyrule = {
hostname = "imbored.dev";
user = "ae";
port = 22;
identityFile = "/home/me/.ssh/id_hyrule";
};
};
};
```
This decision was mostly selfish as it was easiest...
But it comes at the cost of not being able to set the
port wishlist listens on. So for now you're stuck with `2222`.
###### The Future!! (woooowwww)
Create an option for wishlist that is used to construct
the `config.yaml` file

93
flakes/wishlist/flake.nix Normal file
View file

@ -0,0 +1,93 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
config,
nixpkgs,
lib,
flake-utils,
}: let
cfg = config.services.wishlist;
supportedSystems = ["x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
in {
# TODO: 1. add options (ie one to set whether the server should be enabled),
# 2. create a systemd service
# 3. create a main program
# 4. celibrate
# TODO: do I need to make this a home-manager option and set the yaml config?
# define what settings a user can change
options = {
services.wishlist = with lib; {
enable = mkEnableOption "wishlist";
port = mkOption {
type = types.port;
default = 2222;
description = "Port to listen on";
};
package = mkOption {
type = types.package;
default = self.packages.${nixpkgs.system}.default;
description = "Package to use";
};
};
};
# define a systemd service for wishlist ^_^
config = lib.mkIf cfg.enable {
systemd.services.wishlist = {
description = "Single entrypoint for multiple SSH endpoints";
wantedBy = ["multi-user.target"];
serviceConfig = {
DynamicUser = "yes";
ExecStart = "${cfg.package}/bin/wishlist serve";
Restart = "always";
RestartSec = "2s";
};
};
};
packages = flake-utils.lib.eachSystem supportedSystems (
system: let
version = "0.15.1";
#pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = false;
};
#lib = pkgs.lib;
in rec {
defaultPackage = self.packages.${system}.wishlist;
wishlist = pkgs.buildGoModule {
pname = "wishlist";
inherit version;
meta = with lib; {
description = "Single entrypoint for multiple SSH endpoints";
homepage = "https://github.com/charmbracelet/wishlist";
changelog = "https://github.com/charmbracelet/wishlist/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [caarlos0 penguwin];
mainProgram = "wishlist";
};
src = pkgs.fetchFromGitHub {
owner = "charmbracelet";
repo = "wishlist";
rev = "v${version}";
# rev = "d7f058e115a8b4a4131406d01dde84fb4a8e93c4";
hash = "53fojA+gdvpSVNjx6QncH16F8/x+lpY5SkNs7obW2XQ=";
};
vendorSha256 = "0x6rss3fwv2398wrd5kyzkrqaphzvh4ykwfqai9glxm01y6fhxz7";
};
}
);
};
}

View file

@ -0,0 +1,99 @@
# NOTE: Wishlist service fails on nix because of readonly file system
# and it can't find a config file for itself, it needs to write that
# itself I suppose :(
# So:
# 1. Get it to write that file, and
# 2. Allow it to inherit profiles from configured ssh
{
self,
config,
pkgs,
lib,
}: let
cfg = config.services.wishlist;
in {
options = {
services.wishlist = with lib; {
enable = mkEnableOption "wishlist";
name = mkOption {
type = types.str;
default =
};
port = mkOption {
type = types.port;
default = 2222;
description = "Port to listen on";
};
#configPath = mkOption {
# type = types.path;
# default = ;
# description = "Path to config file";
#};
package = mkOption {
type = types.package;
default = self.packages.${nixpkgs.system}.default;
description = "Package to use";
};
};
};
# define a systemd service for wishlist ^_^
config = lib.mkIf cfg.enable {
systemd.services.wishlist = {
description = "Single entrypoint for multiple SSH endpoints";
wantedBy = ["multi-user.target"];
serviceConfig = let
wishlistServiceConfig = pkgs.writeText "config.yaml" ''
hello world!
'';
in {
DynamicUser = "yes";
ExecStart = "${pkgs.wishlist}/bin/wishlist serve --config ${wishlistServiceConfig}";
Restart = "always";
RestartSec = "2s";
};
};
};
/*
packages = flake-utils.lib.eachSystem supportedSystems (
system: let
version = "0.15.1";
#pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = false;
};
#lib = pkgs.lib;
in rec {
defaultPackage = self.packages.${system}.wishlist;
wishlist = pkgs.buildGoModule {
pname = "wishlist";
inherit version;
meta = with lib; {
description = "Single entrypoint for multiple SSH endpoints";
homepage = "https://github.com/charmbracelet/wishlist";
changelog = "https://github.com/charmbracelet/wishlist/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [caarlos0 penguwin];
mainProgram = "wishlist";
};
src = pkgs.fetchFromGitHub {
owner = "charmbracelet";
repo = "wishlist";
rev = "v${version}";
# rev = "d7f058e115a8b4a4131406d01dde84fb4a8e93c4";
hash = "53fojA+gdvpSVNjx6QncH16F8/x+lpY5SkNs7obW2XQ=";
};
vendorSha256 = "0x6rss3fwv2398wrd5kyzkrqaphzvh4ykwfqai9glxm01y6fhxz7";
};
}
);
*/
}

View file

@ -1,140 +0,0 @@
{
inputs,
pkgs,
config,
...
}: {
imports = [
./programs.nix
../../hosts/modules/bashistrans.nix
../../hosts/modules/wm/hyprland.nix
../../hosts/modules/steam.nix
../../hosts/modules/obsidian.nix
inputs.nix-flatpak.nixosModules.nix-flatpak
];
boot.loader.grub2-theme = {
enable = true;
# GitHub: vinceliuice/grub2-themes
theme = "whitesur"; # stylish, vimix, or whitesur
footer = true;
customResolution = "1920x1080";
};
services = {
# Set display manager (login screen)
displayManager = {
# sddm relies on pkgs.libsForQt5.qt5.qtgraphicaleffects
sddm = {
enable = true;
wayland.enable = true; # experimental
theme = "corners";
};
defaultSession =
"hyprland"
+ (
if config.programs.hyprland.withUWSM == true
then "-uwsm"
else null
);
};
tumbler.enable = true; # Thunar image thumbnail support
gvfs.enable = true; # Thunar mount, trash, and other functionality
};
programs = {
zsh.enable = true;
fish.enable = true;
nix-ld.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
set number
set tabstop=4
set shiftwidth=4
'';
};
};
# Thunar also uses: `services.tumbler` & `services.gvfs`
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-volman # for removable drives (ie USBs)
thunar-archive-plugin # create and extract archives
thunar-media-tags-plugin # change metadata for media files
];
};
# mozilla's email client
thunderbird.enable = true;
};
# ----- FONTS -----
fonts = {
enableDefaultPackages = true; # no clue what this line does tbh
packages = with pkgs;
[
geist-font # for my hyprlock theme
# texlive maintains a noto-emoji flake
texlivePackages.noto-emoji
]
++ builtins.filter lib.attrsets.isDerivation (
builtins.attrValues pkgs.nerd-fonts
);
# TODO: change my default fonts
fontconfig = {
defaultFonts = {
serif = ["Geist"]; # TODO: package Iosevka Etoile since Iosevka isn't a serif font
sansSerif = ["Geist"];
monospace = ["Cousine"];
emoji = ["Noto Emoji"];
};
};
};
# ---- ENVIRONMENT VARIABLES ----
environment = {
sessionVariables = {
# Hint Electrons apps to use Wayland
NIXOS_OZONE_WL = "1";
};
systemPackages = with pkgs; [
(callPackage ../sddm-theme-corners.nix {}).sddm-theme-corners
# dependencies for my sddm theme:
# XXX: add these as a buildInput
pkgs.libsForQt5.qt5.qtgraphicaleffects
];
};
# ------- USERS -------
users = {
users = {
# literally me fr (personal account)
me = {
isNormalUser = true;
extraGroups = ["wheel" "netdev" "docker"];
shell = pkgs.bash;
packages = with pkgs; [
firefox
nitch
starfetch
colmena-latest
gitkraken
];
};
};
};
}

View file

@ -1,27 +0,0 @@
{pkgs, ...}: {
# ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [
# User Environment
swww
helvum
easyeffects
pavucontrol
ani-cli
bluetui
wl-clipboard # clipboard for wayland
hyprpicker # color picker
hyprshot # screenshot utility
wl-screenrec # screen recording utility
qbittorrent # torrenting
signal-desktop
kdePackages.gwenview # image viewer
video-trimmer
# Games
prismlauncher # minecraft
upkgs.olympus # celeste
discord
discordo
ekphos
];
}

View file

@ -1,137 +0,0 @@
{
pkgs,
lib,
...
}: {
imports = [
./programs.nix
];
nixpkgs.config.allowUnfreePredicate = let
whitelist = with pkgs;
map lib.getName [
discord
steam
steamcmd
steam-unwrapped
winbox
obsidian
gitkraken
];
in
pkg: builtins.elem (lib.getName pkg) whitelist;
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
efiSupport = true;
device = "nodev";
# useOSProber = true;
};
};
# Enable initrd hook for virtual console customisation
# aka cool colours when bootting yay!!
console = {
enable = true;
earlySetup = true; # initrd pre hook
keyMap = "us";
font = "Lat2-Terminus16";
# ANSI 24-bit color definitions (theme: dracula)
colors = [
"21222c"
"ff5555"
"50fa7b"
"f1fa8c"
"bd93f9"
"ff79c6"
"8be9fd"
"f8f8f2"
"6272a4"
"ff6e6e"
"69ff94"
"ffffa5"
"d6acff"
"ff92df"
"a4ffff"
"ffffff"
];
};
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
bluetooth = {
enable = true;
powerOnBoot = true;
};
};
virtualisation.docker.enable = true;
services = {
# systemd-resolved provides network name resolution
# to local processes via a D-Bus interface.
resolved = {
enable = true;
dnssec = "true";
domains = ["~."];
# Use CloudFlare's WARP+ 1.1.1.1 DNS service
fallbackDns = [
"1.1.1.1#one.one.one.one"
"1.0.0.1#one.one.one.one"
];
dnsovertls = "true";
};
# Multimedia Framework
# With backwards compatability for alsa/pulseaudio/jack
pipewire = {
enable = true;
audio.enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
};
security = {
rtkit.enable = true; # I *think* this is for pipewire
sudo.wheelNeedsPassword = lib.mkDefault true;
};
# ---- ENVIRONMENT VARIABLES ----
environment = {
# always install "dev" derivation outputs
extraOutputsToInstall = ["dev" "man"];
sessionVariables = {
# folder names with capitalisation look awful!
XDG_DOWNLOAD_DIR = "$HOME/downloads";
};
};
documentation = {
enable = true;
doc.enable = true; # install /share/doc packages
man.enable = true; # install manpages
info.enable = true; # install GNU info
dev.enable = true; # install docs intended for developers
nixos = {
enable = true; # install NixOS documentation (ie man -k nix, & nixos-help)
options.splitBuild = true;
includeAllModules = false;
};
};
}

View file

@ -1,114 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# Shell
bash
fish
shellcheck
grc # colorise command outputs
moreutils
# Systems Emulation
qemu # Fellice Bellard's Quick Emulator
# Binaries
binutils
strace
ltrace
perf-tools # ftrace + perf
radare2
gdb
hexyl
# ASM
nasm
x86-manpages
# C Family
gcc
clang
clang-tools
gnumake
cmake
# Rust
cargo
rustc
rustfmt
# Go
go
# Nim
nim
nimble
# Haskell
ghc
ghcid
ormolu
# Nix
nix-prefetch-git
nix-index
nix-unit
deploy-rs.deploy-rs
# Python
python312 # I use 3.12 since it's in a pretty stable state now
python314 # also 3.14 for latest features
poetry
# Sage
sageWithDoc # SageMath + HTML Documentation
# .NET
dotnetCorePackages.dotnet_9.sdk
dotnetCorePackages.dotnet_9.aspnetcore
dotnetCorePackages.dotnet_9.runtime
openvpn
inetutils
wireguard-tools
# security tools
rustscan
nmap
dig
gobuster
nth
zap
httpie
curlie
zoxide
doggo
tldr
btop
eza
yazi
lazygit
ripgrep
viddy # modern `watch` command
timg # terminal image (sixel) viewer
# Pretty necessary
git
git-filter-repo
brightnessctl
acpi
# upower
vim
powertop
imagemagick
# "Standard" Unix Commands
file
wget
tree
pstree
zip
unzip
unrar-free
lz4
man-pages
man-pages-posix
# Cryptography
gnupg
openssl
libargon2
];
}

View file

@ -1,49 +0,0 @@
{
root,
pkgs,
upkgs,
lib,
inputs,
config,
...
}: {
nix.settings = {
# make wheel group trusted users allows my "ae" user
# to import packages not signed by a trusted key
# (aka super duper easier to remote deploy)
trusted-users = ["root" "@wheel"];
experimental-features = [
"nix-command"
"flakes"
"pipe-operators"
];
download-buffer-size = 524288000; # 500 MiB
};
time.timeZone = lib.mkDefault "Australia/Brisbane";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
users.defaultUserShell = pkgs.bash;
home-manager = {
users =
config.users.users
|> builtins.attrNames
|> builtins.filter (x: builtins.pathExists (root + "/homes/${x}"))
|> lib.genAttrs (x: import (root + "/homes/${x}"));
extraSpecialArgs = {inherit inputs pkgs upkgs;};
};
environment.systemPackages = with pkgs; [
git
vim
wget
tree
];
}

View file

@ -1,54 +0,0 @@
{
lib,
sshPort ? 22,
...
}: {
networking = {
networkmanager.enable = true;
# Use CloudFlare's WARP+ 1.1.1.1 DNS service
nameservers = [
"1.1.1.1"
"1.0.0.1"
];
firewall = {
enable = lib.mkDefault true;
allowedTCPPorts = [
sshPort
];
};
};
security = {
# accept Lets Encrypt's security policy
acme = {
acceptTerms = true;
defaults.email = "them@dobutterfliescry.net";
};
sudo = {
enable = true;
wheelNeedsPassword = true;
};
# allow SSH keys for passwordless auth
pam = {
enableSSHAgentAuth = true;
services.sudo.sshAgentAuth = true; # pam_ssh_agent_auth module
};
};
services = {
openssh = {
enable = true;
ports = [sshPort];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
# AllowUsers = ["cry"]; # DO NOT ALLOW ALL
UseDns = true;
X11Forwarding = false;
};
};
};
}

View file

@ -11,9 +11,6 @@
}; };
imports = [ imports = [
../modules/fish.nix
../modules/bat.nix
../modules/btop.nix
]; ];
home = { home = {
@ -21,8 +18,39 @@
homeDirectory = "/home/ae"; homeDirectory = "/home/ae";
}; };
programs = {
};
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
# ssh = {
# enable = true;
# forwardAgent = true;
# addKeysToAgent = "yes";
# matchBlocks = {
# hyrule = {
# hostname = "imbored.dev";
# user = "ae";
# port = 22;
# identityFile = "/home/ae/.ssh/id_hyrule";
# };
# };
# };
# SERVICE: webfishing (example for wishlist)
#systemd.user.services.webfishing = {
# Unit.Description = "I be out here webfishing frfr";
# Install.WantedBy = ["default.target"];
# Service = {
# Type = "exec";
# ExecStart = "echo $HOME; cat $HOME/.ssh/config";
# Restart = "always";
# };
#};
home.stateVersion = "24.11"; # DO NOT MODIFY home.stateVersion = "24.11"; # DO NOT MODIFY
} }

View file

@ -4,44 +4,50 @@
lib, lib,
config, config,
pkgs, pkgs,
upkgs,
... ...
} @ args: { }: {
nixpkgs = {
config.allowUnfree = true;
};
imports = [ imports = [
../modules/fish.nix
../modules/btop.nix
../modules/tmux.nix
../modules/term/foot.nix
../modules/git.nix ../modules/git.nix
../modules/bat.nix ../modules/bat.nix
../modules/fish.nix
../modules/editor/helix.nix ../modules/editor/helix.nix
../modules/btop.nix
../modules/rio.nix
../modules/firefox.nix ../modules/firefox.nix
../modules/apps/thunderbird.nix ../modules/nixcord.nix
../modules/wm/hypr/hyprlock.nix
#../modules/hypr/hypridle.nix
#../modules/hypr/hyprlock.nix
../modules/kanshi.nix ../modules/kanshi.nix
../modules/mako.nix ../modules/ags
]; ];
nixpkgs.config.allowUnfreePredicate = pkg: /*
builtins.elem (lib.GetName pkg) [ programs.spicetify =
"vscode-extension-ms-dotnettools-csharp" let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
enable = true;
enabledExtensions = with spicePkgs.extensions; [
adblock
hidePodcasts
shuffle # shuffle+ (special characters are sanitized out of extension names)
]; ];
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";
};
*/
home = { home = {
username = "me"; username = "me";
homeDirectory = "/home/me"; homeDirectory = "/home/me";
shellAliases = {
brip = "batgrep"; # bat + ripgrep
man = "batman"; # bat + man
};
sessionVariables = {
NIX_SHELL_PRESERVE_PROMPT = 1;
};
pointerCursor = { pointerCursor = {
gtk.enable = true; gtk.enable = true;
# x11.enable = true # dont enable since im on hyprland # x11.enable = true # dont enable since im on hyprland
@ -49,18 +55,6 @@
name = "Bibata-Modern-Ice"; name = "Bibata-Modern-Ice";
size = 16; size = 16;
}; };
packages = with pkgs; [
# for services.gnome-keyring
pkgs.gcr # provides org.gnome.keyring.SystemPrompter
seahorse # gui
tor-browser
fuzzel
speedtest-cli
];
}; };
gtk = { gtk = {
@ -77,12 +71,15 @@
# TODO: use a variable to mirror this cursor size # TODO: use a variable to mirror this cursor size
# with the `home.pointerCurser.size` # with the `home.pointerCurser.size`
cursorTheme = { cursorTheme = {
# dont set the theme (use system default instead)
# only set size to match the system
package = pkgs.bibata-cursors; package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice"; name = "Bibata-Modern-Ice";
size = 16; size = 16;
}; };
}; };
# TODO: this lowkey doesnt work... (maybe the name "Dracula" is wrong?)
qt = { qt = {
enable = true; enable = true;
platformTheme.name = "gtk2"; platformTheme.name = "gtk2";
@ -93,29 +90,24 @@
# these are both required for home-manager to work # these are both required for home-manager to work
home-manager.enable = true; home-manager.enable = true;
zsh = { # DEBUG: testing if my xdg-desktop-portal-hyprland is working or not
obs-studio = {
enable = true; enable = true;
enableCompletion = true; plugins = with pkgs.obs-studio-plugins; [
autosuggestion.enable = true; wlrobs
syntaxHighlighting.enable = true; obs-backgroundremoval
obs-pipewire-audio-capture
history = {
size = 10000;
ignoreAllDups = true;
path = "$HOME/.zsh_history";
ignorePatterns = [
"rm *"
]; ];
}; };
};
# set ssh profiles # set ssh profiles
# (all we need is hyrule, everything else is through wishlist)
# NOTE: (IMPORTANT) this DOES NOT start the ssh-agent # NOTE: (IMPORTANT) this DOES NOT start the ssh-agent
# for that you need to use `services.ssh-agent.enable` # for that you need to use `services.ssh-agent.enable`
ssh = { ssh = {
enable = true; enable = true;
forwardAgent = false; forwardAgent = true;
addKeysToAgent = "no"; addKeysToAgent = "yes"; # always add keys to ssh-agent
matchBlocks = { matchBlocks = {
hyrule = { hyrule = {
@ -123,15 +115,6 @@
user = "ae"; user = "ae";
port = 22; port = 22;
identityFile = "~/.ssh/id_hyrule"; identityFile = "~/.ssh/id_hyrule";
setEnv = {
TERM = "linux";
};
};
clocktown = {
hostname = "clocktown.dobutterfliescry.net";
user = "root";
port = 22;
identityFile = "~/.ssh/id_clocktown";
}; };
subspace = { subspace = {
hostname = "imbored.dev"; hostname = "imbored.dev";
@ -139,36 +122,46 @@
port = 22; port = 22;
identityFile = "~/.ssh/id_subspace"; identityFile = "~/.ssh/id_subspace";
}; };
dead = {
hostname = "deadlyserver.com";
user = "emile";
port = 29843;
identityFile = "~/.ssh/id_deadlyserver";
setEnv = {
TERM = "xterm-256color";
};
};
youcue = {
hostname = "moss.labs.eait.uq.edu.au";
user = "s4740056";
port = 22;
identityFile = "~/.ssh/id_youcue";
setEnv = {
TERM = "xterm-256color";
};
};
};
}; };
}; };
services = { # I want to use fish as my login shell but it always
# goes terrible cause it isn't POSIX compliant, so
# instead Bash is my login and it will just exec fish
#bash = {
# interactiveShellInit = ''
# if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
# then
# shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
# exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
# fi
# '';
#};
/*
spicetify =
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
enable = true;
enabledExtensions = with spicePkgs.extensions; [
adblock
hidePodcasts
#shuffle
];
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";
};
*/
};
# enable OpenSSH private key agent # enable OpenSSH private key agent
ssh-agent.enable = true; services.ssh-agent.enable = true;
gnome-keyring.enable = true;
};
# the ssh-agent won't set this for itself... # the ssh-agent won't set this for itself...
systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent"; systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent";
#home.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent";
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";

View file

@ -1,28 +1,24 @@
import { AppLauncher } from "./widgets/applauncher.js" import { AppLauncher } from "./widgets/applauncher.js"
//import { Notifications } from "./widgets/notifications.js" import { Notifications } from "./widgets/notifications.js"
/*
const date = Variable('', { const date = Variable('', {
poll: [1000, 'date'], poll: [1000, 'date'],
}) })
*/
/*
const Bar = (monitor = 0) => Widget.Window({ const Bar = (monitor = 0) => Widget.Window({
monitor, monitor,
name: 'bar${monitor}', name: 'bar${monitor}',
anchor: ['top', 'left', 'right'], anchor: ['top', 'left', 'right'],
child: Widget.Label({ label: date.bind() }), child: Widget.Label({ label: date.bind() }),
}) })
*/
App.config({ App.config({
style: "./style.css", style: "./style.css",
// icons: "./assets", // icons: "./assets",
windows: [ windows: [
//Bar(), Bar(),
AppLauncher, AppLauncher,
//Notifications() Notifications()
] ]
// gtkTheme: "Adwaita-dark", // gtkTheme: "Adwaita-dark",
// cursorTheme: "Qogir", // cursorTheme: "Qogir",

View file

@ -2,10 +2,10 @@ const WINDOW_NAME = "fullscreen";
const Fullscreen = (children) => Widget.Box({ const Fullscreen = (children) => Widget.Box({
vertical: true, vertical: true,
css: "background-image: url('~/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png');", css: "background-image: url('https://images2.alphacoders.com/135/1351579.png');"
//+ "background-size: cover;" + "background-size: cover;"
//+ "background-position: center;" + "background-position: center;"
//+ "background-repeat: no-repeat;", + "background-repeat: no-repeat;",
children: children, children: children,
}) })

View file

@ -1,10 +0,0 @@
{...}: {
programs.thunderbird = {
enable = true;
profiles = {
"me" = {
isDefault = true;
};
};
};
}

View file

@ -12,13 +12,4 @@
theme = "Dracula"; theme = "Dracula";
}; };
}; };
# other commands that make normal utils prettier
home.packages = with pkgs.bat-extras; [
batdiff
batgrep
batman
batwatch
prettybat
];
} }

View file

@ -18,7 +18,7 @@
background_update = true; background_update = true;
update_ms = 2000; update_ms = 2000;
rounded_corners = false; rounded_corners = false;
graph_symbol = "block"; # braille/block/tty graph_symbol = "braille"; # braille/block/tty
graph_symbol_cpu = "default"; graph_symbol_cpu = "default";
graph_symbol_mem = "default"; graph_symbol_mem = "default";
graph_symbol_net = "default"; graph_symbol_net = "default";

View file

@ -1,69 +1,13 @@
{ {
config,
pkgs, pkgs,
upkgs,
... ...
}: let }: {
lsps = { # read https://docs.helix-editor.com/editor.html
bash-language-server = {
pkg = pkgs.bash-language-server;
cmd = "bash-language-server";
};
clangd = {
pkg = pkgs.clang-tools;
cmd = "clangd";
};
glsl_analyzer = {
pkg = pkgs.glsl_analyzer;
cmd = "glsl_analyzer";
};
haskell-language-server = {
pkg = pkgs.haskell-language-server;
cmd = "haskell-language-server-wrapper";
};
# TODO: once upgraded past Nix-24.07 this line won't be necessary (I think)
# helix will support nixd by default
# SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix
nixd = {
pkg = pkgs.nixd;
cmd = "nixd";
};
OmniSharp = {
pkg = pkgs.omnisharp-roslyn;
cmd = "OmniSharp";
};
rust-analyzer = {
pkg = pkgs.rust-analyzer;
cmd = "rust-analyzer";
};
ty = {
pkg = upkgs.ty;
cmd = "ty";
};
typescript-language-server = {
pkg = pkgs.typescript-language-server;
cmd = "typescript-language-server";
};
};
in {
home.packages =
lsps
|> builtins.attrValues
|> map (lsp: lsp.pkg);
# REF: https://docs.helix-editor.com/editor.html
programs.helix = { programs.helix = {
enable = true; enable = true;
settings = { settings = {
theme = "dracula"; theme = "dracula";
editor = { editor = {
line-number = "absolute"; line-number = "absolute";
popup-border = "all"; popup-border = "all";
@ -163,8 +107,7 @@ in {
}; };
}; };
languages = { languages.language = [
language = [
{ {
name = "nix"; name = "nix";
indent = { indent = {
@ -177,7 +120,6 @@ in {
}; };
auto-format = true; auto-format = true;
formatter.command = "${pkgs.alejandra}/bin/alejandra"; formatter.command = "${pkgs.alejandra}/bin/alejandra";
language-servers = ["nixd"];
} }
{ {
name = "python"; name = "python";
@ -187,79 +129,7 @@ in {
}; };
auto-format = false; # my python is beautiful ^_^ auto-format = false; # my python is beautiful ^_^
rulers = [80]; rulers = [80];
language-servers = ["ty"];
}
{
name = "c";
file-types = ["c" "h"]; # use .hpp for C++
auto-format = true;
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
language-servers = ["clangd"];
}
{
name = "haskell";
auto-format = true;
formatter.command = "${pkgs.ormolu}/bin/ormolu";
language-servers = ["haskell-language-server"];
}
{
name = "rust";
indent = {
tab-width = 2;
unit = " ";
};
auto-format = true;
formatter.command = "${pkgs.rustfmt}/bin/rustfmt";
language-servers = ["rust-analyzer"];
}
{
name = "c-sharp";
file-types = ["cs"];
indent = {
tab-width = 4;
unit = " ";
};
block-comment-tokens = {
start = "/*";
end = "*/";
};
# auto-format = true;
# formatter.command = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
# language-servers = ["OmniSharp"];
}
{
name = "javascript";
file-types = ["js"];
indent = {
tab-width = 2;
unit = " ";
};
block-comment-tokens = {
start = "/*";
end = "*/";
};
auto-format = true;
language-servers = ["typescript-language-server"];
}
{
name = "glsl";
file-types = ["glsl"];
indent = {
tab-width = 2;
unit = " ";
};
block-comment-tokens = {
start = "/*";
end = "*/";
};
auto-format = false;
language-servers = ["glsl_analyzer"];
} }
]; ];
language-server =
lsps
|> builtins.mapAttrs (_: lsp: {command = "${lsp.pkg}/bin/${lsp.cmd}";});
};
}; };
} }

View file

@ -1,134 +0,0 @@
{
config,
lib,
pkgs,
vscodium ? false,
secret-service ? "gnome-libsecret",
vscode-argv ? ".vscode/argv.json",
...
}: {
nixpkgs.overlays = [
(
self: super: {
vscode-extensions = super.vscode-extensions.overrideAttrs (prev: let
mkVscMarketplaceExtension = {
publisher,
name,
version,
hash,
description ? "",
homepage ? null,
changelog ? null,
license ? null,
maintainers ? [lib.maintainers.emileclarkb],
}:
with pkgs.vscode-utils.buildVscodeMarketplaceExtension; {
${publisher}.${name} = buildVscodeMarketplaceExtension {
mktplcRef = {
inherit
publisher
name
version
hash
;
};
meta = {
inherit
(
if license != null
then {license = license;}
else {}
)
description
homepage
maintainers
;
downloadPage = "https://marketplace.visualstudio.com/items?itemName=${publisher}.${name}";
changelog =
if changelog != null
then changelog
else "https://marketplace.visualstudio.com/items/${publisher}.${name}/changelog";
};
};
};
in
lib.mergeAttrsList [
(mkVscMarketplaceExtension {
publisher = "ms-dotnettools";
name = "dotnet-maui";
version = "1.11.14";
hash = lib.fakeHash;
description = "Extend C# Dev Kit with tools for building .NET Multi-platform App UI (MAUI) apps";
homepage = "https://github.com/microsoft/vscode-dotnettools";
license = lib.licenses.unfree;
})
]);
}
)
];
# REF: https://home-manager-options.extranix.com/?query=vscode&release=release-25.05
programs.vscode = {
enable = true;
# TODO: clean up
package =
(
if vscodium
then pkgs.vscodium
else pkgs.vscode
).overrideAttrs (oldAttrs: {
# runtimeDependencies = oldAttrs.runtimeDependencies ++ []
});
mutableExtensionsDir = true;
profiles.default = {
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
# extension format: USER.PACKAGENAME
extensions = with pkgs.vscode-extensions; [
# .NET
ms-dotnettools.csharp
ms-dotnettools.csdevkit
ms-dotnettools.vscode-dotnet-runtime
# TODO: these extensions aren't packaged :(
# deitry.solution-syntax
# ms-dotnettools.vscode-dotnet-pack
# ms-dotnettools.dotnet-maui
# Python
ms-python.python
# GitLens by GitKraken
eamodio.gitlens
ms-azuretools.vscode-docker
github.copilot
github.copilot-chat
# Colors & Themes
dracula-theme.theme-dracula
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
mvllow.rose-pine
];
userSettings = {
"workbench.colorTheme" = "Dracula Theme";
"github.copilot.nextEditSuggestions.enabled" = true;
};
};
};
# TODO: this is super ugly, make sure the JSON is formatted!!
home.file.${vscode-argv}.text = builtins.toJSON {
password-store = secret-service;
disable-hardware-acceleration = false;
disable-color-correct-rendering = false;
enable-crash-reporter = false;
# crash-report-id = ...;
};
}

View file

@ -1,37 +0,0 @@
{
lib,
pkgs,
...
}: {
# REF: https://home-manager-options.extranix.com/?query=vscode&release=release-25.05
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = true;
profiles.default = {
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
# extension format: USER.PACKAGENAME
extensions = with pkgs.vscode-extensions; [
# .NET
ms-dotnettools.csharp
ms-dotnettools.csdevkit
ms-dotnettools.vscode-dotnet-runtime
# ms-dotnettools.vscode-dotnet-pack
# ms-dotnettools.dotnet-maui
# Colors & Themes
dracula-theme.theme-dracula
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
mvllow.rose-pine
];
userSettings = {
"workbench.colorTheme" = "Dracula Theme";
};
};
};
}

View file

@ -1,79 +1,14 @@
{ {
config, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
options = {
morphBashToFish = lib.mkEnableOption "morphBashToFish";
};
# TODO: make the greeting controllable (ie so my VPS can be different)
config = {
programs.fish = { programs.fish = {
enable = true; enable = true;
generateCompletions = true; interactiveShellInit = ''
#set -g fish_greeting "Welcome weary traveler to my shop"
# vendor = { cat ~/banner
# config.enable = true;
# functions.enable = true;
# completions.enable = true;
# };
interactiveShellInit = let
greetings =
[
"Welcome weary traveller to my shop"
"It's dangerous to go alone! Take this."
"Do butterflies cry when they're sad?"
"I hope they do"
"I think Alice is lost..."
"Something wicked this way comes"
"May your L's be many... and your bitches few"
"What a horrible night to have a curse."
"The ancient spirits of light and dark have been released."
"The god of the stars rejects your offering. The ritual can only be performed at night."
"You should have just died..."
"Supreme Witch, Calamitas has killed every player!"
]
|> map (x: "\"${x}\"")
|> builtins.concatStringsSep " ";
in ''
# add dotnet completions if it exists (ie we're in a virtual environment)
if type -q dotnet
complete -f -c dotnet -a "(dotnet complete (commandline -cp))"
end
function rand_greet
set greetings ${greetings}
echo -n $greetings[(random 1 (count $greetings))]
end
function gitignore -a type
curl -sL "https://www.gitignore.io/api/$type"
end
# ripgrep on files
function rgf
rg --files | rg $args
end
set -g fish_greeting (rand_greet)
''; '';
shellAliases = {
brip = "batgrep"; # bat + ripgrep
man = "batman"; # bat + man
ls = "eza --color=auto";
l = "eza -Alh --color=auto --icons=auto";
ll = "eza -lh --color=auto --icons=auto";
li = "eza --color=auto --git-ignore";
};
plugins = [ plugins = [
{ {
name = "grc"; name = "grc";
@ -81,5 +16,4 @@
} }
]; ];
}; };
};
} }

View file

@ -5,66 +5,7 @@
}: { }: {
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true;
userName = "Emile Clark-Boman"; userName = "Emile Clark-Boman";
userEmail = "eclarkboman@gmail.com"; userEmail = "eclarkboman@gmail.com";
aliases = {
s = "status";
d = "diff";
l = "log";
c = "commit";
p = "push";
};
extraConfig = {
color.ui = true;
core.editor = "hx";
github.user = "emileclarkb";
init = {
defaultBranch = "main";
};
url = {
"git@github.com:" = {
insteadOf = [
"gh:"
"github:"
];
};
"https://gitlab.com/" = {
insteadOf = [
"gl:"
"gitlab:"
];
};
"git@github.com:/Agribit/" = {
insteadOf = [
"agri:"
"Agri:"
"agribit:"
"Agribit:"
];
};
"ssh://forgejo@forge.imbored.dev:2222/" = {
insteadOf = [
"forge"
];
};
"ssh://forgejo@forge.imbored.dev:2222/emileclarkb/" = {
insteadOf = [
"cry"
];
};
};
};
includes = [
{
path = "/home/me/agribit/.gitconfig";
condition = "gitdir:/home/me/agribit/**";
}
];
}; };
} }

View file

@ -1,54 +0,0 @@
{...}: let
dracula = rec {
background = "#282A36";
border = cyan;
cyan = "#8BE9FD";
yellow = "#F1FA8C";
red = "#FF5555";
};
theme = dracula;
in {
# notification daemon for Wayland
services.mako = {
enable = true;
settings = {
actions = true;
anchor = "top-right";
layer = "overlay";
sort = "-time";
height = 100;
width = 300;
margin = 50;
background-color = theme.background;
border-color = theme.border;
border-radius = 20;
border-size = 4;
font = "monospace 10";
markup = true;
icons = true;
max-icon-size = 64;
default-timeout = 5000;
ignore-timeout = false;
"actionable=true" = {
anchor = "top-left";
};
"urgency=low" = {
border-color = theme.border;
};
"urgency=normal" = {
border-color = theme.yellow;
};
"urgency=high" = {
default-timeout = 0;
border-color = theme.red;
};
};
};
}

248
homes/modules/nixcord.nix Normal file → Executable file
View file

@ -1,248 +1,16 @@
{inputs, ...}: { {
imports = [ config,
inputs.nixcord.homeModules.nixcord pkgs,
]; ...
}: {
programs.nixcord = { programs.nixcord = {
enable = true; enable = true;
equibop.enable = true;
discord = {
vencord.enable = false;
equicord.enable = true;
};
config = { config = {
enabledThemes = [ frameless = true;
# "aurorastheme.css"
# "base16-colors.css"
];
plugins = { plugins = {
anonymiseFileNames = { # TODO: remove this plugin
enable = true; hideAttachments.enable = true;
anonymiseByDefault = true;
method = 0;
randomisedLength = 16;
};
betterSessions = {
backgroundCheck = true;
checkInterval = 1;
};
biggerStreamPreview.enable = true;
callTimer.enable = true;
fixYoutubeEmbeds.enable = true;
fixSpotifyEmbeds.enable = true;
tidalEmbeds.enable = true;
youtubeAdblock.enable = true;
followVoiceUser.enable = true;
friendsSince.enable = true;
ircColors = {
enable = true;
lightness = 80;
memberListColors = true;
applyColorOnlyInDms = false;
applyColorOnlyToUsersWithoutColor = false;
};
messageLogger = {
enable = true;
showEditDiffs = true;
separatedDiffs = false;
};
# fakeNitro.enable = true;
ghosted.enable = true;
noF1.enable = true;
noMaskedUrlPaste.enable = true;
messageLatency = {
enable = false;
latency = -1;
showMillis = true;
};
openInApp.enable = true;
crashHandler.enable = true;
disableCallIdle.enable = true;
experiments.enable = true;
expressionCloner.enable = true;
favoriteGifSearch.enable = true;
fixImagesQuality.enable = true;
forceOwnerCrown.enable = true;
forwardAnywhere.enable = true;
spotifyCrack.enable = true;
spotifyShareCommands.enable = true;
spotifyControls.enable = true;
fullUserInChatbox.enable = true;
gifPaste.enable = true;
ignoreActivities = {
enable = true;
ignorePlaying = true;
ignoreStreaming = true;
ignoreListening = true;
ignoreWatching = true;
ignoreCompeting = true;
};
imageLink.enable = true;
imageZoom.enable = true;
memberCount.enable = true;
noDevtoolsWarning.enable = true;
noUnblockToJump.enable = true;
pauseInvitesForever.enable = true;
permissionsViewer.enable = true;
pictureInPicture = {
enable = true;
loop = true;
};
platformIndicators.enable = true;
previewMessage.enable = true;
relationshipNotifier.enable = true;
revealAllSpoilers.enable = true;
serverInfo.enable = true;
serverListIndicators.enable = true;
showHiddenChannels.enable = true;
showHiddenThings.enable = true;
showTimeoutDuration = {
enable = true;
displayStyle = "tooltip";
};
silentTyping = {
enable = true;
enabledGlobally = false;
};
startupTimings.enable = true;
typingIndicator.enable = true;
unlockedAvatarZoom = {
enable = true;
zoomMultiplier = 4.0;
};
userMessagesPronouns.enable = true;
validUser.enable = true;
validReply.enable = true;
viewIcons = {
enable = true;
format = "webp";
imgSize = "4096";
};
voiceChatDoubleClick.enable = true;
voiceDownload.enable = true;
voiceMessages = {
enable = true;
noiseSuppression = false;
echoCancellation = true;
};
volumeBooster.enable = true;
webKeybinds.enable = true;
webScreenShareFixes.enable = true;
whoReacted.enable = true;
whosWatching.enable = true;
quickReply.enable = true;
questCompleter.enable = true;
shikiCodeblocks = {
enable = true;
useDevIcon = "COLOR";
theme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/2d87559c7601a928b9f7e0f0dda243d2fb6d4499/packages/tm-themes/themes/kanagawa-wave.json";
}; };
}; };
}; };
};
programs.nixcord.config.plugins.PinDMs = {
enable = true;
canCollapseDmSection = true;
# userBasedCategoryList = {
# "1202666382760607774" = [
# {
# id = "i9dflmraztc";
# name = "🏳️‍⚧️ girlfriends!!! :3 🏳️‍⚧️";
# color = 16359423;
# collapsed = false;
# channels = [
# "1436964273162289185"
# "1436988320474206311"
# "1449837047383855119"
# "1436965652861685891"
# "1436968495190642722"
# "1465424321919975454"
# ];
# }
# {
# id = "p2v1f5y9zbd";
# name = "🦋 best frens <3 🦋";
# color = 10223511;
# collapsed = false;
# channels = [
# "1436985374286155799"
# "1436965657076826222"
# "1429921297160212681"
# "1394808379381387385"
# "1433593753183977545"
# "1438254055452446881"
# "1436966389549236376"
# "1202678007026819134"
# "1437151552224624660"
# "1441906462094921789"
# "1450340272079769712"
# "1458123717124165764"
# "1436975341129306155"
# "1461885176534794427"
# "1462155159470866443"
# "1468735915076878407"
# ];
# }
# {
# id = "c0mg5w635j8";
# name = "🏳️‍🌈 close frens x3 🏳️‍🌈";
# color = 10780927;
# collapsed = false;
# channels = [
# "1437077103873888290"
# "1436975346338762823"
# "1437123353101205590"
# "1441516692164575283"
# "1419557866502754334"
# "1436985041203892315"
# "1438071327515742229"
# ];
# }
# {
# id = "ghjrq5el3b";
# name = "frens :3";
# color = 7334399;
# collapsed = false;
# channels = [
# "1437007154132422701"
# "1437006448948416526"
# "1446781617422209068"
# "1444723474835837103"
# "1437098569483161721"
# "1437237573146771469"
# "1436973705421914123"
# "1437135359359320125"
# "1438010723837022343"
# "1440553969461104740"
# "1437097082887475201"
# "1447222320015085740"
# "1462624704027164824"
# "1449513783893692589"
# "1463737720961634461"
# "1463000874392748249"
# "1461929299727749145"
# "1436984534712451105"
# "1436983282582683813"
# "1437283420312047659"
# "1437089201651847315"
# "1468324280445046824"
# ];
# }
# {
# id = "zbmj00xw7d8";
# name = "goop chats";
# color = 14876549;
# collapsed = false;
# channels = [
# "1437132769141719040"
# "1445549416516681902"
# "1458849972815663209"
# ];
# }
# ];
# };
};
} }

View file

@ -1,16 +0,0 @@
{
config,
pkgs,
...
}: {
programs = {
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
obs-pipewire-audio-capture
];
};
};
}

View file

@ -3,16 +3,8 @@
pkgs, pkgs,
... ...
}: { }: {
home = {
packages = [
pkgs.rio
];
# currently set to ghostty (on lolcathost)
#sessionVariables.TERMINAL = "rio";
};
# The terminal I use # The terminal I use
# TODO: this is dependent on nvim being installed
# TODO: make this into a module with a configurable editor option # TODO: make this into a module with a configurable editor option
programs.rio = { programs.rio = {
enable = true; enable = true;

View file

@ -1,9 +0,0 @@
{
lib,
...
}:
{
options = {
}
}

View file

@ -1,327 +0,0 @@
{upkgs, ...}: {
programs.foot = {
enable = true;
package = upkgs.foot;
server.enable = true;
settings = let
none = "\"\"";
in {
main = {
term = "foot"; # set $TERM
login-shell = "no";
title = "foot";
locked-title = "no";
# font = "GeistMono Nerd Font:size=12";
# font = "Mononoki Nerd Font Mono:size=12";
# font = "0xProto Nerd Font Mono:size=12";
font = "JetBrainsMonoNL Nerd Font:size=12";
# font-bold = "";
# font-italice = "";
# font-bold-italice = "";
# font-size-adjustment = 0.5;
# line-height = ...;
# letter-spacing = 0;
# horizontal-letter-offset = 0;
# vertical-letter-offset = 0;
# underline-offset = ...;
# underline-thickness = ...;
# strikeout-thickness = ...;
box-drawings-uses-font-glyphs = "no";
dpi-aware = "no";
gamma-correct-blending = "no";
initial-color-theme = "1";
# initial-window-size-pixels = "700x500"; # pixel COLSxROWS
initial-window-size-chars = "90x26"; # char COLSxROWS
initial-window-mode = "windowed";
pad = "32x32 center-when-maximized-and-fullscreen";
resize-by-cells = "yes";
resize-keep-grid = "yes";
resize-delay-ms = "100";
bold-text-in-bright = "no";
word-delimiters = ",`|:\"'()[]{}<>";
selection-target = "primary";
# workers = ...; # number of logical CPUs
};
# environment = {
# name = "value";
# }
security = {
osc52 = "enabled";
};
bell = {
system = "no";
urgent = "no";
notify = "no";
visual = "no";
# command = ...;
# command-focused = "no";
};
desktop-notifications = {
command = "notify-send --wait --app-name \${app-id} --icon \${app-id} --category \${category} --urgency \${urgency} --expire-time \${expire-time} --hint STRING:image-path:\${icon} --hint BOOLEAN:suppress-sound:\${muted} --hint STRING:sound-name:\${sound-name} --replace-id \${replace-id} \${action-argument} --print-id -- \${title} \${body}";
command-action-argument = "--action \${action-name=\${action-label}}";
close = none;
inhibit-when-focused = "no";
};
scrollback = {
lines = 1000;
multiplier = 1.0;
indicator-position = "relative";
indicator-format = none;
};
url = {
launch = "xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "url-mode";
regex = "(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]+|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\\-]|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*'))";
};
# "regex:your-fancy-name" = {
# regex = ...;
# launch = "[path to script/application] \${match}"
# };
#
# key-bindings = {
# regex-launch = "[your-fancy-name] Control+Shift+q";
# regex-copy = "[your-fancy-name] Control+Alt+shift+q";
# };
cursor = {
style = "block";
blink = "no";
# blink-rate = 500;
beam-thickness = 1.0;
# underline-thickness = ...;
};
mouse = {
hide-when-typing = "yes";
alternate-scroll-mode = "yes";
};
touch = {
long-press-delay = 400;
};
# Theme: Dracula
# REF: https://github.com/dracula/foot
colors = {
alpha = 1.0;
alpha-mode = "default"; # default/matching/all
background = "282a36";
foreground = "f8f8f2";
## Normal/regular colors (color palette 0-7)
regular0 = "21222c"; # black
regular1 = "ff5555"; # red
regular2 = "50fa7b"; # green
regular3 = "f1fa8c"; # yellow
regular4 = "bd93f9"; # blue
regular5 = "ff79c6"; # magenta
regular6 = "8be9fd"; # cyan
regular7 = "f8f8f2"; # white
## Bright colors (color palette 8-15)
bright0 = "6272a4"; # bright black
bright1 = "ff6e6e"; # bright red
bright2 = "69ff94"; # bright green
bright3 = "ffffa5"; # bright yellow
bright4 = "d6acff"; # bright blue
bright5 = "ff92df"; # bright magenta
bright6 = "a4ffff"; # bright cyan
bright7 = "ffffff"; # bright white
## Misc colors
selection-foreground = "ffffff";
selection-background = "44475a";
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
urls = "8be9fd";
flash = "7f7f00";
flash-alpha = 0.5;
};
# Alternative colour palette (see `man 5 foot.ini`)
colors2 = {
alpha = 1.0;
alpha-mode = "default";
background = "191724";
foreground = "e0def4";
regular0 = "26233a"; # black (Overlay)
regular1 = "eb6f92"; # red (Love)
regular2 = "9ccfd8"; # green (Foam)
regular3 = "f6c177"; # yellow (Gold)
regular4 = "31748f"; # blue (Pine)
regular5 = "c4a7e7"; # magenta (Iris)
regular6 = "ebbcba"; # cyan (Rose)
regular7 = "e0def4"; # white (Text)
bright0 = "47435d"; # bright black (lighter Overlay)
bright1 = "ff98ba"; # bright red (lighter Love)
bright2 = "c5f9ff"; # bright green (lighter Foam)
bright3 = "ffeb9e"; # bright yellow (lighter Gold)
bright4 = "5b9ab7"; # bright blue (lighter Pine)
bright5 = "eed0ff"; # bright magenta (lighter Iris)
bright6 = "ffe5e3"; # bright cyan (lighter Rose)
bright7 = "fefcff"; # bright white (lighter Text)
selection-foreground = "ffffff";
selection-background = "393553";
urls = "ebbcba"; # Rose
flash = "f6c177"; # yellow (Gold)
flash-alpha = 0.5;
cursor = "191724 e0def4";
};
# csd = {
# preferred = "server";
# size = 26;
# font = ...;
# color = ...; # foreground color
# hide-when-maximized = "no";
# border-width = 0;
# border-color = ...;
# button-width = 26;
# button-color = ...; # background color
# button-minimize-color = ...;
# button-maximize-color = ...;
# button-close-color = ...;
# };
key-bindings = {
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
# scrollback-up-half-page = "none";
# scrollback-up-line = "none";
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
# scrollback-down-half-page = "none";
# scrollback-down-line = "none";
# scrollback-home = "none";
# scrollback-end = "none";
clipboard-copy = "Control+Shift+c XF86Copy";
clipboard-paste = "Control+Shift+v XF86Paste";
primary-paste = "Shift+Insert";
search-start = "Control+Shift+r";
font-increase = "Control+plus Control+equal Control+KP_Add";
font-decrease = "Control+minus Control+KP_Subtract";
font-reset = "Control+0 Control+KP_0";
spawn-terminal = "Control+Shift+n";
# minimize = "none";
# maximize = "none";
# fullscreen = "none";
pipe-visible = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
pipe-scrollback = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
pipe-selected = "[xargs -r firefox] none";
pipe-command-output = "[wl-copy] none";
show-urls-launch = "Control+Shift+o";
# show-urls-copy = "none";
# show-urls-persistent = "none";
prompt-prev = "Control+Shift+z";
prompt-next = "Control+Shift+x";
unicode-input = "Control+Shift+u";
# color-theme-switch-1 = "none";
# color-theme-switch-2 = "none";
color-theme-toggle = "Control+Alt+p";
# noop = "none";
# quit = "none";
};
search-bindings = {
cancel = "Control+g Control+c Escape";
commit = "Return KP_Enter";
find-prev = "Control+r";
find-next = "Control+s";
cursor-left = "Left Control+b";
cursor-left-word = "Control+Left Mod1+b";
cursor-right = "Right Control+f";
cursor-right-word = "Control+Right Mod1+f";
cursor-home = "Home Control+a";
cursor-end = "End Control+e";
delete-prev = "BackSpace";
delete-prev-word = "Mod1+BackSpace Control+BackSpace";
delete-next = "Delete";
delete-next-word = "Mod1+d Control+Delete";
delete-to-start = "Control+u";
delete-to-end = "Control+k";
extend-char = "Shift+Right";
extend-to-word-boundary = "Control+w Control+Shift+Right";
extend-to-next-whitespace = "Control+Shift+w";
extend-line-down = "Shift+Down";
extend-backward-char = "Shift+Left";
extend-backward-to-word-boundary = "Control+Shift+Left";
# extend-backward-to-next-whitespace = "none";
extend-line-up = "Shift+Up";
clipboard-paste = "Control+v Control+Shift+v Control+y XF86Paste";
primary-paste = "Shift+Insert";
# unicode-input = "none";
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
# scrollback-up-half-page = "none";
# scrollback-up-line = "none";
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
# scrollback-down-half-page = "none";
# scrollback-down-line = "none";
# scrollback-home = "none";
# scrollback-end = "none";
};
url-bindings = {
cancel = "Control+g Control+c Control+d Escape";
toggle-url-visible = "t";
};
text-bindings = {
"\\x03" = "Mod4+c"; # map Super+c -> Control+c
};
mouse-bindings = {
scrollback-up-mouse = "BTN_WHEEL_BACK";
scrollback-down-mouse = "BTN_WHEEL_FORWARD";
font-increase = "Control+BTN_WHEEL_BACK";
font-decrease = "Control+BTN_WHEEL_FORWARD";
selection-override-modifiers = "Shift";
primary-paste = "BTN_MIDDLE";
select-begin = "BTN_LEFT";
select-begin-block = "Control+BTN_LEFT";
select-extend = "BTN_RIGHT";
select-extend-character-wise = "Control+BTN_RIGHT";
select-word = "BTN_LEFT-2";
select-word-whitespace = "Control+BTN_LEFT-2";
select-quote = "BTN_LEFT-3";
select-row = "BTN_LEFT-4";
};
};
};
}

View file

@ -1,45 +0,0 @@
{pkgs, ...}: {
home = {
packages = [
pkgs.ghostty
];
sessionVariables.TERMINAL = "ghostty";
};
programs.ghostty = {
enable = true;
settings = {
theme = "Dracula";
font-family = "Geist Nerd Font";
font-feature = ["liga" "calt"];
window-padding-x = 12;
window-padding-y = 6;
window-theme = "system";
window-height = 26;
window-width = 90;
copy-on-select = true;
gtk-single-instance = false;
adw-toolbar-style = "flat";
# disable close confirmations
confirm-close-surface = false;
keybind = [
"ctrl+shift+plus=increase_font_size:1"
"ctrl+shift+minus=decrease_font_size:1"
"ctrl+h=goto_split:left"
"ctrl+l=goto_split:right"
];
};
#themes = {
#aylur-dark = colors (import ./colors.nix {scheme = "dark";});
#aylur-light = colors (import ./colors.nix {scheme = "light";});
#};
};
}

View file

@ -1,5 +0,0 @@
{...}: {
programs.tmux = {
enable = true;
};
}

View file

@ -1,43 +0,0 @@
# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland)
# and your home-manager config (for managing hyprland's config files)
{
pkgs,
pkgs-unstable,
inputs,
config,
lib,
...
}: {
options.hyprland = {
enable = lib.mkEnableOption "Hyprland";
};
config = lib.mkIf config.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland; # pkgs-unstable.hyprland;
xwayland.enable = true;
systemd = {
enable = true;
# enable autostart of applications
# REF: `man 8 systemd-xdg-autostart-generator`
enableXdgAutostart = true;
};
plugins = with inputs; [
split-monitor-workspaces.packages.${pkgs.system}.split
];
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
# TODO: finish this
};
}

View file

@ -0,0 +1,72 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
nixpkgs = {
config.allowUnfree = false;
};
imports = [
];
home = {
username = "subspace";
homeDirectory = "/home/subspace";
};
programs = {
fish = {
enable = true;
# Extra commands to run when entering a interactive shell
# (for the subspace user this will be exiting fish to
# run wishlist instead, a shell should not pop up!)
loginShellInit = ''
clear
exec wishlist
'';
};
ssh = {
enable = true;
forwardAgent = true;
addKeysToAgent = "yes";
matchBlocks = {
hyrule = {
hostname = "imbored.dev";
user = "ae";
port = 22;
identityFile = "~/.ssh/id_hyrule";
};
YearnForTheMines = {
hostname = "deadlyserver.com";
user = "emile";
port = 29843;
identityFile = "~/.ssh/id_deadlyserver";
};
};
};
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# SERVICE: webfishing (example for wishlist)
#systemd.user.services.webfishing = {
# Unit.Description = "I be out here webfishing frfr";
# Install.WantedBy = ["default.target"];
# Service = {
# Type = "exec";
# ExecStart = "echo $HOME; cat $HOME/.ssh/config";
# Restart = "always";
# };
#};
home.stateVersion = "24.11"; # DO NOT MODIFY
}

View file

@ -1,77 +0,0 @@
{...}: {
imports = [
./hardware-configuration.nix
./services
];
# super duper minimum grub2 config
boot.loader.grub = {
enable = true;
device = "/dev/vda";
};
networking = {
hostName = "butterfly";
firewall = {
allowedTCPPorts = [
80 # nginx
# 143 # IMAP4
443 # nginx
# 587 # SMTPS
2222 # forgejo ssh
2035 # debug (for my job)
# 3000 (INTERNAL) forgejo
# 3306 (INTERNAL) forgejo sqlite3 database
5000 # debug (for my job)
# 8222 (INTERNAL) vaultwarden
45000 # minecaft server
];
allowedUDPPorts = [
54231 # Wireguard
];
};
# wg-quick.interfaces = {
# wg0 = {
# address = [
# "10.10.10.4/24"
# ];
# dns = ["10.10.10.1"];
# privateKeyFile = "/root/wg_agrivpn_hyrule";
# peers = [
# {
# # peer's public key
# publicKey = "iZ4aqYjbT8O8tfUHEuV+yWLtdoQbdBb6Nt0M4usMSiY=";
# # choose which traffic to forward
# allowedIPs = [
# "10.0.51.0/24"
# "10.10.10.0/24"
# ];
# endpoint = "150.242.34.33:54231";
# }
# ];
# };
# };
};
users = {
users = {
# primary user
cry = {
isNormalUser = true;
home = "/home/cry";
extraGroups = ["wheel"];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsUZY45rgezi+8iROdcR5vPeacJ2fbMjlDijfUrH9hRX2FzCsg/4e3aFKhi2seZMmyTfbstxmDrrH8paUS5TibFgLFBGNngaF3CTjg85i5pm25Hr4IVo31oziBnTWaG6j3buYKtz5e1qSPzXywinJR+5+FCUJU7Fxa+EWTZcOX4wYgArSj4q73rZmvk5N0X44Mudt4nvpD2chvxygsdTzD6ph92qCuaJ/AbfmOoC7b/xvOaOVydUfgDLpHi9VZbd3akvvKxRfW6ZklldgXEzPXKMuastN0mwcBxvIb5G1Vkj8jtSVtKPc5psZ9/NWA5l38xH4qZ6z7eib6thtEMdtcKmTZEEWDADjqTea5Gj61c1n18cr6f3Tff+0bn/cxsl4Y0esi+aDeuCXYiIYNmeKBx0ttDNIxpk4J5Fdh6Xs+AZif5lnJErtu8TPy2aC0bc9wehTjMyvilTHfyerOD1ZJXhN2XwRVDGN7t7leAJZISJlPjqTDcw3Vfvzte/5JqS+FR+hbpG4uz2ix8kUa20u5YF2oSdGl8+zsdozVsdQm10Iv9WSXBV7t4m+oyodgtfzydBpmXq7aBXudCiEKw+7TC7F+1a4YFrVrCNXKFgKUpd1MiVLl7DIbzm5U9MD2BB3Fy7BPCzr3tW6/ExOhhpBWY+HnzVGQfkNr7dRcqfipKw== ae@dobutterfliescry.net"
];
};
};
};
virtualisation.docker.enable = true;
system.stateVersion = "24.11"; # DO NOT MODIFY
}

View file

@ -1,37 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "ahci" "sd_mod" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -1,5 +0,0 @@
{...}: {
imports = [
./nginx.nix
];
}

View file

@ -1,150 +0,0 @@
{...}: {
# more options here: https://mynixos.com/nixpkgs/options/services.forgejo
# TODO: set a favicon https://forgejo.org/docs/next/contributor/customization/#changing-the-logo
# (might need me to override settings in the nixpkg)
# TODO: create a custom theme for forgejo (modify the source files most likely)
services.forgejo = {
enable = true;
# enable support for Git Large File Storage
lfs.enable = true;
database = {
type = "sqlite3"; # postgres
host = "127.0.0.1";
port = "3306"; # 5432 if postgres
};
# settings are written directly to the `app.ini` config file
# refer to: https://forgejo.org/docs/latest/admin/config-cheat-sheet/
settings = {
server = {
# ENABLE_ACME = true;
# ACME_EMAIL = "eclarkboman@gmail.com"; # change this to "me@imbored.dev"
DOMAIN = "dobutterfliescry.net"; # should this be "imbored.dev"?
ROOT_URL = "https://forge.dobutterfliescry.net"; # full public URL of the Forgejo server
# address and port to listen on
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3000;
PROTOCOL = "http"; # http internally, reverse proxy uses https externally
START_SSH_SERVER = true;
DISABLE_SSH = false;
SSH_PORT = 2222;
};
DEFAULT = {
APP_NAME = "tearforge";
APP_SLOGIN = "but cozy";
APP_DISPLAY_NAME_FORMAT = "{APP_NAME} ::{APP_SLOGAN}::";
};
repository = {
DEFAULT_PRIVATE = "private"; # last, private, public
# repo/org created on push to non-existent
ENABLE_PUSH_CREATE_USER = true;
ENABLE_PUSH_CREATE_ORG = false;
DEFAULT_PUSH_CREATE_PRIVATE = true;
MAX_CREATION_LIMIT = -1;
};
"repository.upload" = {
# max per-file size in MB
FILE_MAX_SIZE = 50;
# max number of files per upload
MAX_FILES = 5;
};
badges = let
# flat, flat-square, plastic, for-the-badge, social
style = "for-the-badge";
in {
ENABLED = true;
GENERATOR_URL_TEMPLATE = "https://img.shields.io/badge/{{.label}}-{{.text}}-{{.color}}?style=${style}";
};
ui = {
DEFAULT_THEME = "forgejo-dark";
THEMES = "forgejo-auto,forgejo-light,forgejo-dark";
};
"ui.meta" = {
AUTHOR = "Emile Clark-Boman - emileclarkb";
DESCRIPTION = "This is my personal self-hosted git forge, where I keep and maintain personal projects! PS do butterflies cry when they're sad?";
KEYWORDS = "emile,clark,boman,clarkboman,emileclarkb,git,forge,forgejo,self-hosted,dobutterfliescry,butterfly,butterflies";
};
markdown = {
ENABLE_HARD_LINE_BREAK_IN_COMMENTS = true;
ENABLE_MATH = true;
};
admin = {
DEFAULT_EMAIL_NOTIFICATIONS = "enabled";
SEND_NOTIFICATION_EMAIL_ON_NEW_USER = true;
};
security = {
# Controls access to the installation page.
# When set to “true”, the installation page is not accessible.
#INSTALL_LOCK = false;
PASSWORD_HASH_ALGO = "argon2"; # ARGON2 BEST ALGO FR!! (default: argon2$2$65536$8$50)
MIN_PASSWORD_LENGTH = 12;
PASSWORD_COMPLEXITY = "lower,upper,digit,spec";
PASSWORD_CHECK_PWN = true;
};
service = {
DISABLE_REGISTRATION = true; # toggle for new users
#DEFAULT_USER_IS_RESTRICTED = true;
# Forbid login with third-party services (ie github)
ALLOW_ONLY_INTERNAL_REGISTRATION = true;
ENABLE_CAPTCHA = true;
REQUIRE_CAPTCHA_FOR_LOGIN = true;
REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA = true;
LOGIN_REMEMBER_DAYS = 365;
ENABLE_NOTIFY_MAIL = true;
};
"service.explore" = {
REQUIRE_SIGNIN_VIEW = false;
DISABLE_USERS_PAGE = false;
DISABLE_ORGANIZATIONS_PAGE = false;
DISABLE_CODE_PAGE = false;
};
cache = {
ADAPTER = "twoqueue";
HOST = "{\"size\":100, \"recent_ratio\":0.25, \"ghost_ratio\":0.5}";
ITEM_TTL = "16h";
};
# TODO: fill this in once my mail server is configured
# email.incoming = { ... };
# optional
# TODO: fill this in once my mail server is configured
mailer = {
ENABLED = false;
SMTP_ADDR = "mail.dobutterfliescry.net";
FROM = "iforgor@dobutterfliescry.net";
USER = "iforgor@dobutterfliescry.net";
};
log = {
MODE = "file";
LEVEL = "Info"; # "Trace", "Debug", "Info", "Warn", "Error", "Critical"
ENABLE_SSH_LOG = true;
};
cron = {
ENABLED = true;
RUN_AT_START = false;
};
other = {
SHOW_FOOTER_VERSION = true;
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true;
SHOW_FOOTER_POWERED_BY = true;
ENABLE_SITEMAP = true;
ENABLE_FEED = true;
};
};
};
}

View file

@ -1,38 +0,0 @@
{
config,
pkgs,
...
}: {
imports = [
(builtins.fetchTarball {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-25.05/nixos-mailserver-nixos-25.05.tar.gz";
sha256 = "0jpp086m839dz6xh6kw5r8iq0cm4nd691zixzy6z11c4z2vf8v85";
})
];
# simple-nixos-mailserver
# DOCS: https://nixos-mailserver.readthedocs.io/en/latest
mailserver = {
enable = true;
# stateVersion = 3;
# Manually open the firewall instead
openFirewall = false;
virusScanning = false; # expensive memory usage
fqdn = "mail.imbored.dev";
domains = ["imbored.dev"];
# NOTE: generate hashes with `mkpasswd -sm bcrypt`
loginAccounts = {
"me@imbored.dev" = {
aliases = ["emile@imbored.dev"];
hashedPasswordFile = let
CWD = builtins.getEnv "PWD";
# XXX: TODO: use a secrets manager!
in "${CWD}/secrets/passwd/me";
};
};
certificateScheme = "acme-nginx";
};
}

View file

@ -1,65 +0,0 @@
{
pkgs,
upkgs,
...
}: {
services.minecraft-server = {
enable = true;
package = upkgs.minecraft-server; # use latest version only!
declarative = true;
eula = true;
openFirewall = false; # do this manually instead
whitelist = {
"SECRET1" = "";
"SECRET2" = "";
};
# REF: https://minecraft.wiki/w/Server.properties#Java_Edition
serverProperties = {
server-ip = "195.114.14.69"; # listen on all addresses if unset
server-port = 45000; # connection port
"query.port" = 45000; # share game info/advertising information
user-native-transport = true; # Linux packet RX/TX optimizations
# Users Connections
enforce-secure-profile = true;
online-mode = true; # don't allow unlicensed minecraft accounts to join
prevent-proxy-connections = false;
rate-limit = 0;
# Server Functionality
enable-status = true; # where the server appears as "online"
hide-online-players = false;
log-ips = true;
pause-when-empty-seconds = 60; # pause server when no player online for x seconds
view-distance = 10; # range: 3-32
simulation-distance = 10; # range: 3-32
# Players
motd = "M&M's Cozycraft Realm <3";
max-players = 2;
white-list = true;
idle-player-timeout = 0; # never kick idle players
# Gameplay
gamemode = "survival";
force-gamemode = true;
difficulty = "normal";
hardcore = false;
pvp = true;
allow-cheats = true;
# World
level-name = "M&M's Cozycraft"; # world name
# level-seed = "" # random seed if unset
level-type = "minecraft:normal"; # world generation preset
generate-structures = true;
spawn-monsters = true;
spawn-protection = 0;
};
jvmOpts = "-Xms2046M -Xmx2046M -XX:+UseG1GC -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10";
};
}

View file

@ -1,83 +0,0 @@
{
inputs,
pkgs,
...
}: {
nixpkgs.overlays = [
(self: super: {
# in wake of CVE-2022-3602/CVE-2022-3786
nginxStable = super.nginxStable.override {openssl = pkgs.libressl;};
})
inputs.dobutterfliescry-net.overlays.default
];
# simple nginx instance to host static construction page
# TODO: I want sshd and forgejo's ssh server to both be bound to port 22
# So change sshd to listen on a different address/port (ie 2222 or 127.0.0.3:22, etc)
# and change forgejo to use 127.0.0.2:22 (use port 22, ONLY change loopback address)
services.nginx = {
enable = true;
# XXX: TODO: this should auto use the nginxStable overlay no?
# in wake of CVE-2022-3602/CVE-2022-3786
# package = pkgs.nginxStable.override {openssl = pkgs.libressl;};
recommendedGzipSettings = true;
recommendedZstdSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# streamConfig = ''
# server {
# listen 127.0.0.1:53 udp reuseport;
# proxy_timeout 20s;
# proxy_pass 192.168.0.1:53535;
# }
# '';
virtualHosts = let
localhost = "http://127.0.0.1";
std = {
# TODO: should I run over QUIC+HTTP3? (experimental)
# quic = true;
# http3 = true;
enableACME = true;
# kTLS = true; # offload TLS to the linux kernel
};
vault =
{
forceSSL = true;
locations."/".proxyPass = "${localhost}:8222";
}
// std;
forge =
{
forceSSL = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "${localhost}:3000";
}
// std;
in {
"dobutterfliescry.net" =
{
default = true;
addSSL = true; # not strictly enforced <3
# root = "/var/www/cry";
root = "${pkgs.dobutterfliescry-net}/www";
# extraConfig = ''
# error_page 404 /custom_404.html;
# '';
}
// std;
# Route "vault" subdomain to vaultwarden
"vault.imbored.dev" = vault;
# Route "forge" subdomain to forgejo
# TODO: use `forgejo.settings.server.ENABLE_ACME` instead?
# "tearforge.net" = forge;
"forge.dobutterfliescry.net" = forge;
};
};
}

View file

@ -1,25 +0,0 @@
{...}: {
services.vaultwarden = {
enable = true;
dbBackend = "sqlite";
# backupDir = "/var/backup/vaultwarden"; # disable with null
# https://mynixos.com/nixpkgs/option/services.vaultwarden.config
config = {
# internal address and port to listen on
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
# hostname to listen for
DOMAIN = "https://vault.imbored.dev";
# signup policy
SIGNUPS_ALLOWED = false;
SIGNUPS_VERIFY = true;
INVITATIONS_ALLOWED = true;
};
# https://mynixos.com/nixpkgs/option/services.vaultwarden.environmentFile
environmentFile = "/var/lib/vaultwarden/vaultwarden.env";
};
}

View file

@ -1,10 +1,65 @@
{pkgs, ...}: { {
pkgs,
inputs,
lib,
...
}: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz";
sha256 = "0c07xj74vsj37d3a8f98i9rhhhr99ckwlp45n40f0qkmigm3pk8s";
};
in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
(import "${home-manager}/nixos")
./services #../../flakes/wishlist/wishlist.nix
#../modules/server/nginx.nix
#../modules/server/ssh.nix
#../modules/server/fail2ban.nix
]; ];
# override wishlist with the new cool one!
#pkgs.config.packageOverrides = {
# wishlist = inputs.wishlist.packages.x86_64-linux.wishlist;
#};
nix.settings = {
# make wheel group trusted users allows my "ae" user
# to import packages not signed by a trusted key
# (aka super duper easier to remote deploy)
trusted-users = ["root" "@wheel"];
experimental-features = [
"nix-command"
"flakes"
];
};
time.timeZone = "Australia/Brisbane";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
# colmena deployment configuration
deployment = {
targetHost = "imbored.dev";
targetUser = "ae";
targetPort = 22;
# the following line is unnecessary if using an ssh agent
#sshOptions = ["-i /home/me/.ssh/id_hyrule"];
#keys = {
# "imbored.dev" = {
# # text, keyCommand, or keyFile must be set
# # text = "";
# #keyCommand = [ "" ];
# keyFile = "/home/me/.ssh/id_hyrule";
# };
#};
buildOnTarget = false; # build locally then deploy
};
# super duper minimum grub2 config # super duper minimum grub2 config
boot.loader.grub = { boot.loader.grub = {
enable = true; enable = true;
@ -13,61 +68,419 @@
networking = { networking = {
hostName = "hyrule"; hostName = "hyrule";
networkmanager.enable = true;
firewall = { firewall = {
enable = true;
allowedTCPPorts = [ allowedTCPPorts = [
22 # sshd
80 # nginx 80 # nginx
# 143 # IMAP4
443 # nginx 443 # nginx
]; # 587 # SMTPS
allowedUDPPorts = [ 2222 # forgejo ssh
54231 # Wireguard 2035 # debug (for my job)
# 3000 (INTERNAL) forgejo
# 3306 (INTERNAL) forgejo sqlite3 database
5000 # debug (for my job)
# 8222 (INTERNAL) vaultwarden
]; ];
}; };
# wg-quick.interfaces = {
# wg0 = {
# address = [
# "10.10.10.4/24"
# ];
# dns = ["10.10.10.1"];
# privateKeyFile = "/root/wg_agrivpn_hyrule";
# peers = [
# {
# # peer's public key
# publicKey = "iZ4aqYjbT8O8tfUHEuV+yWLtdoQbdBb6Nt0M4usMSiY=";
# # choose which traffic to forward
# allowedIPs = [
# "10.0.51.0/24"
# "10.10.10.0/24"
# ];
# endpoint = "150.242.34.33:54231";
# }
# ];
# };
# };
}; };
# grant passwordless sudo to wheel group
security.sudo.wheelNeedsPassword = false;
users = { users = {
defaultUserShell = pkgs.bash;
users = { users = {
# primary user # primary user
cry = { ae = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel"]; extraGroups = ["wheel" "networkmanager" "docker"];
shell = pkgs.bash; shell = pkgs.bash;
openssh.authorizedKeys.keys = [ home = "/home/ae"; # TEMP: remove and replace with home-manager
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsUZY45rgezi+8iROdcR5vPeacJ2fbMjlDijfUrH9hRX2FzCsg/4e3aFKhi2seZMmyTfbstxmDrrH8paUS5TibFgLFBGNngaF3CTjg85i5pm25Hr4IVo31oziBnTWaG6j3buYKtz5e1qSPzXywinJR+5+FCUJU7Fxa+EWTZcOX4wYgArSj4q73rZmvk5N0X44Mudt4nvpD2chvxygsdTzD6ph92qCuaJ/AbfmOoC7b/xvOaOVydUfgDLpHi9VZbd3akvvKxRfW6ZklldgXEzPXKMuastN0mwcBxvIb5G1Vkj8jtSVtKPc5psZ9/NWA5l38xH4qZ6z7eib6thtEMdtcKmTZEEWDADjqTea5Gj61c1n18cr6f3Tff+0bn/cxsl4Y0esi+aDeuCXYiIYNmeKBx0ttDNIxpk4J5Fdh6Xs+AZif5lnJErtu8TPy2aC0bc9wehTjMyvilTHfyerOD1ZJXhN2XwRVDGN7t7leAJZISJlPjqTDcw3Vfvzte/5JqS+FR+hbpG4uz2ix8kUa20u5YF2oSdGl8+zsdozVsdQm10Iv9WSXBV7t4m+oyodgtfzydBpmXq7aBXudCiEKw+7TC7F+1a4YFrVrCNXKFgKUpd1MiVLl7DIbzm5U9MD2BB3Fy7BPCzr3tW6/ExOhhpBWY+HnzVGQfkNr7dRcqfipKw== ae@dobutterfliescry.net" packages = with pkgs; [
]; ];
}; };
subspace = let
# override
wishlistBash =
pkgs.bash.override {
};
in {
isNormalUser = true;
shell = pkgs.bash;
home = "/home/subspace";
packages = with pkgs; [
wishlist
];
};
# user for friends to ssh into
friends = { friends = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.bash;
home = "/home/friends"; home = "/home/friends"; # TEMP: remove and replace with home-manager
packages = with pkgs; [
];
}; };
}; };
}; };
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
home-manager = {
users = {
ae = import ../../homes/ae;
subspace = import ../../homes/subspace;
};
sharedModules = [];
};
services = {
# simple nginx instance to host static construction page
# TODO: I want sshd and forgejo's ssh server to both be bound to port 22
# So change sshd to listen on a different address/port (ie 2222 or 127.0.0.3:22, etc)
# and change forgejo to use 127.0.0.2:22 (use port 22, ONLY change loopback address)
nginx = {
enable = true;
# in wake of CVE-2022-3602/CVE-2022-3786
package = pkgs.nginxStable.override {openssl = pkgs.libressl;};
#virtualHosts."imbored.dev".locations."/" = {
virtualHosts = {
"imbored.dev" = {
# "http:imbored.dev" = {
default = true;
# serverName = "imbored.dev";
# listenAddresses = ["imbored.dev"];
enableACME = true;
addSSL = true; # forceSSL = true;
root = "/var/www/imbored";
#index = "index.html";
#root = pkgs.writeTextDir "index.html" ''
# <html>
# <body>
# Give me your mittens!
# </body>
# </html>
#'';
};
# "ssh:imbored.dev" = {
# serverName = "imbored.dev";
# listen = [{
# addr = "imbored.dev";
# port= 22;
# }];
# locations."/".proxyPass = "ssh://127.0.0.1:2222";
# };
# Route "vault" subdomain to vaultwarden
"vault.imbored.dev" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://127.0.0.1:8222";
};
# Route "forge" subdomain to forgejo
"forge.imbored.dev" = {
# "https:forge.imbored.dev" = {
#serverName = "forge.imbored.dev";
#listenAddresses = ["forge.imbored.dev"]; # NOTE: I think this is wrong
enableACME = true; # TODO: maybe use `forgejo.settings.server.ENABLE_ACME` instead?
forceSSL = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://127.0.0.1:3000";
};
# NOTE: would it work if I used "ssh://forge.imbored.dev" and "https://forge.imbored.dev" instead?
# "ssh:forge.imbored.dev" = {
# serverName = "forge.imbored.dev";
# listen = [{
# addr = "forge.imbored.dev";
# port = 22;
# }];
# locations."/".proxyPass = "ssh://127.0.0.2:22";
# };
};
};
openssh = {
enable = true;
ports = [22];
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
AllowUsers = ["ae" "subspace"]; # allow all users by default
UseDns = true;
X11Forwarding = false;
};
};
vaultwarden = {
enable = true;
dbBackend = "sqlite";
# backupDir = "/var/backup/vaultwarden"; # disable with null
# https://mynixos.com/nixpkgs/option/services.vaultwarden.config
config = {
# internal address and port to listen on
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
# hostname to listen for
DOMAIN = "https://vault.imbored.dev";
SIGNUPS_ALLOWED = false;
};
# https://mynixos.com/nixpkgs/option/services.vaultwarden.environmentFile
environmentFile = "/var/lib/vaultwarden/vaultwarden.env";
};
# stalwart-mail = let
# domain = "imbored.dev";
# in {
# enable = false; # true;
# # openFirewall = true; # im doing this manually rn
# settings = {
# certificate."${domain}" = {
# cert = "file://${certs.${domain}.cert}";
# private-key = "file://${certs.${domain}.key}";
# };
# server = {
# hostname = domain;
# tls = {
# certificate = "${domain}";
# enable = true;
# implicit = false;
# };
# listener = {
# "smtp-submission" = {
# bind = ["127.0.0.1:587"];
# protocol = "smtp";
# };
# "imap" = {
# bind = ["127.0.0.1:143"];
# protocol = "imap";
# };
# };
# };
# session = {
# rcpt.directory = "in-memory";
# auth = {
# mechanisms = ["PLAIN"];
# directory = "in-memory";
# };
# };
# jmap.directory = "in-memory";
# queue.outbound.next-hop = ["local"];
# directory."in-memory" = {
# type = "memory";
# users = [
# {
# name = "me";
# secret = "foobar";
# email = ["me@${domain}"];
# }
# {
# name = "Emile";
# secret = "foobar";
# email = ["emile@${domain}"];
# }
# ];
# };
# };
# };
# more options here: https://mynixos.com/nixpkgs/options/services.forgejo
# TODO: set a favicon https://forgejo.org/docs/next/contributor/customization/#changing-the-logo
# (might need me to override settings in the nixpkg)
# TODO: create a custom theme for forgejo (modify the source files most likely)
forgejo = {
enable = true;
# enable support for Git Large File Storage
lfs.enable = true;
database = {
type = "sqlite3"; # postgres
host = "127.0.0.1";
port = "3306"; # 5432 if postgres
};
# settings are written directly to the `app.ini` config file
# refer to: https://forgejo.org/docs/latest/admin/config-cheat-sheet/
settings = {
server = {
# ENABLE_ACME = true;
# ACME_EMAIL = "eclarkboman@gmail.com"; # change this to "me@imbored.dev"
DOMAIN = "forge.imbored.dev"; # should this be "imbored.dev"?
ROOT_URL = "https://forge.imbored.dev"; # full public URL of the Forgejo server
# address and port to listen on
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3000;
PROTOCOL = "http"; # http internally, reverse proxy uses https externally
START_SSH_SERVER = true;
DISABLE_SSH = false;
SSH_PORT = 2222;
};
DEFAULT = {
APP_NAME = "Emile's Forge";
APP_SLOGIN = "Cozy";
APP_DISPLAY_NAME_FORMAT = "{APP_NAME}: {APP_SLOGAN}";
};
repository = {
DEFAULT_PRIVATE = "private"; # last, private, public
DEFAULT_PUSH_CREATE_PRIVATE = true;
MAX_CREATION_LIMIT = -1;
};
"repository.upload" = {
# max per-file size in MB
FILE_MAX_SIZE = 50;
# max number of files per upload
MAX_FILES = 5;
};
badges = let
# flat, flat-square, plastic, for-the-badge, social
style = "for-the-badge";
in {
ENABLED = true;
GENERATOR_URL_TEMPLATE = "https://img.shields.io/badge/{{.label}}-{{.text}}-{{.color}}?style=${style}";
};
ui = {
DEFAULT_THEME = "forgejo-dark";
THEMES = "forgejo-auto,forgejo-light,forgejo-dark";
};
"ui.meta" = {
AUTHOR = "Emile Clark-Boman - emileclarkb";
DESCRIPTION = "This is my personal self-hosted git forge, where I keep and maintain personal projects!";
KEYWORDS = "emileclarkb,git,forge,forgejo,self-hosted";
};
markdown = {
ENABLE_HARD_LINE_BREAK_IN_COMMENTS = true;
ENABLE_MATH = true;
};
admin = {
DEFAULT_EMAIL_NOTIFICATIONS = "enabled";
SEND_NOTIFICATION_EMAIL_ON_NEW_USER = true;
};
security = {
# Controls access to the installation page.
# When set to “true”, the installation page is not accessible.
#INSTALL_LOCK = false;
PASSWORD_HASH_ALGO = "argon2"; # ARGON2 BEST ALGO FR!!
MIN_PASSWORD_LENGTH = 12;
PASSWORD_COMPLEXITY = "lower,upper,digit,spec";
PASSWORD_CHECK_PWN = true;
};
service = {
# toggle to create an admin user
DISABLE_REGISTRATION = true;
#DEFAULT_USER_IS_RESTRICTED = true;
# Forbid login with third-party services (ie github)
ALLOW_ONLY_INTERNAL_REGISTRATION = true;
ENABLE_CAPTCHA = true;
REQUIRE_CAPTCHA_FOR_LOGIN = true;
REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA = true;
LOGIN_REMEMBER_DAYS = 365;
ENABLE_NOTIFY_MAIL = true;
};
"service.explore" = {
REQUIRE_SIGNIN_VIEW = false;
DISABLE_USERS_PAGE = false;
DISABLE_ORGANIZATIONS_PAGE = false;
DISABLE_CODE_PAGE = false;
};
cache = {
ADAPTER = "twoqueue";
HOST = "{\"size\":100, \"recent_ratio\":0.25, \"ghost_ratio\":0.5}";
ITEM_TTL = "16h";
};
# TODO: fill this in once my mail server is configured
# email.incoming = { ... };
# optional
# TODO: fill this in once my mail server is configured
mailer = {
ENABLED = false;
SMTP_ADDR = "mail.imbored.dev";
FROM = "noreply@imbored.dev";
USER = "noreply@imbored.dev";
};
log = {
MODE = "file";
LEVEL = "Info"; # "Trace", "Debug", "Info", "Warn", "Error", "Critical"
ENABLE_SSH_LOG = true;
};
cron = {
ENABLED = true;
RUN_AT_START = false;
};
other = {
SHOW_FOOTER_VERSION = true;
SHOW_FOOTER_TEMPLATE_LOAD_TIME = true;
SHOW_FOOTER_POWERED_BY = true;
ENABLE_SITEMAP = true;
ENABLE_FEED = true;
};
};
};
};
# accept Lets Encrypt's security policy (for nginx)
security.acme = {
acceptTerms = true;
# TODO: change this to me@imbored.dev
defaults.email = "eclarkboman@gmail.com";
};
environment.systemPackages = with pkgs; [
vim
helix
#wishlist
];
programs = {
fish.enable = true;
bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
};
#systemd.services.wishlist = {
# description = "Single entrypoint for multiple SSH endpoints";
# wantedBy = ["multi-user.target"];
#
# serviceConfig = {
# DynamicUser = "yes";
# ExecStart = "${pkgs.wishlist}/bin/wishlist serve --config /home/$USER/.ssh/config";
# Restart = "always";
# RestartSec = "2s";
# };
#};
system.stateVersion = "24.11"; # DO NOT MODIFY system.stateVersion = "24.11"; # DO NOT MODIFY
} }

View file

@ -1,7 +0,0 @@
{...}: {
imports = [
./services/forgejo.nix
./services/vaultwarden.nix
./services/nginx.nix
];
}

View file

@ -1,83 +0,0 @@
{
inputs,
pkgs,
...
}: {
nixpkgs.overlays = [
(self: super: {
# in wake of CVE-2022-3602/CVE-2022-3786
nginxStable = super.nginxStable.override {openssl = pkgs.libressl;};
})
inputs.dobutterfliescry-net.overlays.default
];
# simple nginx instance to host static construction page
# TODO: I want sshd and forgejo's ssh server to both be bound to port 22
# So change sshd to listen on a different address/port (ie 2222 or 127.0.0.3:22, etc)
# and change forgejo to use 127.0.0.2:22 (use port 22, ONLY change loopback address)
services.nginx = {
enable = true;
# XXX: TODO: this should auto use the nginxStable overlay no?
# in wake of CVE-2022-3602/CVE-2022-3786
# package = pkgs.nginxStable.override {openssl = pkgs.libressl;};
recommendedGzipSettings = true;
recommendedZstdSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# streamConfig = ''
# server {
# listen 127.0.0.1:53 udp reuseport;
# proxy_timeout 20s;
# proxy_pass 192.168.0.1:53535;
# }
# '';
virtualHosts = let
localhost = "http://127.0.0.1";
std = {
# TODO: should I run over QUIC+HTTP3? (experimental)
# quic = true;
# http3 = true;
enableACME = true;
# kTLS = true; # offload TLS to the linux kernel
};
vault =
{
forceSSL = true;
locations."/".proxyPass = "${localhost}:8222";
}
// std;
forge =
{
forceSSL = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "${localhost}:3000";
}
// std;
in {
"dobutterfliescry.net" =
{
default = true;
addSSL = true; # not strictly enforced <3
# root = "/var/www/cry";
root = "${pkgs.dobutterfliescry-net}/www";
# extraConfig = ''
# error_page 404 /custom_404.html;
# '';
}
// std;
# Route "vault" subdomain to vaultwarden
"vault.imbored.dev" = vault;
# Route "forge" subdomain to forgejo
# TODO: use `forgejo.settings.server.ENABLE_ACME` instead?
# "tearforge.net" = forge;
"forge.dobutterfliescry.net" = forge;
};
};
}

83
hosts/imbored/default.nix Executable file
View file

@ -0,0 +1,83 @@
{
pkgs,
inputs,
lib,
...
}: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/master.tar.gz";
sha256 = "19w63qccz78v0spx03911z98w1bvlxvd07hb0ma14a4vdzi4ninj";
};
in {
# TODO:
# - add github:charmbracelet/soft-serve
# - add forgejo
imports = [
../modules/server/nginx.nix
../modules/server/ssh.nix
../modules/server/fail2ban.nix
];
system.stateVersion = "24.05";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
time.timeZone = "Australia/Brisbane";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
boot.loader = {
# TODO
};
networking = {
hostName = "imbored";
networkmanager.enable = true;
firewall.allowedTCPPorts = [
22 # sshd
]
};
users = {
defaultUserShell = pkgs.bash;
users = {
# primary user
dev = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.bash;
packages = with pkgs; [
];
};
# user for friends to ssh into
friends = {
isNormalUser = true;
shell = pkgs.bash;
packages = with pkgs; [
];
};
};
};
#home-manager = {
# users = {
# dev = import ../../homes/dev;
# friends = import ../../homes/friends;
# };
#};
environment.SystemPackages = with pkgs; [
];
programs = {
};
}

View file

@ -1,20 +1,297 @@
{...}: { {
pkgs,
inputs,
lib,
...
}: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz";
sha256 = "15k41il0mvmwyv6jns4z8k6khhmb22jk5gpcqs1paym3l01g6abn";
};
in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
(import "${home-manager}/nixos")
inputs.spicetify-nix.nixosModules.default
]; ];
programs.spicetify = let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
enable = true;
enabledExtensions = with spicePkgs.extensions; [
adblock
hidePodcasts
shuffle # shuffle+ (special characters are sanitized out of extension names)
];
#theme = spicePkgs.themes.catppuccin;
#colorScheme = "mocha";
};
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
efiSupport = true;
#efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work on this system
device = "nodev";
useOSProber = true;
};
# GitHub: vinceliuice/grub2-themes
grub2-theme = {
enable = true;
theme = "whitesur"; # stylish, vimix, or whitesur
footer = true;
customResolution = "1920x1080"; # Optional: Set a custom resolution
};
};
# Set your time zone.
time.timeZone = "Australia/Brisbane";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
#packages = with pkgs; [
# nerdfonts
#];
};
# ----- NETWORKING SECTION -----
networking.hostName = "lolcathost"; networking.hostName = "lolcathost";
networking.networkmanager.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = true;
# ----- SERVICES ----- # ----- SERVICES -----
services = { services = {
# dbus = { # Set display manager (login screen)
# # NOTE: programs.uwsm.enable sets implementation to dbus-broker, displayManager = {
# # NOTE: however this seems to break dbus # sddm relies on pkgs.libsForQt5.qt5.qtgraphicaleffects
# implementation = lib.mkForce "dbus"; sddm = {
enable = true;
wayland.enable = true; # enable experimental sddm support for wayland
theme = "corners";
};
defaultSession = "hyprland";
};
# Enable sound
#hardware.pulseaudio.enable = false;
pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# Enable touchpad support
libinput.enable = true;
tumbler.enable = true; # Thunar image thumbnail support
gvfs.enable = true; # Thunar mount, trash, and other functionality
};
security.rtkit.enable = true; # I *think* this is for pipewire
# allow wheel group to use passwordless sudo
users = {
# using fish as the login shell tends
# to go very poorly because it isn't
# POSIX compliant, so we'll just use
# simple Bash then :)
defaultUserShell = pkgs.bash;
users = {
# literally me fr (personal account)
me = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.bash; #pkgs.fish
packages = with pkgs; [
firefox
nitch
starfetch
# flatpak requires gnome-software
# for graphical applications
flatpak
gnome-software
];
};
# user for my professional jobs and stuff
ae = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.bash; #pkgs.fish
packages = with pkgs; [
];
};
# # This is the user account for servers
# dev = {
# isNormalUser = true;
# extraGroups = ["wheel"];
# shell = pkgs.bash; #pkgs.zsh
# packages = with pkgs; [
# ];
# }; # };
# Touchpad support # user for friends to ssh into
libinput.enable = true; friends = {
isNormalUser = true;
shell = pkgs.fish;
packages = with pkgs; [
];
};
};
};
home-manager = {
users.me = import ../../homes/me;
sharedModules = [
inputs.nixcord.homeManagerModules.nixcord
inputs.ags.homeManagerModules.default
{nixpkgs.overlays = [inputs.hyprpanel.overlay];}
];
};
# ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [
# User Environment
inputs.swww.packages.${pkgs.system}.swww
helvum
easyeffects
ani-cli
wl-clipboard # clipboard for wayland
hyprpicker
(callPackage ../sddm-theme-corners.nix {}).sddm-theme-corners
# dependencies for my sddm theme:
pkgs.libsForQt5.qt5.qtgraphicaleffects
python311 # I use 3.11 since it's in a pretty stable state now
poetry # python dependency management and packaging
# fish plugins
grc # colorise command outputs
httpie
curlie
zoxide
doggo
tldr
btop
# Pretty necessary
git
brightnessctl
acpi
vim
# Unix Commands
wget
tree
unzip
];
# Enable the use of certain programs
programs = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
xwayland.enable = true;
};
zsh.enable = true;
fish.enable = true;
# I want to use fish as my login shell but it always goes terrible
# cause it isn't POSIX compliant, so instead Bash is my login and
# will just exec fish (^-^)
bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
# Thunar also uses: `services.tumbler` & `services.gvfs`
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-volman # for removable drives (ie USBs)
thunar-archive-plugin # create and extract archives
thunar-media-tags-plugin # change metadata for media files
];
};
};
# ----- FONTS -----
fonts = {
enableDefaultPackages = true; # no clue what this line does tbh
packages = with pkgs; [
#(nerdfonts.override {
# fonts = [
# "Cousine"
# "Iosevka"
# "JetBrainsMono"
# ];
# })
nerdfonts
geist-font # for my hyprlock theme
# texlive maintains a noto-emoji flake
texlivePackages.noto-emoji
];
# TODO: change my default fonts
fontconfig = {
defaultFonts = {
serif = ["Iosevka"]; # TODO: package Iosevka Etoile since Iosevka isn't a serif font
sansSerif = ["Iosevka "];
monospace = ["Cousine"];
emoji = ["Noto Emoji"];
};
};
};
# Enable the new CLI commands and the flakes as experimental features
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Enable OpenGL
hardware = {
graphics.enable = true;
}; };
# DO NOT MODIFY # DO NOT MODIFY

View file

@ -1,25 +0,0 @@
{
pkgs,
upkgs,
dotnetVersions ? [8 9 10],
...
}: {
imports = [
../langs/dotnet.nix
];
environment.systemPackages = with pkgs; [
# Ensure latest stable Rider version (not necessarily stable on NixOS)
upkgs.jetbrains.rider
# NOTE: Blazor requires a Chromium-based browser
chromium
];
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
icu
];
};
}

View file

@ -1,6 +0,0 @@
{...}: {
programs.winbox = {
enable = true;
openFirewall = false; # port: 5678
};
}

View file

@ -1,27 +0,0 @@
{pkgs, ...}: {
# I want to use fish as my login shell but it always goes terrible
# cause it isn't POSIX compliant, so instead Bash is my login and
# will just exec fish (^-^)
programs = {
fish.enable = true;
bash = {
blesh.enable = false; # ble.sh replacement for GNU readline
completion.enable = true;
interactiveShellInit = ''
# help bash transition into a beautiful fish!
if [[ -z $CRY_BASH_IS_TRANS ]]
then
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
fi
# bash is trans now! (no more transitioning required)
export CRY_BASH_IS_TRANS=true
'';
};
};
}

View file

@ -1,61 +0,0 @@
{
lib,
pkgs,
upkgs,
...
}: let
dotnetVersions = [8 9 10];
dotnetCombined =
pkgs.dotnetCorePackages.combinePackages
(builtins.concatMap
(v: let
# dotnet = pkgs.dotnetCorePackages."dotnet_${builtins.toString x}";
in [
# dotnet.sdk
# the runtime+aspnetcore packaged with the sdk
pkgs.dotnetCorePackages."sdk_${builtins.toString v}_0"
])
dotnetVersions);
# Custom packaged tools
dotnetTools = with lib; {
uno-check = with pkgs.dotnetCorePackages;
buildDotnetGlobalTool {
pname = "Uno.Check";
version = "1.32.17";
nugetHash = "sha256-BfTVF5uHu9/nyLXqdDEOHCxq6BVQWhsnDBbARzdLDAE=";
executables = "uno-check";
dotnet-sdk = dotnet_9.sdk;
dotnet-runtime = dotnet_9.runtime;
meta = {
homepage = "https://github.com/unoplatform/uno.check";
license = licenses.mit;
maintainers = [maintainers.emileclarkb];
};
};
};
in {
environment.systemPackages = with pkgs; [
# .NET
dotnetCombined
# .NET Tools
dotnetTools.uno-check
# Mono
mono
# NOTE: nixupkgs uses .NET8 SDK
# WARNING: nixpkgs-25.05 uses .NET6 SDK (now marked insecure)
upkgs.msbuild
# .NET Framework Tools/Services
omnisharp-roslyn
netcoredbg
];
}

View file

@ -1,5 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
obsidian
];
}

View file

@ -1,57 +0,0 @@
{
pkgs,
lib,
...
}: {
# nixpkgs.config.allowUnfreePredicate = pkg:
# builtins.elem (lib.getName pkg) [
# "steam"
# "steam-original"
# "steam-unwrapped"
# "steam-run"
# ];
nixpkgs.overlays = [
(self: super: {
lutris = super.lutris.overrideAttrs (final: prev: {
# WARNING: pkgs.mbedtls_2 is marked insecure!
# Replace pkgs.mbedtls_2 (v2.28.10) with pkgs.mbedtls (v3.6.4)
targetPkgs = pkgs: (
(builtins.filter (p: p != pkgs.mbedtls_2) (prev.targetPkgs pkgs))
++ [pkgs.mbedtls]
);
});
})
];
programs = {
steam = {
enable = true;
gamescopeSession.enable = false; # .desktop entry for gamescope
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
};
gamemode.enable = true;
};
environment.systemPackages = with pkgs; [
steamcmd
mangohud
protonup-qt
# XXX: DEBUG: disable lutris
# XXX: NOTE: pkgs.lutris depends on pkgs.mbedtls_2 which is marked insecure!
# XXX: NOTE: Use the provided overlay to patch pkgs.mbedtls_2 -> pkgs.mbedtls
# lutris
bottles
heroic
];
}

View file

@ -1,13 +0,0 @@
{pkgs, ...}: {
environment.defaultPackages = with pkgs; [
hyprsunset
];
programs = {
hyprland = {
enable = true;
withUWSM = true; # Universal Wayland Session Manager
xwayland.enable = true;
};
};
}

View file

@ -1,64 +1,226 @@
{ {
pkgs, pkgs,
upkgs, inputs,
lib,
wishlist,
... ...
}: { }: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz";
sha256 = "1dga3vsd60v9mfyhwgbil13mrchw5crbpgh4zjw9fghv1vyk89vq";
};
in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
(import "${home-manager}/nixos")
inputs.spicetify-nix.nixosModules.default
]; ];
networking = { programs.spicetify = let
hostName = "myputer"; spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
firewall = { enable = true;
allowedTCPPorts = [ enabledExtensions = with spicePkgs.extensions; [
22 # SSH adblock
80 # HTTP hidePodcasts
443 # HTTPS shuffle # shuffle+ (special characters are sanitized out of extension names)
5678 # MikroTik WinBox
25565 # Minecraft LAN
]; ];
#theme = spicePkgs.themes.catppuccin;
#colorScheme = "mocha";
};
boot.loader.systemd-boot.enable = false;
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi"; #/boot/efi
};
grub = {
efiSupport = true;
#efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work on this system
device = "nodev";
#useOSProber = true;
};
grub2-theme = {
enable = true;
theme = "whitesur"; # stylish, vimix, or whitesur
footer = true;
customResolution = "1920x1080";
}; };
}; };
# Set your time zone.
time.timeZone = "Australia/Brisbane";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
# ----- NETWORKING SECTION -----
networking.hostName = "myputer";
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = true;
# ----- SERVICES ----- # ----- SERVICES -----
services = { services = {
flatpak.enable = true; # Set display manager (login screen)
displayManager = {
sddm = {
enable = true;
wayland.enable = true; # enable experimental sddm support for wayland
theme = "corners";
};
defaultSession = "hyprland";
}; };
# ------- USERS ------- # Enable sound
pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
tumbler.enable = true; # Thunar image thumbnail support
gvfs.enable = true; # Thunar mount, trash, and other functionality
};
security.rtkit.enable = true; # I *think* this is for pipewire
# allow wheel group to use passwordless sudo
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
users = { users = {
# using fish as the login shell tends
# to go very poorly because it isn't
# POSIX compliant, so we'll just use
# simple Bash then :)
defaultUserShell = pkgs.bash;
users = { users = {
# just me fr (personal account) # just me fr (personal account)
me = { me = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "netdev" "docker"]; extraGroups = ["wheel" "docker"];
shell = pkgs.bash; shell = pkgs.bash; #pkgs.fish
packages = with pkgs; [ packages = let
# TODO: can I just do this: https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake#url-like-syntax
# instead to use colmena's flake.nix by specifying a rev hash in the flake input?
colmena-src = pkgs.fetchFromGitHub {
owner = "zhaofengli";
repo = "colmena";
rev = "47b6414d800c8471e98ca072bc0835345741a56a";
sha256 = "rINodqeUuezuCWOnpJgrH7u9vJ86fYT+Dj8Mu8T/IBc=";
};
colmena-new = pkgs.callPackage "${colmena-src}/package.nix" {};
in
with pkgs; [
firefox firefox
nitch nitch
starfetch starfetch
colmena-latest # flatpak requires gnome-software
flatpak
gnome-software
colmena-new
gitkraken gitkraken
# NOTE: downloadthing this causes my PC to freak!! ("too many open files" error) # NOTE: downloadthing this causes my PC to freak!! ("too many open files" error)
#keyguard # bitwarden client app #keyguard # bitwarden client app
]; ];
}; };
# user for my professional jobs and stuff
ae = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.bash; #pkgs.fish
packages = with pkgs; [
];
}; };
}; };
};
home-manager = {
users.me = import ../../homes/me;
sharedModules = [
inputs.nixcord.homeManagerModules.nixcord
inputs.ags.homeManagerModules.default
{nixpkgs.overlays = [inputs.hyprpanel.overlay];}
];
};
# set environment variables
environment.sessionVariables = {
# folder names with capitalisation look awful!
XDG_DOWNLOAD_DIR = "$HOME/downloads";
# Hint Electrons apps to use Wayland
NIXOS_OZONE_WL = "1";
};
# ---- SYSTEM PACKAGES ----- # ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# User Environment # User Environment
libreoffice inputs.swww.packages.${pkgs.system}.swww
helvum
easyeffects
pavucontrol
ani-cli
wl-clipboard # clipboard for wayland
hyprpicker
# Games #(callPackage ../sddm-theme-corners.nix {}).sddm-theme-corners
prismlauncher # minecraft # dependencies for my sddm theme:
upkgs.olympus # CELESTE!! <3 :3 pkgs.libsForQt5.qt5.qtgraphicaleffects
discord
python311 # I use 3.11 since it's in a pretty stable state now
poetry # python dependency management and packaging
nixd # lsp for nix
neofetch # TODO: remove (installed to debug something)
# fish plugins
grc # colorise command outputs
httpie
curlie
zoxide
doggo
tldr
#btop
tesseract # for my work with Agribit
# TODO: remove this and host my nix flake on github instead
#wishlist
# Pretty necessary
git
brightnessctl
acpi
vim
nix-prefetch-git
# Unix Commands
wget
tree
unzip
# Cryptography
openssl
libargon2
]; ];
# DEBUG: configuring xdg portal here instead? # DEBUG: configuring xdg portal here instead?
@ -77,6 +239,121 @@
# ]; # ];
#}; #};
# Enable the use of certain programs
programs = {
hyprland = {
enable = true;
# TODO: uncomment, I did this when hyprland wasn't working
#package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
#portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
xwayland.enable = true;
};
zsh.enable = true;
fish.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
set number
set tabstop=4
set shiftwidth=4
'';
};
};
# I want to use fish as my login shell but it always goes terrible
# cause it isn't POSIX compliant, so instead Bash is my login and
# will just exec fish (^-^)
bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
# Thunar also users: `services.tumbler` & `services.gvfs`
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-volman # for removable drives (ie USBs)
thunar-archive-plugin # create and extract archives
thunar-media-tags-plugin # change metadata for media files
];
};
# mozilla's email client
thunderbird.enable = true;
};
# ----- FONTS -----
fonts = {
enableDefaultPackages = true; # no clue what this line does tbh
packages = with pkgs; [
/*
(nerdfonts.override {
fonts = [
"Cousine" # its already i guess
"Iosevka" # nah nah
"IosevkaTerm" # big nah
"CascadiaCode" # potential
"FiraCode" # potential
"JetBrainsMono" # for my rofi theme
"Hasklig"
"Hack"
];
})
*/
nerdfonts
geist-font # for my hyprlock theme
# texlive maintains a noto-emoji flake
texlivePackages.noto-emoji
];
# TODO: change my default fonts
fontconfig = {
defaultFonts = {
serif = ["Iosevka"];
sansSerif = ["Iosevka "];
monospace = ["Cousine"];
emoji = ["Noto Emoji"];
};
};
};
# Enable the new CLI commands and the flakes as experimental features
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
#programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
#};
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Enable OpenGL
hardware = {
graphics.enable = true;
};
# DO NOT MODIFY # DO NOT MODIFY
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View file

@ -1,8 +1,8 @@
{pkgs}: { {pkgs}: {
sddm-theme-corners = pkgs.stdenv.mkDerivation { sddm-theme-corners = pkgs.stdenv.mkDerivation rec {
name = "sddm-theme-corners"; name = "sddm-theme-corners";
version = "1.0.0"; #version = "1.0";
#dontBuild = true;
installPhase = '' installPhase = ''
mkdir -p $out/share/sddm/themes mkdir -p $out/share/sddm/themes
cp -ar $src/corners $out/share/sddm/themes/ cp -ar $src/corners $out/share/sddm/themes/

0
modules/core/sound/default.nix Executable file
View file

29
modules/discord/nixcord.nix Executable file
View file

@ -0,0 +1,29 @@
{
lib,
pkgs,
config,
inputs,
outputs,
...
}:
{
imports = [
config.nixcord.homeManagerModules.nixcord
];
programs.nixcord = {
enable = true;
config = {
#themeLinks = [
# ""
#];
# no surrounding window frame
frameless = true;
plugins = {
};
};
};
}

View file

@ -1,12 +1,12 @@
# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland)
# and your home-manager config (for managing hyprland's config files)
{ {
pkgs, pkgs,
inputs, inputs,
config, config,
lib, lib,
... ...
}: { }:
{
options.hyprland = { options.hyprland = {
enable = lib.mkEnableOption "Hyprland"; enable = lib.mkEnableOption "Hyprland";
}; };

72
modules/wishlist.nix Normal file
View file

@ -0,0 +1,72 @@
{
description = "Wishlist: Your SSH directory."
inputs = {
};
outputs = {
self
}: let
nixosModule = {
config,
lib,
pkgs,
...
}: {
options.services.wishlist = {
enable = lib.mkEnableOption "Your SSH directory.";
port = lib.mkOption {
type = lib.types.port;
default = 22;
description = "Port to listen on";
};
};
config = lib.mkIf config.services.wishlist.enable {
# configure the systemd service
systemd.services.wishlist = {
description = "Your SSH directory.";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${self.packages.${pkgs.system}.default}/bin/wishlist";
Restart = "always";
Type = "simple";
DynamicUser = "yes";
};
# environment variables
environment = {
};
};
};
};
in
(flake-utils.lib.eachDefaultSystem (system: let
gopkg = go-nixpkgs.legacyPackages.${system};
in {
packages.default = gopkg.buildGoModule ############################
}))
buildGoModule rec { # is rec necessary?
pname = "wishlist";
version = "0.15.1"
src = fetchFromGithub {
owner = "charmbracelet";
repo = "wishlist";
rev = "v${version}";
hash = "0c9g1s8j9znzd1mw61d0klc6sqri0wx6hljibxdwzi3cabfy3ld6";
};
vendorSha256 = lib.fakeSha256;
meta = with lib; {
homepage = "https://github.com/charmbracelet/wishlist";
description = "Your SSH directory.";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ caarlos0 ];
};
};
}

22
modules/wishlist.nix.bak Normal file
View file

@ -0,0 +1,22 @@
{lib}: {
buildGoModule rec { # is rec necessary?
pname = "wishlist";
version = "0.15.1"
src = fetchFromGithub {
owner = "charmbracelet";
repo = "wishlist";
rev = "v${version}";
hash = "0c9g1s8j9znzd1mw61d0klc6sqri0wx6hljibxdwzi3cabfy3ld6";
};
vendorSha256 = lib.fakeSha256;
meta = with lib; {
homepage = "https://github.com/charmbracelet/wishlist";
description = "Your SSH directory.";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ caarlos0 ];
};
};
}

View file

@ -1,17 +0,0 @@
[
(self: super: {
angry-oxide = import ../packages/angryoxide {
pkgs = super;
inherit
(super)
lib
;
};
ekphos = import ../packages/ekphos {
pkgs = super;
};
x86-manpages = import ../packages/x86-manpages {
pkgs = super;
};
})
]

View file

@ -1,5 +0,0 @@
This directory (`hosts/packages`) contains custom package derivations, and differs
from `hosts/modules/` which contains importable modules for my nixdots.
Often each package I write will have a corresponding module that simply
calls `pkgs.callPackage` to install the derivation to the system environment.

View file

@ -1,84 +0,0 @@
{
pkgs,
lib,
...
}: let
# shared/global properties
angryoxide-owner = "Ragnt";
angryoxide-pname = "AngryOxide";
angryoxide-version = "0.8.32";
angryoxide-meta = {
homepage = "https://github.com/${angryoxide-owner}/${angryoxide-pname}";
license = lib.licenses.gpl3;
maintainers = [lib.maintainers.emileclarkb];
};
# "Vendored LibWifi used in AngryOxide"
angryoxide-libwifi-src = pkgs.fetchFromGitHub {
owner = angryoxide-owner;
repo = "libwifi";
# this specific revision is requested (by rev "e1352..." of AngryOxide)
rev = "71268e1898ad88b8b5d709e186836db417b33e81";
sha256 = "0af9y7bvr3rban6bslsd9smrvibfp1b7d4nfw7wkdxfp49kx6zyr";
};
# Using `mkDerivation` not `buildRustPackage` because
# AngryOxide uses Git submodules for a patched version of "LibWifi",
# and these aren't moved into `/build/source/libs/` for the `buildPhase`.
# Simply fix right? Well no I can't override `buildPhase`...
angryoxide-src = pkgs.stdenv.mkDerivation rec {
pname = "${angryoxide-pname}-source";
version = angryoxide-version;
src = pkgs.fetchFromGitHub {
owner = "Ragnt";
repo = pname;
rev = "e1352c8aad370efa8db69d175686e4353c6002bd";
sha256 = "07nhvy7kp7z4y0fdslv56pw7kz6idcpma42f4hyilrmazjbbjmja";
# clone git submodules (needed for the rust workspace libs)
fetchSubmodules = true;
};
buildPhase = ''
# ensure $out and /libwifi paths exist
mkdir -p $out/libs/libwifi
# copy only the necessary source files
cp Cargo.toml Cargo.lock $out/
cp -r $src/.cargo $src/assets $src/completions $src/libs $src/src $out/
# ensure libwifi submodule is copied to the build environment
cp -r ${angryoxide-libwifi-src}/. $out/libs/libwifi/
'';
installPhase = let
# SOURCE
completionScriptBash = "completions/bash_angry_oxide_completions";
# DESTINATION
completionDirBash = "$out/share/bash-completion/completions";
in ''
# mkdir -p $out/bin
#mkdir $out/bin
#cp target/release/angryoxide $out/bin
# add bash completions
#mkdir -p ${completionDirBash}
#cp ${completionScriptBash} ${completionDirBash}/angryoxide
'';
meta =
{
description = "AngryOxide's source files isolated by (@emileclarkb) into a separate Nix derivation.";
}
// angryoxide-meta;
};
in
pkgs.rustPackages.rustPlatform.buildRustPackage {
pname = angryoxide-pname;
version = angryoxide-version;
src = angryoxide-src;
cargoHash = "sha256-mry4l0a7DZOWkrChU40OVRCBjKwI39cyZtvEBA5tro0=";
meta =
{
description = "802.11 Attack Tool";
}
// angryoxide-meta;
}

View file

@ -1 +0,0 @@
- [ ] Try using `gitHashes` argument instead of patching? (on chameleonultragui package)

View file

@ -1,483 +0,0 @@
{
pkgs,
lib,
makeDesktopItem,
copyDesktopItems,
...
}:
# ChameleonUltraGUI requires flutter sdk >3.0.0
pkgs.flutter324.buildFlutterApplication
rec {
pname = "ChameleonUltraGUI";
version = "1.1.2";
src = pkgs.fetchFromGitHub {
owner = "GameTec-live";
repo = "ChameleonUltraGUI";
sha256 = "1mb6wkqk6vaamrhflfhsgp5gvqiw2qkvmy7j65abcx7sn5990i27";
rev = "11424abaccb4a010fcbeab9799ae8f675d8afe99";
};
desktopItems = [
(makeDesktopItem {
name = pname;
desktopName = pname;
genericName = pname;
icon = "chameleonultragui";
comment = meta.description;
exec = "chameleonultragui %u";
type = "Application";
terminal = false;
categories = ["Utility"];
keywords = [
"Flutter"
"share"
"files"
"chameleon"
"chameleonultra"
"chameleonlite"
];
})
];
# path to application within fetched sources
sourceRoot = "source/chameleonultragui";
buildInputs = [
pkgs.imagemagick # creating mipmaps for share/icons
pkgs.yj # converting pubspec.lock yaml->json
];
nativeBuildInputs = [
copyDesktopItems
];
buildArguments = ["--release"];
# source files compile with Flutter >3.29.0 but this
# derivation uses 3.24.0 (so we patch for compatability)
postPatch = let
argbPatch = ''
--- general.dart.old 2025-05-11 15:59:51.812132078 +1000
+++ general.dart 2025-05-11 15:58:14.755856407 +1000
@@ -211,7 +211,7 @@
}
String colorToHex(Color color) {
- return '#\''${color.toARGB32().toRadixString(16).padLeft(8, '0').substring(2)}';
+ return '#\''${color.value.toRadixString(16).padLeft(8, '0').substring(2)}';
}
Color hexToColor(String hex) {
'';
in ''
# patch source files using Color.toARGB32 method (not defined in Flutter 3.24)
argbPatch="${argbPatch}"
patch lib/helpers/general.dart <(echo "$argbPatch")
'';
postInstall = ''
# create mipmaps of desktop logo
logoOriginal="assets/logo-color-desktop.png"
for i in 16 32 64 128 256 512; do
res="$i"x"$i"
d="$out"/share/icons/hicolor/"$res"/apps
mkdir -p $d
${pkgs.imagemagick}/bin/magick $logoOriginal -resize $res $d/chameleonultragui.png
done
'';
# Nix doesn't natively have a fromYAML function (so I made this instead)
pubspecLock = let
appRoot = "${src}/chameleonultragui";
# when generating patch files use -u flag and then
# make sure to escape all " characters for Nix string
pubspecLockPatch = ''
--- pubspec.lock.bak2025-05-10 15:42:44.287730979 +1000
+++ pubspec.lock2025-05-10 15:41:23.778480048 +1000
@@ -5,18 +5,23 @@
dependency: transitive
description:
name: _fe_analyzer_shared
- sha256: dc27559385e905ad30838356c5f5d574014ba39872d732111cd07ac0beff4c57
+ sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
url: \"https://pub.dev\"
source: hosted
- version: \"80.0.0\"
+ version: \"72.0.0\"
+ _macros:
+ dependency: transitive
+ description: dart
+ source: sdk
+ version: \"0.3.2\"
analyzer:
dependency: transitive
description:
name: analyzer
- sha256: \"192d1c5b944e7e53b24b5586db760db934b177d4147c42fbca8c8c5f1eb8d11e\"
+ sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
url: \"https://pub.dev\"
source: hosted
- version: \"7.3.0\"
+ version: \"6.7.0\"
archive:
dependency: \"direct main\"
description:
@@ -37,26 +42,26 @@
dependency: \"direct main\"
description:
name: async
- sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
+ sha256: \"947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c\"
url: \"https://pub.dev\"
source: hosted
- version: \"2.12.0\"
+ version: \"2.11.0\"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
- sha256: \"8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea\"
+ sha256: \"6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66\"
url: \"https://pub.dev\"
source: hosted
- version: \"2.1.2\"
+ version: \"2.1.1\"
characters:
dependency: transitive
description:
name: characters
- sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
+ sha256: \"04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.4.0\"
+ version: \"1.3.0\"
checked_yaml:
dependency: transitive
description:
@@ -77,18 +82,18 @@
dependency: transitive
description:
name: clock
- sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
+ sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: \"https://pub.dev\"
source: hosted
- version: \"1.1.2\"
+ version: \"1.1.1\"
collection:
dependency: \"direct main\"
description:
name: collection
- sha256: \"2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76\"
+ sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: \"https://pub.dev\"
source: hosted
- version: \"1.19.1\"
+ version: \"1.18.0\"
convert:
dependency: \"direct main\"
description:
@@ -157,10 +162,10 @@
dependency: transitive
description:
name: fake_async
- sha256: \"6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc\"
+ sha256: \"511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.3.2\"
+ version: \"1.3.1\"
ffi:
dependency: \"direct main\"
description:
@@ -196,11 +201,10 @@
file_saver:
dependency: \"direct main\"
description:
- path: \".\"
- ref: fix-windows
- resolved-ref: \"3038d74d5560dcca528423fffd745abf31eb88ae\"
- url: \"https://github.com/Foxushka/file_saver.git\"
- source: git
+ name: file_saver
+ sha256: \"017a127de686af2d2fbbd64afea97052d95f2a0f87d19d25b87e097407bf9c1e\"
+ url: \"https://pub.dev\"
+ source: hosted
version: \"0.2.14\"
fixnum:
dependency: transitive
@@ -234,11 +238,10 @@
flutter_libserialport:
dependency: \"direct main\"
description:
- path: \".\"
- ref: main
- resolved-ref: \"6740aae075505a220a98492910b090824efc7910\"
- url: \"https://github.com/NeariX67/flutter_libserialport.git\"
- source: git
+ name: flutter_libserialport
+ sha256: d193b5ac819db6540d20cc8d20d9f5ec9e3396edb4d2c4a23c97863fa9132336
+ url: \"https://pub.dev\"
+ source: hosted
version: \"0.5.0\"
flutter_lints:
dependency: \"direct dev\"
@@ -347,18 +350,18 @@
dependency: transitive
description:
name: leak_tracker
- sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
+ sha256: \"3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05\"
url: \"https://pub.dev\"
source: hosted
- version: \"10.0.8\"
+ version: \"10.0.5\"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
- sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
+ sha256: \"932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806\"
url: \"https://pub.dev\"
source: hosted
- version: \"3.0.9\"
+ version: \"3.0.5\"
leak_tracker_testing:
dependency: transitive
description:
@@ -399,14 +402,22 @@
url: \"https://pub.dev\"
source: hosted
version: \"1.3.0\"
+ macros:
+ dependency: transitive
+ description:
+ name: macros
+ sha256: \"0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536\"
+ url: \"https://pub.dev\"
+ source: hosted
+ version: \"0.1.2-main.4\"
matcher:
dependency: transitive
description:
name: matcher
- sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
+ sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: \"https://pub.dev\"
source: hosted
- version: \"0.12.17\"
+ version: \"0.12.16+1\"
material_color_utilities:
dependency: transitive
description:
@@ -419,10 +430,10 @@
dependency: transitive
description:
name: meta
- sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
+ sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: \"https://pub.dev\"
source: hosted
- version: \"1.16.0\"
+ version: \"1.15.0\"
mobile_scanner:
dependency: \"direct main\"
description:
@@ -467,10 +478,10 @@
dependency: \"direct main\"
description:
name: path
- sha256: \"75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5\"
+ sha256: \"087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.9.1\"
+ version: \"1.9.0\"
path_provider:
dependency: transitive
description:
@@ -723,15 +734,15 @@
dependency: transitive
description: flutter
source: sdk
- version: \"0.0.0\"
+ version: \"0.0.99\"
source_span:
dependency: transitive
description:
name: source_span
- sha256: \"254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c\"
+ sha256: \"53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.10.1\"
+ version: \"1.10.0\"
sprintf:
dependency: transitive
description:
@@ -744,42 +755,42 @@
dependency: transitive
description:
name: stack_trace
- sha256: \"8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1\"
+ sha256: \"73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.12.1\"
+ version: \"1.11.1\"
stream_channel:
dependency: transitive
description:
name: stream_channel
- sha256: \"969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d\"
+ sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: \"https://pub.dev\"
source: hosted
- version: \"2.1.4\"
+ version: \"2.1.2\"
string_scanner:
dependency: transitive
description:
name: string_scanner
- sha256: \"921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43\"
+ sha256: \"556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde\"
url: \"https://pub.dev\"
source: hosted
- version: \"1.4.1\"
+ version: \"1.2.0\"
term_glyph:
dependency: transitive
description:
name: term_glyph
- sha256: \"7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e\"
+ sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: \"https://pub.dev\"
source: hosted
- version: \"1.2.2\"
+ version: \"1.2.1\"
test_api:
dependency: transitive
description:
name: test_api
- sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
+ sha256: \"5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb\"
url: \"https://pub.dev\"
source: hosted
- version: \"0.7.4\"
+ version: \"0.7.2\"
typed_data:
dependency: transitive
description:
@@ -855,12 +866,11 @@
usb_serial:
dependency: \"direct main\"
description:
- path: \".\"
- ref: fix-usbserial
- resolved-ref: \"9fcbacc92bec19ea02d33a40d9f39e45d19cf637\"
- url: \"https://github.com/Foxushka/usbserial.git\"
- source: git
- version: \"0.5.1\"
+ name: usb_serial
+ sha256: a605a600e34e7f28d4e80851ca3999ef747e42e406138887b8a88b8c382a8b07
+ url: \"https://pub.dev\"
+ source: hosted
+ version: \"0.5.2\"
uuid:
dependency: \"direct main\"
description:
@@ -881,10 +891,10 @@
dependency: transitive
description:
name: vm_service
- sha256: \"0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14\"
+ sha256: \"5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d\"
url: \"https://pub.dev\"
source: hosted
- version: \"14.3.1\"
+ version: \"14.2.5\"
wakelock_plus:
dependency: \"direct main\"
description:
@@ -958,5 +968,5 @@
source: hosted
version: \"2.2.1\"
sdks:
- dart: \">=3.7.0-0 <4.0.0\"
+ dart: \">=3.5.0 <4.0.0\"
flutter: \">=3.24.0\"
'';
in
builtins.fromJSON
(
builtins.readFile (pkgs.runCommand "${pname}-buildenv" {
inputs = [
# DEBUG (both lines commented)
#pkgs.flutter324 # ChameleonUltraGUI requires sdk >3.0.0
#pkgs.yj
];
} ''
# copy source files to a temporary path to rebuild the lockfile
buildPath=$(mktemp -d)
cp -r "${appRoot}/." "$buildPath/"
outPubspecLock="$buildPath/pubspec.lock"
# MUST define variables to use multiline Nix string in bash scripting
pubspecLockPatch="${pubspecLockPatch}"
# apply the pubspec.yaml patch and regenerate lock file
# (create a temporary home directory for flutter to play in)
#(cd $buildPath && chmod -R +w . \
# && patch ./pubspec.yaml <(echo "$pubspecYamlPatch") \
# && export HOME=$(mktemp -d) \
# && flutter --disable-analytics \
# && flutter config --no-cli-animations \
# && ${pkgs.flutter}/bin/flutter pub get)
# patch the lockfile
chmod +w $outPubspecLock
patch $outPubspecLock <(echo "$pubspecLockPatch")
# convert new lockfile to json and return
${pkgs.yj}/bin/yj < "$buildPath/pubspec.lock" > $out
'')
);
# TODO: try this instead of patching
# gitHashes = {
# dartssh2 = "sha256-2pypKwurziwGLZYuGaxlS2lzN3UvJp3bRTvvYYxEqRI=";
# hotkey_manager_linux = "sha256-aO0h94YZvgV/ggVupNw8GjyZsnXrq3qTHRDtuhNv3oI=";
# system_info2 = "sha256-fly7E2vG+bQ/+QGzXk+DYba73RZccltdW2LpZGDKX60=";
# tray_menu = "sha256-riiAiBEms+9ARog8i+MR1fto1Yqx+gwbBWyNbNq6VTM=";
# window_size = "sha256-71PqQzf+qY23hTJvcm0Oye8tng3Asr42E2vfF1nBmVA=";
# xterm = "sha256-h8vIonTPUVnNqZPk/A4ZV7EYCMyM0rrErL9ZOMe4ZBE=";
# };
meta = with lib; {
description = "A GUI for the Chameleon Ultra written in Flutter for crossplatform";
homepage = "https://github.com/GameTec-live/ChameleonUltraGUI";
license = licenses.gpl3;
maintainers = [maintainers.emileclarkb];
platforms = platforms.linux;
};
}
# find /nix/store -type f -print 2>/dev/null | rg "share/applications"
# NOTE: this command will show that there the desktop file was generated
# at some point. just not anymore??
# NOTE2: read over ~/workshop/packaging/nixpkgs-24.11/pkgs/build-support/make-desktopitem/default.nix
# and see exactly how makeDesktopItem is defined!
# perhaps the item is added to the build environment but not the output?
# NOTE: see how it builds derivations for the desktop and makes the desktop items?
# (every time I build it does actually make the desktop items)
# HOWEVER I just dont think they're being copied over...
# /nix/store/4hqs6dkxqngi6wi95dmizbvmgm7l5cf0-ChameleonUltraGUI.desktop/share/applications/ChameleonUltraGUI.desktop
# /nix/store/869gy031lf243k0x9ir7gmrsfksipca1-ChameleonUltraGUI.desktop/share/applications/ChameleonUltraGUI.desktop
# /nix/store/adqq7slakkhpjc4hln19jd6p22cc9ci6-ChameleonUltraGUI.desktop/share/applications/ChameleonUltraGUI.desktop
# /nix/store/x9fa3na0is70h4ya4dbfsivk4m3mab57-ChameleonUltraGUI.desktop/share/applications/ChameleonUltraGUI.desktop

View file

@ -1,25 +0,0 @@
{pkgs, ...}: let
inherit
(pkgs)
lib
;
in
pkgs.rustPackages.rustPlatform.buildRustPackage {
pname = "ekphos";
version = "v0.20.10";
src = pkgs.fetchFromGitHub {
repo = "ekphos";
owner = "hanebox";
sha256 = "sha256-mZ6yQdPpJ9PglYyHwivVDO05vRPvwZG7DPEBJeOVlFE=";
rev = "1ac1ab68dd4ea867dadf54f60e32a9a3e0305695";
};
cargoHash = "sha256-s6Elg0Fqxdlc2/428oV7POMqphx8vWaLOncO5kZyBfQ=";
meta = {
description = "A lightweight, fast, terminal-based markdown research tool inspired by Obsidian";
homepage = "https://github.com/hanebox/ekphos";
license = lib.licenses.mit;
maintainers = [lib.maintainers.emileclarkb];
};
}

View file

@ -1,35 +0,0 @@
# Template: https://nixos-and-flakes.thiscute.world/development/intro
{
description = "Humanity's Last Exam - Devshell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
};
outputs = {nixpkgs, ...}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
python = pkgs.python312.override {
self = python;
packageOverrides = pyfinal: pyprev: {
huggingface-hub = pyfinal.callPackage ./huggingface_hub.nix {};
hf-xet = pyfinal.callPackage ./hf-xet.nix {};
};
};
in {
devShells."${system}".default = pkgs.mkShell {
packages = [
(python.withPackages (pypkgs: [
pypkgs.huggingface-hub
]))
];
shell = "${pkgs.bash}/bin/bash";
shellHook = ''
alias hf=huggingface-cli
'';
};
};
}

View file

@ -1,56 +0,0 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pkg-config,
rustPlatform,
openssl,
}:
buildPythonPackage rec {
pname = "hf-xet";
version = "1.1.5";
pyproject = true;
src = fetchFromGitHub {
owner = "huggingface";
repo = "xet-core";
tag = "v${version}";
hash = "sha256-udjZcXTH+Mc4Gvj6bSPv1xi4MyXrLeCYav+7CzKWyhY=";
};
sourceRoot = "${src.name}/hf_xet";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit
pname
version
src
sourceRoot
;
hash = "sha256-PTzYubJHFvhq6T3314R4aqBAJlwehOqF7SbpLu4Jo6E=";
};
nativeBuildInputs = [
pkg-config
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = [
openssl
];
env.OPENSSL_NO_VENDOR = 1;
pythonImportsCheck = ["hf_xet"];
# No tests (yet?)
doCheck = false;
meta = {
description = "Xet client tech, used in huggingface_hub";
homepage = "https://github.com/huggingface/xet-core/tree/main/hf_xet";
changelog = "https://github.com/huggingface/xet-core/releases/tag/v${version}";
license = lib.licenses.asl20;
};
}

View file

@ -1,62 +0,0 @@
/*
* WARNING: Just use `pkgs.python312Packages.huggingface-hub` (or change python version)
* WARNING: I didn't realise it existed when I packaged this.
*
* Nix Resources:
* 1. https://wiki.nixos.org/wiki/Python
* 2. https://nixos.org/manual/nixpkgs/unstable/#developing-with-python
*
* Hugging Face Resources:
* 1. https://github.com/huggingface/huggingface_hub
* 2. https://huggingface.co/docs/huggingface_hub/main/en/guides/cli
*/
{
lib,
buildPythonPackage,
fetchPypi,
# build time dependencies
setuptools,
# runtime dependencies
filelock,
fsspec,
hf-xet,
pyyaml,
requests,
tqdm,
typing-extensions,
}:
buildPythonPackage rec {
pname = "huggingface_hub";
version = "0.34.3";
src = fetchPypi {
inherit pname version;
hash = "sha256-1YEw/VqnQISAaBR1SRwKvX6DVEIIL7w+9NRbbDn4OFM=";
};
pyproject = true;
doCheck = false; # skip unit testing
pythonImportsCheck = ["huggingface_hub"];
# buildtime dependencies
build-system = [
setuptools
];
# runtime dependencies
dependencies = [
filelock
fsspec
hf-xet
pyyaml
requests
tqdm
typing-extensions
];
meta = rec {
description = "The official Python client for the Huggingface Hub.";
homepage = "https://github.com/huggingface/huggingface_hub";
changelog = "${homepage}/releases/tag/v${version}";
license = lib.licenses.asl20; # Apache License 2.0
};
}

View file

@ -1,32 +0,0 @@
{pkgs, ...}:
pkgs.stdenv.mkDerivation {
pname = "x86-manpages";
version = "0.0.1";
src = pkgs.fetchFromGitHub {
owner = "ttmo-O";
repo = "x86-manpages";
## Recommended
# rev = "0e199a8b4d90be7eb715291c21cf41de8527beac";
# sha256 = "0im596j0pf90npg933gkq6wpw23c47fcwv0n64qfqn5mcy92qbcb";
rev = "94902f9c45de0efe803c32b6c3e88d6623881866";
sha256 = "0k6nsfabzqwnhjiyw2kyg0z49nzrsxn515f6dcjh1rn7bzih5562";
};
installPhase = ''
mkdir -p $out/man/man7
shopt -u nullglob
for m in man7/*.7; do
install -m 644 "$m" "$out/man/man7"
done
'';
meta = with pkgs.lib; {
description = "Manpages for x86 instructions";
homepage = "https://github.com/ttmo-O/x86-manpages";
license = licenses.mit;
platforms = platforms.all;
};
}

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/clc95m2c889yns3n8c71vfgb1q2qd419-nixos-system-myputer-24.11.20250212.0ff09db

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
USAGE="Usage: box [--enter]"
# ===== Configuration ===== #
DATA_DIR="$HOME/.data/box"
# ========================= #
function setup {
mkdir -p "$DATA_DIR" &>/dev/null
}
function box {
mktemp -d
# TODO: use a custom name instead
}
set -euo pipefail
ENTER=false
for arg in $@; do
case "$arg" in
-e|--enter)
ENTER=true
shift
;;
-h|--help)
echo "$USAGE"
;;
-*)
echo "[!] Unknown opt \"$arg\"" >&2
;;
*)
echo "[!] Unknown arg \"$arg\"" >&2
;;
esac
done
setup
BOX=$(box)
if [[ "$ENTER" == true ]]; then
cd "$BOX"
fi

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
function fontgrep {
fc-list \
| grep $@ \
| awk '{$1=""; print substr($0, 2, length($0)-1) }' \
| grep -oE '^\s*[^,]+' \
| sort \
| uniq
}
fontgrep $@

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
EXPR_MSG="evaluating derivation"
PROP_MSG="of derivation"
LOC=$1
if [ -z $1 ]; then
exec {1}<>"$LOC"
fi
ERROR_LINE=$(<$LOC grep -nF "error:" \
| tail -n1 \
| awk '{print substr($1,1,length($1)-1)}' )
<$LOC sed -n "$ERROR_LINE,\$p"
echo "[*] Reason:"
<$LOC grep "evaluating attribute '.*' of derivation" \
| awk '{ print substr($NF, 2, length($NF)-2), substr($5, 2, length($5)-2)}'

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
# USAGE: lsyscalls | sort [-nk2]
echo -e '#include <sys/syscall.h>'\
| cpp -dM \
| grep "#define __NR_.*[0-9]$" \
| cut -d_ -f 4-

View file

@ -1,3 +0,0 @@
#!/usr/bin/env sh
nix-store -q --references /var/run/current-system/sw \
| cut -d'-' -f2-

View file

@ -1,35 +0,0 @@
#!/usr/bin/env bash
# Credit: u/boxofrox https://discourse.nixos.org/u/boxofrox
# Ref: https://discourse.nixos.org/t/how-to-temporarily-open-a-tcp-port-in-nixos/12306/3
USAGE="[Usage] sudo withport <port> <cmd> <args...>"
set -ueo pipefail
open-port() {
local port=$1
iptables -A INPUT -p tcp --dport $port -j ACCEPT
}
close-port() {
local port=${1:-0}
iptables -D INPUT -p tcp --dport $port -j ACCEPT
}
PORT=$1
if [[ -z "$PORT" ]]; then
echo -e "[!] Port not given\n$USAGE" >&2
exit 1
fi
shift; # Drop port argument
if [[ 0 -eq $# ]]; then
echo -e "[!] Command not given\n$USAGE" >&2
exit 1
fi
open-port $PORT
# Ensure port closes if error occurs.
trap "close-port $PORT" EXIT
# Run the command as user, not root.
runuser -u $SUDO_USER -- "$@"
# Trap will close port.

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
# THIS PROGRAM RELIES SOLELY ON `SWWW`
transition=$1
wallpaper_path=$2
if [[ "$transition" == "wipe" ]]; then
swww img --transition-type wipe --transition-angle 30 --transition-step 90 --transition-fps 60 $wallpaper_path
elif [[ "$transition" == "preview" ]]; then
swww img --transition-type wipe --transition-angle 45 --transition-step 90 --transition-bezier .27,.98,.78,0 --transition-fps 60 $wallpaper_path
elif [[ "$transition" == "circle" ]]; then
swww img --transition-type grow --transition-pos "$(hyprctl cursorpos)" --transition-duration 3 --transition-fps 60 --invert-y $wallpaper_path
else
echo "[!] Unknown transition type \"$transition\""
exit 1
fi

View file

@ -1,82 +0,0 @@
#!/usr/bin/env bash
# Requires: systemctl
set -u
function match {
[[ "$1" =~ $2 ]]
}
function padlen {
local MAX=0
for KEY in "$@"; do
local LEN=${#KEY}
((LEN > MAX)) && MAX=$LEN
done
echo $MAX
}
function pad {
local PAD="$1"
if [ -z "$PAD" ]; then
exit 1
fi
for ((i=0; i<PAD; i++)); do
printf " "
done
}
function fmt_print {
set +u
local SERVICE=$1
local LPAD=$2
local ACTIVE=$3
local ENABLED=$4
if [ "$ACTIVE" = "NOTFOUND" ]; then
ACTIVE="\e[1m\e[31m$ACTIVE\e[0m"
elif [ "$ACTIVE" = "inactive" ]; then
ACTIVE="\e[1m\e[31m$ACTIVE\e[0m"
else
ACTIVE="\e[32m$ACTIVE\e[0m"
fi
if [ "$ENABLED" = "enabled" ]; then
ENABLED="[\e[32m$ENABLED\e[0m]"
elif [ "$ENABLED" = "disabled" ]; then
ENABLED="[\e[1m\e[33m$ENABLED\e[0m]"
fi
set -u
echo -e "\e[35m[*]\e[0m $SERVICE:$LPAD $ACTIVE $ENABLED"
}
function fmt_test_service (
local SERVICE=$1
local LPAD_SZ=$2 # service name lpad size
local LPAD=$(pad $LPAD_SZ)
local EXISTS=0
local STAT=$(systemctl status "$SERVICE" 2>/dev/null)
if [ -z "$STAT" ]; then
fmt_print "$SERVICE" "$LPAD" "NOTFOUND"
exit 1
fi
local STAT_LOADED=$(head -n2 <<< "$STAT" | tail -n1)
# NOTE: "active " intentionally contains right padding
local ENABLED=$(match "$STAT_LOADED" "^\s*Loaded: loaded \(.*; enabled; .*\)" && echo "enabled" || echo "disabled")
local ACTIVE=$(match "$STAT" "\s*Active: active \(running\)" && echo "active " || echo "inactive")
fmt_print "$SERVICE" "$LPAD" "$ACTIVE" "$ENABLED"
)
function test_services {
local PAD_ALIGN=$(padlen $@)
# fmt_test_service
for SERVICE in "$@"; do
local LPAD=$((PAD_ALIGN - ${#SERVICE}))
fmt_test_service "$SERVICE" $LPAD
done
}
test_services nginx forgejo vaultwarden

View file

@ -1,81 +0,0 @@
#!/usr/bin/env bash
USAGE="Usage: webdev [-h|--help] [-q|--quiet] uri|file"
# NOTE: These can either be set manually here or they
# NOTE: can be exported as environment variables (^-^)
# === Configuration === #
DEFAULT_BROWSER=${DEFAULT_BROWSER:-}
# ===================== #
# WARNING: Internal use only (do not modify!)
# === Internal Environment === #
QUIET=false
BROWSER=""
LOC=""
LOC_TYPE="" # file or uri
# ============================ #
# Quiet Echo - doesn't echo if QUIET is set
qecho() {
if [[ "$QUIET" == false ]]; then
echo "$@"
fi
}
# Argument Parsing
for ARG in $@; do
case $ARG in
-h|--help)
echo "$USAGE"
exit 0
;;
-q|--quiet)
QUIET=true
;;
-*)
echo -e "[!] Unknown option \"$ARG\"\n$USAGE" >&2
exit 1
;;
*)
# first unknown (non-option) argument assumed $LOC
if [[ -n "$LOC" ]]; then
LOC="$OPT"
else
echo "[!] Unknown option \"$ARG\"\n$USAGE" >&2
exit 1
fi
;;
esac
done
# ensure $LOC was set during argparse phase
if [[ -z "$LOC" ]]; then
echo -e "[!] URI or file not specified\n$USAGE" >&2
fi
# Use DEFAULT_BROWSER or check XDG default-web-browser or fail
if [[ -n "$DEFAULT_BROWSER" ]]; then
qecho "[+] Browser manually set to $DEFAULT_BROWSER"
qecho " > Skipped checking XDG default-web-browser"
else
qecho "[*] Lookup XDG default-web-browser"
BROWSER=$(xdg-settings get default-web-browser 2>/dev/null)
if [[ $? -eq 0 ]]; then
BROWSER=${BROWSER%%.desktop}
qecho "[+] Browser automatically set to $BROWSER"
else
echo "[!] Unknown browser girlypop :(" >&2
echo " > Either:" >&2
echo " > 1. export DEFAULT_BROWSER" >&2
echo " > 2. run \`xdg-settings set default-web-browser\`" >&2
exit 1
fi
fi
echo # linebreak
# Check if $LOC is a valid path
REALPATH=$(realpath "$LOC" 2>/dev/null)
if [ -f "$REALPATH"]; then
LOC="file://$LOC" # open file directly via "file" protocol
fi
# Substitutions left intentionally unquoted (allows for providing args)
command $BROWSER $LOC