1
0
Fork 0

General: switch to Snowfall lib

This commit is contained in:
Aires 2024-12-06 13:04:47 -05:00
parent 2fbee2adb5
commit c1506c5118
91 changed files with 28232 additions and 28134 deletions

2
.gitattributes vendored
View file

@ -1 +1 @@
modules/secrets/** filter=crypt diff=crypt merge=crypt modules/nixos/secrets/** filter=crypt diff=crypt merge=crypt

10
.vscode/settings.json vendored
View file

@ -1,7 +1,7 @@
{ {
"direnv.path.executable": "/run/current-system/sw/bin/direnv", "direnv.path.executable": "/run/current-system/sw/bin/direnv",
"direnv.restart.automatic": true, "direnv.restart.automatic": true,
"nix.enableLanguageServer": true, "nix.enableLanguageServer": true,
"nix.serverPath": "/run/current-system/sw/bin/nil", "nix.serverPath": "/run/current-system/sw/bin/nil",
"nix.formatterPath": "/run/current-system/sw/bin/nix fmt", "nix.formatterPath": "/run/current-system/sw/bin/nix fmt"
} }

View file

@ -1,6 +1,6 @@
# NixOS Configuration # NixOS Configuration
A full set of configuration files managed via NixOS. This project is an **unofficial** extension of the [Auxolotl system template](https://git.auxolotl.org/auxolotl/templates). A full set of configuration files managed via NixOS. This project uses the [Snowfall library](https://snowfall.org/guides/lib/quickstart).
> [!WARNING] > [!WARNING]
> DO NOT DOWNLOAD AND RUN `nixos-rebuild` ON THIS REPOSITORY! These are my personal configuration files. I invite you to look through them, modify them, and take inspiration from them, but if you run `nixos-rebuild`, it _will completely overwrite your current system_! > DO NOT DOWNLOAD AND RUN `nixos-rebuild` ON THIS REPOSITORY! These are my personal configuration files. I invite you to look through them, modify them, and take inspiration from them, but if you run `nixos-rebuild`, it _will completely overwrite your current system_!
@ -9,7 +9,7 @@ A full set of configuration files managed via NixOS. This project is an **unoffi
### Note on secrets management ### Note on secrets management
Secrets are managed using [git-crypt](https://github.com/AGWA/git-crypt). To unlock the repo, use `git-crypt unlock [path to key file]`. git-crypt will transparently encrypt/decrypt files stored in `modules/secrets` going forward, but you'll need this key file on all hosts that are using secrets. Secrets are managed using [transcrypt](https://github.com/elasticdog/transcrypt). To unlock the repo, use `transcrypt -c [cipher] -p '[password]'`. Transcrypt will transparently encrypt/decrypt files stored in `modules/nixos/secrets` going forward. You can get the cipher and password from a host with transcrypt already configured by running `transcrypt --display`.
> [!NOTE] > [!NOTE]
> This is a poor man's secret management solution. If you use this, your secrets will be world-readable in the `/nix/store/`. > This is a poor man's secret management solution. If you use this, your secrets will be world-readable in the `/nix/store/`.
@ -19,18 +19,18 @@ Secrets are managed using [git-crypt](https://github.com/AGWA/git-crypt). To unl
When installing on a brand new system, partition the main drive into two partitions: a `/boot` partition, and a LUKS partition. Then, run `bin/format-drives.sh --root [root partition] --luks [luks partition]` (the script will request sudo privileges): When installing on a brand new system, partition the main drive into two partitions: a `/boot` partition, and a LUKS partition. Then, run `bin/format-drives.sh --root [root partition] --luks [luks partition]` (the script will request sudo privileges):
```sh ```sh
./bin/format-drives.sh --boot /dev/nvme0n1p1 --luks /dev/nvme0n1p2 ./bin/format-drives.sh --boot /dev/nvme0n1p1 --luks /dev/nvme0n1p2
``` ```
Next, set up the host's config under in the `hosts` folder by copying `configuration.nix.template` and `hardware-configuration.nix.template` into a new folder. Running `format-drives.sh` also generates a `hardware-configuration.nix` file you can use. Next, set up the host's config in the `systems/[architecture]` folder by copying `default.nix.template` and `hardware-configuration.nix.template` into a new folder named after the hostname. Running `format-drives.sh` also generates a `hardware-configuration.nix` file you can use.
Then, add the host to `flake.nix` under the `nixosConfigurations` section. If necessary, import modules by adding the host to `flake.nix` under the `outputs.systems.hosts` section.
Finally, run the NixOS installer, replacing `host` with your actual hostname: Finally, run the NixOS installer, replacing `host` with your actual hostname:
```sh ```sh
sudo nixos-install --verbose --root /mnt --flake .#host --no-root-password sudo nixos-install --verbose --root /mnt --flake .#host --no-root-password
``` ```
> [!TIP] > [!TIP]
> This config installs a nixos-rebuild wrapper called `nos` (NixOS Operations Script) that handles pulling and pushing changes to your configuration repository via git. For more info, run `nixos-operations-script --help`. > This config installs a nixos-rebuild wrapper called `nos` (NixOS Operations Script) that handles pulling and pushing changes to your configuration repository via git. For more info, run `nixos-operations-script --help`.
@ -41,10 +41,10 @@ To update a system, run `nixos-operations-script` (or just `nos`). To commit upd
#### Automatic updates #### Automatic updates
To enable automatic updates for a host, set `aux.system.services.autoUpgrade = true;`. You can configure the autoUpgrade module with additional settings, e.g.: To enable automatic updates for a host, set `config.${namespace}.services.autoUpgrade = true;`. You can configure the autoUpgrade module with additional settings, e.g.:
```nix ```nix
aux.system.services.autoUpgrade = { services.autoUpgrade = {
enable = true; enable = true;
configDir = config.secrets.nixConfigFolder; configDir = config.secrets.nixConfigFolder;
onCalendar = "daily"; onCalendar = "daily";
@ -52,7 +52,7 @@ aux.system.services.autoUpgrade = {
}; };
``` ```
Automatic updates work by running `nos`. There's an additional `pushUpdates` option that, when enabled, updates the `flake.lock` file and pushes it back up to the Git repository. Only one host needs to do this (in this case, it's [Hevana](./hosts/Hevana), but you can safely enable it on multiple hosts as long as they use the same repository and update at different times. Automatic updates work by running `nos`. There's an additional `pushUpdates` option that, when enabled, updates the `flake.lock` file and pushes it back up to the Git repository. Only one host needs to do this (in this case, it's [Hevana](./systems/x86_64-linux/Hevana)), but you can safely enable it on multiple hosts as long as they use the same repository and update at different times.
#### Manually updating #### Manually updating
@ -66,7 +66,7 @@ nos
This is the equivalent of running: This is the equivalent of running:
```sh ```sh
cd [flake dir] cd [flake dir]
git pull git pull
nix flake update --commit-lock-file nix flake update --commit-lock-file
@ -127,18 +127,7 @@ nixos-rebuild build-vm --flake .
## About this repository ## About this repository
### Layout This config uses the [Snowfall lib](https://snowfall.org/), along with some default options and settings for common software. It features:
This config uses a custom templating system built off of the [Auxolotl system templates](https://git.auxolotl.org/auxolotl/templates).
- Flakes are the entrypoint, via `flake.nix`. This is where Flake inputs and Flake-specific options get defined.
- Hosts are defined in the `hosts` folder.
- Modules are defined in `modules`. All of these files are automatically imported (except home-manager modules). You simply enable the ones you want to use, and disable the ones you don't. For example, to install Flatpak support, set `aux.system.ui.flatpak.enable = true;`.
- After adding a new module, make sure to `git add` it before running `nixos-rebuild`.
- Home-manager configs live in the `users/` folders.
### Features
This Nix config features:
- Flakes - Flakes
- Home Manager - Home Manager

View file

@ -8,16 +8,16 @@ outDir="./out"
metadataFile="$inDir/metadata.yml" metadataFile="$inDir/metadata.yml"
function usage() { function usage() {
echo "Compile a directory of Markdown (.md) files into DOCX, ePub, and PDF files." echo "Compile a directory of Markdown (.md) files into DOCX, ePub, and PDF files."
echo "" echo ""
echo "Options:" echo "Options:"
echo " --help Show this help screen." echo " --help Show this help screen."
echo " -n, --name [name] The name of this draft." echo " -n, --name [name] The name of this draft."
echo " -i, --input [path] Directory containing the files to convert. Defaults to this directory." echo " -i, --input [path] Directory containing the files to convert. Defaults to this directory."
echo " -o, --output [path] Directory to store the converted files in. Defaults to ./out." echo " -o, --output [path] Directory to store the converted files in. Defaults to ./out."
echo " -m, --metadata [path] Path to the YAML file containing metadata for pandoc." echo " -m, --metadata [path] Path to the YAML file containing metadata for pandoc."
echo "" echo ""
exit 0 exit 0
} }
# Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash # Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
@ -25,47 +25,46 @@ POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--draft-name|--name|-n) --draft-name|--name|-n)
draftName="$2" draftName="$2"
shift shift
shift shift
;; ;;
--input|--indir|-i) --input|--indir|-i)
inDir="$2" inDir="$2"
shift shift
shift shift
;; ;;
--output|--outdir|-o) --output|--outdir|-o)
outDir="$2" outDir="$2"
shift shift
shift shift
;; ;;
--metadata|--metadataFile|-m) --metadata|--metadataFile|-m)
metadataFile="$2" metadataFile="$2"
shift shift
shift shift
;; ;;
--help) --help)
usage usage
;; ;;
*) *)
POSITIONAL_ARGS+=("$1") # save positional arg POSITIONAL_ARGS+=("$1") # save positional arg
shift shift
;; ;;
esac esac
done done
remainingArgs=${POSITIONAL_ARGS[@]}
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
# If this is a git repo and no name has been provided, name the draft after the current branch # If this is a git repo and no name has been provided, name the draft after the current branch
if [ -d ".git" ] && [ "$draftName" = "draft" ]; then if [ -d ".git" ] && [ "$draftName" = "draft" ]; then
draftName=$(git rev-parse --abbrev-ref HEAD) draftName=$(git rev-parse --abbrev-ref HEAD)
fi fi
# Check if this directory already exists # Check if this directory already exists
outDir="$outDir/${draftName}" outDir="$outDir/${draftName}"
if [ -d $outDir ]; then if [ -d "$outDir" ]; then
echo "The folder $outDir already exists." echo "The folder $outDir already exists."
read -p "Enter YES to overwrite, or Ctrl-C to cancel: " confirm && [ $confirm = "YES" ] || exit 1 read -rp "Enter YES to overwrite, or Ctrl-C to cancel: " confirm && [ "$confirm" = "YES" ] || exit 1
fi fi
draftFile="$outDir/${draftName}" draftFile="$outDir/${draftName}"
@ -73,20 +72,20 @@ draftFile="$outDir/${draftName}"
echo "Compiling draft \"${draftName}\"..." echo "Compiling draft \"${draftName}\"..."
# Create the draft directory if it doesn't already exist # Create the draft directory if it doesn't already exist
mkdir -p $outDir mkdir -p "$outDir"
# Initialize merged file # Initialize merged file
echo > $draftFile.md echo > "$draftFile".md
# Grab content files and add a page break to the end of each one. # Grab content files and add a page break to the end of each one.
# Obsidian specifically creates "folder notes," which are named for the directory, so we make sure to exclude it. # Obsidian specifically creates "folder notes," which are named for the directory, so we make sure to exclude it.
find "$inDir" -type f -wholename "* *.md" ! -name content.md -print0 | sort -z | while read -d $'\0' file find "$inDir" -type f -wholename "* *.md" ! -name content.md -print0 | sort -z | while read -rd $'\0' file
do do
# Add newline to Markdown doc # Add newline to Markdown doc
echo >> $draftFile.md echo >> "$draftFile".md
# Clean up incoming Markdown and append it to final doc # Clean up incoming Markdown and append it to final doc
sed "s|(../|($inDir/../|g" "$file" >> $draftFile.md sed "s|(../|($inDir/../|g" "$file" >> "$draftFile".md
echo "\\newpage" >> $draftFile.md echo "\\newpage" >> "$draftFile".md
done done
# Generate the output files: # Generate the output files:
@ -94,9 +93,9 @@ done
# Markdown -> EPUB # Markdown -> EPUB
# Markdown -> PDF (A4 size) # Markdown -> PDF (A4 size)
# Markdown -> PDF (B6/Standard book size) # Markdown -> PDF (B6/Standard book size)
pandoc -t docx $draftFile.md -o $draftFile.docx --metadata-file "$metadataFile" pandoc -t docx "$draftFile".md -o "$draftFile".docx --metadata-file "$metadataFile"
pandoc -t epub $draftFile.md -o $draftFile.epub --metadata-file "$metadataFile" pandoc -t epub "$draftFile".md -o "$draftFile".epub --metadata-file "$metadataFile"
pandoc $draftFile.md -o ${draftFile}-a4.pdf --metadata-file "$metadataFile" -V geometry:"a4paper" -V fontsize:"12pt" pandoc "$draftFile".md -o "$draftFile"-a4.pdf --metadata-file "$metadataFile" -V geometry:"a4paper" -V fontsize:"12pt"
pandoc $draftFile.md -o ${draftFile}-b6.pdf --metadata-file "$metadataFile" -V geometry:"b6paper" -V fontsize:"10pt" pandoc "$draftFile".md -o "$draftFile"-b6.pdf --metadata-file "$metadataFile" -V geometry:"b6paper" -V fontsize:"10pt"
echo "Done! Your new draft is in $outDir" echo "Done! Your new draft is in $outDir"

View file

@ -6,8 +6,8 @@
set -e set -e
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2 echo "This script must be run as root" 1>&2
exit 1 exit 1
fi fi
# Configuration parameters # Configuration parameters
@ -17,48 +17,47 @@ luks_partition="" # The drive partition to create the LUKS container on
root_partition="/dev/mapper/nixos-crypt" # The partition to install NixOS to root_partition="/dev/mapper/nixos-crypt" # The partition to install NixOS to
function usage() { function usage() {
echo "Usage: format-drives.sh [--boot boot-partition-path] [--luks luks-partition-path] [--ask-root-password]" echo "Usage: format-drives.sh [--boot boot-partition-path] [--luks luks-partition-path] [--ask-root-password]"
echo "Options:" echo "Options:"
echo " -h | --help Show this help screen." echo " -h | --help Show this help screen."
echo " -b | --boot <path> The path to the boot drive (e.g. /dev/nvme0n1p1)." echo " -b | --boot <path> The path to the boot drive (e.g. /dev/nvme0n1p1)."
echo " -l | --luks <path> The path to the partition to create the LUKS container on (e.g. /dev/nvme0n1p2)." echo " -l | --luks <path> The path to the partition to create the LUKS container on (e.g. /dev/nvme0n1p2)."
echo " -a | --ask-root-password Sets a password for the root user account." echo " -a | --ask-root-password Sets a password for the root user account."
exit 2 exit 2
} }
# Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash # Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
POSITIONAL_ARGS=() POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--ask-root-password|-a) --ask-root-password|-a)
ask_root_password=true ask_root_password=true
shift shift
;; ;;
--boot|-b) --boot|-b)
boot_partition="$2" boot_partition="$2"
shift shift
shift shift
;; ;;
--luks|-l) --luks|-l)
luks_partition="$2" luks_partition="$2"
shift shift
shift shift
;; ;;
--help|-h) --help|-h)
usage usage
shift ;;
;; *)
*) POSITIONAL_ARGS+=("$1") # save positional arg
POSITIONAL_ARGS+=("$1") # save positional arg shift # past argument
shift # past argument ;;
;; esac
esac
done done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
cryptsetup luksOpen $luks_partition nixos-crypt cryptsetup luksOpen "$luks_partition" nixos-crypt
mkfs.btrfs -L nixos $root_partition mkfs.btrfs -L nixos "$root_partition"
mount /dev/mapper/nixos-crypt /mnt mount /dev/mapper/nixos-crypt /mnt
btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home btrfs subvolume create /mnt/@home
@ -67,13 +66,13 @@ btrfs subvolume create /mnt/@nix
btrfs subvolume create /mnt/@swap btrfs subvolume create /mnt/@swap
umount /mnt umount /mnt
mount -o subvol=@ $root_partition /mnt mount -o subvol=@ "$root_partition" /mnt
mkdir -p /mnt/{boot,home,var/log,nix,swap} mkdir -p /mnt/{boot,home,var/log,nix,swap}
mount $boot_partition /mnt/boot mount "$boot_partition" /mnt/boot
mount -o subvol=@home $root_partition /mnt/home mount -o subvol=@home "$root_partition" /mnt/home
mount -o subvol=@log $root_partition /mnt/var/log mount -o subvol=@log "$root_partition" /mnt/var/log
mount -o subvol=@nix $root_partition /mnt/nix mount -o subvol=@nix "$root_partition" /mnt/nix
mount -o subvol=@swap $root_partition /mnt/swap mount -o subvol=@swap "$root_partition" /mnt/swap
echo "Disks partitioned and mounted to /mnt." echo "Disks partitioned and mounted to /mnt."
# Generate hardware-configuration.nix # Generate hardware-configuration.nix

View file

@ -12,97 +12,97 @@ buildHost="" # Which host to use to generate
remainingArgs="" # All remaining arguments that haven't yet been processed (will be passed to nixos-rebuild) remainingArgs="" # All remaining arguments that haven't yet been processed (will be passed to nixos-rebuild)
function usage() { function usage() {
echo "The NixOS Operations Script (NOS) is a nixos-rebuild wrapper for system maintenance." echo "The NixOS Operations Script (NOS) is a nixos-rebuild wrapper for system maintenance."
echo "" echo ""
echo "Running the script with no parameters performs the following operations:" echo "Running the script with no parameters performs the following operations:"
echo " 1. Pull the latest version of your Nix config repository" echo " 1. Pull the latest version of your Nix config repository"
echo " 2. Run 'nixos-rebuild switch'." echo " 2. Run 'nixos-rebuild switch'."
echo "" echo ""
echo "Advanced usage: nixos-operations-script.sh [-h | --hostname hostname-to-build] [-o | --operation operation] [-f | --flake path-to-flake] [extra nixos-rebuild parameters]" echo "Advanced usage: nixos-operations-script.sh [-h | --hostname hostname-to-build] [-o | --operation operation] [-f | --flake path-to-flake] [extra nixos-rebuild parameters]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --help Show this help screen." echo " --help Show this help screen."
echo " -f, --flake [path] The path to your flake.nix file (defualts to the FLAKE_DIR environment variable)." echo " -f, --flake [path] The path to your flake.nix file (defualts to the FLAKE_DIR environment variable)."
echo " -h, --hostname [hostname] The name of the host to build (defaults to the current system's hostname)." echo " -h, --hostname [hostname] The name of the host to build (defaults to the current system's hostname)."
echo " -o, --operation [operation] The nixos-rebuild operation to perform (defaults to 'switch')." echo " -o, --operation [operation] The nixos-rebuild operation to perform (defaults to 'switch')."
echo " -U, --update Update and commit the flake.lock file." echo " -U, --update Update and commit the flake.lock file."
echo " -u, --user [username] Which user account to run git commands under (defaults to the user running this script)." echo " -u, --user [username] Which user account to run git commands under (defaults to the user running this script)."
echo "" echo ""
exit 0 exit 0
} }
# Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash # Argument processing logic shamelessly stolen from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
POSITIONAL_ARGS=() POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--build-host) --build-host)
buildHost="$2" buildHost="$2"
shift shift
shift shift
;; ;;
--flake|-f) --flake|-f)
flakeDir="$2" flakeDir="$2"
shift shift
shift shift
;; ;;
--hostname|-h) --hostname|-h)
hostname="$2" hostname="$2"
shift shift
shift shift
;; ;;
--update|--upgrade|-U) --update|--upgrade|-U)
update=true update=true
shift shift
;; ;;
--operation|-o) --operation|-o)
operation="$2" operation="$2"
shift shift
shift shift
;; ;;
--user|-u) --user|-u)
user="$2" user="$2"
shift shift
shift shift
;; ;;
--help) --help)
usage usage
;; ;;
*) *)
POSITIONAL_ARGS+=("$1") # save positional arg POSITIONAL_ARGS+=("$1") # save positional arg
shift shift
;; ;;
esac esac
done done
remainingArgs=${POSITIONAL_ARGS[@]} remainingArgs=${POSITIONAL_ARGS[*]}
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [ -z "${flakeDir}" ]; then if [ -z "${flakeDir}" ]; then
echo "Flake directory not specified. Use '--flake <path>' or set \$FLAKE_DIR." echo "Flake directory not specified. Use '--flake <path>' or set \$FLAKE_DIR."
exit 1 exit 1
fi fi
cd $flakeDir cd "$flakeDir" || exit 1
echo "Pulling the latest version of the repository..." echo "Pulling the latest version of the repository..."
/run/wrappers/bin/sudo -u $user /run/current-system/sw/bin/git pull /run/wrappers/bin/sudo -u "$user" /run/current-system/sw/bin/git pull
if [ $update = true ]; then if [ $update = true ]; then
echo "Updating flake.lock..." echo "Updating flake.lock..."
/run/wrappers/bin/sudo -u $user /run/current-system/sw/bin/nix flake update --commit-lock-file /run/wrappers/bin/sudo -u "$user" /run/current-system/sw/bin/nix flake update --commit-lock-file
/run/wrappers/bin/sudo -u $user git push /run/wrappers/bin/sudo -u "$user" git push
else else
echo "Skipping 'nix flake update'..." echo "Skipping 'nix flake update'..."
fi fi
options="--flake ${flakeDir}#${hostname} ${remainingArgs} --use-remote-sudo --log-format multiline-with-logs" options="--flake ${flakeDir}#${hostname} ${remainingArgs} --use-remote-sudo --log-format multiline-with-logs"
if [[ -n "${buildHost}" && $operation != "build" && $operation != *"dry"* ]]; then if [[ -n "${buildHost}" && "$operation" != "build" && "$operation" != *"dry"* ]]; then
echo "Remote build detected, running this operation first: nixos-rebuild build ${options} --build-host $buildHost" echo "Remote build detected, running this operation first: nixos-rebuild build ${options} --build-host $buildHost"
/run/current-system/sw/bin/nixos-rebuild build $options --build-host $buildHost /run/current-system/sw/bin/nixos-rebuild build "$options" --build-host "$buildHost"
echo "Remote build complete!" echo "Remote build complete!"
fi fi
echo "Running this operation: nixos-rebuild ${operation} ${options}" echo "Running this operation: nixos-rebuild ${operation} ${options}"
/run/current-system/sw/bin/nixos-rebuild $operation $options /run/current-system/sw/bin/nixos-rebuild "$operation" "$options"
exit 0 exit 0

View file

@ -58,6 +58,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -97,6 +113,25 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_3"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_2"
@ -115,6 +150,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": { "flakey-profile": {
"locked": { "locked": {
"lastModified": 1712898590, "lastModified": 1712898590,
@ -130,6 +183,22 @@
"type": "github" "type": "github"
} }
}, },
"flatpak": {
"locked": {
"lastModified": 1732285094,
"narHash": "sha256-OD9tu/QN71OnEWtgvm9pXuQs+SGQtKnLHOGVRG5f9CU=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "d3a763532be5d223bb3474642f089667a8091cdf",
"type": "github"
},
"original": {
"owner": "gmodena",
"ref": "v0.5.0",
"repo": "nix-flatpak",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -159,11 +228,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733050161, "lastModified": 1733482664,
"narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", "narHash": "sha256-ZD+h1fwvZs+Xvg46lzTWveAqyDe18h9m7wZnTIJfFZ4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "62d536255879be574ebfe9b87c4ac194febf47c5", "rev": "e38d3dd1d355a003cc63e8fe6ff66ef2257509ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -198,40 +267,11 @@
"type": "github" "type": "github"
} }
}, },
"lib": {
"locked": {
"dir": "lib",
"lastModified": 1728413071,
"narHash": "sha256-5WHctvz0R9N9oBGda1ROuJ/V/m/tZsEXloGWDrd9G7Y=",
"rev": "866b8902c975a1aaec547445976dd39d60def4ab",
"type": "tarball",
"url": "https://git.auxolotl.org/api/v1/repos/auxolotl/labs/archive/866b8902c975a1aaec547445976dd39d60def4ab.tar.gz?rev=866b8902c975a1aaec547445976dd39d60def4ab"
},
"original": {
"dir": "lib",
"type": "tarball",
"url": "https://git.auxolotl.org/auxolotl/labs/archive/main.tar.gz"
}
},
"lix": { "lix": {
"flake": false,
"locked": {
"lastModified": 1729298361,
"narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
"rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
}
},
"lix-module": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"flakey-profile": "flakey-profile", "flakey-profile": "flakey-profile",
"lix": "lix", "lix": "lix_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -251,29 +291,27 @@
"url": "https://git.lix.systems/lix-project/nixos-module" "url": "https://git.lix.systems/lix-project/nixos-module"
} }
}, },
"nix-flatpak": { "lix_2": {
"flake": false,
"locked": { "locked": {
"lastModified": 1732285094, "lastModified": 1729298361,
"narHash": "sha256-OD9tu/QN71OnEWtgvm9pXuQs+SGQtKnLHOGVRG5f9CU=", "narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
"owner": "gmodena", "rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
"repo": "nix-flatpak", "type": "tarball",
"rev": "d3a763532be5d223bb3474642f089667a8091cdf", "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
"type": "github"
}, },
"original": { "original": {
"owner": "gmodena", "type": "tarball",
"ref": "v0.5.0", "url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
"repo": "nix-flatpak",
"type": "github"
} }
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1733217105, "lastModified": 1733481457,
"narHash": "sha256-fc6jTzIwCIVWTX50FtW6AZpuukuQWSEbPiyg6ZRGWFY=", "narHash": "sha256-IS3bxa4N1VMSh3/P6vhEAHQZecQ3oAlKCDvzCQSO5Is=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "cceee0a31d2f01bcc98b2fbd591327c06a4ea4f9", "rev": "e563803af3526852b6b1d77107a81908c66a9fcf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -317,11 +355,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1733212471, "lastModified": 1733392399,
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -377,14 +415,15 @@
"root": { "root": {
"inputs": { "inputs": {
"auto-cpufreq": "auto-cpufreq", "auto-cpufreq": "auto-cpufreq",
"flatpak": "flatpak",
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"lib": "lib", "lix": "lix",
"lix-module": "lix-module",
"nix-flatpak": "nix-flatpak",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable",
"snowfall-lib": "snowfall-lib",
"treefmt": "treefmt"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -412,6 +451,28 @@
"type": "github" "type": "github"
} }
}, },
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1732544274,
"narHash": "sha256-qvzLIxuqukl0nxpXHEh5+iw1BLeLxYOwRC0+7cFUbPo=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "cfeacd055545ab5de0ecfd41e09324dcd8fb2bbb",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "lib",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -441,6 +502,41 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733440889,
"narHash": "sha256-qKL3vjO+IXFQ0nTinFDqNq/sbbnnS5bMI1y0xX215fU=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "50862ba6a8a0255b87377b9d2d4565e96f29b410",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

170
flake.nix
View file

@ -1,4 +1,4 @@
# Based on the Auxolotl template: https://github.com/auxolotl/templates # Uses Snowfall: https://snowfall.org/
# For info on Flakes, see: https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-with-flakes-enabled # For info on Flakes, see: https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-with-flakes-enabled
{ {
description = "Aires' system Flake"; description = "Aires' system Flake";
@ -16,6 +16,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Flatpak support
flatpak.url = "github:gmodena/nix-flatpak/v0.5.0";
# Home-manager support # Home-manager support
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.11"; url = "github:nix-community/home-manager/release-24.11";
@ -25,113 +28,124 @@
# SecureBoot support # SecureBoot support
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1"; lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1";
# Aux lib
lib.url = "https://git.auxolotl.org/auxolotl/labs/archive/main.tar.gz?dir=lib";
# Use Lix in place of Nix. # Use Lix in place of Nix.
# If you'd rather use regular Nix, remove `lix-module.nixosModules.default` from the `modules` section below. # If you'd rather use regular Nix, remove `lix-module.nixosModules.default` from the `modules` section below.
# To learn more about Lix, see https://lix.systems/ # To learn more about Lix, see https://lix.systems/
lix-module = { lix = {
url = "git+https://git.lix.systems/lix-project/nixos-module?ref=release-2.91"; url = "git+https://git.lix.systems/lix-project/nixos-module?ref=release-2.91";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Flatpak support
nix-flatpak.url = "github:gmodena/nix-flatpak/v0.5.0";
# NixOS hardware quirks # NixOS hardware quirks
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Snowfall lib: https://snowfall.org/guides/lib/quickstart/
# Jake's reference config: https://github.com/jakehamilton/config
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
inputs@{ inputs:
auto-cpufreq,
home-manager,
lanzaboote,
lix-module,
nix-flatpak,
nixos-hardware,
nixpkgs,
...
}:
let let
forAllSystems = lib = inputs.snowfall-lib.mkLib {
function: inherit inputs;
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: function nixpkgs.legacyPackages.${system});
# Define shared modules and imports # Root dir for flake.nix
defaultModules = [ src = ./.;
./modules/autoimport.nix
auto-cpufreq.nixosModules.default # Configure Snowfall
lix-module.nixosModules.default snowfall = {
lanzaboote.nixosModules.lanzaboote # Choose a namespace to use for your flake's packages, library, and overlays.
nix-flatpak.nixosModules.nix-flatpak namespace = "Sapana";
home-manager.nixosModules.home-manager
{ # Add flake metadata that can be processed by tools like Snowfall Frost.
_module.args = { meta = {
inherit inputs; # A slug to use in documentation when displaying things like file paths.
name = "aires-flake";
# A title to show for your flake, typically the name.
title = "Aires' Flake";
}; };
home-manager = {
/*
When running, Home Manager will use the global package cache.
It will also back up any files that it would otherwise overwrite.
The originals will have the extension shown below.
*/
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "home-manager-backup";
};
}
];
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
nixosConfigurations = {
Dimaga = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [
nixos-hardware.nixosModules.common-cpu-intel
./hosts/Dimaga
];
}; };
};
in
lib.mkFlake {
# Configure Nix channels
channels-config.allowUnfree = true;
Hevana = nixpkgs.lib.nixosSystem { # Define systems
system = "x86_64-linux"; systems = {
modules = defaultModules ++ [ # Modules to import for all systems
modules.nixos = with inputs; [
auto-cpufreq.nixosModules.default
lix.nixosModules.default
lanzaboote.nixosModules.lanzaboote
flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
{
_module.args = {
inherit inputs;
};
home-manager = {
/*
When running, Home Manager will use the global package cache.
It will also back up any files that it would otherwise overwrite.
The originals will have the extension shown below.
*/
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "home-manager-backup";
};
}
];
# Individual host configurations
hosts = {
Dimaga.modules = with inputs; [
nixos-hardware.nixosModules.common-cpu-intel
];
Hevana.modules = with inputs; [
nixos-hardware.nixosModules.common-cpu-amd-pstate nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-amd nixos-hardware.nixosModules.common-gpu-amd
./hosts/Hevana
]; ];
};
Khanda = nixpkgs.lib.nixosSystem { Khanda.modules = with inputs; [
system = "x86_64-linux";
modules = defaultModules ++ [
nixos-hardware.nixosModules.microsoft-surface-pro-9 nixos-hardware.nixosModules.microsoft-surface-pro-9
./hosts/Khanda
]; ];
};
Pihole = nixpkgs.lib.nixosSystem { Pihole.modules = with inputs; [
system = "aarch64-linux";
modules = defaultModules ++ [
nixos-hardware.nixosModules.raspberry-pi-4 nixos-hardware.nixosModules.raspberry-pi-4
./hosts/Pihole
]; ];
};
Shura = nixpkgs.lib.nixosSystem { Shura.modules = with inputs; [
system = "x86_64-linux";
modules = defaultModules ++ [
nixos-hardware.nixosModules.lenovo-legion-16arha7 nixos-hardware.nixosModules.lenovo-legion-16arha7
./hosts/Shura
]; ];
}; };
}; };
# Use treefmt to format project repo
outputs-builder =
channels:
let
treefmtEval = inputs.treefmt.lib.evalModule channels.nixpkgs ./treefmt.nix;
in
{
# For `nix fmt`
formatter = treefmtEval.config.build.wrapper;
# For `nix flake check`
checks = {
formatting = treefmtEval.config.build.check inputs.self;
};
};
}; };
} }

15
lib/default.nix Normal file
View file

@ -0,0 +1,15 @@
{
lib,
}:
{
# Parses the domain from a URI
getDomainFromURI =
url:
let
parsedURL = (lib.strings.splitString "." url);
in
builtins.concatStringsSep "." [
(builtins.elemAt parsedURL 1)
(builtins.elemAt parsedURL 2)
];
}

View file

@ -1,42 +0,0 @@
[General]
Name=Victrix Pro BFG
Appearance=0x03c4
AddressType=public
SupportedTechnologies=LE;
Trusted=true
Blocked=false
WakeAllowed=true
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;00001813-0000-1000-8000-00805f9b34fb;f95a48e6-a721-11e9-a2a3-022ae2dbcce4;
[LongTermKey]
Key=F12268049C72EA0561E2E77DEA02AC12
Authenticated=0
EncSize=16
EDiv=29996
Rand=5139827239406697411
[PeripheralLongTermKey]
Key=CC60B7A9080383302B61EC2127E0D5CD
Authenticated=0
EncSize=16
EDiv=59630
Rand=6653202288716901387
[SlaveLongTermKey]
Key=CC60B7A9080383302B61EC2127E0D5CD
Authenticated=0
EncSize=16
EDiv=59630
Rand=6653202288716901387
[DeviceID]
Source=2
Vendor=3695
Product=587
Version=768
[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=0
Timeout=300

View file

@ -1,17 +0,0 @@
{ config, lib, ... }:
let
cfg = config.aux.system.apps.dj;
in
{
options = {
aux.system.apps.dj.enable = lib.mkEnableOption "Enables DJing tools (i.e. Mixxx)";
};
config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = {
enable = true;
packages = [ "org.mixxx.Mixxx" ];
};
};
}

View file

@ -1,20 +0,0 @@
{ config, lib, ... }:
let
cfg = config.aux.system.apps.office;
in
{
options = {
aux.system.apps.office.enable = lib.mkEnableOption "Enables office and workstation apps";
};
config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = {
enable = true;
packages = [
"org.onlyoffice.desktopeditors"
"us.zoom.Zoom"
];
};
};
}

View file

@ -1,31 +0,0 @@
# Auto-import modules in this folder, recursively.
# Sourced from https://github.com/evanjs/nixos_cfg/blob/4bb5b0b84a221b25cf50853c12b9f66f0cad3ea4/config/new-modules/default.nix
{ lib, ... }:
let
# Recursively constructs an attrset of a given folder, recursing on directories, value of attrs is the filetype
getDir =
dir:
lib.mapAttrs (file: type: if type == "directory" then getDir "${dir}/${file}" else type) (
builtins.readDir dir
);
# Collects all files of a directory as a list of strings of paths
files =
dir:
lib.collect lib.isString (
lib.mapAttrsRecursive (path: type: lib.concatStringsSep "/" path) (getDir dir)
);
# Search all files and folders within and below the current directory.
# Filters out directories that belong to home-manager, and don't end with .nix or are this file.
validFiles =
dir:
map (file: ./. + "/${file}") (
lib.filter (
file: !lib.hasInfix "home-manager" file && file != "autoimport.nix" && lib.hasSuffix ".nix" file
) (files dir)
);
in
{
imports = validFiles ./.;
}

View file

@ -1,45 +0,0 @@
# Modules common to all systems
{
inputs,
pkgs,
...
}:
{
# Install base packages
aux.system.packages = with pkgs; [
fastfetch # Show a neat system statistics screen when opening a terminal
htop # System monitor
lm_sensors # System temperature monitoring
zellij # Terminal multiplexer
];
# Install the nos helper script
aux.system.nixos-operations-script.enable = true;
# Allow packages from the unstable repo by using 'pkgs.unstable'
nixpkgs.overlays = [
(final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
})
];
programs = {
# Install ZSH for all users
zsh.enable = true;
# Configure nano
nano.nanorc = ''
set tabsize 4
set softwrap
set autoindent
set indicator
'';
};
# Set ZSH as the default shell
users.defaultUserShell = pkgs.zsh;
}

View file

@ -2,15 +2,16 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.apps.development; cfg = config.${namespace}.apps.development;
in in
{ {
options = { options = {
aux.system.apps.development = { ${namespace}.apps.development = {
enable = lib.mkEnableOption "Enables development tools"; enable = lib.mkEnableOption "Enables development tools";
kubernetes.enable = lib.mkEnableOption "Enables kubectl, virtctl, and similar tools."; kubernetes.enable = lib.mkEnableOption "Enables kubectl, virtctl, and similar tools.";
}; };
@ -18,7 +19,7 @@ in
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
aux.system = { ${namespace} = {
packages = with pkgs; [ packages = with pkgs; [
nil # Nix Language server: https://github.com/oxalica/nil nil # Nix Language server: https://github.com/oxalica/nil
nix-prefetch-scripts nix-prefetch-scripts

View file

@ -2,12 +2,13 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
# Gaming-related settings # Gaming-related settings
let let
cfg = config.aux.system.apps.gaming; cfg = config.${namespace}.apps.gaming;
reset-controllers-script = pkgs.writeShellScriptBin "reset-controllers" '' reset-controllers-script = pkgs.writeShellScriptBin "reset-controllers" ''
#!/usr/bin/env bash #!/usr/bin/env bash
sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo
@ -16,25 +17,27 @@ let
in in
{ {
options = { options = {
aux.system.apps.gaming.enable = lib.mkEnableOption "Enables gaming features"; ${namespace}.apps.gaming.enable = lib.mkEnableOption "Enables gaming features";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { ${namespace} = {
enable = true; # Add script to restart xpadneo in case of issues
packages = [ packages = [ reset-controllers-script ];
"gg.minion.Minion"
"com.valvesoftware.Steam" ui.flatpak = {
"org.firestormviewer.FirestormViewer" enable = true;
]; packages = [
"gg.minion.Minion"
"com.valvesoftware.Steam"
"org.firestormviewer.FirestormViewer"
];
};
}; };
# Enable Xbox controller driver (XPadNeo) # Enable Xbox controller driver (XPadNeo)
hardware.xpadneo.enable = true; hardware.xpadneo.enable = true;
# Add script to restart xpadneo in case of issues
aux.system.packages = [ reset-controllers-script ];
# Enable GameMode # Enable GameMode
programs.gamemode.enable = true; programs.gamemode.enable = true;
}; };

View file

@ -1,15 +1,23 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.apps.media; cfg = config.${namespace}.apps.media;
in in
{ {
options = { options = {
aux.system.apps.media.enable = lib.mkEnableOption "Enables media playback and editing apps"; ${namespace}.apps.media = {
enable = lib.mkEnableOption "Enables media playback and editing apps.";
mixxx.enable = lib.mkEnableOption "Installs the Mixxx DJing software.";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { ${namespace}.ui.flatpak = {
enable = true; enable = true;
packages = [ packages = [
"app.drey.EarTag" "app.drey.EarTag"
@ -21,6 +29,7 @@ in
"org.kde.KStyle.Adwaita//6.6" "org.kde.KStyle.Adwaita//6.6"
"org.kde.WaylandDecoration.QAdwaitaDecorations//5.15-23.08" # Replaced deprecated QGnomePlatform https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications "org.kde.WaylandDecoration.QAdwaitaDecorations//5.15-23.08" # Replaced deprecated QGnomePlatform https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications
"org.kde.WaylandDecoration.QAdwaitaDecorations//6.6" "org.kde.WaylandDecoration.QAdwaitaDecorations//6.6"
(lib.mkIf cfg.mixxx.enable "org.mixxx.Mixxx")
"org.videolan.VLC" "org.videolan.VLC"
]; ];
}; };

View file

@ -0,0 +1,25 @@
{
config,
lib,
namespace,
...
}:
let
cfg = config.${namespace}.apps.office;
in
{
options = {
${namespace}.apps.office.enable = lib.mkEnableOption "Enables office and workstation apps";
};
config = lib.mkIf cfg.enable {
${namespace}.ui.flatpak = {
enable = true;
packages = [
"org.onlyoffice.desktopeditors"
"us.zoom.Zoom"
];
};
};
}

View file

@ -2,19 +2,20 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.apps.recording; cfg = config.${namespace}.apps.recording;
in in
{ {
options = { options = {
aux.system.apps.recording.enable = lib.mkEnableOption "Enables video editing tools"; ${namespace}.apps.recording.enable = lib.mkEnableOption "Enables video editing tools";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak.enable = true; ${namespace}.ui.flatpak.enable = true;
services.flatpak.packages = [ services.flatpak.packages = [
"com.obsproject.Studio" "com.obsproject.Studio"

View file

@ -2,20 +2,20 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.apps.social; cfg = config.${namespace}.apps.social;
in in
{ {
options = { options = {
aux.system.apps.social.enable = lib.mkEnableOption "Enables chat apps"; ${namespace}.apps.social.enable = lib.mkEnableOption "Enables chat apps";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system = { ${namespace} = {
allowUnfree = true;
packages = [ pkgs.beeper ]; packages = [ pkgs.beeper ];
ui.flatpak = { ui.flatpak = {
enable = true; enable = true;

View file

@ -2,19 +2,20 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.apps.writing; cfg = config.${namespace}.apps.writing;
compile-manuscript = pkgs.writeShellScriptBin "compile-manuscript" ( compile-manuscript = pkgs.writeShellScriptBin "compile-manuscript" (
builtins.readFile ../../bin/compile-manuscript.sh builtins.readFile ../../../../bin/compile-manuscript.sh
); );
in in
{ {
options = { options = {
aux.system.apps.writing.enable = lib.mkEnableOption "Enables writing and editing tools"; ${namespace}.apps.writing.enable = lib.mkEnableOption "Enables writing and editing tools";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

37
modules/nixos/default.nix Normal file
View file

@ -0,0 +1,37 @@
# Modules common to all systems
{
pkgs,
namespace,
...
}:
{
${namespace} = {
# Install base packages
packages = with pkgs; [
fastfetch # Show a neat system statistics screen when opening a terminal
htop # System monitor
lm_sensors # System temperature monitoring
zellij # Terminal multiplexer
];
# Install the nos helper script
nixos-operations-script.enable = true;
};
programs = {
# Install ZSH for all users
zsh.enable = true;
# Configure nano
nano.nanorc = ''
set tabsize 4
set softwrap
set autoindent
set indicator
'';
};
# Set ZSH as the default shell
users.defaultUserShell = pkgs.zsh;
}

View file

@ -2,11 +2,11 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.aux.system.services.myModule; cfg = config.${namespace}.services.myModule;
in in
{ {
options = { options = {
aux.system.services.myModule = { ${namespace}.services.myModule = {
enable = lib.mkEnableOption "Enables this example module."; enable = lib.mkEnableOption "Enables this example module.";
attributes = lib.mkOption { attributes = lib.mkOption {
default = { }; default = { };

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,109 @@
U2FsdGVkX1/RQfGVP76sNDrjrnhTIFoeGKoRj1M66ltbkzqEVZrSGke1jDZA9e0Q
cwUIfzRo+k2bhNi6VbG4OvteEFeABGn6aoL38owyEgKDlGEti2m6/MPfIrTOYpWS
UArXOKkSCgPi+mzD6ez6ZKXRdaVgn230Iipg4ZacUXkFzUf1YqybTMyp3xVuPaID
AKCdEa9YiL0R5cOMBIKyN3zaj509R9ocauKeJ9w/pVPzgqMoeFNgkeUBh42Z+QFg
/0vy9jX2yoNQrWlOJNfkq50UeivWF90RJzf30gm1uAPX5102Pt0dvUOdfouunFIE
OxYwnBrqJAq2bnoCMCEJkogspVeBVWY/RdJZEhr6Fj6R8Dd/K1rPhvL1UzrrwMo4
3vcXy6AcvEGVA+i7nfSj7J4EfDJnNfsQl0hOV8tm2o/rlOqGiRwPLdi3PxUrAm5I
jZdcNWeendXtBuXZwZSpVFDvi85taasgE7IaPdYj5VfKMwZmdmm7vpmVe3wK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
hKbHj0pS6OtGopX4RAl2Gybi7ZXBPR2af1HywMp4FkRi4AVYcP0CWtp6TcnkBoPy
603JF3Jfoyhg1vGhCipoGx6pCa+RD2gw5VSefhZtOeukDf3BhooMQB+ya1DUCp/T

View file

@ -1,11 +1,16 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.acme; cfg = config.${namespace}.services.acme;
in in
{ {
options = { options = {
aux.system.services.acme = { ${namespace}.services.acme = {
enable = lib.mkEnableOption "Enable the ACME client (for Let's Encrypt TLS certificates)."; enable = lib.mkEnableOption "Enable the ACME client (for Let's Encrypt TLS certificates).";
certs = lib.mkOption { certs = lib.mkOption {
default = { }; default = { };
@ -30,6 +35,6 @@ in
# /var/lib/acme/.challenges must be writable by the ACME user # /var/lib/acme/.challenges must be writable by the ACME user
# and readable by the Nginx user. The easiest way to achieve # and readable by the Nginx user. The easiest way to achieve
# this is to add the Nginx user to the ACME group. # this is to add the Nginx user to the ACME group.
users.users.nginx.extraGroups = lib.mkIf config.aux.system.services.nginx.enable [ "acme" ]; users.users.nginx.extraGroups = lib.mkIf config.${namespace}.services.nginx.enable [ "acme" ];
}; };
} }

View file

@ -1,10 +1,15 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.apcupsd; cfg = config.${namespace}.services.apcupsd;
in in
{ {
options = { options = {
aux.system.services.apcupsd = { ${namespace}.services.apcupsd = {
enable = lib.mkEnableOption "Enables apcupsd"; enable = lib.mkEnableOption "Enables apcupsd";
configText = lib.mkOption { configText = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -1,12 +1,17 @@
# Run automatic updates. Replaces system.autoUpgrade. # Run automatic updates. Replaces system.autoUpgrade.
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.autoUpgrade; cfg = config.${namespace}.services.autoUpgrade;
in in
{ {
options = { options = {
aux.system.services.autoUpgrade = { ${namespace}.services.autoUpgrade = {
enable = lib.mkEnableOption "Enables automatic system updates."; enable = lib.mkEnableOption "Enables automatic system updates.";
configDir = lib.mkOption { configDir = lib.mkOption {
type = lib.types.str; type = lib.types.str;
@ -54,7 +59,7 @@ in
]; ];
# Deploy update script # Deploy update script
aux.system.nixos-operations-script.enable = true; ${namespace}.nixos-operations-script.enable = true;
# Pull and apply updates. # Pull and apply updates.
systemd = { systemd = {
@ -63,7 +68,7 @@ in
Type = "oneshot"; Type = "oneshot";
User = "root"; User = "root";
}; };
path = config.aux.system.corePackages; path = config.${namespace}.corePackages;
unitConfig.RequiresMountsFor = cfg.configDir; unitConfig.RequiresMountsFor = cfg.configDir;
script = script =
"/run/current-system/sw/bin/nixos-operations-script --operation ${cfg.operation} " "/run/current-system/sw/bin/nixos-operations-script --operation ${cfg.operation} "

View file

@ -1,16 +1,16 @@
{ {
config, config,
lib, lib,
pkgs, namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.binary-cache; cfg = config.${namespace}.services.binary-cache;
in in
{ {
options = { options = {
aux.system.services.binary-cache = { ${namespace}.services.binary-cache = {
enable = lib.mkEnableOption "Enable a binary cache hosting service."; enable = lib.mkEnableOption "Enable a binary cache hosting service.";
secretKeyFile = lib.mkOption { secretKeyFile = lib.mkOption {
default = "/var/lib/nix-binary-cache/privkey.pem"; default = "/var/lib/nix-binary-cache/privkey.pem";
@ -49,7 +49,7 @@ in
}; };
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
basicAuth = { basicAuth = {
"${cfg.auth.user}" = cfg.auth.password; "${cfg.auth.user}" = cfg.auth.password;

View file

@ -2,15 +2,16 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.boinc; cfg = config.${namespace}.services.boinc;
in in
{ {
options = { options = {
aux.system.services.boinc = { ${namespace}.services.boinc = {
enable = lib.mkEnableOption "Enables BOINC distributed computing service."; enable = lib.mkEnableOption "Enables BOINC distributed computing service.";
home = lib.mkOption { home = lib.mkOption {
default = "/var/lib/boinc"; default = "/var/lib/boinc";
@ -27,7 +28,7 @@ in
dataDir = cfg.home; dataDir = cfg.home;
extraEnvPackages = [ extraEnvPackages = [
pkgs.ocl-icd pkgs.ocl-icd
] ++ lib.optionals config.aux.system.gpu.nvidia.enable [ pkgs.linuxPackages.nvidia_x11 ]; ] ++ lib.optionals config.${namespace}.gpu.nvidia.enable [ pkgs.linuxPackages.nvidia_x11 ];
allowRemoteGuiRpc = true; allowRemoteGuiRpc = true;
}; };

View file

@ -2,16 +2,16 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.duplicacy-web; cfg = config.${namespace}.services.duplicacy-web;
duplicacy-web = pkgs.callPackage ../../packages/duplicacy-web.nix { inherit pkgs lib; };
in in
{ {
options = { options = {
aux.system.services.duplicacy-web = { ${namespace}.services.duplicacy-web = {
enable = lib.mkEnableOption "Enables duplicacy-web"; enable = lib.mkEnableOption "Enables duplicacy-web";
home = lib.mkOption { home = lib.mkOption {
default = "/var/lib/duplicacy-web"; default = "/var/lib/duplicacy-web";
@ -22,8 +22,7 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
nixpkgs.config.allowUnfree = true; environment.systemPackages = [ pkgs.Sapana.duplicacy-web ];
environment.systemPackages = [ duplicacy-web ];
networking.firewall.allowedTCPPorts = [ 3875 ]; networking.firewall.allowedTCPPorts = [ 3875 ];
@ -38,7 +37,7 @@ in
description = "Start the Duplicacy backup service and web UI"; description = "Start the Duplicacy backup service and web UI";
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = ''${duplicacy-web}/duplicacy-web''; ExecStart = ''${pkgs.Sapana.duplicacy-web}/duplicacy-web'';
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 10; RestartSec = 10;
KillMode = "process"; KillMode = "process";

View file

@ -1,15 +1,15 @@
{ {
pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.forgejo; cfg = config.${namespace}.services.forgejo;
in in
{ {
options = { options = {
aux.system.services.forgejo = { ${namespace}.services.forgejo = {
enable = lib.mkEnableOption "Enables Forgejo Git hosting service."; enable = lib.mkEnableOption "Enables Forgejo Git hosting service.";
home = lib.mkOption { home = lib.mkOption {
default = ""; default = "";
@ -32,7 +32,7 @@ in
enable = true; enable = true;
settings = { settings = {
server = { server = {
DOMAIN = pkgs.util.getDomainFromURI cfg.url; DOMAIN = lib.Sapana.getDomainFromURI cfg.url;
ROOT_URL = cfg.url; ROOT_URL = cfg.url;
HTTP_PORT = 3000; HTTP_PORT = 3000;
}; };
@ -42,7 +42,7 @@ in
} // lib.optionalAttrs (cfg.home != null) { stateDir = cfg.home; }; } // lib.optionalAttrs (cfg.home != null) { stateDir = cfg.home; };
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:3000"; proxyPass = "http://127.0.0.1:3000";

View file

@ -2,18 +2,19 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.jellyfin; cfg = config.${namespace}.services.jellyfin;
jellyfin-audio-save = pkgs.unstable.jellyfin.overrideAttrs ( jellyfin-audio-save = pkgs.unstable.jellyfin.overrideAttrs (
finalAttrs: prevAttrs: { patches = [ ./jellyfin/jellyfin-audio-save-position.patch ]; } finalAttrs: prevAttrs: { patches = [ ./jellyfin-audio-save-position.patch ]; }
); );
in in
{ {
options = { options = {
aux.system.services.jellyfin = { ${namespace}.services.jellyfin = {
enable = lib.mkEnableOption "Enables the Jellyfin media streaming service."; enable = lib.mkEnableOption "Enables the Jellyfin media streaming service.";
home = lib.mkOption { home = lib.mkOption {
default = "/var/lib/jellyfin"; default = "/var/lib/jellyfin";
@ -30,11 +31,11 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.users.media.enable = true; ${namespace}.users.media.enable = true;
services = { services = {
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:8096"; proxyPass = "http://127.0.0.1:8096";

View file

@ -2,14 +2,15 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.languagetool; cfg = config.${namespace}.services.languagetool;
in in
{ {
options = { options = {
aux.system.services.languagetool = { ${namespace}.services.languagetool = {
enable = lib.mkEnableOption (lib.mdDoc "Enables LanguageTool server."); enable = lib.mkEnableOption (lib.mdDoc "Enables LanguageTool server.");
auth = { auth = {
password = lib.mkOption { password = lib.mkOption {
@ -50,13 +51,11 @@ in
public = true; public = true;
allowOrigin = "*"; allowOrigin = "*";
# Enable Ngrams # Enable Ngrams
settings.languageModel = lib.mkIf cfg.ngrams.enable "${ settings.languageModel = lib.mkIf cfg.ngrams.enable "${pkgs.Sapana.languagetool-ngrams}/share/languagetool/ngrams";
(pkgs.callPackage ../../packages/languagetool-ngrams.nix { inherit pkgs lib; })
}/share/languagetool/ngrams";
}; };
# Create Nginx virtualhost # Create Nginx virtualhost
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
basicAuth = { basicAuth = {
"${cfg.auth.user}" = cfg.auth.password; "${cfg.auth.user}" = cfg.auth.password;

View file

@ -1,12 +1,17 @@
# See https://wiki.nixos.org/wiki/Msmtp # See https://wiki.nixos.org/wiki/Msmtp
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.msmtp; cfg = config.${namespace}.services.msmtp;
in in
{ {
options = { options = {
aux.system.services.msmtp = { ${namespace}.services.msmtp = {
enable = lib.mkEnableOption "Enables mail server"; enable = lib.mkEnableOption "Enables mail server";
accounts = lib.mkOption { accounts = lib.mkOption {
type = lib.types.attrs; type = lib.types.attrs;

View file

@ -2,14 +2,15 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.netdata; cfg = config.${namespace}.services.netdata;
in in
{ {
options = { options = {
aux.system.services.netdata = { ${namespace}.services.netdata = {
enable = lib.mkEnableOption "Enables Netdata monitoring."; enable = lib.mkEnableOption "Enables Netdata monitoring.";
auth = { auth = {
user = lib.mkOption { user = lib.mkOption {
@ -50,7 +51,7 @@ in
(lib.mkIf (cfg.enable && cfg.type == "parent") { (lib.mkIf (cfg.enable && cfg.type == "parent") {
services = { services = {
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
basicAuth = { basicAuth = {
"${cfg.auth.user}" = cfg.auth.password; "${cfg.auth.user}" = cfg.auth.password;

View file

@ -1,11 +1,16 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.nginx; cfg = config.${namespace}.services.nginx;
in in
{ {
options = { options = {
aux.system.services.nginx = { ${namespace}.services.nginx = {
enable = lib.mkEnableOption "Enable the Nginx web server."; enable = lib.mkEnableOption "Enable the Nginx web server.";
virtualHosts = lib.mkOption { virtualHosts = lib.mkOption {

View file

@ -2,17 +2,18 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.qbittorrent; cfg = config.${namespace}.services.qbittorrent;
UID = 850; UID = 850;
GID = 850; GID = 850;
in in
{ {
options = { options = {
aux.system.services.qbittorrent = { ${namespace}.services.qbittorrent = {
enable = lib.mkEnableOption "Enables qBittorrent."; enable = lib.mkEnableOption "Enables qBittorrent.";
home = lib.mkOption { home = lib.mkOption {
default = "/var/lib/qbittorrent"; default = "/var/lib/qbittorrent";
@ -58,7 +59,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services = { services = {
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:${cfg.port}"; proxyPass = "http://127.0.0.1:${cfg.port}";

View file

@ -2,14 +2,15 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.rss; cfg = config.${namespace}.services.rss;
in in
{ {
options = { options = {
aux.system.services.rss = { ${namespace}.services.rss = {
enable = lib.mkEnableOption "Enables RSS hosting service via FreshRSS."; enable = lib.mkEnableOption "Enables RSS hosting service via FreshRSS.";
auth = { auth = {
password = lib.mkOption { password = lib.mkOption {
@ -56,7 +57,7 @@ in
}; };
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURI cfg.url; useACMEHost = lib.Sapana.getDomainFromURI cfg.url;
forceSSL = true; forceSSL = true;
}; };
}; };

View file

@ -1,11 +1,16 @@
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.ssh; cfg = config.${namespace}.services.ssh;
in in
{ {
options = { options = {
aux.system.services.ssh = { ${namespace}.services.ssh = {
enable = lib.mkEnableOption "Enables SSH server."; enable = lib.mkEnableOption "Enables SSH server.";
ports = lib.mkOption { ports = lib.mkOption {
default = [ 22 ]; default = [ 22 ];

View file

@ -1,12 +1,17 @@
# See https://wiki.nixos.org/wiki/Syncthing # See https://wiki.nixos.org/wiki/Syncthing
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.services.syncthing; cfg = config.${namespace}.services.syncthing;
in in
{ {
options = { options = {
aux.system.services.syncthing = { ${namespace}.services.syncthing = {
enable = lib.mkEnableOption "Enables Syncthing."; enable = lib.mkEnableOption "Enables Syncthing.";
enableTray = lib.mkEnableOption "Enables the Syncthing Tray applet."; enableTray = lib.mkEnableOption "Enables the Syncthing Tray applet.";
home = lib.mkOption { home = lib.mkOption {
@ -36,7 +41,7 @@ in
networking.firewall.allowedTCPPorts = with cfg.web; lib.mkIf (enable && public) [ port ]; networking.firewall.allowedTCPPorts = with cfg.web; lib.mkIf (enable && public) [ port ];
services = { services = {
flatpak.packages = lib.mkIf (config.aux.system.ui.flatpak.enable && cfg.enableTray) [ flatpak.packages = lib.mkIf (config.${namespace}.ui.flatpak.enable && cfg.enableTray) [
"io.github.martchus.syncthingtray" "io.github.martchus.syncthingtray"
]; ];

View file

@ -3,15 +3,16 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.services.virtualization; cfg = config.${namespace}.services.virtualization;
in in
{ {
options = { options = {
aux.system.services.virtualization = { ${namespace}.services.virtualization = {
enable = lib.mkEnableOption "Enables virtualization tools on this host."; enable = lib.mkEnableOption "Enables virtualization tools on this host.";
host = { host = {
enable = lib.mkEnableOption "Enables virtual machine hosting."; enable = lib.mkEnableOption "Enables virtual machine hosting.";

View file

@ -3,16 +3,17 @@
lib, lib,
config, config,
pkgs, pkgs,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.bluetooth; cfg = config.${namespace}.bluetooth;
in in
{ {
options = { options = {
aux.system.bluetooth = { ${namespace}.bluetooth = {
enable = lib.mkEnableOption "Enables bluetooth."; enable = lib.mkEnableOption "Enables bluetooth.";
experimental.enable = lib.mkEnableOption "Enables experimental features, like device power reporting."; experimental.enable = lib.mkEnableOption "Enables experimental features, like device power reporting.";
}; };

View file

@ -4,17 +4,18 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
# Bootloader # Bootloader
let let
cfg = config.aux.system.bootloader; cfg = config.${namespace}.bootloader;
in in
{ {
options = { options = {
aux.system.bootloader = { ${namespace}.bootloader = {
enable = lib.mkOption { enable = lib.mkOption {
description = "Automatically configures the bootloader. Set to false to configure manually."; description = "Automatically configures the bootloader. Set to false to configure manually.";
type = lib.types.bool; type = lib.types.bool;

View file

@ -3,16 +3,17 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system; cfg = config.${namespace};
gitWithLibsecret = pkgs.git.override { withLibsecret = true; }; gitWithLibsecret = pkgs.git.override { withLibsecret = true; };
in in
{ {
options = { options = {
aux.system = { ${namespace} = {
packages = lib.mkOption { packages = lib.mkOption {
description = "Additional system packages to install. This is just a wrapper for environment.systemPackages."; description = "Additional system packages to install. This is just a wrapper for environment.systemPackages.";
type = lib.types.listOf lib.types.package; type = lib.types.listOf lib.types.package;
@ -71,7 +72,7 @@ in
autodetect = true; autodetect = true;
notifications = { notifications = {
wall.enable = true; wall.enable = true;
mail = lib.mkIf config.aux.system.services.msmtp.enable { mail = lib.mkIf config.${namespace}.services.msmtp.enable {
enable = true; enable = true;
mailer = "/run/wrappers/bin/sendmail"; mailer = "/run/wrappers/bin/sendmail";
sender = "${config.networking.hostName}@${config.secrets.networking.domains.primary}"; sender = "${config.networking.hostName}@${config.secrets.networking.domains.primary}";

View file

@ -1,12 +1,17 @@
# Basic system-wide text editor configuration. # Basic system-wide text editor configuration.
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.editor; cfg = config.${namespace}.editor;
in in
{ {
options = { options = {
aux.system.editor = lib.mkOption { ${namespace}.editor = lib.mkOption {
description = "Selects the default text editor."; description = "Selects the default text editor.";
default = "nano"; default = "nano";
type = lib.types.enum [ type = lib.types.enum [

View file

@ -1,6 +1,11 @@
{ lib, config, ... }: {
lib,
config,
namespace,
...
}:
let let
cfg = config.aux.system.filesystem; cfg = config.${namespace}.filesystem;
# LUKS partition will decrypt to /dev/mapper/nixos-root # LUKS partition will decrypt to /dev/mapper/nixos-root
decryptPart = "nixos-root"; decryptPart = "nixos-root";
@ -14,7 +19,7 @@ let
in in
{ {
options = { options = {
aux.system.filesystem = { ${namespace}.filesystem = {
enable = lib.mkEnableOption "Enables standard BTRFS subvolumes and parameters."; enable = lib.mkEnableOption "Enables standard BTRFS subvolumes and parameters.";
partitions = { partitions = {
boot = lib.mkOption { boot = lib.mkOption {
@ -60,7 +65,7 @@ in
boot.initrd.luks.devices.${decryptPart} = { boot.initrd.luks.devices.${decryptPart} = {
device = cfg.partitions.luks; device = cfg.partitions.luks;
# Enable TPM auto-unlocking if configured # Enable TPM auto-unlocking if configured
crypttabExtraOpts = lib.mkIf config.aux.system.bootloader.tpm2.enable [ "tpm2-device=auto" ]; crypttabExtraOpts = lib.mkIf config.${namespace}.bootloader.tpm2.enable [ "tpm2-device=auto" ];
}; };
fileSystems = { fileSystems = {
"/" = { "/" = {

View file

@ -0,0 +1,110 @@
# Enables AMD GPU support.
{
pkgs,
config,
lib,
namespace,
...
}:
let
cfg = config.${namespace}.gpu;
in
{
options = {
${namespace}.gpu = {
amd.enable = lib.mkEnableOption "Enables AMD GPU support.";
intel.enable = lib.mkEnableOption "Enables Intel GPU support.";
nvidia = {
enable = lib.mkEnableOption "Enables Nvidia GPU support.";
hybrid = {
enable = lib.mkEnableOption "Enables hybrid GPU support.";
sync = lib.mkEnableOption "Enables sync mode for faster performance at the cost of higher battery usage.";
busIDs = {
nvidia = lib.mkOption {
description = "The bus ID for your Nvidia GPU.";
type = lib.types.str;
example = "PCI:0:2:0";
default = "";
};
intel = lib.mkOption {
description = "The bus ID for your integrated Intel GPU. If you don't have an Intel GPU, you can leave this blank.";
type = lib.types.str;
example = "PCI:14:0:0";
default = "";
};
amd = lib.mkOption {
description = "The bus ID for your integrated AMD GPU. If you don't have an AMD GPU, you can leave this blank.";
type = lib.types.str;
example = "PCI:54:0:0";
default = "";
};
};
};
};
};
};
config = lib.mkMerge [
(lib.mkIf cfg.amd.enable {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.graphics = {
enable = true;
# 32-bit application compatibility
enable32Bit = true;
};
})
(lib.mkIf cfg.intel.enable {
services.xserver.videoDrivers = [ "intel" ];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vpl-gpu-rt
];
extraPackages32 = with pkgs.driversi686Linux; [
intel-media-driver
vpl-gpu-rt
];
};
})
(lib.mkIf cfg.nvidia.enable {
assertions = [
{
assertion = (cfg.nvidia.hybrid.busIDs.nvidia != "");
message = "You need to define a bus ID for your Nvidia GPU. To learn how to find the bus ID, see https://wiki.nixos.org/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
}
{
assertion = (cfg.nvidia.hybrid.busIDs.intel != "" || cfg.nvidia.hybrid.busIDs.amd != "");
message = "You need to define a bus ID for your non-Nvidia GPU. To learn how to find your bus ID, see https://wiki.nixos.org/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
}
];
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware = {
opengl.extraPackages = with pkgs; [ vaapiVdpau ];
nvidia = {
modesetting.enable = true;
nvidiaSettings = config.${namespace}.ui.desktops.enable;
package = config.boot.kernelPackages.nvidiaPackages.stable;
prime = lib.mkIf cfg.nvidia.hybrid.enable {
offload = lib.mkIf (!cfg.nvidia.hybrid.sync) {
enable = true;
enableOffloadCmd = true; # Provides `nvidia-offload` command.
};
sync.enable = cfg.nvidia.hybrid.sync;
nvidiaBusId = cfg.nvidia.hybrid.busIDs.nvidia;
intelBusId = cfg.nvidia.hybrid.busIDs.intel;
amdgpuBusId = cfg.nvidia.hybrid.busIDs.amd;
};
};
};
})
];
}

View file

@ -1,5 +1,5 @@
# Configure basic networking options. # Configure basic networking options.
{ lib, ... }: { lib, namespace, ... }:
{ {
networking = { networking = {
# Default to DHCP. Set to false to use static IPs. # Default to DHCP. Set to false to use static IPs.

View file

@ -4,20 +4,21 @@
inputs, inputs,
lib, lib,
pkgs, pkgs,
namespace,
system,
... ...
}: }:
let let
cfg = config.aux.system; cfg = config.${namespace};
nixos-operations-script = pkgs.writeShellScriptBin "nixos-operations-script" ( nixos-operations-script = pkgs.writeShellScriptBin "nixos-operations-script" (
builtins.readFile ../../bin/nixos-operations-script.sh builtins.readFile ../../../../bin/nixos-operations-script.sh
); );
in in
{ {
options = { options = {
aux.system = { ${namespace} = {
allowUnfree = lib.mkEnableOption "Allow unfree packages to install.";
retentionPeriod = lib.mkOption { retentionPeriod = lib.mkOption {
description = "How long to retain NixOS generations. Defaults to one month."; description = "How long to retain NixOS generations. Defaults to one month.";
type = lib.types.str; type = lib.types.str;
@ -28,10 +29,12 @@ in
}; };
config = lib.mkMerge [ config = lib.mkMerge [
{ {
nixpkgs.config.allowUnfree = cfg.allowUnfree;
nix = { nix = {
# Use Lix in place of Nix
package = inputs.lix.packages.${system}.default;
# Ensure we can still build when secondary caches are unavailable
extraOptions = '' extraOptions = ''
# Ensure we can still build when secondary caches are unavailable
fallback = true fallback = true
''; '';
@ -62,14 +65,14 @@ in
# Only allow these users to use Nix # Only allow these users to use Nix
allowed-users = with config.users.users; [ allowed-users = with config.users.users; [
root.name root.name
(lib.mkIf config.aux.system.users.aires.enable aires.name) (lib.mkIf config.${namespace}.users.aires.enable aires.name)
(lib.mkIf config.aux.system.users.gremlin.enable gremlin.name) (lib.mkIf config.${namespace}.users.gremlin.enable gremlin.name)
]; ];
# Avoid signature verification messages when doing remote builds # Avoid signature verification messages when doing remote builds
trusted-users = with config.users.users; [ trusted-users = with config.users.users; [
root.name root.name
(lib.mkIf config.aux.system.users.aires.enable aires.name) (lib.mkIf config.${namespace}.users.aires.enable aires.name)
]; ];
}; };
@ -94,7 +97,7 @@ in
} }
(lib.mkIf cfg.nixos-operations-script.enable { (lib.mkIf cfg.nixos-operations-script.enable {
# Enable and configure NOS # Enable and configure NOS
aux.system.packages = [ nixos-operations-script ]; ${namespace}.packages = [ nixos-operations-script ];
environment.variables."FLAKE_DIR" = config.secrets.nixConfigFolder; environment.variables."FLAKE_DIR" = config.secrets.nixConfigFolder;
}) })
]; ];

View file

@ -1,11 +1,16 @@
{ lib, config, ... }: {
lib,
config,
namespace,
...
}:
let let
cfg = config.aux.system.raid; cfg = config.${namespace}.raid;
in in
{ {
options = { options = {
aux.system.raid = { ${namespace}.raid = {
enable = lib.mkEnableOption "Enables RAID support."; enable = lib.mkEnableOption "Enables RAID support.";
storage = { storage = {
enable = lib.mkEnableOption "Enables support for the storage array."; enable = lib.mkEnableOption "Enables support for the storage array.";
@ -28,7 +33,7 @@ in
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf cfg.enable { boot.swraid.enable = true; }) (lib.mkIf cfg.enable { boot.swraid.enable = true; })
(lib.mkIf cfg.storage.enable { (lib.mkIf cfg.storage.enable {
aux.system.raid.enable = true; ${namespace}.raid.enable = true;
boot.swraid.mdadmConf = '' boot.swraid.mdadmConf = ''
ARRAY /dev/md/Sapana metadata=1.2 UUID=51076daf:efdb34dd:bce48342:3b549fcb ARRAY /dev/md/Sapana metadata=1.2 UUID=51076daf:efdb34dd:bce48342:3b549fcb
MAILADDR ${cfg.storage.mailAddr} MAILADDR ${cfg.storage.mailAddr}

View file

@ -3,15 +3,16 @@
pkgs, pkgs,
lib, lib,
config, config,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.ui.audio; cfg = config.${namespace}.ui.audio;
in in
{ {
options = { options = {
aux.system.ui.audio = { ${namespace}.ui.audio = {
enable = lib.mkEnableOption "Enables audio."; enable = lib.mkEnableOption "Enables audio.";
enableLowLatency = lib.mkEnableOption "Enables low-latency audio (may cause crackling) per https://wiki.nixos.org/wiki/PipeWire#Low-latency_setup."; enableLowLatency = lib.mkEnableOption "Enables low-latency audio (may cause crackling) per https://wiki.nixos.org/wiki/PipeWire#Low-latency_setup.";
}; };

View file

@ -1,15 +1,20 @@
# Enables the Budgie desktop environment. # Enables the Budgie desktop environment.
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.ui.desktops.budgie; cfg = config.${namespace}.ui.desktops.budgie;
in in
{ {
options = { options = {
aux.system.ui.desktops.budgie.enable = lib.mkEnableOption "Enables the Budgie desktop environment."; ${namespace}.ui.desktops.budgie.enable = lib.mkEnableOption "Enables the Budgie desktop environment.";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; ${namespace}.ui.desktops.enable = true;
services.xserver = { services.xserver = {
enable = true; enable = true;

View file

@ -3,15 +3,16 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.ui.desktops; cfg = config.${namespace}.ui.desktops;
in in
{ {
options = { options = {
aux.system.ui.desktops = { ${namespace}.ui.desktops = {
enable = lib.mkEnableOption "Enables base desktop environment support."; enable = lib.mkEnableOption "Enables base desktop environment support.";
xkb = lib.mkOption { xkb = lib.mkOption {
description = "The keyboard layout to use by default. Defaults to us."; description = "The keyboard layout to use by default. Defaults to us.";
@ -25,7 +26,7 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system = { ${namespace} = {
bluetooth = { bluetooth = {
enable = true; enable = true;
experimental.enable = true; experimental.enable = true;
@ -79,7 +80,7 @@ in
enable = true; enable = true;
# Configure keymap in X11 # Configure keymap in X11
xkb = config.aux.system.ui.desktops.xkb; xkb = config.${namespace}.ui.desktops.xkb;
}; };
# Enable touchpad support (enabled by default in most desktop managers, buuuut just in case). # Enable touchpad support (enabled by default in most desktop managers, buuuut just in case).

View file

@ -4,22 +4,23 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.ui.desktops.gnome; cfg = config.${namespace}.ui.desktops.gnome;
in in
{ {
options = { options = {
aux.system.ui.desktops.gnome = { ${namespace}.ui.desktops.gnome = {
enable = lib.mkEnableOption "Enables the Gnome Desktop Environment."; enable = lib.mkEnableOption "Enables the Gnome Desktop Environment.";
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; ${namespace}.ui.desktops.enable = true;
# Enable Gnome # Enable Gnome
services = { services = {

View file

@ -1,15 +1,20 @@
# Enables the Hyprland desktop environment. # Enables the Hyprland desktop environment.
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.ui.desktops.hyprland; cfg = config.${namespace}.ui.desktops.hyprland;
in in
{ {
options = { options = {
aux.system.ui.desktops.hyprland.enable = lib.mkEnableOption "Enables the Hyprland desktop environment."; ${namespace}.ui.desktops.hyprland.enable = lib.mkEnableOption "Enables the Hyprland desktop environment.";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; ${namespace}.ui.desktops.enable = true;
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;

View file

@ -3,22 +3,23 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
let let
cfg = config.aux.system.ui.desktops.kde; cfg = config.${namespace}.ui.desktops.kde;
in in
{ {
options = { options = {
aux.system.ui.desktops.kde = { ${namespace}.ui.desktops.kde = {
enable = lib.mkEnableOption "Enables the KDE Desktop Environment."; enable = lib.mkEnableOption "Enables the KDE Desktop Environment.";
useX11 = lib.mkEnableOption "Uses X11 instead of Wayland."; useX11 = lib.mkEnableOption "Uses X11 instead of Wayland.";
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; ${namespace}.ui.desktops.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;

View file

@ -1,15 +1,20 @@
# Enables the XFCE desktop environment. # Enables the XFCE desktop environment.
{ config, lib, ... }: {
config,
lib,
namespace,
...
}:
let let
cfg = config.aux.system.ui.desktops.xfce; cfg = config.${namespace}.ui.desktops.xfce;
in in
{ {
options = { options = {
aux.system.ui.desktops.xfce.enable = lib.mkEnableOption "Enables the XFCE desktop environment."; ${namespace}.ui.desktops.xfce.enable = lib.mkEnableOption "Enables the XFCE desktop environment.";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; ${namespace}.ui.desktops.enable = true;
services.xserver = { services.xserver = {
enable = true; enable = true;

View file

@ -2,16 +2,17 @@
pkgs, pkgs,
config, config,
lib, lib,
namespace,
... ...
}: }:
# Flatpak support and options # Flatpak support and options
let let
cfg = config.aux.system.ui.flatpak; cfg = config.${namespace}.ui.flatpak;
in in
{ {
options = { options = {
aux.system.ui.flatpak = { ${namespace}.ui.flatpak = {
enable = lib.mkEnableOption { description = "Enables Flatpak support."; }; enable = lib.mkEnableOption { description = "Enables Flatpak support."; };
packages = lib.mkOption { packages = lib.mkOption {
description = "Flatpak packages to install."; description = "Flatpak packages to install.";
@ -72,8 +73,8 @@ in
aggregatedIcons = pkgs.buildEnv { aggregatedIcons = pkgs.buildEnv {
name = "system-icons"; name = "system-icons";
paths = with pkgs; [ paths = with pkgs; [
(lib.mkIf config.aux.system.ui.desktops.gnome.enable gnome-themes-extra) (lib.mkIf config.${namespace}.ui.desktops.gnome.enable gnome-themes-extra)
(lib.mkIf config.aux.system.ui.desktops.kde.enable kdePackages.breeze-icons) (lib.mkIf config.${namespace}.ui.desktops.kde.enable kdePackages.breeze-icons)
papirus-icon-theme papirus-icon-theme
qogir-icon-theme qogir-icon-theme
]; ];

View file

@ -1,16 +1,17 @@
{ {
lib, lib,
config, config,
namespace,
... ...
}: }:
# Define 'aires' # Define 'aires'
let let
cfg = config.aux.system.users.aires; cfg = config.${namespace}.users.aires;
in in
{ {
options = { options = {
aux.system.users.aires = { ${namespace}.users.aires = {
enable = lib.mkEnableOption "Enables aires user account"; enable = lib.mkEnableOption "Enables aires user account";
autologin = lib.mkEnableOption "Automatically logs aires in on boot"; autologin = lib.mkEnableOption "Automatically logs aires in on boot";
}; };
@ -66,7 +67,7 @@ in
userName = config.secrets.users.aires.firstName; userName = config.secrets.users.aires.firstName;
userEmail = config.secrets.users.aires.email; userEmail = config.secrets.users.aires.email;
extraConfig = { extraConfig = {
core.editor = config.aux.system.editor; core.editor = config.${namespace}.editor;
merge.conflictStyle = "zdiff3"; merge.conflictStyle = "zdiff3";
pull.ff = "only"; pull.ff = "only";
push.autoSetupRemote = "true"; push.autoSetupRemote = "true";

View file

Before

Width:  |  Height:  |  Size: 853 KiB

After

Width:  |  Height:  |  Size: 853 KiB

View file

@ -1,5 +1,4 @@
{ lib, osConfig, ... }: _: {
{
# NOTE: Allegedly prevents random Gnome crashes. But really, it just prevents me from logging in. # NOTE: Allegedly prevents random Gnome crashes. But really, it just prevents me from logging in.
# See https://www.reddit.com/r/archlinux/comments/1erbika/fyi_if_you_experience_crashes_on_gnome_on_amd/ # See https://www.reddit.com/r/archlinux/comments/1erbika/fyi_if_you_experience_crashes_on_gnome_on_amd/
/* /*
@ -9,7 +8,7 @@
*/ */
# Additional Gnome configurations via home-manager. # Additional Gnome configurations via home-manager.
dconf.settings = lib.mkIf osConfig.aux.system.ui.desktops.gnome.enable { dconf.settings = {
"org/gnome/mutter" = { "org/gnome/mutter" = {
edge-tiling = true; edge-tiling = true;
workspaces-only-on-primary = false; workspaces-only-on-primary = false;

View file

@ -2,16 +2,17 @@
pkgs, pkgs,
lib, lib,
config, config,
namespace,
... ...
}: }:
# Define 'gremlin' user # Define 'gremlin' user
let let
cfg = config.aux.system.users.gremlin; cfg = config.${namespace}.users.gremlin;
in in
{ {
options = { options = {
aux.system.users.gremlin = { ${namespace}.users.gremlin = {
enable = lib.mkEnableOption "Enables gremlin user account"; enable = lib.mkEnableOption "Enables gremlin user account";
}; };
}; };
@ -35,7 +36,7 @@ in
}; };
# Install gremlin-specific flatpaks # Install gremlin-specific flatpaks
aux.system.ui.flatpak.packages = [ ${namespace}.ui.flatpak.packages = [
"com.google.Chrome" "com.google.Chrome"
"com.slack.Slack" "com.slack.Slack"
]; ];

View file

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View file

@ -1,13 +1,18 @@
{ lib, config, ... }: {
lib,
config,
namespace,
...
}:
# Define user for managing media files # Define user for managing media files
let let
cfg = config.aux.system.users.media; cfg = config.${namespace}.users.media;
in in
{ {
options = { options = {
aux.system.users.media = { ${namespace}.users.media = {
enable = lib.mkEnableOption "Enables media user account"; enable = lib.mkEnableOption "Enables media user account";
}; };
}; };

View file

@ -1,4 +1,4 @@
{ ... }: { namespace, ... }:
{ {
home-manager.users.root = { home-manager.users.root = {
imports = [ ../common/home-manager/zsh.nix ]; imports = [ ../common/home-manager/zsh.nix ];

File diff suppressed because it is too large Load diff

View file

@ -1,112 +0,0 @@
U2FsdGVkX19uO/YPjMlCHQXarQnzeZWOIhvuR/7/nwgPGZu7YTeyyEqzGS0hFNdF
jIo5a5umjTBPe0gUkAkTecwUFmbVCje2aQ0GmsBzEjsUXJTiM4kpElcWpRfBebtm
qfh2JTFTAOj2QUB2rYjK2JzwfZpGEWyoG5A3QRukzFnr7I7sUse9sVBQeKnI4put
/Kpe9tN+tDnf3byU83I7XxE9YECnlTTvF/A2CX4S7xf7Ig56DGH7rFAT3I4NIBkZ
FOTnIZcgQnBuB0HM/YdDeGsUIaxlDXcpFdj1YnVfrPDMuC245wO8n05YPNuiGEQZ
+2A0jDVeKWGasORdE19m4ciBRi4A3qgsMmArFvXtWJ+lHBL+510GrvNPlipbX7BM
c+TwrL6WgSwe0mtsB7e9MzDe6Fod3zQuLZIcD+9tqADP1V6REg8JjMH6fUj7atZ+
KlgejWbxliG0s1snuzZlVGSUS441ydkXb+takXLOtGBMRD5LDdSquEl9W/LAlAuo
bBWo+HiwIQjDadr/1zRGCcO1kYgtaFrSFJATTlU/cbf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1VfZJx
5ab+d1+nDjffafKt1c3+npusiAWfKyZiSogzutgRn6dI37QcYGE3NAs+H/IS7a0R
b7E1OKe1sYaR0h4tfHJ+SfOC1msK5itiMWqiUaHDuEBcmn1qGSwhPePJ4D5U1380
949SQ0Wo9LF2FC7n32+ntPXBTWbBNvAcz4qNMqxzojumPLCRtr5+GDnf34sEsBTS
jNVB5ZTZKUBcOrReUGC2X1bigbRE7corL19dkEaxzZI=

View file

@ -1,26 +0,0 @@
# Enables AMD GPU support.
{
pkgs,
config,
lib,
...
}:
let
cfg = config.aux.system.gpu.amd;
in
{
options = {
aux.system.gpu.amd.enable = lib.mkEnableOption "Enables AMD GPU support.";
};
config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.graphics = {
enable = true;
# 32-bit application compatibility
enable32Bit = true;
};
};
}

View file

@ -1,33 +0,0 @@
# Enables Intel GPU support.
# https://wiki.nixos.org/wiki/Intel_Graphics
# https://nixos.org/manual/nixos/stable/#sec-x11--graphics-cards-intel
{
pkgs,
config,
lib,
...
}:
let
cfg = config.aux.system.gpu.intel;
in
{
options = {
aux.system.gpu.intel.enable = lib.mkEnableOption "Enables Intel GPU support.";
};
config = lib.mkIf cfg.enable {
services.xserver.videoDrivers = [ "intel" ];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vpl-gpu-rt
];
extraPackages32 = with pkgs.driversi686Linux; [
intel-media-driver
vpl-gpu-rt
];
};
};
}

View file

@ -1,80 +0,0 @@
# Enables Nvidia GPU support.
{
pkgs,
config,
lib,
...
}:
let
cfg = config.aux.system.gpu.nvidia;
in
{
options = {
aux.system.gpu.nvidia = {
enable = lib.mkEnableOption "Enables Nvidia GPU support.";
hybrid = {
enable = lib.mkEnableOption "Enables hybrid GPU support.";
sync = lib.mkEnableOption "Enables sync mode for faster performance at the cost of higher battery usage.";
busIDs = {
nvidia = lib.mkOption {
description = "The bus ID for your Nvidia GPU.";
type = lib.types.str;
example = "PCI:0:2:0";
default = "";
};
intel = lib.mkOption {
description = "The bus ID for your integrated Intel GPU. If you don't have an Intel GPU, you can leave this blank.";
type = lib.types.str;
example = "PCI:14:0:0";
default = "";
};
amd = lib.mkOption {
description = "The bus ID for your integrated AMD GPU. If you don't have an AMD GPU, you can leave this blank.";
type = lib.types.str;
example = "PCI:54:0:0";
default = "";
};
};
};
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = (cfg.hybrid.busIDs.nvidia != "");
message = "You need to define a bus ID for your Nvidia GPU. To learn how to find the bus ID, see https://wiki.nixos.org/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
}
{
assertion = (cfg.hybrid.busIDs.intel != "" || cfg.hybrid.busIDs.amd != "");
message = "You need to define a bus ID for your non-Nvidia GPU. To learn how to find your bus ID, see https://wiki.nixos.org/wiki/Nvidia#Configuring_Optimus_PRIME:_Bus_ID_Values_.28Mandatory.29.";
}
];
aux.system.allowUnfree = true;
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware = {
opengl.extraPackages = with pkgs; [ vaapiVdpau ];
nvidia = {
modesetting.enable = true;
nvidiaSettings = config.aux.system.ui.desktops.enable;
package = config.boot.kernelPackages.nvidiaPackages.stable;
prime = lib.mkIf cfg.hybrid.enable {
offload = lib.mkIf (!cfg.hybrid.sync) {
enable = true;
enableOffloadCmd = true; # Provides `nvidia-offload` command.
};
sync.enable = cfg.hybrid.sync;
nvidiaBusId = cfg.hybrid.busIDs.nvidia;
intelBusId = cfg.hybrid.busIDs.intel;
amdgpuBusId = cfg.hybrid.busIDs.amd;
};
};
};
};
}

View file

@ -1,25 +0,0 @@
# Utility and helper functions
{
lib,
...
}:
{
nixpkgs.overlays = [
(final: _prev: {
# Define custom functions using 'pkgs.util'
util = {
# Parses the domain from a URI
getDomainFromURI =
url:
let
parsedURL = (lib.strings.splitString "." url);
in
builtins.concatStringsSep "." [
(builtins.elemAt parsedURL 1)
(builtins.elemAt parsedURL 2)
];
};
})
];
}

View file

@ -0,0 +1,10 @@
{ channels, inputs, ... }:
final: prev:
{
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
}

View file

@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgs.unzip ]; nativeBuildInputs = [ pkgs.unzip ];
buildInputs = [ pkgs.unzip ]; buildInputs = [ pkgs.unzip ];
src = ../modules/secrets/Freight-20240828T164047Z-001.zip; src = ../../modules/nixos/secrets/Freight-20240828T164047Z-001.zip;
unpackPhase = '' unpackPhase = ''
runHook preUnpack runHook preUnpack

View file

@ -2,6 +2,7 @@
config, config,
pkgs, pkgs,
lib, lib,
namespace,
... ...
}: }:
let let
@ -24,7 +25,7 @@ in
}; };
}; };
aux.system = { ${namespace} = {
bootloader.enable = false; # Bootloader configured in hardware-configuration.nix bootloader.enable = false; # Bootloader configured in hardware-configuration.nix
packages = with pkgs; [ packages = with pkgs; [
libraspberrypi libraspberrypi

View file

@ -1,6 +1,11 @@
# Raspberry Pi 4B # Raspberry Pi 4B
# See https://wiki.nixos.org/wiki/NixOS_on_ARM/Raspberry_Pi_4 # See https://wiki.nixos.org/wiki/NixOS_on_ARM/Raspberry_Pi_4
{ lib, modulesPath, ... }: {
lib,
modulesPath,
namespace,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -4,6 +4,7 @@
home-manager, home-manager,
lib, lib,
config, config,
namespace,
... ...
}: }:
let let
@ -22,8 +23,7 @@ in
networking.hostName = hostName; networking.hostName = hostName;
# Configure the system here. # Configure the system here.
aux.system = { config.${namespace} = {
role = "workstation";
apps = { apps = {
# Define applications here # Define applications here
}; };

View file

@ -29,7 +29,7 @@ in
}; };
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { ${namespace}.filesystem = {
enable = true; enable = true;
partitions = { partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}"; boot = "/dev/disk/by-uuid/${bootUUID}";

View file

@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
namespace,
... ...
}: }:
@ -32,7 +33,7 @@ let
*/ */
serviceList = lib.attrsets.collect ( serviceList = lib.attrsets.collect (
x: x != "acme" && (lib.attrsets.matchAttrs { enable = true; } x) x: x != "acme" && (lib.attrsets.matchAttrs { enable = true; } x)
) config.aux.system.services; ) config.${namespace}.services;
subdomains = builtins.catAttrs "url" serviceList; subdomains = builtins.catAttrs "url" serviceList;
in in
@ -75,7 +76,7 @@ in
Type = "oneshot"; Type = "oneshot";
User = "aires"; User = "aires";
}; };
path = config.aux.system.corePackages; path = config.${namespace}.corePackages;
script = '' script = ''
/run/current-system/sw/bin/nixos-operations-script --operation build --hostname Khanda --flake ${config.secrets.nixConfigFolder} /run/current-system/sw/bin/nixos-operations-script --operation build --hostname Khanda --flake ${config.secrets.nixConfigFolder}
''; '';
@ -92,12 +93,7 @@ in
}; };
# Configure the system. # Configure the system.
aux.system = { ${namespace} = {
# Enable to allow unfree (e.g. closed source) packages.
# Some settings may override this (e.g. enabling Nvidia GPU support).
# https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree
allowUnfree = true;
# Enable Secure Boot support. # Enable Secure Boot support.
bootloader = { bootloader = {
enable = true; enable = true;

View file

@ -1,5 +1,5 @@
# Minisforum UM340 # Minisforum UM340
{ modulesPath, ... }: { modulesPath, namespace, ... }:
let let
bootUUID = "D2E7-FE8F"; # The UUID of the boot partition. bootUUID = "D2E7-FE8F"; # The UUID of the boot partition.
luksUUID = "7b9c756c-ba9d-43fc-b935-7c77a70f5f1b"; # The UUID of the locked LUKS partition. luksUUID = "7b9c756c-ba9d-43fc-b935-7c77a70f5f1b"; # The UUID of the locked LUKS partition.
@ -30,7 +30,7 @@ in
}; };
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { ${namespace}.filesystem = {
enable = true; enable = true;
partitions = { partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}"; boot = "/dev/disk/by-uuid/${bootUUID}";

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, namespace, ... }:
let let
# Do not change this value! This tracks when NixOS was installed on your system. # Do not change this value! This tracks when NixOS was installed on your system.
@ -13,12 +13,7 @@ in
###*** Configure your system below this line. ***### ###*** Configure your system below this line. ***###
# Configure the system. # Configure the system.
aux.system = { ${namespace} = {
# Enable to allow unfree (e.g. closed source) packages.
# Some settings may override this (e.g. enabling Nvidia GPU support).
# https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree
allowUnfree = true;
apps = { apps = {
development.enable = true; development.enable = true;
media.enable = true; media.enable = true;

View file

@ -4,6 +4,7 @@
lib, lib,
pkgs, pkgs,
modulesPath, modulesPath,
namespace,
... ...
}: }:
let let
@ -56,7 +57,7 @@ in
}; };
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { ${namespace}.filesystem = {
enable = true; enable = true;
partitions = { partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}"; boot = "/dev/disk/by-uuid/${bootUUID}";

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }: {
config,
pkgs,
namespace,
...
}:
let let
# Do not change this value! This tracks when NixOS was installed on your system. # Do not change this value! This tracks when NixOS was installed on your system.
stateVersion = "24.05"; stateVersion = "24.05";
@ -14,14 +19,16 @@ in
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
networking.hostName = hostName; networking.hostName = hostName;
custom-fonts.Freight-Pro.enable = config.aux.system.users.gremlin.enable; custom-fonts.Freight-Pro.enable = config.${namespace}.users.gremlin.enable;
aux.system = { ${namespace} = {
apps = { apps = {
development.enable = true; development.enable = true;
dj.enable = true;
gaming.enable = true; gaming.enable = true;
media.enable = true; media = {
enable = true;
mixxx.enable = true;
};
office.enable = true; office.enable = true;
recording.enable = true; recording.enable = true;
social.enable = true; social.enable = true;

View file

@ -1,5 +1,10 @@
# Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7) # Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7)
{ pkgs, modulesPath, ... }: {
pkgs,
modulesPath,
namespace,
...
}:
let let
bootUUID = "AFCB-D880"; # The UUID of the boot partition. bootUUID = "AFCB-D880"; # The UUID of the boot partition.
luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition. luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition.
@ -28,7 +33,7 @@ in
}; };
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { ${namespace}.filesystem = {
enable = true; enable = true;
partitions = { partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}"; boot = "/dev/disk/by-uuid/${bootUUID}";

15
treefmt.nix Normal file
View file

@ -0,0 +1,15 @@
# Configure formatter for .nix and other repo files
{ pkgs, ... }:
{
projectRootFile = "flake.nix";
programs = {
beautysh.enable = true;
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
prettier.enable = true;
yamlfmt.enable = true;
};
}