Compare commits
1 Commits
main
...
feature/tm
Author | SHA1 | Date | |
---|---|---|---|
ae77cb3e0c |
63
.github/workflows/build-then-cache.yaml
vendored
63
.github/workflows/build-then-cache.yaml
vendored
@ -1,63 +0,0 @@
|
|||||||
name: Build and upload to Attic cache
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_arm:
|
|
||||||
runs-on: ubuntu-22.04-arm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
|
||||||
with:
|
|
||||||
extra-conf: |
|
|
||||||
keep-going = true
|
|
||||||
fallback = true
|
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
|
||||||
- uses: ryanccn/attic-action@v0
|
|
||||||
with:
|
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
|
||||||
cache: ${{ vars.ATTIC_CACHE }}
|
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
# free useless disk space
|
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
|
||||||
# TODO: figure out how to use flake checks and use those to build it
|
|
||||||
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
|
||||||
|
|
||||||
build_x86-64_packages:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
|
||||||
with:
|
|
||||||
extra-conf: |
|
|
||||||
keep-going = true
|
|
||||||
fallback = true
|
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
|
||||||
- uses: ryanccn/attic-action@v0
|
|
||||||
with:
|
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
|
||||||
cache: ${{ vars.ATTIC_CACHE }}
|
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
- run: 'nix develop .#ci --command bash ci/run_builds.sh packages'
|
|
||||||
|
|
||||||
build_x86-64:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
|
||||||
with:
|
|
||||||
extra-conf: |
|
|
||||||
keep-going = true
|
|
||||||
fallback = true
|
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
|
||||||
- uses: ryanccn/attic-action@v0
|
|
||||||
with:
|
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
|
||||||
cache: ${{ vars.ATTIC_CACHE }}
|
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
# free useless disk space
|
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
|
||||||
# TODO: figure out how to use flake checks and use those to build it
|
|
||||||
- run: 'nix develop .#ci --command bash ci/run_builds.sh config'
|
|
49
.github/workflows/proactive-update.yaml
vendored
49
.github/workflows/proactive-update.yaml
vendored
@ -1,49 +0,0 @@
|
|||||||
name: Proactively build and cache flake
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 */6 * * *"
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "force-build"
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_arm:
|
|
||||||
runs-on: ubuntu-22.04-arm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
|
||||||
with:
|
|
||||||
extra-conf: |
|
|
||||||
keep-going = true
|
|
||||||
fallback = true
|
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
|
||||||
- uses: ryanccn/attic-action@v0
|
|
||||||
with:
|
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
|
||||||
cache: ${{ vars.ATTIC_CACHE }}
|
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
# free useless disk space
|
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
|
||||||
- run: 'nix flake update'
|
|
||||||
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
|
||||||
|
|
||||||
build_x86:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
|
||||||
with:
|
|
||||||
extra-conf: |
|
|
||||||
keep-going = true
|
|
||||||
fallback = true
|
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
|
||||||
- uses: ryanccn/attic-action@v0
|
|
||||||
with:
|
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
|
||||||
cache: ${{ vars.ATTIC_CACHE }}
|
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
# free useless disk space
|
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
|
||||||
- run: 'nix flake update'
|
|
||||||
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
|
26
README.md
26
README.md
@ -1,16 +1,8 @@
|
|||||||
# NullBite's NixOS Config
|
# NullBite's NixOS Config
|
||||||
Preface: the current structure of this flake scares me a bit. I have added
|
|
||||||
[flake-parts](https://github.com/hercules-ci/flake-parts) to this repository
|
|
||||||
and I plan to modularize it in the same way I refactored my actual NixOS and
|
|
||||||
Home Manager configurations. This repository used to be *a lot worse* because
|
|
||||||
it was my very first Nix project, but I have learned a lot about both Nix and
|
|
||||||
programming in general in this span of time.
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
This is my personal NixOS config. Right now, it's just a <del>basic</del>
|
This is my personal NixOS config. Right now, it's just a <del>basic</del>
|
||||||
extremely ~~overengineered~~ messy flake which imports a (mostly) normal stock NixOS configuration.
|
extremely overengineered flake which imports a (mostly) normal stock NixOS configuration.
|
||||||
|
|
||||||
Now that I have used NixOS for a ~~month~~ year, I have learned a fair bit and have made
|
Now that I have used NixOS for a month, I have learned a fair bit and have made
|
||||||
some organizational changes. <del>Currently, the repository is organized as
|
some organizational changes. <del>Currently, the repository is organized as
|
||||||
such</del> (I am in the process of migrating my config to this format, some
|
such</del> (I am in the process of migrating my config to this format, some
|
||||||
stuff may not match yet):
|
stuff may not match yet):
|
||||||
@ -71,13 +63,13 @@ stuff may not match yet):
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- ~~Reorganize repo to use a more "standard" module layout.~~
|
- Reorganize repo to use a more "standard" module layout.
|
||||||
- ~~[github:Misterio77/nix-config](https://github.com/Misterio77/nix-config) might be a good reference for a better module layout.~~
|
- [github:Misterio77/nix-config](https://github.com/Misterio77/nix-config) might be a good reference for a better module layout.
|
||||||
- ~~Select entire desktop configuration via a single option and make bootable with specialisation.~~
|
- Select entire desktop configuration via a single option and make bootable with specialisation.
|
||||||
- ~~Give each desktop a modularized configuration that can be enabled with an option.~~
|
- Give each desktop a modularized configuration that can be enabled with an option.
|
||||||
- ~~figure out nixpkgs.lib.options.mkOption and add a string option that picks a desktop to use.~~
|
- figure out nixpkgs.lib.options.mkOption and add a string option that picks a desktop to use.
|
||||||
- add Plasma, Hyprland, and maybe GNOME if I'm feeling silly (I'd probably never actually use it).
|
- add Plasma, Hyprland, and maybe GNOME if I'm feeling silly (I'd probably never actually use it).
|
||||||
- ~~make more things configurable as options once I figure out the above, it's probably cleaner than importing modules.~~
|
- make more things configurable as options once I figure out the above, it's probably cleaner than importing modules.
|
||||||
- Reorganize README bullets into headings
|
- Reorganize README bullets into headings
|
||||||
- make system ephemeral/stateless
|
- make system ephemeral/stateless
|
||||||
- The following command is able to successfully show any accumulated state on my system: <pre><code>sudo find / -xdev \( -path /home -o -path /nix -o -path /boot \) -prune -o \( -name flatpak -o -name boot.bak -o -path /var/log -o -name .cache \) \( -prune -print \) -o \( -type f \) -print</code></pre>
|
- The following command is able to successfully show any accumulated state on my system: <pre><code>sudo find / -xdev \( -path /home -o -path /nix -o -path /boot \) -prune -o \( -name flatpak -o -name boot.bak -o -path /var/log -o -name .cache \) \( -prune -print \) -o \( -type f \) -print</code></pre>
|
||||||
@ -93,4 +85,4 @@ stuff may not match yet):
|
|||||||
- coredumps
|
- coredumps
|
||||||
- /root user and /home
|
- /root user and /home
|
||||||
- /etc/machine-id
|
- /etc/machine-id
|
||||||
- ~~configure /etc/supergfxd.conf with a oneshot systemd unit on boot bsaed on selected specialisation (should still be modifiable with supergfxctl but should be ephemeral)~~
|
- configure /etc/supergfxd.conf with a oneshot systemd unit on boot bsaed on selected specialisation (should still be modifiable with supergfxctl but should be ephemeral)
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# shellcheck disable=SC2317
|
|
||||||
# ^ SC2317 (Command appears to be unreachable.)
|
|
||||||
|
|
||||||
set -Exo pipefail
|
|
||||||
|
|
||||||
err=0
|
|
||||||
|
|
||||||
set_error () {
|
|
||||||
err=1
|
|
||||||
pkill -s 0 -9 nix-eval-jobs || true
|
|
||||||
}
|
|
||||||
|
|
||||||
trap set_error ERR
|
|
||||||
|
|
||||||
system="$(nix eval --impure --raw --expr 'builtins.currentSystem')"
|
|
||||||
|
|
||||||
|
|
||||||
run_builds () {
|
|
||||||
for i in "$@" ; do
|
|
||||||
nix-fast-build --eval-workers 1 --no-nom --skip-cache --attic-cache main -f "$i"
|
|
||||||
pkill -s 0 -9 nix-eval-jobs || true
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
_build_systems () {
|
|
||||||
case "$system" in
|
|
||||||
# TODO this is messy and hard-coded, make an attribute set for
|
|
||||||
# each system containing the specializations as well as the nospec ver
|
|
||||||
x86_64-linux) run_builds \
|
|
||||||
.\#nixosConfigurations.nullbox.config.specialisation.hyprland.configuration.system.build.toplevel \
|
|
||||||
.\#nospec.nullbox.config.system.build.toplevel \
|
|
||||||
.\#nixosConfigurations.slab.config.specialisation.{hyprland,nvidia}.configuration.system.build.toplevel \
|
|
||||||
.\#nospec.slab.config.system.build.toplevel \
|
|
||||||
.\#nixosConfigurations.nixos-wsl.config.system.build.toplevel \
|
|
||||||
;;
|
|
||||||
|
|
||||||
aarch64-linux) run_builds \
|
|
||||||
.\#nixosConfigurations.rpi4.config.system.build.toplevel \
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
build_systems () {
|
|
||||||
# system should be set in `nix develop` but just in case
|
|
||||||
local system
|
|
||||||
system="${system:-$(nix eval --impure --raw --expr 'builtins.currentSystem')}"
|
|
||||||
#nix eval --json .#legacyPackages."${system}".specialisedNixosConfigurations --apply 'builtins.attrNames' \
|
|
||||||
# | jq -c '.[]' \
|
|
||||||
# | while read -r line ; do
|
|
||||||
# local build
|
|
||||||
# build="$(printf '%s' "$line" | jq -r)"
|
|
||||||
# run_builds ".#legacyPackages.${system}.specialisedNixosConfigurations.${build}"
|
|
||||||
# done
|
|
||||||
run_builds ".#legacyPackages.${system}.specialisedNixosConfigurations"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
build_packages () {
|
|
||||||
run_builds .\#packages."${system}".redlib
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$#" -ne 0 ]] ; then
|
|
||||||
until [[ "$#" -le 0 ]]; do
|
|
||||||
case "$1" in
|
|
||||||
pkgs|packages) DO_PACKAGES=1;;
|
|
||||||
config) DO_CONFIG=1;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
else
|
|
||||||
DO_PACKAGES=1
|
|
||||||
DO_CONFIG=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "${DO_CONFIG:+x}" ]] ; then build_systems; fi
|
|
||||||
if [[ -n "${DO_PACKAGES:+x}" ]] ; then build_packages; fi
|
|
||||||
|
|
||||||
exit $err
|
|
@ -1,118 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
# or more contributor license agreements. See the NOTICE file
|
|
||||||
# distributed with this work for additional information
|
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
|
||||||
# to you under the Apache License, Version 2.0 (the
|
|
||||||
# "License"); you may not use this file except in compliance
|
|
||||||
# with the License. You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing,
|
|
||||||
# software distributed under the License is distributed on an
|
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
df -h
|
|
||||||
echo "::group::/usr/local/*"
|
|
||||||
du -hsc /usr/local/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# ~1GB
|
|
||||||
sudo rm -rf \
|
|
||||||
/usr/local/aws-sam-cil \
|
|
||||||
/usr/local/julia* || :
|
|
||||||
echo "::group::/usr/local/bin/*"
|
|
||||||
du -hsc /usr/local/bin/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# ~1GB (From 1.2GB to 214MB)
|
|
||||||
sudo rm -rf \
|
|
||||||
/usr/local/bin/aliyun \
|
|
||||||
/usr/local/bin/azcopy \
|
|
||||||
/usr/local/bin/bicep \
|
|
||||||
/usr/local/bin/cmake-gui \
|
|
||||||
/usr/local/bin/cpack \
|
|
||||||
/usr/local/bin/helm \
|
|
||||||
/usr/local/bin/hub \
|
|
||||||
/usr/local/bin/kubectl \
|
|
||||||
/usr/local/bin/minikube \
|
|
||||||
/usr/local/bin/node \
|
|
||||||
/usr/local/bin/packer \
|
|
||||||
/usr/local/bin/pulumi* \
|
|
||||||
/usr/local/bin/sam \
|
|
||||||
/usr/local/bin/stack \
|
|
||||||
/usr/local/bin/terraform || :
|
|
||||||
# 142M
|
|
||||||
sudo rm -rf /usr/local/bin/oc || : \
|
|
||||||
echo "::group::/usr/local/share/*"
|
|
||||||
du -hsc /usr/local/share/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# 506MB
|
|
||||||
sudo rm -rf /usr/local/share/chromium || :
|
|
||||||
# 1.3GB
|
|
||||||
sudo rm -rf /usr/local/share/powershell || :
|
|
||||||
echo "::group::/usr/local/lib/*"
|
|
||||||
du -hsc /usr/local/lib/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# 15GB
|
|
||||||
sudo rm -rf /usr/local/lib/android || :
|
|
||||||
# 341MB
|
|
||||||
sudo rm -rf /usr/local/lib/heroku || :
|
|
||||||
# 1.2GB
|
|
||||||
sudo rm -rf /usr/local/lib/node_modules || :
|
|
||||||
echo "::group::/opt/*"
|
|
||||||
du -hsc /opt/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# 679MB
|
|
||||||
sudo rm -rf /opt/az || :
|
|
||||||
echo "::group::/opt/microsoft/*"
|
|
||||||
du -hsc /opt/microsoft/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# 197MB
|
|
||||||
sudo rm -rf /opt/microsoft/powershell || :
|
|
||||||
echo "::group::/opt/hostedtoolcache/*"
|
|
||||||
du -hsc /opt/hostedtoolcache/*
|
|
||||||
echo "::endgroup::"
|
|
||||||
# 5.3GB
|
|
||||||
sudo rm -rf /opt/hostedtoolcache/CodeQL || :
|
|
||||||
# 1.4GB
|
|
||||||
sudo rm -rf /opt/hostedtoolcache/go || :
|
|
||||||
# 489MB
|
|
||||||
sudo rm -rf /opt/hostedtoolcache/PyPy || :
|
|
||||||
# 376MB
|
|
||||||
sudo rm -rf /opt/hostedtoolcache/node || :
|
|
||||||
|
|
||||||
# Remove Web browser packages
|
|
||||||
# sudo apt purge -y \
|
|
||||||
# firefox \
|
|
||||||
# google-chrome-stable \
|
|
||||||
# microsoft-edge-stable
|
|
||||||
#
|
|
||||||
# this works better on arm
|
|
||||||
for i in firefox \
|
|
||||||
google-chrome-stable \
|
|
||||||
microsoft-edge-stable ; do
|
|
||||||
sudo apt purge -y "$i" || :
|
|
||||||
done
|
|
||||||
|
|
||||||
## extras
|
|
||||||
sudo rm -rf /home/runner/.rustup \
|
|
||||||
/home/runner/.cargo \
|
|
||||||
/home/linuxbrew \
|
|
||||||
/usr/lib/google-cloud-sdk \
|
|
||||||
/usr/lib/jvm \
|
|
||||||
/usr/lib/mono \
|
|
||||||
/usr/lib/heroku \
|
|
||||||
/usr/share/swift \
|
|
||||||
/usr/share/dotnet \
|
|
||||||
/opt/microsoft/msedge \
|
|
||||||
/opt/google/chrome \
|
|
||||||
/usr/lib/firefox \
|
|
||||||
/usr/local/.ghcup
|
|
||||||
|
|
||||||
df -h
|
|
15
default.nix
15
default.nix
@ -1,15 +0,0 @@
|
|||||||
(
|
|
||||||
import
|
|
||||||
(
|
|
||||||
let
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
||||||
nodeName = lock.nodes.root.inputs.flake-compat;
|
|
||||||
in
|
|
||||||
fetchTarball {
|
|
||||||
url = lock.nodes.${nodeName}.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
|
|
||||||
sha256 = lock.nodes.${nodeName}.locked.narHash;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{src = ./.;}
|
|
||||||
)
|
|
||||||
.defaultNix
|
|
765
flake.lock
generated
765
flake.lock
generated
File diff suppressed because it is too large
Load Diff
515
flake.nix
515
flake.nix
@ -1,32 +1,16 @@
|
|||||||
# vim: set foldmethod=marker:
|
|
||||||
{
|
{
|
||||||
description = "NixOS Configuration";
|
description = "NixOS Configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# {{{
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
|
||||||
# ^^^^^^^^^^^^^ this part is optional
|
# ^^^^^^^^^^^^^ this part is optional
|
||||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
nixpkgs-nix-du.url = "github:NixOS/nixpkgs/c933cf4698e5189b35dd83bf4d7a81aef16d464a";
|
nixpkgs-nix-du.url = "github:NixOS/nixpkgs/c933cf4698e5189b35dd83bf4d7a81aef16d464a";
|
||||||
nixpkgs-mopidy.url = "github:NixOS/nixpkgs/93ff48c9be84a76319dac293733df09bbbe3f25c";
|
|
||||||
|
|
||||||
# this seems to be a popular way to declare systems
|
# this seems to be a popular way to declare systems
|
||||||
systems.url = "github:nix-systems/default";
|
systems.url = "github:nix-systems/default";
|
||||||
|
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
||||||
|
|
||||||
treefmt-nix = {
|
|
||||||
url = "github:numtide/treefmt-nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
|
||||||
|
|
||||||
# this is nice so one-off impure scripts can interact with attributes in
|
|
||||||
# this flake
|
|
||||||
flake-compat = {
|
|
||||||
url = "github:edolstra/flake-compat";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@ -60,7 +44,7 @@
|
|||||||
|
|
||||||
# https://github.com/nix-community/lanzaboote/releases
|
# https://github.com/nix-community/lanzaboote/releases
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
url = "github:nix-community/lanzaboote/v0.4.2";
|
url = "github:nix-community/lanzaboote/v0.4.1";
|
||||||
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
@ -85,11 +69,6 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
zen-browser = {
|
|
||||||
url = "github:youwen5/zen-browser-flake";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
|
||||||
|
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
url = "github:oxalica/rust-overlay";
|
url = "github:oxalica/rust-overlay";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@ -121,173 +100,35 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.systems.follows = "systems";
|
inputs.systems.follows = "systems";
|
||||||
};
|
};
|
||||||
}; # }}}
|
|
||||||
|
|
||||||
outputs = {
|
|
||||||
self,
|
|
||||||
flake-parts,
|
|
||||||
...
|
|
||||||
} @ inputs:
|
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} (
|
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
nixfiles-lib,
|
|
||||||
...
|
|
||||||
} @ flakeArgs: {
|
|
||||||
# flake-parts imports
|
|
||||||
imports = [
|
|
||||||
./flake
|
|
||||||
./lib/nixfiles/module.nix
|
|
||||||
./pkgs/module.nix
|
|
||||||
./overlays
|
|
||||||
inputs.treefmt-nix.flakeModule
|
|
||||||
];
|
|
||||||
|
|
||||||
config = {
|
|
||||||
# flake-parts systems (still uses nix-systems)
|
|
||||||
systems = import inputs.systems;
|
|
||||||
|
|
||||||
# expose vars to nix repl
|
|
||||||
debug = lib.mkDefault true;
|
|
||||||
|
|
||||||
perSystem = {
|
|
||||||
config,
|
|
||||||
system,
|
|
||||||
pkgs,
|
|
||||||
self',
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
treefmt = {
|
|
||||||
programs = {
|
|
||||||
alejandra.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages.specialisedNixosConfigurations = let
|
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@inputs:
|
||||||
attrs = lib.pipe self.nixosConfigurations [
|
let
|
||||||
(lib.filterAttrs (n: v: !(builtins.elem n ["iso" "rpi4-x86_64"])))
|
inherit (self) outputs;
|
||||||
(lib.filterAttrs (n: v: v.pkgs.system or "" == system))
|
# inputs is already defined
|
||||||
(lib.mapAttrs' (configName: v: let
|
lib = nixpkgs.lib;
|
||||||
nospec =
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
(v.extendModules {
|
|
||||||
modules = [
|
|
||||||
({lib, ...}: {
|
|
||||||
config.specialisation = lib.mkForce {};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
})
|
|
||||||
.config;
|
|
||||||
configs =
|
|
||||||
(
|
|
||||||
lib.mapAttrs'
|
|
||||||
(n: v: lib.nameValuePair "specialisation-${n}" v.configuration)
|
|
||||||
v.config.specialisation
|
|
||||||
)
|
|
||||||
// {inherit nospec;};
|
|
||||||
in
|
|
||||||
lib.nameValuePair configName configs))
|
|
||||||
(
|
|
||||||
lib.concatMapAttrs (
|
|
||||||
configName: v:
|
|
||||||
(
|
|
||||||
lib.mapAttrs' (
|
|
||||||
specName: v: lib.nameValuePair "${configName}--${specName}" v
|
|
||||||
)
|
|
||||||
)
|
|
||||||
v
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(lib.mapAttrs (_: v: v.system.build.toplevel))
|
|
||||||
];
|
|
||||||
in
|
|
||||||
attrs;
|
|
||||||
|
|
||||||
devShells = {
|
overlays = let
|
||||||
ci = pkgs.mkShell {
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
jq
|
|
||||||
nix-update
|
|
||||||
nix-fast-build
|
|
||||||
];
|
|
||||||
};
|
|
||||||
default = let
|
|
||||||
formatter =
|
|
||||||
pkgs.runCommandNoCC "flake-formatter" {
|
|
||||||
formatter = lib.getExe self'.formatter;
|
|
||||||
} ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
ln -s "$formatter" "$out/bin/formatter"
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
alejandra
|
|
||||||
nix-update
|
|
||||||
formatter
|
|
||||||
inputs.agenix.packages.${system}.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nixfiles = {
|
|
||||||
vars = {
|
|
||||||
### Configuration
|
|
||||||
# My username
|
|
||||||
username = "nullbite";
|
|
||||||
# My current timezone for any mobile devices (i.e., my laptop)
|
|
||||||
mobileTimeZone = "America/New_York";
|
|
||||||
};
|
|
||||||
|
|
||||||
common.overlays = let
|
|
||||||
nix-minecraft-patched-overlay = let
|
nix-minecraft-patched-overlay = let
|
||||||
normal = inputs.nix-minecraft-upstream.overlays.default;
|
normal = inputs.nix-minecraft-upstream.overlays.default;
|
||||||
quilt = inputs.nix-minecraft.overlays.default;
|
quilt = inputs.nix-minecraft.overlays.default;
|
||||||
in
|
in lib.composeExtensions
|
||||||
lib.composeExtensions
|
|
||||||
normal
|
normal
|
||||||
(final: prev: let
|
(final: prev: let
|
||||||
x = quilt final prev;
|
x=quilt final prev;
|
||||||
in {
|
in {
|
||||||
inherit (x) quiltServers quilt-server;
|
inherit (x) quiltServers quilt-server;
|
||||||
minecraftServers = prev.minecraftServers // x.quiltServers;
|
minecraftServers = prev.minecraftServers // x.quiltServers;
|
||||||
});
|
});
|
||||||
|
in [
|
||||||
packagesOverlay = final: prev: let
|
(final: prev: let
|
||||||
packages = import ./pkgs {inherit (prev) pkgs;};
|
packages = import ./pkgs { inherit (prev) pkgs; };
|
||||||
in {
|
in {
|
||||||
inherit (packages) mopidy-autoplay google-fonts;
|
inherit (packages) mopidy-autoplay google-fonts;
|
||||||
atool-wrapped = packages.atool;
|
atool-wrapped = packages.atool;
|
||||||
};
|
})
|
||||||
|
|
||||||
zen-browser-overlay = final: prev: let
|
|
||||||
inherit (final) system callPackage;
|
|
||||||
|
|
||||||
input = inputs.zen-browser;
|
|
||||||
packages = input.packages.${system};
|
|
||||||
sources = builtins.fromJSON (builtins.readFile (input + "/sources.json"));
|
|
||||||
|
|
||||||
warnExists = name: value: let
|
|
||||||
pass =
|
|
||||||
if prev ? ${name}
|
|
||||||
then builtins.warn "zen-browser-overlay: Package `${name}` already exists. This overlay is no longer needed and should be removed." value
|
|
||||||
else value;
|
|
||||||
in
|
|
||||||
pass;
|
|
||||||
in {
|
|
||||||
zen-browser-bin = callPackage packages.zen-browser.override {};
|
|
||||||
zen-browser-unwrapped = warnExists "zen-browser-unwrapped" (callPackage packages.zen-browser-unwrapped.override {
|
|
||||||
inherit (sources.${system}) hash url;
|
|
||||||
inherit (sources) version;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
in [
|
|
||||||
# TODO delete this, transfer all packages to new-packages overlay
|
|
||||||
packagesOverlay
|
|
||||||
self.overlays.new-packages
|
|
||||||
# various temporary fixes that automatically revert
|
# various temporary fixes that automatically revert
|
||||||
self.overlays.mitigations
|
self.overlays.mitigations
|
||||||
|
|
||||||
@ -302,82 +143,279 @@
|
|||||||
inputs.rust-overlay.overlays.default
|
inputs.rust-overlay.overlays.default
|
||||||
inputs.nixfiles-assets.overlays.default
|
inputs.nixfiles-assets.overlays.default
|
||||||
nix-minecraft-patched-overlay
|
nix-minecraft-patched-overlay
|
||||||
zen-browser-overlay
|
# inputs.hypridle.overlays.default
|
||||||
|
(final: prev: { inherit (inputs.hypridle.packages.${prev.system}) hypridle; })
|
||||||
];
|
];
|
||||||
|
|
||||||
systems = {
|
### Configuration
|
||||||
slab.system = "x86_64-linux";
|
# My username
|
||||||
nullbox.system = "x86_64-linux";
|
username = "nullbite";
|
||||||
rpi4.system = "aarch64-linux";
|
# My current timezone for any mobile devices (i.e., my laptop)
|
||||||
|
mobileTimeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
nixos-wsl = {
|
# Variables to be passed to NixOS modules in the vars attrset
|
||||||
system = "x86_64-linux";
|
vars = {
|
||||||
wsl = true;
|
inherit username mobileTimeZone self;
|
||||||
};
|
};
|
||||||
|
|
||||||
# for eval testing
|
# funciton to generate packages for each system
|
||||||
rpi4-x86_64 = {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
name = "rpi4";
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}; # end systems
|
|
||||||
};
|
|
||||||
|
|
||||||
flake = let
|
|
||||||
# {{{
|
|
||||||
inherit (nixfiles-lib.flake-legacy) mkSystem mkWSLSystem mkISOSystem mkHome;
|
|
||||||
inherit (inputs) nixpkgs nixpkgs-unstable;
|
|
||||||
inherit (self) outputs;
|
|
||||||
inherit (config.nixfiles.vars) username mobileTimeZone;
|
|
||||||
|
|
||||||
# inputs is already defined
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
|
|
||||||
# function to generate packages for each system
|
|
||||||
eachSystem = lib.genAttrs (import inputs.systems);
|
eachSystem = lib.genAttrs (import inputs.systems);
|
||||||
|
|
||||||
|
# This function produces a module that adds the home-manager module to the
|
||||||
|
# system and configures the given module to the user's Home Manager
|
||||||
|
# configuration
|
||||||
|
homeManagerInit = let _username=username; _nixpkgs=nixpkgs;
|
||||||
|
in { system,
|
||||||
|
nixpkgs ? _nixpkgs, # this is so modules can know which flake the system is using
|
||||||
|
home-manager ? inputs.home-manager,
|
||||||
|
username ? _username,
|
||||||
|
module ? _ : {},
|
||||||
|
rootModule ? (import ./home/root.nix),
|
||||||
|
userModules ? { ${username} = [ module ] ; root = [ rootModule ]; },
|
||||||
|
stateVersion }:
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./home
|
||||||
|
] ++ modules;
|
||||||
|
config = {
|
||||||
|
home = { inherit stateVersion; };
|
||||||
|
};
|
||||||
|
});
|
||||||
|
users = mapUserModules userModules;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "hm.bak";
|
||||||
|
inherit users;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs vars nixpkgs home-manager;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO rewrite this so it follows the same wrapper pattern as mkHome
|
||||||
|
# This function produces a nixosSystem which imports configuration.nix and
|
||||||
|
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
|
||||||
|
mkSystemN = let
|
||||||
|
_username = username;
|
||||||
|
_overlays = overlays;
|
||||||
|
in { nixpkgs ? inputs.nixpkgs,
|
||||||
|
home-manager ? inputs.home-manager,
|
||||||
|
username ? _username,
|
||||||
|
entrypoint ? ./system,
|
||||||
|
modules ? [ ],
|
||||||
|
stateVersion ? null,
|
||||||
|
config ? { },
|
||||||
|
overlays ? _overlays,
|
||||||
|
system,
|
||||||
|
... }@args: let
|
||||||
|
_modules = [ entrypoint config ] ++ modules ++ [{
|
||||||
|
nixpkgs.config = {
|
||||||
|
inherit overlays;
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
}] ++ lib.optional (args ? stateVersion) { config.system.stateVersion = stateVersion; };
|
||||||
|
in nixpkgs.lib.nixosSystem {
|
||||||
|
};
|
||||||
|
mkSystem = let _username=username; _overlays=overlays; _nixpkgs=nixpkgs;
|
||||||
|
in { system,
|
||||||
|
nixpkgs ? _nixpkgs,
|
||||||
|
home-manager ? inputs.home-manager,
|
||||||
|
overlays ? _overlays,
|
||||||
|
hostname,
|
||||||
|
username ? _username,
|
||||||
|
stateVersion,
|
||||||
|
extraModules ? [] }:
|
||||||
|
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
./system
|
||||||
|
({pkgs, config, lib, ...}@args:
|
||||||
|
{
|
||||||
|
# Values for every single system that would not conceivably need
|
||||||
|
# to be made modular
|
||||||
|
system.stateVersion = stateVersion;
|
||||||
|
nixpkgs = {
|
||||||
|
inherit overlays;
|
||||||
|
config = {
|
||||||
|
# not having the freedom to install unfree programs is unfree
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nix.settings.experimental-features = ["nix-command" "flakes" ];
|
||||||
|
})
|
||||||
|
./hosts/${hostname}/configuration.nix
|
||||||
|
(homeManagerInit {
|
||||||
|
inherit nixpkgs home-manager;
|
||||||
|
module = import ./hosts/${hostname}/home.nix;
|
||||||
|
inherit username system stateVersion;
|
||||||
|
})
|
||||||
|
] ++ extraModules;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs outputs vars nixpkgs home-manager;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mkWSLSystem = let _username=username; in
|
||||||
|
{username ? _username, extraModules ? [], ...}@args: let
|
||||||
|
WSLModule = {...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.nix-wsl.nixosModules.wsl
|
||||||
|
];
|
||||||
|
wsl.enable = true;
|
||||||
|
wsl.defaultUser = username;
|
||||||
|
};
|
||||||
|
override = {extraModules = extraModules ++ [WSLModule];};
|
||||||
|
in
|
||||||
|
mkSystem (args // override);
|
||||||
|
|
||||||
|
mkISOSystem = system: inputs.nixpkgs-unstable.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
"${inputs.nixpkgs-unstable}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
|
||||||
|
({ config, pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
neovim
|
||||||
|
gparted
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# values to be passed to nixosModules and homeManagerModules wrappers
|
# values to be passed to nixosModules and homeManagerModules wrappers
|
||||||
moduleInputs = {
|
moduleInputs = {
|
||||||
};
|
};
|
||||||
# }}}
|
|
||||||
|
# Make a home-manager standalone configuration. This implementation is
|
||||||
|
# better than mkSystem because it extends homeManagerConfiguration.
|
||||||
|
mkHome = let
|
||||||
|
_home-manager = inputs.home-manager;
|
||||||
|
_nixpkgs = inputs.nixpkgs;
|
||||||
|
_username = username;
|
||||||
|
in { home-manager ? _home-manager,
|
||||||
|
nixpkgs ? _nixpkgs,
|
||||||
|
username ? _username,
|
||||||
|
homeDirectory ? "/home/${username}",
|
||||||
|
entrypoint ? ./home/standalone.nix,
|
||||||
|
modules ? [ ],
|
||||||
|
stateVersion ? null,
|
||||||
|
config ? { },
|
||||||
|
system,
|
||||||
|
... }@args: let
|
||||||
|
_modules = [ entrypoint ] ++ modules ++ [ config ] ++ [
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home = {
|
||||||
|
inherit username homeDirectory;
|
||||||
|
};
|
||||||
|
nixpkgs.config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
] ++ lib.optional (args ? stateVersion) { config.home.stateVersion = stateVersion; };
|
||||||
|
in home-manager.lib.homeManagerConfiguration ({
|
||||||
|
modules = _modules;
|
||||||
|
pkgs = import nixpkgs {inherit system overlays; };
|
||||||
|
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs outputs vars nixpkgs home-manager;
|
||||||
|
|
||||||
|
# this is needed because modules don't use the default arg for some reason???
|
||||||
|
osConfig = {};
|
||||||
|
};
|
||||||
|
} // builtins.removeAttrs args
|
||||||
|
[ "system" "nixpkgs" "home-manager" "modules" "username" "homeDirectory" "stateVersion" "entrypoint" "config" ]);
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
# for repl debugging via :lf .
|
||||||
|
inherit inputs vars;
|
||||||
|
|
||||||
|
devShells = eachSystem (system: let
|
||||||
|
pkgs = import nixpkgs-unstable { inherit system; };
|
||||||
|
in {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
nix-update
|
||||||
|
inputs.agenix.packages.${system}.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
# nix flake modules are meant to be portable so we cannot rely on
|
# nix flake modules are meant to be portable so we cannot rely on
|
||||||
# (extraS|s)pecialArgs to pass variables
|
# (extraS|s)pecialArgs to pass variables
|
||||||
nixosModules = (import ./modules/nixos) moduleInputs;
|
nixosModules = (import ./modules/nixos) moduleInputs;
|
||||||
homeManagerModules = (import ./modules/home-manager) moduleInputs;
|
homeManagerModules = (import ./modules/home-manager) moduleInputs;
|
||||||
packages = eachSystem (
|
packages = eachSystem (system: let pkgs = import nixpkgs-unstable { inherit system; };
|
||||||
system: {
|
in (
|
||||||
|
import ./pkgs { inherit pkgs; }) // {
|
||||||
iso = let
|
iso = let
|
||||||
isoSystem = mkISOSystem system;
|
isoSystem = mkISOSystem system;
|
||||||
in
|
in isoSystem.config.system.build.isoImage;
|
||||||
isoSystem.config.system.build.isoImage;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
apps = eachSystem (system:
|
apps = eachSystem (system: import ./pkgs/apps.nix
|
||||||
import ./pkgs/apps.nix
|
{ inherit (self.outputs) packages; inherit system; });
|
||||||
{
|
|
||||||
inherit (self.outputs) packages;
|
overlays = import ./overlays self;
|
||||||
inherit system;
|
|
||||||
});
|
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
iso = mkISOSystem "x86_64-linux";
|
iso = mkISOSystem "x86_64-linux";
|
||||||
}; # end nixosConfigurations
|
slab = mkSystem {
|
||||||
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
|
home-manager = inputs.home-manager-unstable;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
hostname = "slab";
|
||||||
|
stateVersion = "23.11";
|
||||||
|
};
|
||||||
|
|
||||||
nospec = lib.mapAttrs (n: v:
|
nullbox = mkSystem {
|
||||||
v.extendModules {
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
modules = [
|
home-manager = inputs.home-manager-unstable;
|
||||||
(
|
system = "x86_64-linux";
|
||||||
{lib, ...}: {specialisation = lib.mkForce {};}
|
hostname = "nullbox";
|
||||||
)
|
stateVersion = "23.11";
|
||||||
];
|
};
|
||||||
})
|
|
||||||
config.flake.nixosConfigurations;
|
nixos-wsl = mkWSLSystem {
|
||||||
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
|
home-manager = inputs.home-manager-unstable;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
stateVersion = "23.11";
|
||||||
|
hostname = "nixos-wsl";
|
||||||
|
};
|
||||||
|
|
||||||
|
# for eval testing
|
||||||
|
rpi4-x86_64 = mkSystem {
|
||||||
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
|
home-manager = inputs.home-manager-unstable;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
stateVersion = "24.11";
|
||||||
|
hostname = "rpi4";
|
||||||
|
extraModules = [{
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
rpi4 = mkSystem {
|
||||||
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
|
home-manager = inputs.home-manager-unstable;
|
||||||
|
system = "aarch64-linux";
|
||||||
|
stateVersion = "24.11";
|
||||||
|
hostname = "rpi4";
|
||||||
|
};
|
||||||
|
}; # end nixosConfigurations
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
# minimal root config
|
# minimal root config
|
||||||
@ -386,11 +424,11 @@
|
|||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
username = "root";
|
username = "root";
|
||||||
homeDirectory = "/root";
|
homeDirectory = "/root";
|
||||||
config = {pkgs, ...}: {
|
config = { pkgs, ...}: {
|
||||||
programs.bash.enable = true;
|
programs.bash.enable = true;
|
||||||
|
|
||||||
# update nix system-wide since it's installed via root profile
|
# update nix system-wide since it's installed via root profile
|
||||||
home.packages = with pkgs; [btdu nix];
|
home.packages = with pkgs; [ btdu nix ];
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs-unstable;
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
home-manager = inputs.home-manager-unstable;
|
home-manager = inputs.home-manager-unstable;
|
||||||
@ -399,12 +437,12 @@
|
|||||||
"nullbite@rpi4" = mkHome {
|
"nullbite@rpi4" = mkHome {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
config = {pkgs, ...}: {
|
config = { pkgs, ...} : {
|
||||||
programs = {
|
programs = {
|
||||||
zsh.enable = false;
|
zsh.enable = false;
|
||||||
keychain.enable = false;
|
keychain.enable = false;
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [btdu];
|
home.packages = with pkgs; [ btdu ];
|
||||||
};
|
};
|
||||||
nixpkgs = inputs.nixpkgs-unstable;
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
home-manager = inputs.home-manager-unstable;
|
home-manager = inputs.home-manager-unstable;
|
||||||
@ -413,14 +451,14 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
username = "deck";
|
username = "deck";
|
||||||
modules = [./users/deck/home.nix];
|
modules = [ ./users/deck/home.nix ];
|
||||||
nixpkgs = inputs.nixpkgs-unstable;
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
home-manager = inputs.home-manager-unstable;
|
home-manager = inputs.home-manager-unstable;
|
||||||
};
|
};
|
||||||
"testuser" = mkHome {
|
"testuser" = mkHome {
|
||||||
username = "testuser";
|
username = "testuser";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [./users/testuser/home.nix];
|
modules = [ ./users/testuser/home.nix ];
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
nixpkgs = inputs.nixpkgs-unstable;
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
home-manager = inputs.home-manager-unstable;
|
home-manager = inputs.home-manager-unstable;
|
||||||
@ -428,17 +466,12 @@
|
|||||||
"nix-on-droid" = mkHome {
|
"nix-on-droid" = mkHome {
|
||||||
username = "nix-on-droid";
|
username = "nix-on-droid";
|
||||||
homeDirectory = "/data/data/com.termux.nix/files/home";
|
homeDirectory = "/data/data/com.termux.nix/files/home";
|
||||||
modules = [./users/nix-on-droid/home.nix];
|
modules = [ ./users/nix-on-droid/home.nix ];
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
nixpkgs = inputs.nixpkgs-unstable;
|
nixpkgs = inputs.nixpkgs-unstable;
|
||||||
home-manager = inputs.home-manager-unstable;
|
home-manager = inputs.home-manager-unstable;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}; # end outputs
|
||||||
};
|
} # end flake
|
||||||
}
|
|
||||||
); # end outputs
|
|
||||||
}
|
|
||||||
# end flake
|
|
||||||
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
# flake-parts TODO
|
|
||||||
|
|
||||||
- Move logic for generating system/home configs to module (most important,
|
|
||||||
reason i wanted to use flake-parts)
|
|
||||||
- Move common default args from the awful wrapper function to dedicated options:
|
|
||||||
- default module imports
|
|
||||||
- "common" module
|
|
||||||
- currently defines stateVersion, nixpkgs.config.allowUnfree, a few others
|
|
||||||
- make default module path configurable, but still default to
|
|
||||||
`./hosts/${hostname}/configuration.nix`
|
|
||||||
- make "entrypoint" (`./system`, `./home/standalone.nix`, etc) configurable
|
|
||||||
- make nixfiles home manager initialization a configurable option
|
|
||||||
- specialArgs (i want to deprecate this but one thing at a time)
|
|
||||||
- define system "types" and generate all of them internally using lazy
|
|
||||||
eval. export a specific one to the flake outputs.
|
|
||||||
- generate as something like `nixfiles.hosts.<name>.outputs`
|
|
||||||
- `flake.nixosConfigurations.<name>` is set from `nixfiles.hosts.<name>.output`
|
|
||||||
- default chosen by option like `nixfiles.hosts.<name>.type`
|
|
||||||
- types:
|
|
||||||
- normal
|
|
||||||
- WSL
|
|
||||||
- ISO image
|
|
||||||
- define deploy-rs outputs in same section as hosts
|
|
||||||
- make common, central interface for configuring overlays to be consumed by
|
|
||||||
various parts of flake, move hard-coded overlays out of common module
|
|
||||||
- literally just a list, maybe process it using lib.composeManyExtensions
|
|
||||||
- some top-level config is okay (e.g., defining hosts using nixfiles options).
|
|
||||||
hide away all of the internal logic into imported modules.
|
|
||||||
- move random functions into nixfiles lib
|
|
||||||
- move top-level universal configs (username, mobileTimeZone) into option
|
|
||||||
(honestly, this alone makes flake-parts worth it)
|
|
@ -1,9 +0,0 @@
|
|||||||
{...}: {
|
|
||||||
imports = [
|
|
||||||
./packages.nix
|
|
||||||
./home.nix
|
|
||||||
./system.nix
|
|
||||||
./meta.nix
|
|
||||||
./overlays.nix
|
|
||||||
];
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
{...}: {}
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options.nixfiles.vars = lib.mkOption {
|
|
||||||
description = "Global variables";
|
|
||||||
type = lib.types.attrs;
|
|
||||||
default = {};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
overlayType = lib.mkOptionType {
|
|
||||||
name = "nixpkgs-overlay";
|
|
||||||
description = "nixpkgs overlay";
|
|
||||||
check = lib.isFunction;
|
|
||||||
merge = lib.mergeOneOption;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.nixfiles.common.overlays = lib.mkOption {
|
|
||||||
description = "List of overlays shared between various parts of the flake.";
|
|
||||||
type = lib.types.listOf overlayType;
|
|
||||||
default = [];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
{...}: {
|
|
||||||
}
|
|
258
flake/system.nix
258
flake/system.nix
@ -1,258 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
lib,
|
|
||||||
nixfiles-lib,
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.systems;
|
|
||||||
inherit
|
|
||||||
(lib)
|
|
||||||
types
|
|
||||||
mkOption
|
|
||||||
mkIf
|
|
||||||
filterAttrs
|
|
||||||
mapAttrs
|
|
||||||
;
|
|
||||||
|
|
||||||
inherit (builtins) attrNames isNull;
|
|
||||||
|
|
||||||
inherit (nixfiles-lib.flake-legacy) mkSystem mkHome mkWSLSystem mkISOSystem homeManagerInit;
|
|
||||||
inherit (nixfiles-lib.types) mkCheckedType;
|
|
||||||
|
|
||||||
mkConfigurationOption = systemType:
|
|
||||||
mkOption {
|
|
||||||
description = "${systemType} configuration type";
|
|
||||||
type = with types; nullOr mkCheckedType "configuration";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.nixfiles.systems = let
|
|
||||||
systemModule = let
|
|
||||||
outerConfig = config;
|
|
||||||
outerOptions = options;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options = {
|
|
||||||
enable =
|
|
||||||
lib.mkEnableOption ""
|
|
||||||
// {
|
|
||||||
description = ''
|
|
||||||
Whether to install this configuration into the flake outputs.
|
|
||||||
'';
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs = mkOption {
|
|
||||||
description = "nixpkgs input to build system with";
|
|
||||||
type = nixfiles-lib.types.flake;
|
|
||||||
default = inputs.nixpkgs-unstable;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
description = ''
|
|
||||||
Arguments to pass to nixpkgs.lib.nixosSystem
|
|
||||||
'';
|
|
||||||
type = types.attrs;
|
|
||||||
default = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
system = mkOption {
|
|
||||||
description = "Nix system value";
|
|
||||||
type = types.str;
|
|
||||||
example = "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = mkOption {
|
|
||||||
description = "Extra NixOS configuration modules.";
|
|
||||||
type = with types; listOf deferredModule;
|
|
||||||
default = [];
|
|
||||||
};
|
|
||||||
|
|
||||||
name = mkOption {
|
|
||||||
description = ''
|
|
||||||
Name of NixOS configuration. This influences the default
|
|
||||||
directory to load configuration from. This does *not* modify the
|
|
||||||
system's hostname, but should probably be set to the same value.
|
|
||||||
'';
|
|
||||||
type = lib.types.str;
|
|
||||||
default = name;
|
|
||||||
};
|
|
||||||
|
|
||||||
configRoot = mkOption {
|
|
||||||
description = "Path to directory containing system and home configuration modules.";
|
|
||||||
type = lib.types.path;
|
|
||||||
default = self + "/hosts/${config.name}";
|
|
||||||
};
|
|
||||||
|
|
||||||
configuration = mkOption {
|
|
||||||
description = "Path/module of main NixOS configuration.";
|
|
||||||
type = with types; nullOr deferredModule;
|
|
||||||
default = config.configRoot + "/configuration.nix";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
enable =
|
|
||||||
lib.mkEnableOption ""
|
|
||||||
// {
|
|
||||||
description = ''
|
|
||||||
Whether to enable home-manager for this configuration.
|
|
||||||
'';
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
input = mkOption {
|
|
||||||
description = "home-manager input";
|
|
||||||
type = nixfiles-lib.types.flake;
|
|
||||||
default = inputs.home-manager-unstable;
|
|
||||||
};
|
|
||||||
|
|
||||||
configuration = mkOption {
|
|
||||||
description = "Path/module of main home-manager configuration.";
|
|
||||||
type = with types; nullOr deferredModule;
|
|
||||||
default = config.configRoot + "/home.nix";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = mkOption {
|
|
||||||
description = "Extra home-manager modules";
|
|
||||||
type = with types; listOf deferredModule;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
wsl =
|
|
||||||
lib.mkEnableOption ""
|
|
||||||
// {
|
|
||||||
description = ''
|
|
||||||
Whether to import WSL related configuration
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
result = lib.mkOption {
|
|
||||||
description = "Resulting system configuration";
|
|
||||||
type = with types; nullOr (mkCheckedType "configuration");
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
home-manager.input = lib.mkIf (config.nixpkgs == inputs.nixpkgs) (lib.mkDefault inputs.home-manager);
|
|
||||||
|
|
||||||
modules = let
|
|
||||||
nixfilesModule = self + "/system";
|
|
||||||
defaultsModule = {...}: {
|
|
||||||
# Values for every single system that would not conceivably need
|
|
||||||
# to be made modular
|
|
||||||
|
|
||||||
# this should be set in the system config
|
|
||||||
# system.stateVersion = stateVersion;
|
|
||||||
nixpkgs = {
|
|
||||||
inherit (outerConfig.nixfiles.common) overlays;
|
|
||||||
config = {
|
|
||||||
# not having the freedom to install unfree programs is unfree
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# this should be on by default and there is no reason to turn it
|
|
||||||
# off because this flake will literally stop working otheriwse
|
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
||||||
};
|
|
||||||
wslModule = {...}: {
|
|
||||||
imports = [
|
|
||||||
inputs.nix-wsl.nixosModules.wsl
|
|
||||||
];
|
|
||||||
wsl.enable = true;
|
|
||||||
wsl.defaultUser = outerConfig.nixfiles.vars.username;
|
|
||||||
};
|
|
||||||
|
|
||||||
homeManagerModule = let
|
|
||||||
homeManagerModuleInner = homeManagerInit {
|
|
||||||
inherit (config) nixpkgs system;
|
|
||||||
inherit (outerConfig.nixfiles.vars) username;
|
|
||||||
home-manager = config.home-manager.input;
|
|
||||||
module =
|
|
||||||
if (isNull config.home-manager.configuration)
|
|
||||||
then {}
|
|
||||||
else config.home-manager.configuration;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
perUserDefaultsModule = {lib, ...}: {
|
|
||||||
config = {
|
|
||||||
# previously, home-manager inherited stateVersion from
|
|
||||||
# nixos in a really hacky way that depended on the wrapper
|
|
||||||
# function. this should preserve that behavior in a much
|
|
||||||
# safer way by directly setting it in a module. ideally, it
|
|
||||||
# should probably be set manually, but I want to maintain
|
|
||||||
# backwards compatibility for now.
|
|
||||||
home.stateVersion = lib.mkDefault config.system.stateVersion;
|
|
||||||
|
|
||||||
# pass the system nixpkgs config as defaults for the
|
|
||||||
# home-manager nixpkgs config. useGlobalPkgs prevents
|
|
||||||
# setting overlays at the home level; this allows for doing
|
|
||||||
# that while inheriting the system overlays.
|
|
||||||
nixpkgs = {
|
|
||||||
config = lib.mapAttrs (n: v: lib.mkDefault v) config.nixpkgs.config;
|
|
||||||
# mkOrder 900 is after mkBefore but before default order
|
|
||||||
overlays = lib.mkOrder 900 config.nixpkgs.overlays;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
# TODO placeholder using old function
|
|
||||||
homeManagerModuleInner
|
|
||||||
];
|
|
||||||
|
|
||||||
options.home-manager.users = lib.mkOption {
|
|
||||||
type = with lib.types; attrsOf (submodule perUserDefaultsModule);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
[
|
|
||||||
nixfilesModule
|
|
||||||
defaultsModule
|
|
||||||
]
|
|
||||||
++ lib.optional (!(isNull config.configuration)) config.configuration
|
|
||||||
++ lib.optional config.home-manager.enable homeManagerModule
|
|
||||||
++ lib.optional config.wsl wslModule;
|
|
||||||
extraConfig = {
|
|
||||||
inherit (config) system modules;
|
|
||||||
# TODO get rid of specialArgs and pass things as a module
|
|
||||||
specialArgs = let
|
|
||||||
inherit (self) outputs;
|
|
||||||
in {
|
|
||||||
inherit inputs outputs;
|
|
||||||
inherit (outerConfig.nixfiles) vars;
|
|
||||||
inherit (config) nixpkgs;
|
|
||||||
inherit (config.home-manager) input;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
result = config.nixpkgs.lib.nixosSystem config.extraConfig;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.mkOption {
|
|
||||||
description = ''
|
|
||||||
NixOS system configurations
|
|
||||||
'';
|
|
||||||
type = with types; attrsOf (submodule systemModule);
|
|
||||||
default = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
flake.nixosConfigurations = let
|
|
||||||
enabledSystems = filterAttrs (n: v: v.enable) cfg;
|
|
||||||
in
|
|
||||||
mapAttrs (_: v: v.result) enabledSystems;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,9 +1,9 @@
|
|||||||
{...}: {
|
{...}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./wm
|
./wm
|
||||||
./nodm.nix
|
./nodm.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./theme.nix
|
./theme.nix
|
||||||
./shell.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
{
|
{ pkgs, lib, config, osConfig ? { }, options, nixpkgs, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
options,
|
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.common.nix;
|
cfg = config.nixfiles.common.nix;
|
||||||
standalone = !(osConfig ? home-manager);
|
standalone = !(osConfig ? home-manager);
|
||||||
in {
|
in {
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
{
|
{ lib, pkgs, config, osConfig ? {}, options, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.common.nodm;
|
cfg = config.nixfiles.common.nodm;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = let
|
config = let
|
||||||
hyprland = "${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland";
|
hyprland="${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland";
|
||||||
tty = "${pkgs.coreutils}/bin/tty";
|
tty="${pkgs.coreutils}/bin/tty";
|
||||||
initCommands = ''
|
initCommands =
|
||||||
|
''
|
||||||
if [[ "$(${tty})" == "/dev/tty1" && -z "''${WAYLAND_DISPLAY:+x}" ]] ; then
|
if [[ "$(${tty})" == "/dev/tty1" && -z "''${WAYLAND_DISPLAY:+x}" ]] ; then
|
||||||
${hyprland}
|
${hyprland}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in
|
in lib.mkIf (cfg.enable && config.wayland.windowManager.hyprland.enable) {
|
||||||
lib.mkIf (cfg.enable && config.wayland.windowManager.hyprland.enable) {
|
|
||||||
# auto start Hyprland on tty1
|
# auto start Hyprland on tty1
|
||||||
programs.zsh.initExtra = initCommands;
|
programs.zsh.initExtra = initCommands;
|
||||||
programs.bash.initExtra = initCommands;
|
programs.bash.initExtra = initCommands;
|
||||||
@ -27,9 +22,7 @@ in {
|
|||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Whether to automatically start a desktop session on TTY1, behaving like a rudimentary display manager.";
|
description = "Whether to automatically start a desktop session on TTY1, behaving like a rudimentary display manager.";
|
||||||
default =
|
default = osConfig ? systemd
|
||||||
osConfig
|
|
||||||
? systemd
|
|
||||||
&& config.nixfiles.meta.graphical
|
&& config.nixfiles.meta.graphical
|
||||||
&& (!(
|
&& (!(
|
||||||
(osConfig.systemd.services.display-manager.enable or false)
|
(osConfig.systemd.services.display-manager.enable or false)
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkOption mkEnableOption mkIf mkDefault;
|
|
||||||
cfg = config.nixfiles.common.shell;
|
|
||||||
|
|
||||||
common_functions = shell: ''
|
|
||||||
__nixfiles_alias_comma_frequent_commands () {
|
|
||||||
history | sed 's:^ \+[0-9]\+ \+::' | grep '^,' | cut -d' ' -f2- | sed 's:^\(-[^ ]\+ \?\)\+::g' | grep . | cut -d' ' -f1 | sort | uniq -c | sort -g
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
options.nixfiles.common.shell = {
|
|
||||||
enable =
|
|
||||||
lib.mkEnableOption ""
|
|
||||||
// {
|
|
||||||
description = "Whether to enable the nixfiles shell configuration.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
home.shellAliases = {
|
|
||||||
v = "nvim";
|
|
||||||
icat = "kitten icat";
|
|
||||||
srun = "systemd-run";
|
|
||||||
urun = "systemd-run --user";
|
|
||||||
|
|
||||||
# this lets me find commands that i run with comma very frequently so i
|
|
||||||
# can install them
|
|
||||||
comma-frequent = "__nixfiles_alias_comma_frequent_commands";
|
|
||||||
};
|
|
||||||
programs.fzf.enable = mkDefault true;
|
|
||||||
programs.fzf.enableZshIntegration = mkDefault true;
|
|
||||||
programs.fzf.enableBashIntegration = mkDefault true;
|
|
||||||
|
|
||||||
programs.bash = {
|
|
||||||
enable = mkDefault true;
|
|
||||||
# declare functions at start of bashrc
|
|
||||||
bashrcExtra = common_functions "bash";
|
|
||||||
initExtra = ''
|
|
||||||
export HOME_MANAGER_MANAGED=true;
|
|
||||||
[[ -e ~/dotfiles/shell/.bashrc ]] && . ~/dotfiles/shell/.bashrc ]]
|
|
||||||
unset HOME_MANAGERR_MANAGED
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
programs.zsh = {
|
|
||||||
enable = mkDefault true;
|
|
||||||
initExtra =
|
|
||||||
''
|
|
||||||
export HOME_MANAGER_MANAGED=true
|
|
||||||
[[ -e ~/dotfiles/shell/.zshrc ]] && . ~/dotfiles/shell/.zshrc ]]
|
|
||||||
unset HOME_MANAGER_MANAGED
|
|
||||||
''
|
|
||||||
+ common_functions "zsh";
|
|
||||||
oh-my-zsh = {
|
|
||||||
enable = mkDefault true;
|
|
||||||
theme = "robbyrussell";
|
|
||||||
extraConfig = ''
|
|
||||||
DISABLE_MAGIC_FUNCTIONS="true"
|
|
||||||
'';
|
|
||||||
plugins = [
|
|
||||||
"git"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,20 +1,13 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.theming;
|
cfg = config.nixfiles.theming;
|
||||||
mkDefaultStylix = lib.mkOverride 999;
|
mkDefaultStylix = lib.mkOverride 999;
|
||||||
|
|
||||||
toCaps = s:
|
toCaps = s: with lib.strings; with builtins;
|
||||||
with lib.strings;
|
(toUpper (substring 0 1 s)) + toLower (substring 1 ((stringLength s)-1) s);
|
||||||
with builtins;
|
|
||||||
(toUpper (substring 0 1 s)) + toLower (substring 1 ((stringLength s) - 1) s);
|
|
||||||
inherit (lib.strings) toUpper toLower;
|
inherit (lib.strings) toUpper toLower;
|
||||||
|
|
||||||
mkCtp = flavor: accent:
|
mkCtp = flavor: accent: with pkgs; {
|
||||||
with pkgs; {
|
|
||||||
names = {
|
names = {
|
||||||
cursors = "catppuccin-${toLower flavor}-${toLower accent}-cursors";
|
cursors = "catppuccin-${toLower flavor}-${toLower accent}-cursors";
|
||||||
icons = "Papirus-Dark";
|
icons = "Papirus-Dark";
|
||||||
@ -28,18 +21,9 @@
|
|||||||
};
|
};
|
||||||
packages = {
|
packages = {
|
||||||
cursors = catppuccin-cursors."${toLower flavor}${toCaps accent}";
|
cursors = catppuccin-cursors."${toLower flavor}${toCaps accent}";
|
||||||
kvantum = catppuccin-kvantum.override {
|
kvantum = catppuccin-kvantum.override { variant = toLower flavor; accent = toLower accent; };
|
||||||
variant = toLower flavor;
|
icons = catppuccin-papirus-folders.override { flavor = toLower flavor; accent = toLower accent; };
|
||||||
accent = toLower accent;
|
gtk = catppuccin-gtk.override { variant = toLower flavor; accents = [ (toLower accent) ]; };
|
||||||
};
|
|
||||||
icons = catppuccin-papirus-folders.override {
|
|
||||||
flavor = toLower flavor;
|
|
||||||
accent = toLower accent;
|
|
||||||
};
|
|
||||||
gtk = catppuccin-gtk.override {
|
|
||||||
variant = toLower flavor;
|
|
||||||
accents = [(toLower accent)];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -70,11 +54,9 @@ in {
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
fonts.fontconfig.enable = lib.mkDefault true;
|
fonts.fontconfig.enable = lib.mkDefault true;
|
||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; [
|
||||||
[
|
|
||||||
ubuntu_font_family
|
ubuntu_font_family
|
||||||
]
|
] ++ lib.mapAttrsToList (k: v: v) ctp.packages;
|
||||||
++ lib.mapAttrsToList (k: v: v) ctp.packages;
|
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
{
|
{ pkgs, lib, config, osConfig ? {}, options, ...}:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.common.wm;
|
cfg = config.nixfiles.common.wm;
|
||||||
inherit (lib) mkDefault;
|
inherit (lib) mkDefault;
|
||||||
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.common.wm = {
|
options.nixfiles.common.wm = {
|
||||||
enable = lib.mkEnableOption "common window manager config";
|
enable = lib.mkEnableOption "common window manager config";
|
||||||
autostart = lib.mkOption {
|
autostart = lib.mkOption {
|
||||||
description = "List of window manager agnostic commnads to run at window manager startup";
|
description = "List of window manager agnostic commnads to run at window manager startup";
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [];
|
default = [ ];
|
||||||
example = ["steam -silent"];
|
example = [ "steam -silent" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,14 +51,8 @@ in {
|
|||||||
nwg-displays
|
nwg-displays
|
||||||
|
|
||||||
# very consistent (ok it's actually a little better now)
|
# very consistent (ok it's actually a little better now)
|
||||||
(catppuccin-papirus-folders.override {
|
(catppuccin-papirus-folders.override {accent = "mauve"; flavor = "mocha"; })
|
||||||
accent = "mauve";
|
(pkgs.catppuccin-kvantum.override {accent = "mauve"; variant = "mocha"; })
|
||||||
flavor = "mocha";
|
|
||||||
})
|
|
||||||
(pkgs.catppuccin-kvantum.override {
|
|
||||||
accent = "mauve";
|
|
||||||
variant = "mocha";
|
|
||||||
})
|
|
||||||
catppuccin-cursors.mochaMauve
|
catppuccin-cursors.mochaMauve
|
||||||
|
|
||||||
arc-theme
|
arc-theme
|
||||||
@ -84,13 +73,13 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# File associations
|
# File associations
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications = let
|
defaultApplications = let
|
||||||
defaultBrowser = ["firefox.desktop"];
|
defaultBrowser = [ "firefox.desktop" ];
|
||||||
in
|
in mkOverrideEach 50 {
|
||||||
mkOverrideEach 50 {
|
|
||||||
"x-scheme-handler/https" = defaultBrowser;
|
"x-scheme-handler/https" = defaultBrowser;
|
||||||
"x-scheme-handler/http" = defaultBrowser;
|
"x-scheme-handler/http" = defaultBrowser;
|
||||||
"text/html" = defaultBrowser;
|
"text/html" = defaultBrowser;
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
{
|
{ pkgs, config, lib, outputs, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
outputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
df = lib.mkDefault;
|
df = lib.mkDefault;
|
||||||
mkxf = with lib; mapAttrs' (name: value: nameValuePair ("XF86" + name) value);
|
mkxf = with lib; mapAttrs' (name: value: nameValuePair ("XF86" + name) (value));
|
||||||
|
|
||||||
# not rewriting this rn
|
# not rewriting this rn
|
||||||
keysetting = "${outputs.packages.${pkgs.system}.wm-helpers}/bin/keysetting";
|
keysetting = "${outputs.packages.${pkgs.system}.wm-helpers}/bin/keysetting";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.common.wm = {
|
options.nixfiles.common.wm = {
|
||||||
keybinds = lib.mkOption {
|
keybinds = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -1,18 +1,10 @@
|
|||||||
{
|
{ pkgs, config, lib, options, osConfig ? { }, nixpkgs, home-manager, inputs, ... }@args:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
options,
|
|
||||||
osConfig ? {},
|
|
||||||
nixpkgs,
|
|
||||||
home-manager,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
isStandalone = osConfig ? home-manager;
|
isStandalone = osConfig ? home-manager;
|
||||||
cfg = config.nixfiles;
|
cfg = config.nixfiles;
|
||||||
flakeType = cfg.lib.types.flake;
|
flakeType = cfg.lib.types.flake;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common
|
./common
|
||||||
./package-sets
|
./package-sets
|
||||||
@ -33,7 +25,7 @@ in {
|
|||||||
|
|
||||||
lib = lib.mkOption {
|
lib = lib.mkOption {
|
||||||
description = "nixfiles library";
|
description = "nixfiles library";
|
||||||
default = (import ../lib/nixfiles) {inherit pkgs;};
|
default = (import ../lib/nixfiles) { inherit pkgs; };
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,13 +53,13 @@ in {
|
|||||||
meta.graphical = lib.mkOption {
|
meta.graphical = lib.mkOption {
|
||||||
description = "Whether to enable graphical home-manager applications";
|
description = "Whether to enable graphical home-manager applications";
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = osConfig ? services && osConfig.services.xserver.enable;
|
default = (osConfig ? services && osConfig.services.xserver.enable);
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
meta.wayland = lib.mkOption {
|
meta.wayland = lib.mkOption {
|
||||||
description = "Whether to prefer wayland packages and configuration";
|
description = "Whether to prefer wayland packages and configuration";
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = (lib.hasAttrByPath ["nixfiles" "meta" "wayland"] osConfig) && osConfig.nixfiles.meta.wayland;
|
default = (lib.hasAttrByPath [ "nixfiles" "meta" "wayland" ] osConfig) && osConfig.nixfiles.meta.wayland;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
{
|
{ pkgs, lib, config, osConfig ? {}, inputs, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.packageSets.communication;
|
cfg = config.nixfiles.packageSets.communication;
|
||||||
|
rustdesk-pkg = if (lib.strings.hasInfix "23.11" lib.version) then
|
||||||
|
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.rustdesk-flutter
|
||||||
|
else
|
||||||
|
pkgs.rustdesk-flutter;
|
||||||
|
|
||||||
vesktop-ozone-cmd = let
|
vesktop-ozone-cmd = let
|
||||||
extraFlags = lib.optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
extraFlags = lib.optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
||||||
@ -19,21 +17,23 @@
|
|||||||
done
|
done
|
||||||
exec "$@"
|
exec "$@"
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.packageSets.communication = {
|
options.nixfiles.packageSets.communication = {
|
||||||
enable = lib.mkEnableOption "communication package set";
|
enable = lib.mkEnableOption "communication package set";
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
xdg.desktopEntries.vesktop = lib.mkIf config.nixfiles.meta.graphical {
|
xdg.desktopEntries.vesktop = lib.mkIf config.nixfiles.meta.graphical {
|
||||||
categories = ["Network" "InstantMessaging" "Chat"];
|
categories= ["Network" "InstantMessaging" "Chat"];
|
||||||
exec = vesktop-ozone-cmd + " %U";
|
exec=vesktop-ozone-cmd + " %U";
|
||||||
genericName = "Internet Messenger";
|
genericName="Internet Messenger";
|
||||||
icon = "vesktop";
|
icon="vesktop";
|
||||||
name = "Vesktop";
|
name="Vesktop";
|
||||||
type = "Application";
|
type="Application";
|
||||||
settings = {
|
settings = {
|
||||||
StartupWMClass = "Vesktop";
|
StartupWMClass="Vesktop";
|
||||||
Keywords = "discord;vencord;electron;chat";
|
Keywords="discord;vencord;electron;chat";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,18 +41,16 @@ in {
|
|||||||
(waitNet + " " + vesktop-ozone-cmd + " --start-minimized")
|
(waitNet + " " + vesktop-ozone-cmd + " --start-minimized")
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; lib.optionals config.nixfiles.meta.graphical [
|
||||||
lib.optionals config.nixfiles.meta.graphical [
|
|
||||||
element-desktop
|
element-desktop
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
signal-desktop
|
signal-desktop
|
||||||
thunderbird
|
thunderbird
|
||||||
vesktop
|
vesktop
|
||||||
rustdesk-flutter
|
rustdesk-pkg
|
||||||
tor-browser
|
tor-browser
|
||||||
onionshare
|
onionshare
|
||||||
]
|
] ++ [
|
||||||
++ [
|
|
||||||
irssi
|
irssi
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{...}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./communication.nix
|
./communication.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
{
|
{ pkgs, lib, config, osConfig ? {}, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.packageSets.dev;
|
cfg = config.nixfiles.packageSets.dev;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.packageSets.dev = {
|
options.nixfiles.packageSets.dev = {
|
||||||
enable = lib.mkEnableOption "development package set";
|
enable = lib.mkEnableOption "development package set";
|
||||||
};
|
};
|
||||||
|
@ -1,34 +1,26 @@
|
|||||||
{
|
{ config, osConfig ? { }, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
osConfig ? {},
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.packageSets.gaming;
|
cfg = config.nixfiles.packageSets.gaming;
|
||||||
default = osConfig.nixfiles.packageSets.gaming.enable or false;
|
default = osConfig.nixfiles.packageSets.gaming.enable or false;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
nixpkgs.overlays = let
|
nixpkgs.overlays = let
|
||||||
in
|
in lib.mkAfter [ ];
|
||||||
lib.mkAfter [];
|
|
||||||
|
|
||||||
nixfiles.common.wm.autostart = [
|
nixfiles.common.wm.autostart = [
|
||||||
"steam -silent"
|
"steam -silent"
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; [
|
||||||
[
|
|
||||||
ludusavi
|
ludusavi
|
||||||
rclone # needed to sync ludusavi
|
rclone # needed to sync ludusavi
|
||||||
protontricks
|
protontricks
|
||||||
]
|
] ++ lib.optionals cfg.enableLaunchers [
|
||||||
++ lib.optionals cfg.enableLaunchers [
|
|
||||||
steam
|
steam
|
||||||
prismlauncher
|
prismlauncher
|
||||||
heroic
|
heroic
|
||||||
legendary-gl
|
legendary-gl
|
||||||
lucem
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
options.nixfiles.packageSets.gaming = {
|
options.nixfiles.packageSets.gaming = {
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
{
|
{ config, lib, pkgs, osConfig ? { }, ...}:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.packageSets.multimedia;
|
cfg = config.nixfiles.packageSets.multimedia;
|
||||||
inherit (lib) optionals mkEnableOption mkIf;
|
inherit (lib) optionals mkEnableOption mkIf;
|
||||||
default = osConfig ? nixfiles && osConfig.nixfiles.packageSets.multimedia.enable;
|
default = osConfig ? nixfiles && osConfig.nixfiles.packageSets.multimedia.enable;
|
||||||
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.packageSets.multimedia = {
|
options.nixfiles.packageSets.multimedia = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
description = "Whether to enable multimedia packages";
|
description = "Whether to enable multimedia packages";
|
||||||
@ -20,8 +16,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; optionals config.nixfiles.meta.graphical [
|
||||||
optionals config.nixfiles.meta.graphical [
|
|
||||||
mpv
|
mpv
|
||||||
gimp
|
gimp
|
||||||
krita
|
krita
|
||||||
@ -32,8 +27,7 @@ in {
|
|||||||
picard
|
picard
|
||||||
spicetify-cli
|
spicetify-cli
|
||||||
(kodi.withPackages (_: [])) # this is required to get python libs
|
(kodi.withPackages (_: [])) # this is required to get python libs
|
||||||
]
|
] ++ [
|
||||||
++ [
|
|
||||||
yt-dlp
|
yt-dlp
|
||||||
gallery-dl
|
gallery-dl
|
||||||
imagemagick
|
imagemagick
|
||||||
@ -45,18 +39,18 @@ in {
|
|||||||
xdg.mimeApps.defaultApplications = lib.mkMerge [
|
xdg.mimeApps.defaultApplications = lib.mkMerge [
|
||||||
# project files
|
# project files
|
||||||
(mkOverrideEach 100 {
|
(mkOverrideEach 100 {
|
||||||
"image/x-xcf" = ["gimp.desktop"];
|
"image/x-xcf" = [ "gimp.desktop" ];
|
||||||
"image/x-compressed-xcf" = ["gimp.desktop"];
|
"image/x-compressed-xcf" = [ "gimp.desktop" ];
|
||||||
"image/x-krita" = ["krita.desktop"];
|
"image/x-krita" = [ "krita.desktop" ];
|
||||||
"application/x-audacity-project" = ["audacity.desktop"];
|
"application/x-audacity-project" = [ "audacity.desktop" ];
|
||||||
"application/x-audacity-project+sqlite3" = ["audacity.desktop"];
|
"application/x-audacity-project+sqlite3" = [ "audacity.desktop" ];
|
||||||
"image/svg+xml" = ["org.inkscape.Inkscape.desktop"];
|
"image/svg+xml" = [ "org.inkscape.Inkscape.desktop" ];
|
||||||
"image/svg+xml-compressed" = ["org.inkscape.Inkscape.desktop"];
|
"image/svg+xml-compressed" = [ "org.inkscape.Inkscape.desktop" ];
|
||||||
})
|
})
|
||||||
# general files
|
# general files
|
||||||
(with pkgs; mkOverrideEach 150 (config.lib.xdg.mimeAssociations [nomacs mpv]))
|
(with pkgs; mkOverrideEach 150 (config.lib.xdg.mimeAssociations [ nomacs mpv ]))
|
||||||
# rest of the files
|
# rest of the files
|
||||||
(with pkgs; mkOverrideEach 200 (config.lib.xdg.mimeAssociations [inkscape gimp audacity]))
|
(with pkgs; mkOverrideEach 200 (config.lib.xdg.mimeAssociations [ inkscape gimp audacity ]))
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,31 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.packageSets.productivity;
|
cfg = config.nixfiles.packageSets.productivity;
|
||||||
inherit (lib) optionals;
|
inherit (lib) optionals;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; optionals config.nixfiles.meta.graphical [
|
||||||
optionals config.nixfiles.meta.graphical [
|
|
||||||
libreoffice-fresh
|
libreoffice-fresh
|
||||||
obsidian
|
obsidian
|
||||||
anki
|
anki
|
||||||
zen-browser-bin
|
|
||||||
|
|
||||||
# mapping/GIS
|
# mapping/GIS
|
||||||
qgis
|
qgis
|
||||||
josm
|
josm
|
||||||
]
|
] ++ [
|
||||||
++ [
|
|
||||||
pandoc
|
pandoc
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.desktopEntries.obsidian = lib.mkIf config.nixfiles.meta.graphical {
|
xdg.desktopEntries.obsidian = lib.mkIf config.nixfiles.meta.graphical {
|
||||||
categories = ["Office"];
|
categories = [ "Office" ];
|
||||||
comment = "Knowledge base";
|
comment = "Knowledge base";
|
||||||
exec = let
|
exec = let
|
||||||
extraFlags = with lib.strings;
|
extraFlags = with lib.strings;
|
||||||
optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
||||||
in "env NIXOS_OZONE_WL=1 obsidian${extraFlags} %u";
|
in "env NIXOS_OZONE_WL=1 obsidian${extraFlags} %u";
|
||||||
icon = "obsidian";
|
icon = "obsidian";
|
||||||
mimeType = ["x-scheme-handler/obsidian"];
|
mimeType = [ "x-scheme-handler/obsidian" ];
|
||||||
name = "Obsidian";
|
name = "Obsidian";
|
||||||
type = "Application";
|
type = "Application";
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
{
|
{ lib, pkgs, config, osConfig ? { }, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.profile.base;
|
cfg = config.nixfiles.profile.base;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# imports = [
|
# imports = [
|
||||||
# ./comma.nix
|
# ./comma.nix
|
||||||
# ];
|
# ];
|
||||||
@ -19,9 +15,7 @@ in {
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
nixfiles.programs.comma.enable = true;
|
nixfiles.programs.comma.enable = true;
|
||||||
nixfiles.programs.neovim.enable = lib.mkDefault true;
|
|
||||||
nixfiles.common.nix.enable = true;
|
nixfiles.common.nix.enable = true;
|
||||||
nixfiles.common.shell.enable = true;
|
|
||||||
|
|
||||||
home.sessionVariables = lib.mkMerge [
|
home.sessionVariables = lib.mkMerge [
|
||||||
(lib.mkIf config.programs.neovim.enable {
|
(lib.mkIf config.programs.neovim.enable {
|
||||||
@ -35,33 +29,47 @@ in {
|
|||||||
"${config.home.profileDirectory}/share/terminfo"
|
"${config.home.profileDirectory}/share/terminfo"
|
||||||
"/usr/share/terminfo"
|
"/usr/share/terminfo"
|
||||||
];
|
];
|
||||||
in
|
in builtins.concatStringsSep ":" terminfo-dirs;
|
||||||
builtins.concatStringsSep ":" terminfo-dirs;
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
maintenance.enable = lib.mkDefault true;
|
|
||||||
# default value is stateVersion dependent, doesn't evaluate after 25.05
|
|
||||||
# even if signing isn't configured for some reason
|
|
||||||
signing.format = lib.mkDefault "openpgp";
|
|
||||||
};
|
|
||||||
|
|
||||||
# this allows `git config --global` commands to work by ensuring the
|
# TODO move this stuff to a shell.nix or something; this is just a quick
|
||||||
# presense of ~/.gitconfig. git will read from both files, and `git config`
|
# fix so home.sessionVariables works
|
||||||
# will not write to ~/.gitconfig when the managed config exists unless
|
home.shellAliases = {
|
||||||
# ~/.gitconfig also exists
|
v = "nvim";
|
||||||
home.activation.git-create-gitconfig =
|
icat = "kitten icat";
|
||||||
lib.mkIf config.programs.git.enable
|
};
|
||||||
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
programs.fzf.enable = lib.mkDefault true;
|
||||||
_nixfiles_git_create_gitconfig () {
|
programs.fzf.enableZshIntegration = lib.mkDefault true;
|
||||||
if ! [[ -a "$HOME/.gitconfig" ]] ; then
|
programs.fzf.enableBashIntegration = lib.mkDefault true;
|
||||||
touch "$HOME/.gitconfig"
|
|
||||||
fi
|
programs.bash = {
|
||||||
}
|
enable = lib.mkDefault true;
|
||||||
run _nixfiles_git_create_gitconfig
|
initExtra = ''
|
||||||
'');
|
export HOME_MANAGER_MANAGED=true;
|
||||||
|
[[ -e ~/dotfiles/shell/.bashrc ]] && . ~/dotfiles/shell/.bashrc ]]
|
||||||
|
unset HOME_MANAGERR_MANAGED
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
programs.zsh = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
initExtra = ''
|
||||||
|
export HOME_MANAGER_MANAGED=true
|
||||||
|
[[ -e ~/dotfiles/shell/.zshrc ]] && . ~/dotfiles/shell/.zshrc ]]
|
||||||
|
unset HOME_MANAGER_MANAGED
|
||||||
|
'';
|
||||||
|
oh-my-zsh = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
theme = "robbyrussell";
|
||||||
|
extraConfig = ''
|
||||||
|
DISABLE_MAGIC_FUNCTIONS="true"
|
||||||
|
'';
|
||||||
|
plugins = [
|
||||||
|
"git"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
programs.btop.enable = lib.mkDefault true;
|
programs.btop.enable = lib.mkDefault true;
|
||||||
|
|
||||||
@ -70,18 +78,16 @@ in {
|
|||||||
# defaultTerminal =
|
# defaultTerminal =
|
||||||
# if config.programs.kitty.enable then "kitty"
|
# if config.programs.kitty.enable then "kitty"
|
||||||
# else null;
|
# else null;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
settings = lib.mkMerge [
|
settings = lib.mkMerge [{
|
||||||
{
|
|
||||||
use_preview_script = lib.mkDefault true;
|
use_preview_script = lib.mkDefault true;
|
||||||
preview_files = lib.mkDefault true;
|
preview_files = lib.mkDefault true;
|
||||||
}
|
} (lib.mkIf (!(isNull defaultTerminal)) {
|
||||||
(lib.mkIf (!(isNull defaultTerminal)) {
|
|
||||||
preview_images = lib.mkDefault true;
|
preview_images = lib.mkDefault true;
|
||||||
preview_images_method = lib.mkDefault defaultTerminal;
|
preview_images_method = lib.mkDefault defaultTerminal;
|
||||||
})
|
})];
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.keychain = {
|
programs.keychain = {
|
||||||
@ -91,8 +97,7 @@ in {
|
|||||||
extraFlags = [
|
extraFlags = [
|
||||||
"--quiet"
|
"--quiet"
|
||||||
"--systemd"
|
"--systemd"
|
||||||
"--inherit"
|
"--inherit" "any-once"
|
||||||
"any-once"
|
|
||||||
"--noask"
|
"--noask"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -105,19 +110,23 @@ in {
|
|||||||
# some packages defined here may be redundant with packages on a non-NixOS
|
# some packages defined here may be redundant with packages on a non-NixOS
|
||||||
# home-manager setup, but it's better to have a consistent environment at
|
# home-manager setup, but it's better to have a consistent environment at
|
||||||
# the cost of slightly more space
|
# the cost of slightly more space
|
||||||
|
programs.neovim = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
vimAlias = lib.mkDefault true;
|
||||||
|
withPython3 = lib.mkDefault true;
|
||||||
|
defaultEditor = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; let
|
home.packages = with pkgs; let
|
||||||
neofetch-hyfetch-shim = writeShellScriptBin "neofetch" ''
|
neofetch-hyfetch-shim = writeShellScriptBin "neofetch" ''
|
||||||
exec "${pkgs.hyfetch}/bin/neowofetch" "$@"
|
exec "${pkgs.hyfetch}/bin/neowofetch" "$@"
|
||||||
'';
|
'';
|
||||||
in
|
in [
|
||||||
[
|
|
||||||
# nix stuff
|
# nix stuff
|
||||||
nvd
|
nvd
|
||||||
nix-tree
|
nix-tree
|
||||||
nh
|
nh
|
||||||
nix-output-monitor
|
nix-output-monitor
|
||||||
attic-client
|
|
||||||
nix-fast-build
|
|
||||||
|
|
||||||
git
|
git
|
||||||
git-lfs
|
git-lfs
|
||||||
@ -132,18 +141,19 @@ in {
|
|||||||
grc
|
grc
|
||||||
fzf
|
fzf
|
||||||
pv
|
pv
|
||||||
jq
|
|
||||||
lsof
|
|
||||||
xxd
|
|
||||||
shellcheck
|
|
||||||
|
|
||||||
# for icat on all systems
|
# for icat on all systems
|
||||||
kitty.kitten
|
kitty.kitten
|
||||||
|
|
||||||
|
# terminfo (just the ones i'm likely to use)
|
||||||
|
kitty.terminfo
|
||||||
|
alacritty.terminfo
|
||||||
|
termite.terminfo
|
||||||
|
tmux.terminfo
|
||||||
|
|
||||||
# pretty
|
# pretty
|
||||||
hyfetch
|
hyfetch
|
||||||
neofetch-hyfetch-shim
|
neofetch-hyfetch-shim
|
||||||
fastfetch
|
|
||||||
|
|
||||||
# files
|
# files
|
||||||
restic
|
restic
|
||||||
@ -151,37 +161,14 @@ in {
|
|||||||
rmlint
|
rmlint
|
||||||
ncdu
|
ncdu
|
||||||
|
|
||||||
# compression
|
|
||||||
atool-wrapped
|
|
||||||
lzip
|
|
||||||
plzip
|
|
||||||
lzop
|
|
||||||
xz
|
|
||||||
zip
|
|
||||||
unzip
|
|
||||||
arj
|
|
||||||
rpm
|
|
||||||
cpio
|
|
||||||
p7zip
|
|
||||||
|
|
||||||
# other utilities
|
# other utilities
|
||||||
tmux
|
tmux
|
||||||
tmuxp
|
|
||||||
openssh
|
|
||||||
autossh
|
|
||||||
mosh
|
mosh
|
||||||
btop
|
btop
|
||||||
htop
|
htop
|
||||||
zoxide
|
zoxide
|
||||||
asciinema
|
asciinema
|
||||||
mtr
|
|
||||||
]
|
|
||||||
++ builtins.map (x: lib.hiPrio x) [
|
|
||||||
# terminfo (just the ones i'm likely to use)
|
|
||||||
kitty.terminfo
|
|
||||||
alacritty.terminfo
|
|
||||||
termite.terminfo
|
|
||||||
tmux.terminfo
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{...}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./base.nix
|
./base.nix
|
||||||
./pc.nix
|
./pc.nix
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
{
|
{ pkgs, config, osConfig ? {}, lib, ...}:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.profile.pc;
|
cfg = config.nixfiles.profile.pc;
|
||||||
default = osConfig ? nixfiles && osConfig.nixfiles.profile.pc.enable;
|
default = osConfig ? nixfiles && osConfig.nixfiles.profile.pc.enable;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.profile.pc.enable = lib.mkOption {
|
options.nixfiles.profile.pc.enable = lib.mkOption {
|
||||||
description = "Whether to enable the personal computer profile";
|
description = "Whether to enable the personal computer profile";
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
{
|
{ lib, pkgs, config, inputs, ... } @args:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
cfg = config.nixfiles.programs.comma;
|
cfg = config.nixfiles.programs.comma;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nix-index-database.hmModules.nix-index
|
inputs.nix-index-database.hmModules.nix-index
|
||||||
];
|
];
|
||||||
@ -17,8 +13,7 @@ in {
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
programs.nix-index.symlinkToCacheHome = lib.mkDefault cfg.enable;
|
programs.nix-index.symlinkToCacheHome = lib.mkDefault cfg.enable;
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs; lib.optionals cfg.enable [
|
||||||
lib.optionals cfg.enable [
|
|
||||||
comma
|
comma
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{...}: {
|
{...}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./comma.nix
|
./comma.nix
|
||||||
./mopidy.nix
|
./mopidy.nix
|
||||||
./hypridle.nix
|
./hypridle.nix
|
||||||
./dunst.nix
|
./dunst.nix
|
||||||
./neovim.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.programs.dunst;
|
cfg = config.nixfiles.programs.dunst;
|
||||||
mkd = lib.mkDefault;
|
mkd = lib.mkDefault;
|
||||||
in {
|
in {
|
||||||
|
@ -1,25 +1,21 @@
|
|||||||
{
|
{ pkgs, config, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.services.hypridle;
|
cfg = config.nixfiles.services.hypridle;
|
||||||
inherit (lib.types) str int;
|
inherit (lib.types) str int;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.services.hypridle = {
|
options.nixfiles.services.hypridle = {
|
||||||
enable = lib.mkEnableOption "the hypridle configuration";
|
enable = lib.mkEnableOption "the hypridle configuration";
|
||||||
timeouts = let
|
timeouts = let
|
||||||
mkTimeout = timeout: desc:
|
mkTimeout = timeout: desc: lib.mkOption {
|
||||||
lib.mkOption {
|
|
||||||
description = "${desc}";
|
description = "${desc}";
|
||||||
type = int;
|
type = int;
|
||||||
default = timeout;
|
default = timeout;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
dpms = mkTimeout 300 "DPMS timeout";
|
dpms = mkTimeout (300) "DPMS timeout";
|
||||||
lock = mkTimeout 360 "Lock timeout";
|
lock = mkTimeout (360) "Lock timeout";
|
||||||
locked-dpms = mkTimeout 10 "DPMS timeout while locked";
|
locked-dpms = mkTimeout (10) "DPMS timeout while locked";
|
||||||
};
|
};
|
||||||
commands = {
|
commands = {
|
||||||
dpms-off = lib.mkOption {
|
dpms-off = lib.mkOption {
|
||||||
@ -61,6 +57,7 @@ in {
|
|||||||
lock-dpms = pkgs.writeShellScript "lock-dpms" ''
|
lock-dpms = pkgs.writeShellScript "lock-dpms" ''
|
||||||
${pkgs.procps}/bin/pgrep -x swaylock > /dev/null && "${dpms-wrapped}"
|
${pkgs.procps}/bin/pgrep -x swaylock > /dev/null && "${dpms-wrapped}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in [
|
in [
|
||||||
{
|
{
|
||||||
timeout = cfg.timeouts.dpms;
|
timeout = cfg.timeouts.dpms;
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
{
|
{ lib, pkgs, config, outputs, osConfig ? {}, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
outputs,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.programs.mopidy;
|
cfg = config.nixfiles.programs.mopidy;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.programs.mopidy = {
|
options.nixfiles.programs.mopidy = {
|
||||||
enable = lib.mkEnableOption "mopidy configuration";
|
enable = lib.mkEnableOption "mopidy configuration";
|
||||||
};
|
};
|
||||||
@ -43,7 +38,7 @@ in {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
(ncmpcpp.override {visualizerSupport = true;})
|
(ncmpcpp.override { visualizerSupport = true; })
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.programs.neovim;
|
|
||||||
in {
|
|
||||||
options.nixfiles.programs.neovim.enable = lib.mkEnableOption "the Neovim configuration";
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
programs.neovim = {
|
|
||||||
enable = true;
|
|
||||||
vimAlias = lib.mkDefault true;
|
|
||||||
withPython3 = lib.mkDefault true;
|
|
||||||
defaultEditor = lib.mkDefault true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
lua-language-server
|
|
||||||
rust-analyzer
|
|
||||||
vscode-langservers-extracted
|
|
||||||
pyright
|
|
||||||
gcc
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,12 +1,8 @@
|
|||||||
# Configuration for root user.
|
# Configuration for root user.
|
||||||
# TODO this file is sorta an exception to my repo organization, it should
|
# TODO this file is sorta an exception to my repo organization, it should
|
||||||
# probably be somewhere else.
|
# probably be somewhere else.
|
||||||
|
{ config, lib, pkgs, ... }@args:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
} @ args: {
|
|
||||||
imports = [
|
imports = [
|
||||||
./.
|
./.
|
||||||
];
|
];
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{...}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hyprland
|
./hyprland
|
||||||
./plasma.nix
|
./plasma.nix
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
{
|
{ lib, pkgs, config, osConfig ? {}, outputs, inputs, ... }@args:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
outputs,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
cfg = config.nixfiles.sessions.hyprland;
|
cfg = config.nixfiles.sessions.hyprland;
|
||||||
mkd = lib.mkDefault;
|
mkd = lib.mkDefault;
|
||||||
hyprland-pkg = config.wayland.windowManager.hyprland.finalPackage;
|
hyprland-pkg = config.wayland.windowManager.hyprland.finalPackage;
|
||||||
@ -19,7 +12,7 @@
|
|||||||
rofi = "${pkgs.rofi-wayland}/bin/rofi";
|
rofi = "${pkgs.rofi-wayland}/bin/rofi";
|
||||||
notifydaemon = "${pkgs.dunst}/bin/dunst";
|
notifydaemon = "${pkgs.dunst}/bin/dunst";
|
||||||
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
||||||
polkit-agent = "${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1";
|
polkit-agent = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
|
||||||
grimblast = "${inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast}/bin/grimblast";
|
grimblast = "${inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast}/bin/grimblast";
|
||||||
swayidle = "${pkgs.swayidle}/bin/swayidle";
|
swayidle = "${pkgs.swayidle}/bin/swayidle";
|
||||||
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
|
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
|
||||||
@ -31,15 +24,13 @@
|
|||||||
lock-cmd = "${swaylock}";
|
lock-cmd = "${swaylock}";
|
||||||
|
|
||||||
mkKittyHdrop = name: command: let
|
mkKittyHdrop = name: command: let
|
||||||
class =
|
class = if builtins.isNull (builtins.match "[[:alnum:]_]+" name) then throw "mkKittyHdrop: window name should be an alphanumeric string" else "kitty-${name}";
|
||||||
if builtins.isNull (builtins.match "[[:alnum:]_]+" name)
|
|
||||||
then throw "mkKittyHdrop: window name should be an alphanumeric string"
|
|
||||||
else "kitty-${name}";
|
|
||||||
wrappedCommand = pkgs.writeShellScript "hdrop-${name}" ''
|
wrappedCommand = pkgs.writeShellScript "hdrop-${name}" ''
|
||||||
exec bash -c ${lib.escapeShellArg command}
|
exec bash -c ${lib.escapeShellArg command}
|
||||||
'';
|
'';
|
||||||
in "hdrop -f -c ${class} 'kitty --class=${class} ${wrappedCommand}'";
|
in "hdrop -f -c ${class} 'kitty --class=${class} ${wrappedCommand}'";
|
||||||
|
|
||||||
|
|
||||||
# lock-cmd = let
|
# lock-cmd = let
|
||||||
# cmd = pkgs.writeShellScript "lock-script" ''
|
# cmd = pkgs.writeShellScript "lock-script" ''
|
||||||
# ${swayidle} -w timeout 10 '${hyprctl} dispatch dpms off' resume '${hyprctl} dispatch dpms on' &
|
# ${swayidle} -w timeout 10 '${hyprctl} dispatch dpms off' resume '${hyprctl} dispatch dpms on' &
|
||||||
@ -57,7 +48,7 @@
|
|||||||
resume 'hyprctl dispatch dpms on'
|
resume 'hyprctl dispatch dpms on'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hypr-dispatcher-package = pkgs.callPackage ./dispatcher {hyprland = hyprland-pkg;};
|
hypr-dispatcher-package = pkgs.callPackage ./dispatcher { hyprland = hyprland-pkg; };
|
||||||
hypr-dispatcher = "${hypr-dispatcher-package}/bin/hypr-dispatcher";
|
hypr-dispatcher = "${hypr-dispatcher-package}/bin/hypr-dispatcher";
|
||||||
|
|
||||||
wallpaper-package = "${pkgs.nixfiles-assets}";
|
wallpaper-package = "${pkgs.nixfiles-assets}";
|
||||||
@ -65,8 +56,7 @@
|
|||||||
wallpaper-cmd = "${swaybg} -i ${wallpaper-package}/share/wallpapers/${wallpaper}";
|
wallpaper-cmd = "${swaybg} -i ${wallpaper-package}/share/wallpapers/${wallpaper}";
|
||||||
|
|
||||||
# https://github.com/flatpak/xdg-desktop-portal-gtk/issues/440#issuecomment-1900520919
|
# https://github.com/flatpak/xdg-desktop-portal-gtk/issues/440#issuecomment-1900520919
|
||||||
xdpg-workaround =
|
xdpg-workaround = pkgs.writeShellScript "xdg-desktop-portal-gtk-workaround"
|
||||||
pkgs.writeShellScript "xdg-desktop-portal-gtk-workaround"
|
|
||||||
''
|
''
|
||||||
${pkgs.coreutils}/bin/sleep 3
|
${pkgs.coreutils}/bin/sleep 3
|
||||||
${pkgs.systemd}/bin/systemctl --user import-environment PATH
|
${pkgs.systemd}/bin/systemctl --user import-environment PATH
|
||||||
@ -75,20 +65,19 @@
|
|||||||
|
|
||||||
bar-cmd = "${pkgs.waybar}/bin/waybar";
|
bar-cmd = "${pkgs.waybar}/bin/waybar";
|
||||||
# Hyprland workspace configuration
|
# Hyprland workspace configuration
|
||||||
mainWorkspaces = builtins.genList (x: x + 1) (9 ++ [0]);
|
mainWorkspaces = builtins.genList (x: x+1) (9 ++ [0]);
|
||||||
workspaceName = key: let
|
workspaceName = key: let
|
||||||
inherit (builtins) hasAttr;
|
inherit (builtins) hasAttr;
|
||||||
keyNames = {
|
keyNames = {
|
||||||
"0" = "10";
|
"0" = "10";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
if hasAttr key keyNames
|
if hasAttr key keyNames then keyNames."${key}" else key;
|
||||||
then keyNames."${key}"
|
|
||||||
else key;
|
|
||||||
|
|
||||||
inherit (outputs.packages.${pkgs.system}) wm-helpers;
|
inherit (outputs.packages.${pkgs.system}) wm-helpers;
|
||||||
keysetting = "${wm-helpers}/bin/keysetting";
|
keysetting = "${wm-helpers}/bin/keysetting";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# FIXME this is temporary just to get it working, need to make wm-common an
|
# FIXME this is temporary just to get it working, need to make wm-common an
|
||||||
# option first
|
# option first
|
||||||
# imports = [
|
# imports = [
|
||||||
@ -99,10 +88,7 @@ in {
|
|||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
description = "Whether to enable hyprland.";
|
description = "Whether to enable hyprland.";
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default =
|
default = if (builtins.hasAttr "home-manager" osConfig) then osConfig.nixfiles.sessions.hyprland.enable else false;
|
||||||
if (builtins.hasAttr "home-manager" osConfig)
|
|
||||||
then osConfig.nixfiles.sessions.hyprland.enable
|
|
||||||
else false;
|
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -126,7 +112,7 @@ in {
|
|||||||
nixfiles.common.wm.enable = true;
|
nixfiles.common.wm.enable = true;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
kitty
|
kitty
|
||||||
kdePackages.dolphin
|
dolphin
|
||||||
rofi-wayland
|
rofi-wayland
|
||||||
wev
|
wev
|
||||||
dunst
|
dunst
|
||||||
@ -147,6 +133,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
package = lib.mkIf (osConfig ? programs) (lib.mkDefault osConfig.programs.hyprland.package);
|
package = lib.mkIf (osConfig ? programs) (lib.mkDefault osConfig.programs.hyprland.package);
|
||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
# enable debug logging
|
# enable debug logging
|
||||||
debug.disable_logs = mkd false;
|
debug.disable_logs = mkd false;
|
||||||
|
|
||||||
@ -163,10 +150,8 @@ in {
|
|||||||
|
|
||||||
exec-once = let
|
exec-once = let
|
||||||
wrapScope = cmd: "systemd-run --user --scope -- ${cmd}";
|
wrapScope = cmd: "systemd-run --user --scope -- ${cmd}";
|
||||||
in
|
in (lib.optional cfg.autolock lock-cmd) ++ (map wrapScope config.nixfiles.common.wm.autostart) ++
|
||||||
(lib.optional cfg.autolock lock-cmd)
|
[
|
||||||
++ (map wrapScope config.nixfiles.common.wm.autostart)
|
|
||||||
++ [
|
|
||||||
wallpaper-cmd
|
wallpaper-cmd
|
||||||
notifydaemon
|
notifydaemon
|
||||||
polkit-agent
|
polkit-agent
|
||||||
@ -181,6 +166,7 @@ in {
|
|||||||
# Some default env vars.
|
# Some default env vars.
|
||||||
# env = mkd "XCURSOR_SIZE,24";
|
# env = mkd "XCURSOR_SIZE,24";
|
||||||
|
|
||||||
|
|
||||||
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
||||||
input = {
|
input = {
|
||||||
kb_layout = mkd "us";
|
kb_layout = mkd "us";
|
||||||
@ -277,8 +263,7 @@ in {
|
|||||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||||
|
|
||||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||||
bind =
|
bind = [
|
||||||
[
|
|
||||||
"$mod, Q, exec, ${terminal}"
|
"$mod, Q, exec, ${terminal}"
|
||||||
"$mod, Return, exec, ${terminal}"
|
"$mod, Return, exec, ${terminal}"
|
||||||
"$mod, C, killactive, "
|
"$mod, C, killactive, "
|
||||||
@ -360,13 +345,11 @@ in {
|
|||||||
# edit this file
|
# edit this file
|
||||||
("$mod SHIFT, slash, exec, ${terminal} -e ${pkgs.neovim}/bin/nvim "
|
("$mod SHIFT, slash, exec, ${terminal} -e ${pkgs.neovim}/bin/nvim "
|
||||||
+ lib.escapeShellArg (config.nixfiles.path + "/home/sessions/hyprland/default.nix"))
|
+ lib.escapeShellArg (config.nixfiles.path + "/home/sessions/hyprland/default.nix"))
|
||||||
]
|
] ++ lib.optional config.nixfiles.programs.mopidy.enable
|
||||||
++ lib.optional config.nixfiles.programs.mopidy.enable
|
|
||||||
"$mod CTRL, n, exec, ${mkKittyHdrop "ncmpcpp" "ncmpcpp"}";
|
"$mod CTRL, n, exec, ${mkKittyHdrop "ncmpcpp" "ncmpcpp"}";
|
||||||
|
|
||||||
# repeat, ignore mods
|
# repeat, ignore mods
|
||||||
bindei =
|
bindei = lib.mapAttrsToList (keysym: command: ",${keysym}, exec, ${command}") config.nixfiles.common.wm.finalKeybinds
|
||||||
lib.mapAttrsToList (keysym: command: ",${keysym}, exec, ${command}") config.nixfiles.common.wm.finalKeybinds
|
|
||||||
++ [
|
++ [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
{
|
{ lib,
|
||||||
lib,
|
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
socat,
|
socat,
|
||||||
coreutils,
|
coreutils,
|
||||||
hyprland,
|
hyprland,
|
||||||
makeShellWrapper,
|
makeShellWrapper }:
|
||||||
}: let
|
let
|
||||||
wrappedPath = lib.makeBinPath [coreutils socat hyprland];
|
wrappedPath = lib.makeBinPath [ coreutils socat hyprland ];
|
||||||
in
|
in
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "hyprland-dispatcher";
|
name = "hyprland-dispatcher";
|
||||||
phases = ["installPhase"];
|
phases = [ "installPhase" ];
|
||||||
nativeBuildInputs = [makeShellWrapper];
|
nativeBuildInputs = [ makeShellWrapper ];
|
||||||
src = ./.;
|
src = ./.;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -Dm555 $src/dispatcher.sh $out/bin/hypr-dispatcher
|
install -Dm555 $src/dispatcher.sh $out/bin/hypr-dispatcher
|
||||||
wrapProgramShell $out/bin/hypr-dispatcher --prefix PATH : "${wrappedPath}"
|
wrapProgramShell $out/bin/hypr-dispatcher --prefix PATH : "${wrappedPath}"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
{
|
{ pkgs, config, lib, osConfig ? {}, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkOption mkEnableOption;
|
inherit (lib) mkOption mkEnableOption;
|
||||||
cfg = config.nixfiles.sessions.plasma;
|
cfg = config.nixfiles.sessions.plasma;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.nixfiles.sessions.plasma = {
|
options.nixfiles.sessions.plasma = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
description = "Whether to enable the Plasma session home configuration.";
|
description = "Whether to enable the Plasma session home configuration.";
|
||||||
@ -17,10 +13,10 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# TODO make this a generic implementation
|
# TODO make this a generic implementation
|
||||||
home.packages = let
|
home.packages = let
|
||||||
startupScript =
|
startupScript = pkgs.writeShellScript "autostart-script"
|
||||||
pkgs.writeShellScript "autostart-script"
|
|
||||||
(lib.concatStringsSep "\n"
|
(lib.concatStringsSep "\n"
|
||||||
(builtins.map (x: "sh -c ${lib.escapeShellArg x} &") config.nixfiles.common.wm.autostart));
|
(builtins.map (x: "sh -c ${lib.escapeShellArg x} &") config.nixfiles.common.wm.autostart));
|
||||||
|
|
||||||
@ -34,6 +30,6 @@ in {
|
|||||||
mkdir -p $out/etc/xdg/autostart
|
mkdir -p $out/etc/xdg/autostart
|
||||||
ln -s "${desktopFilePkg}/share/applications/${name}.desktop" "$out/etc/xdg/autostart/"
|
ln -s "${desktopFilePkg}/share/applications/${name}.desktop" "$out/etc/xdg/autostart/"
|
||||||
'';
|
'';
|
||||||
in [autostartPkg];
|
in [ autostartPkg ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
# Home Manager default nixfiles entrypoint. This serves as an alternative to
|
# Home Manager default nixfiles entrypoint. This serves as an alternative to
|
||||||
# default.nix, which sets up some more appropriate options for home-manager
|
# default.nix, which sets up some more appropriate options for home-manager
|
||||||
|
{ inputs, pkgs, config, lib, ... }:
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
./.
|
./.
|
||||||
inputs.stylix.homeManagerModules.stylix
|
inputs.stylix.homeManagerModules.stylix
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
|
{ pkgs, lib, config, inputs, ... }@args:
|
||||||
{
|
{
|
||||||
pkgs,
|
imports = [ ];
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
} @ args: {
|
|
||||||
imports = [];
|
|
||||||
config = {
|
config = {
|
||||||
stylix = lib.mkMerge [
|
stylix = lib.mkMerge [
|
||||||
{
|
{
|
||||||
targets.vim.enable = lib.mkDefault false;
|
targets.vim.enable = lib.mkDefault false;
|
||||||
targets.neovim.enable = lib.mkDefault false;
|
targets.neovim.enable = lib.mkDefault false;
|
||||||
targets.gtk.enable = lib.mkDefault false;
|
targets.gtk.enable = lib.mkDefault false;
|
||||||
targets.qt.enable = lib.mkDefault false;
|
|
||||||
targets.fzf.enable = lib.mkDefault false;
|
targets.fzf.enable = lib.mkDefault false;
|
||||||
# the ring is styled light so it's light on light which looks worse than the default theme
|
# the ring is styled light so it's light on light which looks worse than the default theme
|
||||||
targets.swaylock.enable = lib.mkDefault false;
|
targets.swaylock.enable = lib.mkDefault false;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
{ pkgs, config, lib, vars, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
imports = [
|
||||||
config,
|
./tmpfiles-workaround.nix
|
||||||
lib,
|
];
|
||||||
vars,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = {
|
config = {
|
||||||
networking.hostName = "nixos-wsl";
|
networking.hostName = "nixos-wsl";
|
||||||
|
|
||||||
@ -31,7 +29,7 @@
|
|||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
description = "WSL startup workaround";
|
description = "WSL startup workaround";
|
||||||
wantedBy = ["default.target"];
|
wantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -47,12 +45,10 @@
|
|||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
fileSystems."/mnt/wsl/instances/NixOS" = {
|
fileSystems."/mnt/wsl/instances/NixOS" = {
|
||||||
device = "/";
|
device = "/";
|
||||||
options = ["bind"];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# standard disclaimer don't change this for any reason whatsoever
|
|
||||||
system.stateVersion = "23.11";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
|
{ pkgs, lib, config, osConfig ? {}, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
osConfig ? {},
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = {
|
config = {
|
||||||
nixfiles = {
|
nixfiles = {
|
||||||
profile.base.enable = true;
|
profile.base.enable = true;
|
||||||
|
11
hosts/nixos-wsl/tmpfiles-workaround.nix
Normal file
11
hosts/nixos-wsl/tmpfiles-workaround.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
config.systemd.tmpfiles.packages = let
|
||||||
|
package = pkgs.runCommand "no-systemd-tmpfiles-nocow" {} ''
|
||||||
|
mkdir -p "$out/lib/tmpfiles.d"
|
||||||
|
cd "$out/lib/tmpfiles.d"
|
||||||
|
|
||||||
|
ln -s /dev/null journal-nocow.conf
|
||||||
|
'';
|
||||||
|
in lib.mkAfter [ package ];
|
||||||
|
}
|
@ -1,22 +1,20 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) escapeShellArg;
|
inherit (lib) escapeShellArg;
|
||||||
secret = name: config.age.secrets."${name}".path;
|
secret = name: config.age.secrets."${name}".path;
|
||||||
fs = config.fileSystems."/srv/mcserver";
|
fs = config.fileSystems."/srv/mcserver";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
age.secrets.restic-rclone.file = ../../secrets/restic-rclone.age;
|
age.secrets.restic-rclone.file = ../../secrets/restic-rclone.age;
|
||||||
age.secrets.restic-password.file = ../../secrets/restic-password.age;
|
age.secrets.restic-password.file = ../../secrets/restic-password.age;
|
||||||
|
|
||||||
systemd.services.restic-backups-system = {
|
systemd.services.restic-backups-system = {
|
||||||
path = with pkgs; [btrfs-progs];
|
path = with pkgs; [ btrfs-progs ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.restic.backups.system = {
|
services.restic.backups.system = {
|
||||||
|
|
||||||
# create an atomic backup
|
# create an atomic backup
|
||||||
backupPrepareCommand = ''
|
backupPrepareCommand = ''
|
||||||
set -Eeuxo pipefail
|
set -Eeuxo pipefail
|
||||||
@ -39,7 +37,6 @@ in {
|
|||||||
];
|
];
|
||||||
paths = [
|
paths = [
|
||||||
"/srv/mcserver/@restic"
|
"/srv/mcserver/@restic"
|
||||||
"/persist/backup"
|
|
||||||
];
|
];
|
||||||
dynamicFilesFrom = ''
|
dynamicFilesFrom = ''
|
||||||
echo
|
echo
|
||||||
@ -49,6 +46,7 @@ in {
|
|||||||
"--tag=auto"
|
"--tag=auto"
|
||||||
"--group-by=host,tag"
|
"--group-by=host,tag"
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,15 +2,13 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running `nixos-help`).
|
# and in the NixOS manual (accessible by running `nixos-help`).
|
||||||
|
|
||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
imports =
|
||||||
pkgs,
|
[ # Include the results of the hardware scan.
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
# Encryption
|
# Encryption
|
||||||
./luks.nix
|
./luks.nix
|
||||||
@ -22,30 +20,35 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
fileSystems = lib.mkMerge [
|
fileSystems = lib.mkMerge [
|
||||||
{
|
{
|
||||||
"/ntfs" = {
|
"/ntfs" = {
|
||||||
fsType = "ntfs-3g";
|
fsType = "ntfs-3g";
|
||||||
device = "/dev/disk/by-uuid/6AC23F0FC23EDF4F";
|
device = "/dev/disk/by-uuid/6AC23F0FC23EDF4F";
|
||||||
options = ["auto_cache" "nofail"];
|
options = [ "auto_cache" "nofail" ];
|
||||||
};
|
};
|
||||||
"/.btrfsroot" = {
|
"/.btrfsroot" = {
|
||||||
options = ["subvol=/"];
|
options = [ "subvol=/" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.genAttrs ["/.btrfsroot" "/" "/home" "/nix"] (fs: {
|
(lib.genAttrs [ "/.btrfsroot" "/" "/home" "/nix" ] ( fs: {
|
||||||
options = ["compress=zstd"];
|
options = [ "compress=zstd" ];
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# hardware.nvidia.package = lib.mkForce config.boot.kernelPackages.nvidiaPackages.production;
|
||||||
|
hardware.nvidia.open = lib.mkForce false;
|
||||||
|
|
||||||
specialisation.hyprland.configuration = {
|
specialisation.hyprland.configuration = {
|
||||||
system.nixos.tags = ["Hyprland"];
|
system.nixos.tags = [ "Hyprland" ];
|
||||||
nixfiles = {
|
nixfiles = {
|
||||||
session = "hyprland";
|
session = "hyprland";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
@ -62,7 +65,7 @@
|
|||||||
workarounds.nvidiaPrimary = true;
|
workarounds.nvidiaPrimary = true;
|
||||||
programs.greetd = {
|
programs.greetd = {
|
||||||
settings = {
|
settings = {
|
||||||
randr = ["--output" "HDMI-A-3" "--off"];
|
randr = [ "--output" "HDMI-A-3" "--off" ];
|
||||||
autologin = false;
|
autologin = false;
|
||||||
autologinUser = "nullbite";
|
autologinUser = "nullbite";
|
||||||
autolock = false;
|
autolock = false;
|
||||||
@ -106,7 +109,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_6_12;
|
# temporary while i am away from server
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_6_6;
|
||||||
|
|
||||||
networking.wg-quick.interfaces.wg0 = {
|
networking.wg-quick.interfaces.wg0 = {
|
||||||
configFile = "/etc/wireguard/wg0.conf";
|
configFile = "/etc/wireguard/wg0.conf";
|
||||||
@ -118,6 +122,7 @@
|
|||||||
# boot.loader.efi.canTouchEfiVariables = true;
|
# boot.loader.efi.canTouchEfiVariables = true;
|
||||||
# see custom-hardware-configuration.nix
|
# see custom-hardware-configuration.nix
|
||||||
|
|
||||||
|
|
||||||
# networking.hostName = "nixos"; # Define your hostname.
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
networking.hostName = "nullbox";
|
networking.hostName = "nullbox";
|
||||||
# Pick only one of the below networking options.
|
# Pick only one of the below networking options.
|
||||||
@ -127,6 +132,7 @@
|
|||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/New_York";
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
# (/run/current-system/configuration.nix). This is useful in case you
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
# accidentally delete configuration.nix.
|
# accidentally delete configuration.nix.
|
||||||
@ -140,4 +146,6 @@
|
|||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,76 +1,72 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
imports =
|
||||||
lib,
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod"];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||||
boot.initrd.kernelModules = ["dm-snapshot"];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.kernelModules = ["kvm-intel"];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@root"];
|
options = [ "subvol=nixos/@root" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
fileSystems."/nix" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@nix"];
|
options = [ "subvol=nixos/@nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/.btrfsroot" = {
|
fileSystems."/.btrfsroot" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@home"];
|
options = [ "subvol=@home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" =
|
||||||
device = "/dev/disk/by-uuid/F4D6-20B6";
|
{ device = "/dev/disk/by-uuid/F4D6-20B6";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/mcserver-old" = {
|
fileSystems."/srv/mcserver-old" =
|
||||||
device = "/dev/disk/by-uuid/7204ff85-6404-4bd7-ba0d-3fb23a5cf52c";
|
{ device = "/dev/disk/by-uuid/7204ff85-6404-4bd7-ba0d-3fb23a5cf52c";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@mcserver"];
|
options = [ "subvol=@mcserver" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/mcserver-old/.snapshots" = {
|
fileSystems."/srv/mcserver-old/.snapshots" =
|
||||||
device = "/dev/disk/by-uuid/7204ff85-6404-4bd7-ba0d-3fb23a5cf52c";
|
{ device = "/dev/disk/by-uuid/7204ff85-6404-4bd7-ba0d-3fb23a5cf52c";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=snapshots/@mcserver"];
|
options = [ "subvol=snapshots/@mcserver" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/mcserver" = {
|
fileSystems."/srv/mcserver" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@mcserver"];
|
options = [ "subvol=@mcserver" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/mcserver/.snapshots" = {
|
fileSystems."/srv/mcserver/.snapshots" =
|
||||||
device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
{ device = "/dev/disk/by-uuid/e36d1ab4-d18b-434e-80b5-0efca0652eb5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=snapshots/@mcserver"];
|
options = [ "subvol=snapshots/@mcserver" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices =
|
||||||
{device = "/dev/disk/by-uuid/4b86cbd6-6fc5-47d4-9d44-35eec59cb785";}
|
[ { device = "/dev/disk/by-uuid/4b86cbd6-6fc5-47d4-9d44-35eec59cb785"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
|
{ lib, pkgs, osConfig, ... }:
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
osConfig,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,16 +1,11 @@
|
|||||||
{
|
{ pkgs, config, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) escapeShellArg;
|
inherit (lib) escapeShellArg;
|
||||||
# (wip) more configurable than old one, will be used by volatile btrfs module
|
# (wip) more configurable than old one, will be used by volatile btrfs module
|
||||||
mkBtrfsInit = {
|
mkBtrfsInit = { volatileRoot ? "/volatile",
|
||||||
volatileRoot ? "/volatile",
|
|
||||||
oldRoots ? "/old_roots",
|
oldRoots ? "/old_roots",
|
||||||
volume,
|
volume }:
|
||||||
}: ''
|
''
|
||||||
mkdir -p /btrfs_tmp
|
mkdir -p /btrfs_tmp
|
||||||
mount ${escapeShellArg volume} /btrfs_tmp -o subvol=/
|
mount ${escapeShellArg volume} /btrfs_tmp -o subvol=/
|
||||||
|
|
||||||
@ -39,7 +34,7 @@ in {
|
|||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
device = root_vol;
|
device = root_vol;
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/nixos/@persist"];
|
options = [ "subvol=/nixos/@persist" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO volatile btrfs module
|
# TODO volatile btrfs module
|
||||||
@ -52,12 +47,8 @@ in {
|
|||||||
fileSystems."/" = lib.mkForce {
|
fileSystems."/" = lib.mkForce {
|
||||||
device = root_vol;
|
device = root_vol;
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/nixos/volatile"];
|
options = [ "subvol=/nixos/volatile" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# agenix fix
|
|
||||||
fileSystems."/etc/ssh".neededForBoot = true;
|
|
||||||
|
|
||||||
environment.persistence = {
|
environment.persistence = {
|
||||||
"/persist/nobackup" = {
|
"/persist/nobackup" = {
|
||||||
hideMounts = true;
|
hideMounts = true;
|
||||||
@ -79,24 +70,15 @@ in {
|
|||||||
# probably NEVER be excluded removed.
|
# probably NEVER be excluded removed.
|
||||||
"/var/lib/nixos/"
|
"/var/lib/nixos/"
|
||||||
# password files for user.user.<name>.hashedPasswordFile
|
# password files for user.user.<name>.hashedPasswordFile
|
||||||
{
|
{ directory = "/etc/passfile"; mode = "0700"; }
|
||||||
directory = "/etc/passfile";
|
|
||||||
mode = "0700";
|
|
||||||
}
|
|
||||||
|
|
||||||
# persistent non-declarative config
|
# persistent non-declarative config
|
||||||
"/etc/nixos"
|
"/etc/nixos"
|
||||||
"/etc/ssh"
|
"/etc/ssh"
|
||||||
{
|
{ directory = "/etc/wireguard"; mode = "0700"; }
|
||||||
directory = "/etc/wireguard";
|
|
||||||
mode = "0700";
|
|
||||||
}
|
|
||||||
|
|
||||||
# let's keep the root home dir as well
|
# let's keep the root home dir as well
|
||||||
{
|
{ directory = "/root"; mode = "0700"; }
|
||||||
directory = "/root";
|
|
||||||
mode = "0700";
|
|
||||||
}
|
|
||||||
|
|
||||||
# system state
|
# system state
|
||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
@ -107,29 +89,13 @@ in {
|
|||||||
"/var/lib/power-profiles-daemon"
|
"/var/lib/power-profiles-daemon"
|
||||||
"/var/lib/systemd/rfkill"
|
"/var/lib/systemd/rfkill"
|
||||||
"/var/lib/systemd/timesync"
|
"/var/lib/systemd/timesync"
|
||||||
{
|
{ directory = "/var/lib/tailscale"; mode = "0700"; }
|
||||||
directory = "/var/lib/tailscale";
|
|
||||||
mode = "0700";
|
|
||||||
}
|
|
||||||
"/var/lib/unbound"
|
"/var/lib/unbound"
|
||||||
"/var/db/sudo/lectured"
|
"/var/db/sudo/lectured"
|
||||||
|
|
||||||
# remember login stuff
|
# remember login stuff
|
||||||
{
|
{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; }
|
||||||
directory = "/var/cache/tuigreet";
|
{ directory = "/var/cache/regreet"; user = "greeter"; group = "greeter"; }
|
||||||
user = "greeter";
|
|
||||||
group = "greeter";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = "/var/cache/regreet";
|
|
||||||
user = "greeter";
|
|
||||||
group = "greeter";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = "/var/lib/regreet";
|
|
||||||
user = "greeter";
|
|
||||||
group = "greeter";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
{
|
{ pkgs, config, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
usb = "903D-DF5B";
|
usb = "903D-DF5B";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
# cryptsetup
|
# cryptsetup
|
||||||
boot.initrd.kernelModules = ["uas" "usbcore" "usb_storage"];
|
boot.initrd.kernelModules = ["uas" "usbcore" "usb_storage"];
|
||||||
@ -19,7 +16,7 @@ in {
|
|||||||
mount -n -t vfat -o ro `findfs UUID=${usb}` /key
|
mount -n -t vfat -o ro `findfs UUID=${usb}` /key
|
||||||
'';
|
'';
|
||||||
|
|
||||||
device = "/dev/disk/by-uuid/85b5f22e-0fa5-4f0d-8fba-f800a0b41671";
|
device="/dev/disk/by-uuid/85b5f22e-0fa5-4f0d-8fba-f800a0b41671";
|
||||||
keyFile = "/key/image.png"; # yes it's literally an image file. bite me
|
keyFile = "/key/image.png"; # yes it's literally an image file. bite me
|
||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
fallbackToPassword = true;
|
fallbackToPassword = true;
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.services.minecraft-servers;
|
cfg = config.services.minecraft-servers;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/srv/mcserver".options = ["compress=zstd" "nofail"];
|
"/srv/mcserver".options = [ "compress=zstd" "nofail" ];
|
||||||
"/srv/mcserver/.snapshots".options = ["compress=zstd" "nofail"];
|
"/srv/mcserver/.snapshots".options = [ "compress=zstd" "nofail" ];
|
||||||
};
|
};
|
||||||
networking.firewall.trustedInterfaces = ["wg0"];
|
networking.firewall.trustedInterfaces = [ "wg0" ];
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
users = {
|
users = {
|
||||||
nullbite.extraGroups = ["minecraft"];
|
nullbite.extraGroups = [ "minecraft" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,8 +45,7 @@ in {
|
|||||||
nulllite-staging = let
|
nulllite-staging = let
|
||||||
commit = "b8c639a";
|
commit = "b8c639a";
|
||||||
packHash = "sha256-HTDVIkcBf0DyLbSCuU08/HnEQuesi3cmXXhB4y4lyko=";
|
packHash = "sha256-HTDVIkcBf0DyLbSCuU08/HnEQuesi3cmXXhB4y4lyko=";
|
||||||
in
|
in pkgs.fetchPackwizModpack {
|
||||||
pkgs.fetchPackwizModpack {
|
|
||||||
url = "https://gitea.protogen.io/nullbite/nulllite/raw/commit/${commit}/pack.toml";
|
url = "https://gitea.protogen.io/nullbite/nulllite/raw/commit/${commit}/pack.toml";
|
||||||
inherit packHash;
|
inherit packHash;
|
||||||
};
|
};
|
||||||
@ -59,8 +55,8 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
autoStart = false;
|
autoStart = false;
|
||||||
modpack = nulllite-staging;
|
modpack = nulllite-staging;
|
||||||
modpackSymlinks = ["mods"];
|
modpackSymlinks = [ "mods" ];
|
||||||
modpackFiles = ["config/"];
|
modpackFiles = [ "config/" ];
|
||||||
serverProperties.server-port = 25574;
|
serverProperties.server-port = 25574;
|
||||||
serverProperties.motd = "staging server";
|
serverProperties.motd = "staging server";
|
||||||
};
|
};
|
||||||
@ -69,8 +65,8 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
modpack = pkgs.modpacks.notlite;
|
modpack = pkgs.modpacks.notlite;
|
||||||
modpackSymlinks = ["config/yosbr" "config/quilt-loader-overrides.json" "mods"];
|
modpackSymlinks = [ "config/yosbr" "config/quilt-loader-overrides.json" "mods" ];
|
||||||
modpackFiles = ["kubejs/"];
|
modpackFiles = [ "kubejs/" ];
|
||||||
serverProperties = {
|
serverProperties = {
|
||||||
motd = "owo what's this (nix notlite edition)";
|
motd = "owo what's this (nix notlite edition)";
|
||||||
server-port = 25567;
|
server-port = 25567;
|
||||||
@ -80,10 +76,11 @@ in {
|
|||||||
level-seed = "8555431723250870652";
|
level-seed = "8555431723250870652";
|
||||||
level-type = "bclib:normal";
|
level-type = "bclib:normal";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
minecraft-nixtest = let
|
minecraft-nixtest = let
|
||||||
self = cfg.servers.minecraft-nixtest;
|
self = cfg.servers.minecraft-nixtest;
|
||||||
package = pkgs.quiltServers.quilt-1_20_1.override {loaderVersion = "0.21.0";};
|
package = pkgs.quiltServers.quilt-1_20_1.override { loaderVersion = "0.21.0"; };
|
||||||
in {
|
in {
|
||||||
useRecommendedDefaults = true;
|
useRecommendedDefaults = true;
|
||||||
enable = false;
|
enable = false;
|
||||||
@ -95,8 +92,8 @@ in {
|
|||||||
NullBite = "e24e8e0e-7540-4126-b737-90043155bcd4";
|
NullBite = "e24e8e0e-7540-4126-b737-90043155bcd4";
|
||||||
Silveere = "468554f1-27cd-4ea1-9308-3dd14a9b1a12";
|
Silveere = "468554f1-27cd-4ea1-9308-3dd14a9b1a12";
|
||||||
};
|
};
|
||||||
modpackSymlinks = ["mods"];
|
modpackSymlinks = [ "mods" ];
|
||||||
modpackFiles = ["config/" "kubejs/"];
|
modpackFiles = [ "config/" "kubejs/" ];
|
||||||
serverProperties = rec {
|
serverProperties = rec {
|
||||||
motd = "owo what's this (nix edition)";
|
motd = "owo what's this (nix edition)";
|
||||||
server-port = 25568;
|
server-port = 25568;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = {
|
config = {
|
||||||
networking.networkmanager.dns = "none";
|
networking.networkmanager.dns = "none";
|
||||||
services.unbound.enable = true;
|
services.unbound.enable = true;
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
inherit (lib) types mkIf optionalString;
|
inherit (lib) types mkIf optionalString;
|
||||||
inherit
|
inherit (builtins)
|
||||||
(builtins)
|
|
||||||
isNull
|
isNull
|
||||||
any
|
any
|
||||||
all
|
all
|
||||||
@ -20,18 +20,22 @@
|
|||||||
"regular"
|
"regular"
|
||||||
"basic"
|
"basic"
|
||||||
];
|
];
|
||||||
getUpstreamFromInstance = instance: let
|
getUpstreamFromInstance =
|
||||||
|
instance:
|
||||||
|
let
|
||||||
inherit (config.services.authelia.instances.${instance}.settings) server;
|
inherit (config.services.authelia.instances.${instance}.settings) server;
|
||||||
port = server.port or 9091;
|
port = server.port or 9091;
|
||||||
host = server.host or "127.0.0.1";
|
host = server.host or "127.0.0.1";
|
||||||
|
|
||||||
targetHost =
|
targetHost =
|
||||||
if host == "0.0.0.0"
|
if host == "0.0.0.0" then
|
||||||
then "127.0.0.1"
|
"127.0.0.1"
|
||||||
else if lib.hasInfix ":" host
|
else if lib.hasInfix ":" host then
|
||||||
then throw "TODO IPv6 not supported in Authelia server address (hard to parse, can't tell if it is [::])."
|
throw "TODO IPv6 not supported in Authelia server address (hard to parse, can't tell if it is [::])."
|
||||||
else host;
|
else
|
||||||
in "http://${targetHost}:${toString port}";
|
host;
|
||||||
|
in
|
||||||
|
"http://${targetHost}:${toString port}";
|
||||||
|
|
||||||
# use this when reverse proxying to authelia (and only authelia because i
|
# use this when reverse proxying to authelia (and only authelia because i
|
||||||
# like the nixos recommended proxy settings better)
|
# like the nixos recommended proxy settings better)
|
||||||
@ -112,7 +116,9 @@
|
|||||||
proxy_set_header X-Forwarded-URI $request_uri;
|
proxy_set_header X-Forwarded-URI $request_uri;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
genAuthConfig = method: let
|
genAuthConfig =
|
||||||
|
method:
|
||||||
|
let
|
||||||
snippet_regular = ''
|
snippet_regular = ''
|
||||||
## Configure the redirection when the authz failure occurs. Lines starting
|
## Configure the redirection when the authz failure occurs. Lines starting
|
||||||
## with 'Modern Method' and 'Legacy Method' should be commented /
|
## with 'Modern Method' and 'Legacy Method' should be commented /
|
||||||
@ -128,7 +134,8 @@
|
|||||||
## redirect to the $redirection_url.
|
## redirect to the $redirection_url.
|
||||||
error_page 401 =302 $redirection_url;
|
error_page 401 =302 $redirection_url;
|
||||||
'';
|
'';
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
## Send a subrequest to Authelia to verify if the user is authenticated and
|
## Send a subrequest to Authelia to verify if the user is authenticated and
|
||||||
# has permission to access the resource.
|
# has permission to access the resource.
|
||||||
|
|
||||||
@ -149,21 +156,22 @@
|
|||||||
|
|
||||||
${optionalString (method == "regular") snippet_regular}
|
${optionalString (method == "regular") snippet_regular}
|
||||||
'';
|
'';
|
||||||
genAuthConfigPkg = method: pkgs.writeText "authelia-authrequest-${method}.conf" (genAuthConfig method);
|
genAuthConfigPkg =
|
||||||
in {
|
method: pkgs.writeText "authelia-authrequest-${method}.conf" (genAuthConfig method);
|
||||||
|
in
|
||||||
|
{
|
||||||
# authelia
|
# authelia
|
||||||
options.services.nginx = let
|
options.services.nginx =
|
||||||
mkAttrsOfSubmoduleOpt = module: lib.mkOption {type = with types; attrsOf (submodule module);};
|
let
|
||||||
|
mkAttrsOfSubmoduleOpt = module: lib.mkOption { type = with types; attrsOf (submodule module); };
|
||||||
|
|
||||||
# make system config accessible from submodules
|
# make system config accessible from submodules
|
||||||
systemConfig = config;
|
systemConfig = config;
|
||||||
|
|
||||||
# submodule definitions
|
# submodule definitions
|
||||||
vhostModule = {
|
vhostModule =
|
||||||
name,
|
{ name, config, ... }@attrs:
|
||||||
config,
|
{
|
||||||
...
|
|
||||||
} @ attrs: {
|
|
||||||
options = {
|
options = {
|
||||||
locations = mkAttrsOfSubmoduleOpt (genLocationModule attrs);
|
locations = mkAttrsOfSubmoduleOpt (genLocationModule attrs);
|
||||||
authelia = {
|
authelia = {
|
||||||
@ -227,7 +235,8 @@ in {
|
|||||||
forceSSL = lib.mkIf (!(isNull config.authelia.endpoint.upstream)) true;
|
forceSSL = lib.mkIf (!(isNull config.authelia.endpoint.upstream)) true;
|
||||||
|
|
||||||
# authelia nginx internal endpoints
|
# authelia nginx internal endpoints
|
||||||
locations = let
|
locations =
|
||||||
|
let
|
||||||
api = "${config.authelia.upstream}/api/authz/auth-request";
|
api = "${config.authelia.upstream}/api/authz/auth-request";
|
||||||
in
|
in
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
@ -269,13 +278,13 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
genLocationModule = vhostAttrs: {
|
genLocationModule =
|
||||||
name,
|
vhostAttrs:
|
||||||
config,
|
{ name, config, ... }:
|
||||||
...
|
let
|
||||||
}: let
|
|
||||||
vhostConfig = vhostAttrs.config;
|
vhostConfig = vhostAttrs.config;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.authelia.method = lib.mkOption {
|
options.authelia.method = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
Authelia authentication method to use for this location.
|
Authelia authentication method to use for this location.
|
||||||
@ -299,12 +308,15 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
|
||||||
|
in
|
||||||
|
{
|
||||||
virtualHosts = mkAttrsOfSubmoduleOpt vhostModule;
|
virtualHosts = mkAttrsOfSubmoduleOpt vhostModule;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO check if any vhosts have authelia configured
|
# TODO check if any vhosts have authelia configured
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
# TODO later, there are only assertions here
|
# TODO later, there are only assertions here
|
||||||
configured = any (
|
configured = any (
|
||||||
vhost: (!(isNull vhost.authelia.upstream)) || (!(isNull vhost.authelia.endpoint.upstream))
|
vhost: (!(isNull vhost.authelia.upstream)) || (!(isNull vhost.authelia.endpoint.upstream))
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
secret = name: config.age.secrets."${name}".path;
|
secret = name: config.age.secrets."${name}".path;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
age.secrets.restic-rclone.file = ../../secrets/restic-rclone.age;
|
age.secrets.restic-rclone.file = ../../secrets/restic-rclone.age;
|
||||||
age.secrets.restic-password.file = ../../secrets/restic-password.age;
|
age.secrets.restic-password.file = ../../secrets/restic-password.age;
|
||||||
@ -17,7 +14,6 @@ in {
|
|||||||
".snapshots"
|
".snapshots"
|
||||||
"gdlmirror"
|
"gdlmirror"
|
||||||
"gitea-dump-*"
|
"gitea-dump-*"
|
||||||
"/var/lib/thelounge/storage"
|
|
||||||
];
|
];
|
||||||
paths = [
|
paths = [
|
||||||
"/srv"
|
"/srv"
|
||||||
@ -28,8 +24,6 @@ in {
|
|||||||
"/var/lib/gitea"
|
"/var/lib/gitea"
|
||||||
"/var/lib/tailscale"
|
"/var/lib/tailscale"
|
||||||
"/var/lib/private/anki-sync-server"
|
"/var/lib/private/anki-sync-server"
|
||||||
"/var/lib/thelounge"
|
|
||||||
"/var/lib/paperless"
|
|
||||||
"/etc"
|
"/etc"
|
||||||
];
|
];
|
||||||
dynamicFilesFrom = ''
|
dynamicFilesFrom = ''
|
||||||
@ -41,6 +35,7 @@ in {
|
|||||||
"--tag=auto"
|
"--tag=auto"
|
||||||
"--group-by=host,tag"
|
"--group-by=host,tag"
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
imports =
|
||||||
lib,
|
[ # Include the results of the hardware scan.
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./services.nix
|
./services.nix
|
||||||
|
|
||||||
./media-sync.nix
|
|
||||||
|
|
||||||
./backup.nix
|
./backup.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -26,9 +22,8 @@
|
|||||||
"/opt/hassio"
|
"/opt/hassio"
|
||||||
"/opt/hassio/.snapshots"
|
"/opt/hassio/.snapshots"
|
||||||
];
|
];
|
||||||
fn = x: {options = ["compress=zstd" "commit=300" "noatime"];};
|
fn = (x: { options = [ "compress=zstd" "commit=300" "noatime" ];});
|
||||||
in
|
in lib.genAttrs mounts fn;
|
||||||
lib.genAttrs mounts fn;
|
|
||||||
|
|
||||||
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
@ -38,7 +33,8 @@
|
|||||||
configurationLimit = 5;
|
configurationLimit = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_6_12;
|
# temporary while i am away from server
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_6_6;
|
||||||
|
|
||||||
nixfiles = {
|
nixfiles = {
|
||||||
profile.server.enable = true;
|
profile.server.enable = true;
|
||||||
@ -67,7 +63,7 @@
|
|||||||
"wg0"
|
"wg0"
|
||||||
"tailscale0"
|
"tailscale0"
|
||||||
];
|
];
|
||||||
networking.firewall.allowedUDPPorts = [51820];
|
networking.firewall.allowedUDPPorts = [ 51820 ];
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -97,6 +93,9 @@
|
|||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
# services.xserver.enable = true;
|
# services.xserver.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
||||||
# services.xserver.xkb.layout = "us";
|
# services.xserver.xkb.layout = "us";
|
||||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
||||||
@ -126,7 +125,7 @@
|
|||||||
# };
|
# };
|
||||||
users.users.nullbite = {
|
users.users.nullbite = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = [ "wheel" ];
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -182,4 +181,6 @@
|
|||||||
#
|
#
|
||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.services.gitea;
|
cfg = config.services.gitea;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -35,37 +32,19 @@ in {
|
|||||||
DEFAULT_THEME = "catppuccin-mocha-pink";
|
DEFAULT_THEME = "catppuccin-mocha-pink";
|
||||||
THEMES = let
|
THEMES = let
|
||||||
ctpAttrs = {
|
ctpAttrs = {
|
||||||
flavor = ["latte" "frappe" "macchiato" "mocha"];
|
flavor = [ "latte" "frappe" "macchiato" "mocha" ];
|
||||||
accent = [
|
accent = [ "rosewater" "flamingo" "pink" "mauve"
|
||||||
"rosewater"
|
"red" "maroon" "peach" "yellow" "green" "teal"
|
||||||
"flamingo"
|
"sky" "sapphire" "blue" ];
|
||||||
"pink"
|
|
||||||
"mauve"
|
|
||||||
"red"
|
|
||||||
"maroon"
|
|
||||||
"peach"
|
|
||||||
"yellow"
|
|
||||||
"green"
|
|
||||||
"teal"
|
|
||||||
"sky"
|
|
||||||
"sapphire"
|
|
||||||
"blue"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
ctpThemes =
|
ctpThemes = lib.mapCartesianProduct
|
||||||
lib.mapCartesianProduct
|
( { flavor, accent }: "catppuccin-${flavor}-${accent}" )
|
||||||
({
|
|
||||||
flavor,
|
|
||||||
accent,
|
|
||||||
}: "catppuccin-${flavor}-${accent}")
|
|
||||||
ctpAttrs;
|
ctpAttrs;
|
||||||
in
|
in lib.concatStringsSep "," ([
|
||||||
lib.concatStringsSep "," ([
|
|
||||||
"gitea"
|
"gitea"
|
||||||
"arc-green"
|
"arc-green"
|
||||||
"auto"
|
"auto"
|
||||||
]
|
] ++ ctpThemes);
|
||||||
++ ctpThemes);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,77 +1,74 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
imports =
|
||||||
lib,
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci"];
|
boot.initrd.availableKernelModules = [ "xhci_pci" ];
|
||||||
boot.initrd.kernelModules = [];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/.btrfsroot" = {
|
fileSystems."/.btrfsroot" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/"];
|
options = [ "subvol=/" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@"];
|
options = [ "subvol=nixos/@" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
fileSystems."/nix" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@nix"];
|
options = [ "subvol=nixos/@nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@home"];
|
options = [ "subvol=@home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" =
|
||||||
device = "/dev/disk/by-uuid/18e0dfd8-78bd-478d-9df8-1c28bc0b55df";
|
{ device = "/dev/disk/by-uuid/18e0dfd8-78bd-478d-9df8-1c28bc0b55df";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/syncthing" = {
|
fileSystems."/srv/syncthing" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/@syncthing"];
|
options = [ "subvol=/@syncthing" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/srv/media" = {
|
fileSystems."/srv/media" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/@media"];
|
options = [ "subvol=/@media" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/opt/hassio" = {
|
fileSystems."/opt/hassio" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/@hassio"];
|
options = [ "subvol=/@hassio" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/opt/hassio/.snapshots" = {
|
fileSystems."/opt/hassio/.snapshots" =
|
||||||
device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
{ device = "/dev/disk/by-uuid/112535b6-4318-4d26-812b-7baf0d65dae5";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=/snapshots/@hassio"];
|
options = [ "subvol=/snapshots/@hassio" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{device = "/dev/disk/by-uuid/b8e046b3-28a2-47c5-b305-24be5be42eff";}
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/b8e046b3-28a2-47c5-b305-24be5be42eff"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
@ -84,3 +81,4 @@
|
|||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
nixfiles.profile.base.enable = true;
|
nixfiles.profile.base.enable = true;
|
||||||
programs.keychain.enable = false;
|
programs.keychain.enable = false;
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
in {
|
|
||||||
config = {
|
|
||||||
nixfiles.programs.syncthing.enable = true;
|
|
||||||
|
|
||||||
systemd.timers.gallery-dl = {
|
|
||||||
wantedBy = ["timers.target"];
|
|
||||||
timerConfig = {
|
|
||||||
OnBootSec = "5m";
|
|
||||||
OnUnitActiveSec = "13";
|
|
||||||
RandomizedDelaySec = "4m";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.gallery-dl = {
|
|
||||||
path = with pkgs; [bash coreutils findutils gallery-dl];
|
|
||||||
serviceConfig = {
|
|
||||||
# none of your fucking business
|
|
||||||
# TODO move this into an agenix secret probably
|
|
||||||
ExecStart = "/srv/gallery-dl.sh";
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "nullbite";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.timers.gallery-dl-dedup = {
|
|
||||||
wantedBy = ["timers.target"];
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "03:00";
|
|
||||||
RandomizedDelaySec = "3h";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.gallery-dl-dedup = {
|
|
||||||
path = with pkgs; [bash coreutils rmlint];
|
|
||||||
serviceConfig = {
|
|
||||||
# likewise
|
|
||||||
ExecStart = "/srv/gallery-dl-dedup.sh";
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "nullbite";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -4,6 +4,7 @@ AreTheStraightsOK
|
|||||||
autism
|
autism
|
||||||
beatsaber
|
beatsaber
|
||||||
Bitwarden
|
Bitwarden
|
||||||
|
boykisser
|
||||||
btd6
|
btd6
|
||||||
ConservativeRap
|
ConservativeRap
|
||||||
crackheadcraigslist
|
crackheadcraigslist
|
||||||
@ -19,22 +20,17 @@ femboymemes
|
|||||||
feminineboys
|
feminineboys
|
||||||
flatpak
|
flatpak
|
||||||
geometrydash
|
geometrydash
|
||||||
gocommitdie
|
|
||||||
homeassistant
|
homeassistant
|
||||||
ihaveihaveihavereddit
|
ihaveihaveihavereddit
|
||||||
LinkedInLunatics
|
LinkedInLunatics
|
||||||
linux
|
linux
|
||||||
linux_gaming
|
linux_gaming
|
||||||
losercity
|
losercity
|
||||||
MINDWAVEgame
|
|
||||||
NixOS
|
NixOS
|
||||||
NonBinaryTalk
|
NonBinaryTalk
|
||||||
okbuddyhetero
|
okbuddyhetero
|
||||||
peepeeshart
|
peepeeshart
|
||||||
pressureroblox
|
|
||||||
prismlauncher
|
prismlauncher
|
||||||
programmingcirclejerk
|
|
||||||
regretevator
|
|
||||||
rust
|
rust
|
||||||
rustjerk
|
rustjerk
|
||||||
selfhosted
|
selfhosted
|
||||||
@ -42,9 +38,9 @@ Shark_Park
|
|||||||
steam
|
steam
|
||||||
SteamDeck
|
SteamDeck
|
||||||
talesfromtechsupport
|
talesfromtechsupport
|
||||||
|
techsupport
|
||||||
termux
|
termux
|
||||||
theamazingdigitalciru
|
theamazingdigitalciru
|
||||||
Ultrakill
|
Ultrakill
|
||||||
unicodecirclejerk
|
|
||||||
VaushV
|
VaushV
|
||||||
whenthe
|
whenthe
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (config.age) secrets;
|
|
||||||
inherit (builtins) toString;
|
|
||||||
in {
|
|
||||||
imports = [
|
imports = [
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
./authelia.nix
|
./authelia.nix
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
age.secrets.cloudflaredns = {
|
age.secrets.cloudflaredns = {
|
||||||
file = ../../secrets/cloudflare-dns.age;
|
file = ../../secrets/cloudflare-dns.age;
|
||||||
group = "secrets";
|
group = "secrets";
|
||||||
@ -56,16 +50,8 @@ in {
|
|||||||
file = ../../secrets/anki-user.age;
|
file = ../../secrets/anki-user.age;
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets.homepage = {
|
|
||||||
file = ../../secrets/homepage.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets.paperless-admin = {
|
|
||||||
file = ../../secrets/paperless-admin.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.secrets = {};
|
users.groups.secrets = {};
|
||||||
users.users.acme.extraGroups = ["secrets"];
|
users.users.acme.extraGroups = [ "secrets" ];
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
@ -99,18 +85,16 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.nginx.extraGroups = ["acme"];
|
users.users.nginx.extraGroups = [ "acme" ];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
80
|
80 443
|
||||||
443
|
|
||||||
# this is needed for node to work for some reason
|
# this is needed for node to work for some reason
|
||||||
8123
|
8123
|
||||||
];
|
];
|
||||||
|
|
||||||
users.groups.authelia-shared = {};
|
users.groups.authelia-shared = { };
|
||||||
services.authelia.instances =
|
services.authelia.instances = lib.mapAttrs (inst: opts: {
|
||||||
lib.mapAttrs (inst: opts: {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
group = "authelia-shared";
|
group = "authelia-shared";
|
||||||
secrets = {
|
secrets = {
|
||||||
@ -161,7 +145,7 @@ in {
|
|||||||
|
|
||||||
users.users."${config.services.authelia.instances.main.user}".extraGroups = let
|
users.users."${config.services.authelia.instances.main.user}".extraGroups = let
|
||||||
name = config.services.redis.servers.authelia.user;
|
name = config.services.redis.servers.authelia.user;
|
||||||
in [name];
|
in [ name ];
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -175,13 +159,7 @@ in {
|
|||||||
|
|
||||||
virtualHosts = let
|
virtualHosts = let
|
||||||
useACMEHost = "protogen.io";
|
useACMEHost = "protogen.io";
|
||||||
mkProxy = args @ {
|
mkProxy = args@{ upstream ? "http://127.0.0.1:${builtins.toString args.port}", auth ? false, authelia ? false, extraConfig ? {}, ... }:
|
||||||
upstream ? "http://127.0.0.1:${builtins.toString args.port}",
|
|
||||||
auth ? false,
|
|
||||||
authelia ? false,
|
|
||||||
extraConfig ? {},
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
inherit useACMEHost;
|
inherit useACMEHost;
|
||||||
@ -209,24 +187,14 @@ in {
|
|||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
|
|
||||||
mkAuthProxy = port:
|
mkAuthProxy = port: mkProxy { inherit port; authelia = true; };
|
||||||
mkProxy {
|
|
||||||
inherit port;
|
|
||||||
authelia = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkReverseProxy = port: mkProxy {inherit port;};
|
mkReverseProxy = port: mkProxy { inherit port; };
|
||||||
in
|
in (lib.mapAttrs (domain: instance: { forceSSL = true; inherit useACMEHost; authelia.endpoint = { inherit instance; };}) {
|
||||||
(lib.mapAttrs (domain: instance: {
|
|
||||||
forceSSL = true;
|
|
||||||
inherit useACMEHost;
|
|
||||||
authelia.endpoint = {inherit instance;};
|
|
||||||
}) {
|
|
||||||
"auth.protogen.io" = "main";
|
"auth.protogen.io" = "main";
|
||||||
"auth.nbt.sh" = "main";
|
"auth.nbt.sh" = "main";
|
||||||
"auth.proot.link" = "main";
|
"auth.proot.link" = "main";
|
||||||
})
|
}) // {
|
||||||
// {
|
|
||||||
"changedetection.protogen.io" = mkReverseProxy 5000;
|
"changedetection.protogen.io" = mkReverseProxy 5000;
|
||||||
|
|
||||||
# firefly
|
# firefly
|
||||||
@ -254,14 +222,9 @@ in {
|
|||||||
"redlib.protogen.io" = mkAuthProxy 8087;
|
"redlib.protogen.io" = mkAuthProxy 8087;
|
||||||
"rss.protogen.io" = mkReverseProxy 8082;
|
"rss.protogen.io" = mkReverseProxy 8082;
|
||||||
"blahaj.protogen.io" = mkReverseProxy 8086;
|
"blahaj.protogen.io" = mkReverseProxy 8086;
|
||||||
"paper.protogen.io" = mkReverseProxy config.services.paperless.port;
|
|
||||||
|
|
||||||
# octoprint (proxy_addr is 10.10.1.8)
|
# octoprint (proxy_addr is 10.10.1.8)
|
||||||
"print.protogen.io" = lib.mkMerge [
|
"print.protogen.io" = lib.mkMerge [ (mkProxy { authelia = true; upstream = "http://10.10.1.8:80"; })
|
||||||
(mkProxy {
|
|
||||||
authelia = true;
|
|
||||||
upstream = "http://10.10.1.8:80";
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
locations."/webcam" = {
|
locations."/webcam" = {
|
||||||
proxyPass = "http://10.10.1.8:80$request_uri";
|
proxyPass = "http://10.10.1.8:80$request_uri";
|
||||||
@ -269,19 +232,14 @@ in {
|
|||||||
basicAuthFile = config.age.secrets.htpasswd-cam.path;
|
basicAuthFile = config.age.secrets.htpasswd-cam.path;
|
||||||
authelia.method = null;
|
authelia.method = null;
|
||||||
};
|
};
|
||||||
}
|
}];
|
||||||
];
|
|
||||||
|
|
||||||
# searx auth 8088 (none for /favicon.ico, /autocompleter, /opensearch.xml)
|
# searx auth 8088 (none for /favicon.ico, /autocompleter, /opensearch.xml)
|
||||||
"search.protogen.io".locations."/".return = "302 https://searx.protogen.io$request_uri";
|
"search.protogen.io".locations."/".return = "302 https://searx.protogen.io$request_uri";
|
||||||
"searx.protogen.io" = let
|
"searx.protogen.io" = let
|
||||||
port = 8088;
|
port = 8088;
|
||||||
in
|
in mkProxy { authelia = true; inherit port; extraConfig = {
|
||||||
mkProxy {
|
locations = lib.genAttrs [ "/favicon.ico" "/autocompleter" "/opensearch.xml" ] (attr: {
|
||||||
authelia = true;
|
|
||||||
inherit port;
|
|
||||||
extraConfig = {
|
|
||||||
locations = lib.genAttrs ["/favicon.ico" "/autocompleter" "/opensearch.xml"] (attr: {
|
|
||||||
proxyPass = "http://localhost:${builtins.toString port}";
|
proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
authelia.method = null;
|
authelia.method = null;
|
||||||
@ -289,19 +247,11 @@ in {
|
|||||||
auth_basic off;
|
auth_basic off;
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
};
|
};};
|
||||||
};
|
|
||||||
|
|
||||||
# URL shortener
|
# URL shortener
|
||||||
"nbt.sh" = mkProxy {
|
"nbt.sh" = mkProxy { port = 8090; extraConfig.serverAliases = [ "proot.link" ]; };
|
||||||
port = 8090;
|
"admin.nbt.sh" = mkProxy { authelia = true; port = 8091; extraConfig.serverAliases = [ "admin.proot.link" ]; };
|
||||||
extraConfig.serverAliases = ["proot.link"];
|
|
||||||
};
|
|
||||||
"admin.nbt.sh" = mkProxy {
|
|
||||||
authelia = true;
|
|
||||||
port = 8091;
|
|
||||||
extraConfig.serverAliases = ["admin.proot.link"];
|
|
||||||
};
|
|
||||||
|
|
||||||
# uptime
|
# uptime
|
||||||
"uptime.protogen.io" = mkReverseProxy 3001;
|
"uptime.protogen.io" = mkReverseProxy 3001;
|
||||||
@ -309,11 +259,6 @@ in {
|
|||||||
|
|
||||||
"anki.protogen.io" = mkReverseProxy config.services.anki-sync-server.port;
|
"anki.protogen.io" = mkReverseProxy config.services.anki-sync-server.port;
|
||||||
|
|
||||||
# homepage
|
|
||||||
"home.protogen.io" = mkAuthProxy 8089;
|
|
||||||
|
|
||||||
"lounge.protogen.io" = mkAuthProxy 9000;
|
|
||||||
|
|
||||||
"trackmap.protogen.io" = let
|
"trackmap.protogen.io" = let
|
||||||
root = pkgs.modpacks.notlite-ctm-static;
|
root = pkgs.modpacks.notlite-ctm-static;
|
||||||
in {
|
in {
|
||||||
@ -339,7 +284,7 @@ in {
|
|||||||
|
|
||||||
# main site
|
# main site
|
||||||
"protogen.io" = {
|
"protogen.io" = {
|
||||||
serverAliases = ["x.protogen.io"];
|
serverAliases = [ "x.protogen.io" ];
|
||||||
useACMEHost = "protogen.io";
|
useACMEHost = "protogen.io";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
@ -357,7 +302,7 @@ in {
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
return = "302 https://protogen.io$request_uri";
|
return = "302 https://protogen.io$request_uri";
|
||||||
};
|
};
|
||||||
serverAliases = ["www.nullbite.com" "nullbite.dev" "www.nullbite.dev" "www.protogen.io" "nullbite.xyz" "www.nullbite.xyz"];
|
serverAliases = [ "www.nullbite.com" "nullbite.dev" "www.nullbite.dev" "www.protogen.io" "nullbite.xyz" "www.nullbite.xyz" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# show blank page for unknown hosts
|
# show blank page for unknown hosts
|
||||||
@ -369,122 +314,18 @@ in {
|
|||||||
return = "404";
|
return = "404";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://gethomepage.dev
|
|
||||||
services.homepage-dashboard = let
|
|
||||||
entry = name: value: {"${name}" = value;};
|
|
||||||
makeBookmark = name: {...} @ attrs: entry name [attrs];
|
|
||||||
makeBookmark' = name: icon: abbr: href: makeBookmark name ({inherit abbr href;} // lib.optionalAttrs (icon != null) {inherit icon;});
|
|
||||||
in {
|
|
||||||
enable = true;
|
|
||||||
listenPort = 8089;
|
|
||||||
environmentFile = secrets.homepage.path;
|
|
||||||
|
|
||||||
# bookmarks customCSS customJS docker environmentFile kubernetes services settings widgets
|
|
||||||
settings = {
|
|
||||||
theme = "dark";
|
|
||||||
color = "slate";
|
|
||||||
};
|
|
||||||
|
|
||||||
widgets = [
|
|
||||||
(entry "resources" {
|
|
||||||
cpu = true;
|
|
||||||
memory = true;
|
|
||||||
disk = "/";
|
|
||||||
})
|
|
||||||
(entry "search" {
|
|
||||||
provider = "custom";
|
|
||||||
target = "_self";
|
|
||||||
url = "https://searx.protogen.io/search?q=";
|
|
||||||
suggestionUrl = "https://searx.protogen.io/autocompleter?q=";
|
|
||||||
showSearchSuggestions = true;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
services = let
|
|
||||||
service = name: subdomain: icon: {...} @ attrs:
|
|
||||||
entry name ({
|
|
||||||
href = "https://${subdomain}.protogen.io";
|
|
||||||
inherit icon;
|
|
||||||
}
|
|
||||||
// attrs);
|
|
||||||
basicService = name: subdomain: icon: service name subdomain icon {};
|
|
||||||
in [
|
|
||||||
(entry "unsorted" [
|
|
||||||
(basicService "Firefly III" "firefly" "firefly-iii")
|
|
||||||
(basicService "Gitea" "gitea" "gitea")
|
|
||||||
(basicService "Home Assistant" "hass" "home-assistant")
|
|
||||||
(basicService "Node-RED" "node" "node-red")
|
|
||||||
(basicService "Zigbee2MQTT" "z2m" "zigbee2mqtt")
|
|
||||||
(basicService "Code Server (Home Assistant)" "vsc-hass" "vscode")
|
|
||||||
(basicService "Deemix" "deemix" "deemix")
|
|
||||||
(basicService "Miniflux" "rss" "miniflux")
|
|
||||||
(basicService "mlmym" "blahaj" "lemmy-light")
|
|
||||||
(basicService "Octoprint" "print" "octoprint")
|
|
||||||
(basicService "SearXNG" "searx" "searxng")
|
|
||||||
(basicService "TheLounge" "lounge" "thelounge")
|
|
||||||
(basicService "Paperless" "paper" "paperless-ngx")
|
|
||||||
(entry "Shlink" {
|
|
||||||
href = "https://admin.nbt.sh";
|
|
||||||
icon = "shlink";
|
|
||||||
})
|
|
||||||
(basicService "Create Track Map" "trackmap" "")
|
|
||||||
|
|
||||||
((x:
|
|
||||||
service x x x {
|
|
||||||
widget = {
|
|
||||||
};
|
|
||||||
}) "changedetection")
|
|
||||||
|
|
||||||
(service "Uptime Kuma" "uptime" "uptime-kuma" {
|
|
||||||
widget = {
|
|
||||||
type = "uptimekuma";
|
|
||||||
url = "https://uptime.protogen.io";
|
|
||||||
slug = "all";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
(service "Jellyfin" "room" "jellyfin" {
|
|
||||||
widget = {
|
|
||||||
type = "jellyfin";
|
|
||||||
url = "https://room.protogen.io";
|
|
||||||
key = "{{HOMEPAGE_VAR_JELLYFIN}}";
|
|
||||||
enableBlocks = true;
|
|
||||||
enableNowPlaying = true;
|
|
||||||
enableUser = true;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
])
|
|
||||||
];
|
|
||||||
|
|
||||||
bookmarks = [
|
|
||||||
(entry "Admin" [
|
|
||||||
(makeBookmark' "Backblaze" "backblaze" "BZ" "https://secure.backblaze.com/user_signin.htm")
|
|
||||||
(makeBookmark' "Cloudflare" "cloudflare" "CF" "https://dash.cloudflare.com")
|
|
||||||
(makeBookmark' "Porkbun" "porkbun" "PB" "https://porkbun.com/account/domainsSpeedy")
|
|
||||||
(makeBookmark' "Namecheap" "namechea" "NC" "https://ap.www.namecheap.com/")
|
|
||||||
])
|
|
||||||
(entry "Developer" [
|
|
||||||
(makeBookmark' "GitHub" "github" "GH" "https://github.com")
|
|
||||||
])
|
|
||||||
(entry "Local" [
|
|
||||||
(makeBookmark' "Syncthing" "syncthing" "ST" "http://127.0.0.1:8384")
|
|
||||||
(makeBookmark' "Iris" null "IR" "http://localhost:6680/iris/")
|
|
||||||
])
|
|
||||||
(entry "Entertainment" [
|
|
||||||
(makeBookmark' "Redlib" "redlib" "RL" "https://redlib.protogen.io")
|
|
||||||
])
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
storageDriver = "btrfs";
|
storageDriver = "btrfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# needed for mDNS in Home Assistant
|
# needed for mDNS in Home Assistant
|
||||||
networking.firewall.allowedUDPPorts = [5353];
|
networking.firewall.allowedUDPPorts = [ 5353 ];
|
||||||
|
|
||||||
systemd.services.redlib.environment = {
|
systemd.services.redlib.environment = {
|
||||||
REDLIB_DEFAULT_SUBSCRIPTIONS = lib.pipe ./reddit-subscriptions.txt [
|
REDLIB_DEFAULT_SUBSCRIPTIONS = lib.pipe ./reddit-subscriptions.txt [
|
||||||
@ -507,41 +348,6 @@ in {
|
|||||||
port = 8087;
|
port = 8087;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.thelounge = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = {
|
|
||||||
prefetch = true;
|
|
||||||
prefetchStorage = true;
|
|
||||||
prefetchMaxImageSize = 8192;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.redis.servers.paperless.enable = true;
|
|
||||||
services.paperless = {
|
|
||||||
enable = true;
|
|
||||||
# default is "localhost", binding should not rely on DNS (even if
|
|
||||||
# localhost is hard-coded 99.999% of the time)
|
|
||||||
address = "127.0.0.1";
|
|
||||||
passwordFile = secrets.paperless-admin.path;
|
|
||||||
settings = {
|
|
||||||
PAPERLESS_ADMIN_USER = "nullbite";
|
|
||||||
PAPERLESS_REDIS = "unix://${config.services.redis.servers.paperless.unixSocket}";
|
|
||||||
PAPERLESS_URL = "https://paper.protogen.io";
|
|
||||||
PAPERLESS_TIKA_ENABLED = true;
|
|
||||||
PAPERLESS_TIKA_ENDPOINT = "http://localhost:${toString config.services.tika.port}";
|
|
||||||
PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://localhost:${toString config.services.gotenberg.port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users.users."${config.services.paperless.user}".extraGroups = let
|
|
||||||
name = config.services.redis.servers.paperless.group;
|
|
||||||
in [name];
|
|
||||||
|
|
||||||
services.gotenberg = {
|
|
||||||
enable = true;
|
|
||||||
port = 3002;
|
|
||||||
};
|
|
||||||
services.tika.enable = true;
|
|
||||||
|
|
||||||
services.anki-sync-server = {
|
services.anki-sync-server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
address = "127.0.0.1";
|
address = "127.0.0.1";
|
||||||
|
@ -2,23 +2,10 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
{ config, lib, pkgs, vars, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
vars,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
|
|
||||||
../../system # nixfiles modules
|
|
||||||
./nvidia-optimus.nix
|
|
||||||
./supergfxd.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
config = {
|
|
||||||
# nix.settings.experimental-features = ["nix-command" "flakes" ];
|
# nix.settings.experimental-features = ["nix-command" "flakes" ];
|
||||||
|
|
||||||
fileSystems = lib.mkMerge [
|
fileSystems = lib.mkMerge [
|
||||||
@ -28,27 +15,30 @@
|
|||||||
device = "/dev/disk/by-uuid/028A49020517BEA9";
|
device = "/dev/disk/by-uuid/028A49020517BEA9";
|
||||||
};
|
};
|
||||||
"/.btrfsroot" = {
|
"/.btrfsroot" = {
|
||||||
options = ["subvol=/"];
|
options = [ "subvol=/" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
# Lanzaboote workaround (nix-community/lanzaboote#173)
|
# Lanzaboote workaround (nix-community/lanzaboote#173)
|
||||||
(lib.mkIf config.boot.lanzaboote.enable {
|
(lib.mkIf config.boot.lanzaboote.enable {
|
||||||
"/efi/EFI/Linux" = {
|
"/efi/EFI/Linux" = { device = "/boot/EFI/Linux"; options = [ "bind" ]; };
|
||||||
device = "/boot/EFI/Linux";
|
"/efi/EFI/nixos" = { device = "/boot/EFI/nixos"; options = [ "bind" ]; };
|
||||||
options = ["bind"];
|
|
||||||
};
|
|
||||||
"/efi/EFI/nixos" = {
|
|
||||||
device = "/boot/EFI/nixos";
|
|
||||||
options = ["bind"];
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.genAttrs ["/.btrfsroot" "/" "/home" "/nix"] (fs: {
|
(lib.genAttrs [ "/.btrfsroot" "/" "/home" "/nix" ] ( fs: {
|
||||||
options = ["compress=zstd"];
|
options = [ "compress=zstd" ];
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
|
||||||
|
../../system # nixfiles modules
|
||||||
|
./nvidia-optimus.nix
|
||||||
|
./supergfxd.nix
|
||||||
|
];
|
||||||
|
|
||||||
# specialisation.plasma.configuration = {
|
# specialisation.plasma.configuration = {
|
||||||
# system.nixos.tags = [ "Plasma" ];
|
# system.nixos.tags = [ "Plasma" ];
|
||||||
# nixfiles = {
|
# nixfiles = {
|
||||||
@ -59,7 +49,7 @@
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
specialisation.hyprland.configuration = {
|
specialisation.hyprland.configuration = {
|
||||||
system.nixos.tags = ["Hyprland"];
|
system.nixos.tags = [ "Hyprland" ];
|
||||||
nixfiles.session = "hyprland";
|
nixfiles.session = "hyprland";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -99,20 +89,21 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
networking.hostName = "slab";
|
networking.hostName = "slab";
|
||||||
|
|
||||||
boot.initrd.systemd.enable = true;
|
boot.initrd.systemd.enable = true;
|
||||||
|
|
||||||
boot.plymouth.enable = true;
|
boot.plymouth.enable = true;
|
||||||
|
|
||||||
boot.kernelParams = ["quiet"];
|
boot.kernelParams = [ "quiet" ];
|
||||||
# annoying ACPI bug
|
# annoying ACPI bug
|
||||||
boot.consoleLogLevel = 2;
|
boot.consoleLogLevel = 2;
|
||||||
|
|
||||||
# cryptsetup
|
# cryptsetup
|
||||||
boot.initrd.luks.devices = {
|
boot.initrd.luks.devices = {
|
||||||
lvmroot = {
|
lvmroot = {
|
||||||
device = "/dev/disk/by-uuid/2872c0f0-e544-45f0-9b6c-ea022af7805a";
|
device="/dev/disk/by-uuid/2872c0f0-e544-45f0-9b6c-ea022af7805a";
|
||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
fallbackToPassword = lib.mkIf (!config.boot.initrd.systemd.enable) true;
|
fallbackToPassword = lib.mkIf (!config.boot.initrd.systemd.enable) true;
|
||||||
preLVM = true;
|
preLVM = true;
|
||||||
@ -145,7 +136,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# GPS data from my phone
|
# GPS data from my phone
|
||||||
services.gpsd.devices = lib.mkIf config.nixfiles.hardware.gps.enable ["tcp://pixel.magpie-moth.ts.net:6000"];
|
services.gpsd.devices = lib.mkIf config.nixfiles.hardware.gps.enable [ "tcp://pixel.magpie-moth.ts.net:6000" ];
|
||||||
|
|
||||||
# systemd power/suspend configuration
|
# systemd power/suspend configuration
|
||||||
systemd.targets = lib.genAttrs ["suspend" "hybrid-sleep" "suspend-then-hibernate"] (_: {
|
systemd.targets = lib.genAttrs ["suspend" "hybrid-sleep" "suspend-then-hibernate"] (_: {
|
||||||
@ -171,6 +162,7 @@
|
|||||||
# boot.loader.efi.canTouchEfiVariables = true;
|
# boot.loader.efi.canTouchEfiVariables = true;
|
||||||
# see custom-hardware-configuration.nix
|
# see custom-hardware-configuration.nix
|
||||||
|
|
||||||
|
|
||||||
# networking.hostName = "nixos"; # Define your hostname.
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
# Pick only one of the below networking options.
|
# Pick only one of the below networking options.
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
@ -201,9 +193,11 @@
|
|||||||
# services.xserver.displayManager.sddm.enable = true;
|
# services.xserver.displayManager.sddm.enable = true;
|
||||||
# services.xserver.desktopManager.plasma5.enable = true;
|
# services.xserver.desktopManager.plasma5.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# Enable flatpak
|
# Enable flatpak
|
||||||
# services.flatpak.enable = true;
|
# services.flatpak.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
||||||
# services.xserver.xkb.layout = "us";
|
# services.xserver.xkb.layout = "us";
|
||||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
||||||
@ -223,6 +217,7 @@
|
|||||||
# jack.enable = true;
|
# jack.enable = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
@ -247,6 +242,7 @@
|
|||||||
# shell = pkgs.zsh;
|
# shell = pkgs.zsh;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
|
||||||
# shell config
|
# shell config
|
||||||
# programs.zsh.enable = true;
|
# programs.zsh.enable = true;
|
||||||
# programs.fzf = {
|
# programs.fzf = {
|
||||||
@ -298,7 +294,7 @@
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
networking.firewall.allowedTCPPorts = [22];
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
# networking.firewall.enable = false;
|
# networking.firewall.enable = false;
|
||||||
@ -315,5 +311,6 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,57 +1,53 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
imports =
|
||||||
lib,
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
pkgs,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "sdhci_pci"];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "sdhci_pci" ];
|
||||||
boot.initrd.kernelModules = ["dm-snapshot" "amdgpu"];
|
boot.initrd.kernelModules = [ "dm-snapshot" "amdgpu" ];
|
||||||
boot.kernelModules = ["kvm-amd"];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" =
|
||||||
device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
{ device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@"];
|
options = [ "subvol=nixos/@" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
fileSystems."/nix" =
|
||||||
device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
{ device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=nixos/@nix"];
|
options = [ "subvol=nixos/@nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" =
|
||||||
device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
{ device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@home"];
|
options = [ "subvol=@home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" =
|
||||||
device = "/dev/disk/by-uuid/50D3-45F0";
|
{ device = "/dev/disk/by-uuid/50D3-45F0";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = ["fmask=0022" "dmask=0022"];
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/efi" = {
|
fileSystems."/efi" =
|
||||||
device = "/dev/disk/by-uuid/4E1B-8BEE";
|
{ device = "/dev/disk/by-uuid/4E1B-8BEE";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = ["fmask=0022" "dmask=0022"];
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices =
|
||||||
{device = "/dev/disk/by-uuid/9360890a-4050-4326-bf5f-8fa2bdc6744a";}
|
[ { device = "/dev/disk/by-uuid/9360890a-4050-4326-bf5f-8fa2bdc6744a"; }
|
||||||
];
|
];
|
||||||
fileSystems."/.btrfsroot" = {
|
fileSystems."/.btrfsroot" =
|
||||||
device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
{ device = "/dev/disk/by-uuid/9c2a06d8-bff5-4587-95a6-e25495e9c4ec";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
|
{ lib, pkgs, osConfig, config, ... }:
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
osConfig,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
../../home
|
../../home
|
||||||
];
|
];
|
||||||
@ -14,7 +9,7 @@
|
|||||||
profile.base.enable = true;
|
profile.base.enable = true;
|
||||||
|
|
||||||
common.wm.keybinds = {
|
common.wm.keybinds = {
|
||||||
Launch1 = "playerctl play-pause"; # ROG key
|
Launch1="playerctl play-pause"; # ROG key
|
||||||
# Launch3="true"; # AURA fn key
|
# Launch3="true"; # AURA fn key
|
||||||
# Launch4="true"; # fan control fn key
|
# Launch4="true"; # fan control fn key
|
||||||
};
|
};
|
||||||
@ -22,8 +17,8 @@
|
|||||||
home.stateVersion = "23.11";
|
home.stateVersion = "23.11";
|
||||||
|
|
||||||
# TODO mkif stylix.enable; danth/stylix#216
|
# TODO mkif stylix.enable; danth/stylix#216
|
||||||
home.pointerCursor = lib.mkIf (config.nixfiles.theming.enable && !config.stylix.enable) {size = 32;};
|
home.pointerCursor = lib.mkIf (config.nixfiles.theming.enable && !config.stylix.enable) { size = 32; };
|
||||||
stylix.cursor = lib.mkIf config.stylix.enable {size = 32;};
|
stylix.cursor = { size = 32; };
|
||||||
|
|
||||||
nixfiles.theming.catppuccin.themeDPI = "hdpi";
|
nixfiles.theming.catppuccin.themeDPI = "hdpi";
|
||||||
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.supergfxd.enable = true;
|
services.supergfxd.enable = true;
|
||||||
specialisation = {
|
specialisation = {
|
||||||
nvidia.configuration = {
|
nvidia.configuration = {
|
||||||
system.nixos.tags = ["NVIDIA"];
|
system.nixos.tags = [ "NVIDIA" ];
|
||||||
|
|
||||||
nixfiles.supergfxd.profile = "Hybrid";
|
nixfiles.supergfxd.profile = "Hybrid";
|
||||||
|
|
||||||
@ -32,8 +30,7 @@
|
|||||||
package = let
|
package = let
|
||||||
stable = config.boot.kernelPackages.nvidiaPackages.stable;
|
stable = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
version = stable;
|
version = stable;
|
||||||
in
|
in version;
|
||||||
version;
|
|
||||||
|
|
||||||
prime = {
|
prime = {
|
||||||
offload = {
|
offload = {
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
{
|
{ pkgs, lib, config, options, ... }@args:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
gfx = {
|
gfx = {
|
||||||
Integrated = {
|
Integrated = {
|
||||||
supergfxd = pkgs.writeText "supergfxd-integrated" ''
|
supergfxd = pkgs.writeText "supergfxd-integrated" ''
|
||||||
@ -74,8 +69,7 @@
|
|||||||
isKeyInAttrset = let
|
isKeyInAttrset = let
|
||||||
getKeys = attrset: lib.mapAttrsToList (name: _: name) attrset;
|
getKeys = attrset: lib.mapAttrsToList (name: _: name) attrset;
|
||||||
isInList = key: list: lib.any (x: x == key) list;
|
isInList = key: list: lib.any (x: x == key) list;
|
||||||
in
|
in key: attrset: isInList key (getKeys attrset);
|
||||||
key: attrset: isInList key (getKeys attrset);
|
|
||||||
|
|
||||||
inherit (lib) mkIf mkOption types;
|
inherit (lib) mkIf mkOption types;
|
||||||
in {
|
in {
|
||||||
|
@ -1,31 +1,8 @@
|
|||||||
{...} @ attrs: let
|
{ pkgs, ... }:
|
||||||
# compatibility with old loading system (this looks awful fix this when i
|
let
|
||||||
# fully migrate to flake-parts). this constructs an attrset that resembles
|
|
||||||
# what the old args used to look like in attrs', so i don't have to rewrite
|
|
||||||
# all of the glue. it creates a fake pkgs value containing only `lib`.
|
|
||||||
#
|
|
||||||
# actually no idk if i can fix this because it needs to be accessible from
|
|
||||||
# everything (flake, nixos/home-manager modules, maybe derivations). this
|
|
||||||
# might be the best way to do this so i can pass in either pkgs or lib based
|
|
||||||
# on the current context, and just return relevant libraries based on that
|
|
||||||
# input.
|
|
||||||
#
|
|
||||||
# create empty `pkgs` with lib only `lib` attr as fallback
|
|
||||||
pkgs = attrs.pkgs or {inherit (attrs) lib;};
|
|
||||||
# inherit lib from whatever `pkgs` happens to be
|
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
# compat
|
|
||||||
attrs' = attrs // {inherit pkgs;};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
types = (import ./types.nix) attrs';
|
types = (import ./types.nix) { inherit pkgs; };
|
||||||
}
|
minecraft = (import ./minecraft.nix) { inherit pkgs; };
|
||||||
# only if an actual `pkgs` was passed
|
}
|
||||||
// lib.optionalAttrs (attrs ? pkgs) {
|
|
||||||
minecraft = (import ./minecraft.nix) attrs';
|
|
||||||
}
|
|
||||||
# modules that rely on `self` (flake)
|
|
||||||
// lib.optionalAttrs (attrs ? self) {
|
|
||||||
flake-legacy = (import ./flake-legacy.nix) attrs';
|
|
||||||
}
|
|
||||||
|
@ -1,259 +0,0 @@
|
|||||||
{
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
moduleAttrs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (moduleAttrs.config.nixfiles.common) overlays;
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
# My username
|
|
||||||
username = "nullbite";
|
|
||||||
# My current timezone for any mobile devices (i.e., my laptop)
|
|
||||||
mobileTimeZone = "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# Variables to be passed to NixOS modules in the vars attrset
|
|
||||||
vars = {
|
|
||||||
inherit username mobileTimeZone self;
|
|
||||||
};
|
|
||||||
|
|
||||||
# funciton to generate packages for each system
|
|
||||||
eachSystem = lib.genAttrs (import inputs.systems);
|
|
||||||
|
|
||||||
# values to be passed to nixosModules and homeManagerModules wrappers
|
|
||||||
moduleInputs = {
|
|
||||||
};
|
|
||||||
inherit (self) inputs outputs;
|
|
||||||
inherit (inputs) nixpkgs nixpkgs-unstable home-manager home-manager-unstable;
|
|
||||||
in rec {
|
|
||||||
# This function produces a module that adds the home-manager module to the
|
|
||||||
# system and configures the given module to the user's Home Manager
|
|
||||||
# configuration
|
|
||||||
homeManagerInit = let
|
|
||||||
_username = username;
|
|
||||||
_nixpkgs = nixpkgs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
system,
|
|
||||||
nixpkgs ? _nixpkgs, # this is so modules can know which flake the system is using
|
|
||||||
home-manager ? inputs.home-manager,
|
|
||||||
username ? _username,
|
|
||||||
module ? _: {},
|
|
||||||
rootModule ? (import (self + "/home/root.nix")),
|
|
||||||
userModules ? {
|
|
||||||
${username} = [module];
|
|
||||||
root = [rootModule];
|
|
||||||
},
|
|
||||||
stateVersion ? null,
|
|
||||||
}: {
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
mapUserModules = lib.attrsets.mapAttrs (user: modules: {lib, ...}: {
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
(self + "/home")
|
|
||||||
]
|
|
||||||
++ modules;
|
|
||||||
config = {
|
|
||||||
home = lib.mkIf (!(builtins.isNull stateVersion)) {inherit stateVersion;};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
users = mapUserModules userModules;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = lib.mkDefault false;
|
|
||||||
useUserPackages = lib.mkDefault true;
|
|
||||||
backupFileExtension = "hm.bak";
|
|
||||||
inherit users;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs vars nixpkgs home-manager;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO rewrite this so it follows the same wrapper pattern as
|
|
||||||
# mkHome This function produces a nixosSystem which imports
|
|
||||||
# configuration.nix and a Home Manager home.nix for the given user
|
|
||||||
# from ./hosts/${hostname}/
|
|
||||||
#
|
|
||||||
# nevermind i am migrating everything to flake-parts, i'm glad i
|
|
||||||
# never got around to this. i think the module system takes care of
|
|
||||||
# whatever the fuck godforsaken use-case i had for rewriting this
|
|
||||||
# (more ergonomic and/or default arguments or something).
|
|
||||||
mkSystemN = let
|
|
||||||
_username = username;
|
|
||||||
_overlays = overlays;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
nixpkgs ? inputs.nixpkgs,
|
|
||||||
home-manager ? inputs.home-manager,
|
|
||||||
username ? _username,
|
|
||||||
entrypoint ? (self + "/system"),
|
|
||||||
modules ? [],
|
|
||||||
stateVersion ? null,
|
|
||||||
config ? {},
|
|
||||||
overlays ? _overlays,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
_modules =
|
|
||||||
[entrypoint config]
|
|
||||||
++ modules
|
|
||||||
++ [
|
|
||||||
{
|
|
||||||
nixpkgs.config = {
|
|
||||||
inherit overlays;
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ lib.optional (args ? stateVersion) {config.system.stateVersion = stateVersion;};
|
|
||||||
in
|
|
||||||
nixpkgs.lib.nixosSystem {
|
|
||||||
};
|
|
||||||
mkSystem = let
|
|
||||||
_username = username;
|
|
||||||
_overlays = overlays;
|
|
||||||
_nixpkgs = nixpkgs;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
system,
|
|
||||||
nixpkgs ? _nixpkgs,
|
|
||||||
home-manager ? inputs.home-manager,
|
|
||||||
overlays ? _overlays,
|
|
||||||
hostname,
|
|
||||||
username ? _username,
|
|
||||||
stateVersion,
|
|
||||||
extraModules ? [],
|
|
||||||
}:
|
|
||||||
nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules =
|
|
||||||
[
|
|
||||||
(self + "/system")
|
|
||||||
({
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
} @ args: {
|
|
||||||
# Values for every single system that would not conceivably need
|
|
||||||
# to be made modular
|
|
||||||
system.stateVersion = stateVersion;
|
|
||||||
nixpkgs = {
|
|
||||||
inherit overlays;
|
|
||||||
config = {
|
|
||||||
# not having the freedom to install unfree programs is unfree
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
||||||
})
|
|
||||||
(self + "/hosts/${hostname}/configuration.nix")
|
|
||||||
(homeManagerInit {
|
|
||||||
inherit nixpkgs home-manager;
|
|
||||||
module = import (self + "/hosts/${hostname}/home.nix");
|
|
||||||
inherit username system stateVersion;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
++ extraModules;
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs vars nixpkgs home-manager;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkWSLSystem = let
|
|
||||||
_username = username;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
username ? _username,
|
|
||||||
extraModules ? [],
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
WSLModule = {...}: {
|
|
||||||
imports = [
|
|
||||||
inputs.nix-wsl.nixosModules.wsl
|
|
||||||
];
|
|
||||||
wsl.enable = true;
|
|
||||||
wsl.defaultUser = username;
|
|
||||||
};
|
|
||||||
override = {extraModules = extraModules ++ [WSLModule];};
|
|
||||||
in
|
|
||||||
mkSystem (args // override);
|
|
||||||
|
|
||||||
mkISOSystem = system:
|
|
||||||
inputs.nixpkgs-unstable.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
"${inputs.nixpkgs-unstable}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
|
|
||||||
({
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
neovim
|
|
||||||
gparted
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
# Make a home-manager standalone configuration. This implementation is
|
|
||||||
# better than mkSystem because it extends homeManagerConfiguration.
|
|
||||||
mkHome = let
|
|
||||||
_home-manager = inputs.home-manager;
|
|
||||||
_nixpkgs = inputs.nixpkgs;
|
|
||||||
_username = username;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
home-manager ? _home-manager,
|
|
||||||
nixpkgs ? _nixpkgs,
|
|
||||||
username ? _username,
|
|
||||||
homeDirectory ? "/home/${username}",
|
|
||||||
entrypoint ? (self + "/home/standalone.nix"),
|
|
||||||
modules ? [],
|
|
||||||
stateVersion ? null,
|
|
||||||
config ? {},
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
} @ args: let
|
|
||||||
_modules =
|
|
||||||
[entrypoint]
|
|
||||||
++ modules
|
|
||||||
++ [config]
|
|
||||||
++ [
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
home = {
|
|
||||||
inherit username homeDirectory;
|
|
||||||
};
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ lib.optional (args ? stateVersion) {config.home.stateVersion = stateVersion;};
|
|
||||||
in
|
|
||||||
home-manager.lib.homeManagerConfiguration ({
|
|
||||||
modules = _modules;
|
|
||||||
pkgs = import nixpkgs {inherit system overlays;};
|
|
||||||
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs vars nixpkgs home-manager;
|
|
||||||
|
|
||||||
# this is needed because modules don't use the default arg for some reason???
|
|
||||||
osConfig = {};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// builtins.removeAttrs args
|
|
||||||
["system" "nixpkgs" "home-manager" "modules" "username" "homeDirectory" "stateVersion" "entrypoint" "config"]);
|
|
||||||
}
|
|
@ -1,19 +1,14 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
in {
|
in
|
||||||
mkServer = {
|
{
|
||||||
modpack ? null,
|
mkServer = { modpack ? null, modpackSymlinks ? [], modpackFiles ? [], jvmOpts ? null, ...}@opts: let
|
||||||
modpackSymlinks ? [],
|
|
||||||
modpackFiles ? [],
|
|
||||||
jvmOpts ? null,
|
|
||||||
...
|
|
||||||
} @ opts: let
|
|
||||||
# log4j exploit is bad and scary and i have no idea if this is still needed
|
# log4j exploit is bad and scary and i have no idea if this is still needed
|
||||||
# but it's best to be on the safe side
|
# but it's best to be on the safe side
|
||||||
jvmOptsPatched = let
|
jvmOptsPatched = let
|
||||||
requiredJvmOpts = "-Dlog4j2.formatMsgNoLookups=true";
|
requiredJvmOpts = "-Dlog4j2.formatMsgNoLookups=true";
|
||||||
in
|
in if (!(builtins.isNull jvmOpts))
|
||||||
if (!(builtins.isNull jvmOpts))
|
|
||||||
then requiredJvmOpts + " " + jvmOpts
|
then requiredJvmOpts + " " + jvmOpts
|
||||||
else requiredJvmOpts;
|
else requiredJvmOpts;
|
||||||
|
|
||||||
@ -22,21 +17,14 @@ in {
|
|||||||
|
|
||||||
serverPackage = let
|
serverPackage = let
|
||||||
mcVersion = modpack.manifest.versions.minecraft;
|
mcVersion = modpack.manifest.versions.minecraft;
|
||||||
fixedVersion = lib.replaceStrings ["."] ["_"] mcVersion;
|
fixedVersion = lib.replaceStrings [ "." ] [ "_" ] mcVersion;
|
||||||
quiltVersion = modpack.manifest.versions.quilt or null;
|
quiltVersion = modpack.manifest.versions.quilt or null;
|
||||||
fabricVersion = modpack.manifest.versions.fabric or null;
|
fabricVersion = modpack.manifest.versions.fabric or null;
|
||||||
loader =
|
loader = if (!(builtins.isNull quiltVersion)) then "quilt" else "fabric";
|
||||||
if (!(builtins.isNull quiltVersion))
|
loaderVersion = if loader == "quilt" then quiltVersion else fabricVersion;
|
||||||
then "quilt"
|
in pkgs.minecraftServers."${loader}-${fixedVersion}".override { inherit loaderVersion; };
|
||||||
else "fabric";
|
|
||||||
loaderVersion =
|
in lib.mkMerge [
|
||||||
if loader == "quilt"
|
|
||||||
then quiltVersion
|
|
||||||
else fabricVersion;
|
|
||||||
in
|
|
||||||
pkgs.minecraftServers."${loader}-${fixedVersion}".override {inherit loaderVersion;};
|
|
||||||
in
|
|
||||||
lib.mkMerge [
|
|
||||||
(lib.mkIf (!(builtins.isNull modpack)) {
|
(lib.mkIf (!(builtins.isNull modpack)) {
|
||||||
inherit symlinks files;
|
inherit symlinks files;
|
||||||
package = lib.mkDefault serverPackage;
|
package = lib.mkDefault serverPackage;
|
||||||
@ -74,6 +62,6 @@ in {
|
|||||||
difficulty = lib.mkDefault "hard";
|
difficulty = lib.mkDefault "hard";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
(builtins.removeAttrs opts ["modpack" "modpackSymlinks" "modpackFiles" "jvmOpts"])
|
(builtins.removeAttrs opts [ "modpack" "modpackSymlinks" "modpackFiles" "jvmOpts" ])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
} @ moduleAttrs: let
|
|
||||||
inherit (lib) types;
|
|
||||||
nixfiles-lib = (import ./.) {inherit lib self moduleAttrs;};
|
|
||||||
in {
|
|
||||||
options.nixfiles.lib = lib.mkOption {
|
|
||||||
description = "nixfiles library";
|
|
||||||
type = types.attrs;
|
|
||||||
readOnly = true;
|
|
||||||
default = nixfiles-lib;
|
|
||||||
};
|
|
||||||
|
|
||||||
config._module.args = {
|
|
||||||
inherit nixfiles-lib;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,21 +1,13 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
inherit (lib.types) mkOptionType;
|
inherit (lib.types) mkOptionType;
|
||||||
inherit (lib.options) mergeEqualOption;
|
inherit (lib.options) mergeEqualOption;
|
||||||
in {
|
in
|
||||||
mkCheckedType = type:
|
{
|
||||||
mkOptionType {
|
|
||||||
name = "${type}";
|
|
||||||
description = "Attribute set of type ${type}";
|
|
||||||
descriptionClass = "noun";
|
|
||||||
merge = mergeEqualOption;
|
|
||||||
check = value: value._type or "" == "${type}";
|
|
||||||
};
|
|
||||||
flake = mkOptionType {
|
flake = mkOptionType {
|
||||||
name = "flake";
|
name="flake";
|
||||||
description = "Nix flake";
|
description="Nix flake";
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
merge = mergeEqualOption;
|
merge = mergeEqualOption; check = (value: value._type or "" == "flake"); };
|
||||||
check = value: value._type or "" == "flake";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1 +1,2 @@
|
|||||||
_: {}
|
_:
|
||||||
|
{}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
{...} @ moduleInputs: {
|
{...}@moduleInputs:
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
@ -1,58 +1,35 @@
|
|||||||
{
|
nixfiles: final: prev:
|
||||||
config,
|
let
|
||||||
lib,
|
pkgs-unstable = import nixfiles.inputs.nixpkgs-unstable { config.allowUnfree = true; inherit (final) system; };
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
# TODO legacy refactor
|
|
||||||
# not high priority, this still works well for this overlay.
|
|
||||||
nixfiles = self;
|
|
||||||
overlay = final: prev: let
|
|
||||||
pkgs-unstable = import nixfiles.inputs.nixpkgs-unstable {
|
|
||||||
config.allowUnfree = true;
|
|
||||||
inherit (final) system;
|
|
||||||
};
|
|
||||||
inherit (final) callPackage kdePackages lib;
|
inherit (final) callPackage kdePackages lib;
|
||||||
|
|
||||||
backport = let
|
backport = let
|
||||||
_callPackage = callPackage;
|
_callPackage = callPackage;
|
||||||
in
|
in { pkgname,
|
||||||
{
|
|
||||||
pkgname,
|
|
||||||
callPackage ? _callPackage,
|
callPackage ? _callPackage,
|
||||||
new ? pkgs-unstable,
|
new ? pkgs-unstable,
|
||||||
override ? {},
|
override ? {} } : let
|
||||||
}: let
|
|
||||||
inherit (lib) getAttrFromPath;
|
inherit (lib) getAttrFromPath;
|
||||||
inherit (builtins) getAttr isString;
|
inherit (builtins) getAttr isString;
|
||||||
|
|
||||||
getAttr' = name: attrs:
|
getAttr' = name: attrs: if isString pkgname then getAttr name attrs else getAttrFromPath name attrs;
|
||||||
if isString pkgname
|
|
||||||
then getAttr name attrs
|
|
||||||
else getAttrFromPath name attrs;
|
|
||||||
oldPkg = getAttr' pkgname prev;
|
oldPkg = getAttr' pkgname prev;
|
||||||
newPkg = getAttr' pkgname pkgs-unstable;
|
newPkg = getAttr' pkgname pkgs-unstable;
|
||||||
in
|
in if oldPkg.version == newPkg.version
|
||||||
if oldPkg.version == newPkg.version
|
|
||||||
then oldPkg
|
then oldPkg
|
||||||
else (callPackage newPkg.override) override;
|
else (callPackage newPkg.override) override;
|
||||||
|
|
||||||
backport' = pkgname: backport {inherit pkgname;};
|
backport' = pkgname: backport { inherit pkgname; };
|
||||||
|
|
||||||
# defined locally to not pull in perl from unstable
|
# defined locally to not pull in perl from unstable
|
||||||
stripJavaArchivesHook =
|
stripJavaArchivesHook = final.makeSetupHook {
|
||||||
final.makeSetupHook {
|
|
||||||
name = "strip-java-archives-hook";
|
name = "strip-java-archives-hook";
|
||||||
propagatedBuildInputs = [final.strip-nondeterminism];
|
propagatedBuildInputs = [ final.strip-nondeterminism ];
|
||||||
}
|
} ./strip-java-archives.sh;
|
||||||
./strip-java-archives.sh;
|
|
||||||
in {
|
in {
|
||||||
vesktop = backport' "vesktop";
|
vesktop = backport' "vesktop";
|
||||||
obsidian = backport {
|
obsidian = backport { pkgname="obsidian"; override.electron = final.electron_28; };
|
||||||
pkgname = "obsidian";
|
|
||||||
override.electron = final.electron_28;
|
|
||||||
};
|
|
||||||
prismlauncher-unwrapped = backport {
|
prismlauncher-unwrapped = backport {
|
||||||
pkgname = "prismlauncher-unwrapped";
|
pkgname = "prismlauncher-unwrapped";
|
||||||
inherit (kdePackages) callPackage;
|
inherit (kdePackages) callPackage;
|
||||||
@ -62,7 +39,4 @@
|
|||||||
inherit (final.darwin.apple_sdk.frameworks) Cocoa;
|
inherit (final.darwin.apple_sdk.frameworks) Cocoa;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in {
|
|
||||||
config.flake.overlays.backports = overlay;
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
{
|
nixfiles:
|
||||||
config,
|
let
|
||||||
lib,
|
inherit (nixfiles.inputs.nixpkgs) lib;
|
||||||
...
|
# this name is awful. maybe i don't know anything about functional
|
||||||
}: let
|
# programming or something, but the naming isn't very self explanatory
|
||||||
|
# - why is it "compose" instead of "combine"
|
||||||
|
# - why is it "extensions" instead of "overlays"
|
||||||
inherit (lib) composeManyExtensions;
|
inherit (lib) composeManyExtensions;
|
||||||
cfg = config.flake.overlays;
|
in rec {
|
||||||
in {
|
backports = import ./backports.nix nixfiles;
|
||||||
imports = [
|
mitigations = import ./mitigations.nix nixfiles;
|
||||||
./mitigations.nix
|
modpacks = import ./modpacks.nix nixfiles;
|
||||||
./backports.nix
|
default = composeManyExtensions [
|
||||||
./modpacks.nix
|
|
||||||
];
|
|
||||||
config.flake.overlays = {
|
|
||||||
default = with cfg;
|
|
||||||
composeManyExtensions [
|
|
||||||
backports
|
backports
|
||||||
mitigations
|
mitigations
|
||||||
];
|
];
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,142 +1,61 @@
|
|||||||
{
|
nixfiles: final: prev:
|
||||||
config,
|
let
|
||||||
lib,
|
pkgsStable = import nixfiles.inputs.nixpkgs.outPath { inherit (prev) system; };
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
# TODO legacy refactor
|
|
||||||
# not high priority, this still works well for this overlay.
|
|
||||||
nixfiles = self;
|
|
||||||
overlay = final: prev: let
|
|
||||||
pkgsStable = import nixfiles.inputs.nixpkgs.outPath {
|
|
||||||
inherit (prev) system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
updateTime = nixfiles.inputs.nixpkgs-unstable.lastModified;
|
updateTime = nixfiles.inputs.nixpkgs-unstable.lastModified;
|
||||||
|
|
||||||
inherit (final) callPackage fetchFromGitHub;
|
inherit (final) lib callPackage fetchFromGitHub;
|
||||||
inherit
|
inherit (lib) recurseIntoAttrs optionalAttrs
|
||||||
(lib)
|
versionOlder versionAtLeast;
|
||||||
recurseIntoAttrs
|
|
||||||
optionalAttrs
|
|
||||||
versionOlder
|
|
||||||
versionAtLeast
|
|
||||||
;
|
|
||||||
|
|
||||||
pkgsFromFlake = flake: (import flake.outPath) {inherit (prev) system;};
|
pkgsFromFlake = flake: (import flake.outPath) { inherit (prev) system; };
|
||||||
pkgsFromInput = name: pkgsFromFlake nixfiles.inputs.${name};
|
pkgsFromInput = name: pkgsFromFlake nixfiles.inputs.${name};
|
||||||
pickFixed = ours: theirs:
|
pickFixed = ours: theirs: if versionAtLeast ours.version theirs.version then ours else theirs;
|
||||||
if versionAtLeast ours.version theirs.version
|
pickNewer = ours: theirs: if versionOlder theirs.version ours.version then ours else theirs;
|
||||||
then ours
|
|
||||||
else theirs;
|
|
||||||
pickNewer = ours: theirs:
|
|
||||||
if versionOlder theirs.version ours.version
|
|
||||||
then ours
|
|
||||||
else theirs;
|
|
||||||
|
|
||||||
hold = now: days: ours: theirs: let
|
hold = now: days: ours: theirs: let
|
||||||
seconds = days * 24 * 60 * 60;
|
seconds = days * 24 * 60 * 60;
|
||||||
endTimestamp = now + seconds;
|
endTimestamp = now + seconds;
|
||||||
in
|
in if now < endTimestamp then ours else theirs;
|
||||||
if now < endTimestamp
|
|
||||||
then ours
|
|
||||||
else theirs;
|
|
||||||
|
|
||||||
optionalPkg = cond: val:
|
optionalPkg = cond: val: if cond then val else null;
|
||||||
if cond
|
|
||||||
then val
|
|
||||||
else null;
|
|
||||||
|
|
||||||
gimp-with-plugins-good = let
|
gimp-with-plugins-good = let
|
||||||
badPlugins = ["gap"];
|
badPlugins = [ "gap" ];
|
||||||
itemInList = list: item: lib.any (x: x == item) list;
|
itemInList = list: item: lib.any (x: x==item) list;
|
||||||
pluginFilter = name: value: (value.type or null == "derivation") && (!(itemInList badPlugins name)) && (!value.meta.broken);
|
pluginFilter = name: value: (value.type or null == "derivation") && (!(itemInList badPlugins name)) && (!value.meta.broken);
|
||||||
filteredPlugins = lib.filterAttrs pluginFilter prev.gimpPlugins;
|
filteredPlugins = lib.filterAttrs pluginFilter prev.gimpPlugins;
|
||||||
plugins = lib.mapAttrsToList (_: v: v) filteredPlugins;
|
plugins = lib.mapAttrsToList (_: v: v) filteredPlugins;
|
||||||
in
|
in prev.gimp-with-plugins.override { inherit plugins; };
|
||||||
prev.gimp-with-plugins.override {inherit plugins;};
|
|
||||||
# this also causes an infinite recursion and i have no idea why
|
# this also causes an infinite recursion and i have no idea why
|
||||||
# in nixfiles.inputs.nixpkgs.lib.filterAttrs (k: v: v != null) {
|
# in nixfiles.inputs.nixpkgs.lib.filterAttrs (k: v: v != null) {
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
nix-du = let
|
nix-du = let
|
||||||
old = prev.nix-du;
|
old = prev.nix-du;
|
||||||
new = (pkgsFromInput "nixpkgs-nix-du").nix-du;
|
new = (pkgsFromInput "nixpkgs-nix-du").nix-du;
|
||||||
in
|
in pickNewer old new;
|
||||||
pickNewer old new;
|
|
||||||
|
|
||||||
gimp-with-plugins = gimp-with-plugins-good;
|
gimp-with-plugins = gimp-with-plugins-good;
|
||||||
|
|
||||||
nwg-displays = let
|
easyeffects = let
|
||||||
stable = pkgsStable.nwg-displays;
|
stable = pkgsStable.easyeffects;
|
||||||
unstable = prev.nwg-displays;
|
unstable = prev.easyeffects;
|
||||||
now = 1739114541;
|
in if updateTime < 1726148749 then stable else unstable;
|
||||||
in
|
|
||||||
hold now 7 stable unstable;
|
|
||||||
|
|
||||||
libreoffice = let
|
compsize = let
|
||||||
stable = pkgsStable.libreoffice;
|
stable = pkgsStable.compsize;
|
||||||
unstable = prev.libreoffice;
|
unstable = prev.compsize;
|
||||||
now = 1739558971;
|
now = 1724786296;
|
||||||
in
|
in hold now 7 stable unstable;
|
||||||
hold now 7 stable unstable;
|
|
||||||
|
|
||||||
gotenberg = let
|
qgis = let
|
||||||
stable = pkgsStable.gotenberg;
|
stable = pkgsStable.qgis;
|
||||||
unstable = prev.gotenberg;
|
unstable = prev.qgis;
|
||||||
now = 1745707083;
|
now = 1733871491;
|
||||||
in
|
in hold now 7 stable unstable;
|
||||||
hold now 90 stable unstable;
|
|
||||||
|
|
||||||
redlib = let
|
redlib = let
|
||||||
redlib-new = final.callPackage nixfiles.packages.${prev.system}.redlib.override {};
|
redlib-new = final.callPackage nixfiles.packages.${prev.system}.redlib.override {};
|
||||||
inherit (prev) redlib;
|
inherit (prev) redlib;
|
||||||
in
|
in pickNewer redlib-new redlib;
|
||||||
pickNewer redlib-new redlib;
|
|
||||||
|
|
||||||
rustdesk-flutter = let
|
|
||||||
stable = pkgsStable.rustdesk-flutter;
|
|
||||||
unstable = prev.rustdesk-flutter;
|
|
||||||
now = 1741899501;
|
|
||||||
in
|
|
||||||
hold now 7 stable unstable;
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
lib.genAttrs [
|
|
||||||
"mopidyPackages"
|
|
||||||
"mopidy"
|
|
||||||
"mopidy-bandcamp"
|
|
||||||
"mopidy-iris"
|
|
||||||
"mopidy-jellyfin"
|
|
||||||
"mopidy-local"
|
|
||||||
"mopidy-moped"
|
|
||||||
"mopidy-mopify"
|
|
||||||
"mopidy-mpd"
|
|
||||||
"mopidy-mpris"
|
|
||||||
"mopidy-muse"
|
|
||||||
"mopidy-musicbox-webclient"
|
|
||||||
"mopidy-notify"
|
|
||||||
"mopidy-podcast"
|
|
||||||
"mopidy-scrobbler"
|
|
||||||
"mopidy-somafm"
|
|
||||||
"mopidy-soundcloud"
|
|
||||||
"mopidy-spotify"
|
|
||||||
"mopidy-subidy"
|
|
||||||
"mopidy-tidal"
|
|
||||||
"mopidy-tunein"
|
|
||||||
"mopidy-youtube"
|
|
||||||
"mopidy-ytmusic"
|
|
||||||
] (name: let
|
|
||||||
pkgs-mopidy = (import inputs.nixpkgs-mopidy) {inherit (prev) system;};
|
|
||||||
unstable = prev."${name}";
|
|
||||||
stable = pkgs-mopidy."${name}";
|
|
||||||
now = 1740786429;
|
|
||||||
in
|
|
||||||
# pin for at least 90 days because who knows when this will be fixed
|
|
||||||
# https://github.com/mopidy/mopidy/issues/2183
|
|
||||||
hold now 90 stable unstable)
|
|
||||||
);
|
|
||||||
in {
|
|
||||||
config.flake.overlays.mitigations = overlay;
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,11 @@
|
|||||||
{
|
nixfiles: final: prev:
|
||||||
config,
|
let
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
# TODO legacy refactor
|
|
||||||
# not high priority, this still works well for this overlay.
|
|
||||||
nixfiles = self;
|
|
||||||
overlay = final: prev: let
|
|
||||||
inherit (final) lib;
|
inherit (final) lib;
|
||||||
inherit (lib) fakeHash;
|
inherit (lib) fakeHash;
|
||||||
notlite = let
|
notlite = let
|
||||||
commit = "0e42bfbc6189db5848252d7dc7a638103d9d44ee";
|
commit = "0e42bfbc6189db5848252d7dc7a638103d9d44ee";
|
||||||
packHash = "sha256-X9a7htRhJcSRXu4uDvzSjdjCyWg+x7Dqws9pIlQtl6A=";
|
packHash = "sha256-X9a7htRhJcSRXu4uDvzSjdjCyWg+x7Dqws9pIlQtl6A=";
|
||||||
in
|
in final.fetchPackwizModpack {
|
||||||
final.fetchPackwizModpack {
|
|
||||||
url = "https://gitea.protogen.io/nullbite/notlite/raw/commit/${commit}/pack.toml";
|
url = "https://gitea.protogen.io/nullbite/notlite/raw/commit/${commit}/pack.toml";
|
||||||
inherit packHash;
|
inherit packHash;
|
||||||
};
|
};
|
||||||
@ -24,17 +14,14 @@
|
|||||||
pname = "ctm-static";
|
pname = "ctm-static";
|
||||||
version = "0.0.0";
|
version = "0.0.0";
|
||||||
src = final.emptyDirectory;
|
src = final.emptyDirectory;
|
||||||
nativeBuildInputs = [final.unzip];
|
nativeBuildInputs = [ final.unzip ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
unzip "${notlite}/mods/create-track-map-*.jar" 'assets/littlechasiu/ctm/static/*'
|
unzip "${notlite}/mods/create-track-map-*.jar" 'assets/littlechasiu/ctm/static/*'
|
||||||
cp -r assets/littlechasiu/ctm/static/. $out/
|
cp -r assets/littlechasiu/ctm/static/. $out/
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
modpacks = {
|
modpacks = {
|
||||||
inherit notlite notlite-ctm-static;
|
inherit notlite notlite-ctm-static;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in {
|
|
||||||
config.flake.overlays.modpacks = overlay;
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
{
|
{ packages, system, ... }:
|
||||||
packages,
|
let _packages = packages; in
|
||||||
system,
|
let
|
||||||
...
|
|
||||||
}: let
|
|
||||||
_packages = packages;
|
|
||||||
in let
|
|
||||||
packages = _packages.${system};
|
packages = _packages.${system};
|
||||||
mkApp = program: {
|
mkApp = program: { type = "app"; inherit program; };
|
||||||
type = "app";
|
in
|
||||||
inherit program;
|
{
|
||||||
};
|
|
||||||
in {
|
|
||||||
keysetting = mkApp "${packages.wm-helpers}/bin/keysetting";
|
keysetting = mkApp "${packages.wm-helpers}/bin/keysetting";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{ lib,
|
||||||
lib,
|
|
||||||
atool,
|
atool,
|
||||||
makeBinaryWrapper,
|
makeBinaryWrapper,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
@ -15,14 +14,14 @@
|
|||||||
p7zip,
|
p7zip,
|
||||||
unrar,
|
unrar,
|
||||||
lha,
|
lha,
|
||||||
unfree ? false,
|
unfree ? false }:
|
||||||
}: let
|
let
|
||||||
wrappedPath = lib.makeBinPath ([lzip plzip lzop xz zip unzip arj rpm cpio p7zip] ++ lib.optionals unfree [unrar lha]);
|
wrappedPath = lib.makeBinPath ([lzip plzip lzop xz zip unzip arj rpm cpio p7zip] ++ lib.optionals unfree [unrar lha]);
|
||||||
in
|
in
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "atool-wrapped";
|
name = "atool-wrapped";
|
||||||
phases = ["installPhase"];
|
phases = [ "installPhase" ];
|
||||||
nativeBuildInputs = [makeBinaryWrapper];
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||||
src = ./.;
|
src = ./.;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
# symlinking them doesn't work for some reason so i have to build multiple
|
# symlinking them doesn't work for some reason so i have to build multiple
|
||||||
@ -35,4 +34,4 @@ in
|
|||||||
mkdir -p "$out/share"
|
mkdir -p "$out/share"
|
||||||
ln -s "${atool}/share/man" "$out/share/man"
|
ln -s "${atool}/share/man" "$out/share/man"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
{pkgs ? import <nixpkgs> {}}: let
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
let
|
||||||
rofi-dmenu-wrapped = pkgs.writeShellScript "rofi-dmenu" ''
|
rofi-dmenu-wrapped = pkgs.writeShellScript "rofi-dmenu" ''
|
||||||
exec "${pkgs.rofi-wayland}/bin/rofi" -dmenu "$@"
|
exec "${pkgs.rofi-wayland}/bin/rofi" -dmenu "$@"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export COMMA_PICKER="${rofi-dmenu-wrapped}"
|
export COMMA_PICKER="${rofi-dmenu-wrapped}"
|
||||||
'';
|
'';
|
||||||
@ -12,4 +13,4 @@ in
|
|||||||
libnotify
|
libnotify
|
||||||
comma
|
comma
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
buildNpmPackage,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}:
|
|
||||||
buildNpmPackage rec {
|
|
||||||
pname = "cross-seed";
|
|
||||||
version = "6.11.2";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "cross-seed";
|
|
||||||
repo = "cross-seed";
|
|
||||||
rev = "v${version}";
|
|
||||||
hash = "sha256-m/TlEAW9BFEXOvBixOj09ylgstgHKL48e9zC50fzD5g=";
|
|
||||||
};
|
|
||||||
|
|
||||||
npmDepsHash = "sha256-c8wTvEA7QQb17gBHdBKMUatn8I/wKOhXP1W5ftH3pJc=";
|
|
||||||
}
|
|
@ -1,15 +1,16 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
inherit (pkgs) callPackage callPackages;
|
inherit (pkgs) callPackage callPackages;
|
||||||
|
|
||||||
mopidyPackages = callPackages ./mopidy {
|
mopidyPackages = callPackages ./mopidy {
|
||||||
python = pkgs.python3;
|
python = pkgs.python3;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
inherit (mopidyPackages) mopidy-autoplay;
|
{
|
||||||
google-fonts = callPackage ./google-fonts {};
|
inherit (mopidyPackages) mopidy-autoplay ;
|
||||||
wm-helpers = callPackage ./wm-helpers {};
|
google-fonts = callPackage ./google-fonts { };
|
||||||
atool = callPackage ./atool-wrapped {};
|
wm-helpers = callPackage ./wm-helpers { };
|
||||||
nixfiles-assets = callPackage ./nixfiles-assets {};
|
atool = callPackage ./atool-wrapped { };
|
||||||
redlib = callPackage ./redlib {};
|
nixfiles-assets = callPackage ./nixfiles-assets { };
|
||||||
cross-seed = callPackage ./cross-seed {};
|
redlib = callPackage ./redlib { };
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{ lib
|
||||||
lib,
|
, stdenvNoCC
|
||||||
stdenvNoCC,
|
, fetchFromGitHub
|
||||||
fetchFromGitHub,
|
, fonts ? []
|
||||||
fonts ? [],
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
pname = "google-fonts";
|
pname = "google-fonts";
|
||||||
version = "unstable-2023-10-20";
|
version = "unstable-2023-10-20";
|
||||||
@ -11,7 +11,7 @@ stdenvNoCC.mkDerivation {
|
|||||||
# Adobe Blank is split out in a separate output,
|
# Adobe Blank is split out in a separate output,
|
||||||
# because it causes crashes with `libfontconfig`.
|
# because it causes crashes with `libfontconfig`.
|
||||||
# It has an absurd number of symbols
|
# It has an absurd number of symbols
|
||||||
outputs = ["out" "adobeBlank"];
|
outputs = [ "out" "adobeBlank" ];
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "google";
|
owner = "google";
|
||||||
@ -45,32 +45,26 @@ stdenvNoCC.mkDerivation {
|
|||||||
# FamilyName.ttf. This installs all fonts if fonts is empty and otherwise
|
# FamilyName.ttf. This installs all fonts if fonts is empty and otherwise
|
||||||
# only the specified fonts by FamilyName.
|
# only the specified fonts by FamilyName.
|
||||||
fonts = map (font: builtins.replaceStrings [" "] [""] font) fonts;
|
fonts = map (font: builtins.replaceStrings [" "] [""] font) fonts;
|
||||||
installPhase =
|
installPhase = ''
|
||||||
''
|
|
||||||
adobeBlankDest=$adobeBlank/share/fonts/truetype
|
adobeBlankDest=$adobeBlank/share/fonts/truetype
|
||||||
install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf
|
install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf
|
||||||
rm -r ofl/adobeblank
|
rm -r ofl/adobeblank
|
||||||
dest=$out/share/fonts/truetype
|
dest=$out/share/fonts/truetype
|
||||||
''
|
'' + (if fonts == [] then ''
|
||||||
+ (
|
|
||||||
if fonts == []
|
|
||||||
then ''
|
|
||||||
find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' +
|
find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' +
|
||||||
''
|
'' else ''
|
||||||
else ''
|
|
||||||
for font in $fonts; do
|
for font in $fonts; do
|
||||||
find . \( -name "$font-*.ttf" -o -name "$font[*.ttf" -o -name "$font.ttf" \) -exec install -m 444 -Dt $dest '{}' +
|
find . \( -name "$font-*.ttf" -o -name "$font[*.ttf" -o -name "$font.ttf" \) -exec install -m 444 -Dt $dest '{}' +
|
||||||
done
|
done
|
||||||
''
|
'');
|
||||||
);
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://fonts.google.com";
|
homepage = "https://fonts.google.com";
|
||||||
description = "Font files available from Google Fonts";
|
description = "Font files available from Google Fonts";
|
||||||
license = with licenses; [asl20 ofl ufl];
|
license = with licenses; [ asl20 ofl ufl ];
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
hydraPlatforms = [];
|
hydraPlatforms = [];
|
||||||
maintainers = with maintainers; [manveru];
|
maintainers = with maintainers; [ manveru ];
|
||||||
sourceProvenance = [sourceTypes.binaryBytecode];
|
sourceProvenance = [ sourceTypes.binaryBytecode ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.nixfiles.outputs.packages;
|
|
||||||
inherit (lib) mapAttrs mkEnableOption mkIf;
|
|
||||||
in {
|
|
||||||
options.nixfiles.outputs.packages = {
|
|
||||||
enable =
|
|
||||||
mkEnableOption ""
|
|
||||||
// {
|
|
||||||
description = ''
|
|
||||||
Whether to generate the packages output.
|
|
||||||
'';
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
perSystem = {
|
|
||||||
system,
|
|
||||||
inputs',
|
|
||||||
self',
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
packages = let
|
|
||||||
inherit (pkgs) callPackage callPackages;
|
|
||||||
|
|
||||||
# i forget how this works so i'm not messing with it.
|
|
||||||
mopidyPackages = callPackages ./mopidy {
|
|
||||||
python = pkgs.python3;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(mapAttrs (_: v: callPackage v {}) {
|
|
||||||
google-fonts = ./google-fonts;
|
|
||||||
wm-helpers = ./wm-helpers;
|
|
||||||
atool = ./atool-wrapped;
|
|
||||||
nixfiles-assets = ./nixfiles-assets;
|
|
||||||
redlib = ./redlib;
|
|
||||||
cross-seed = ./cross-seed;
|
|
||||||
})
|
|
||||||
// {
|
|
||||||
inherit (mopidyPackages) mopidy-autoplay;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
buildNimPackage,
|
|
||||||
curl,
|
|
||||||
gtk4,
|
|
||||||
libadwaita,
|
|
||||||
pkg-config,
|
|
||||||
openssl,
|
|
||||||
xorg,
|
|
||||||
libxkbcommon,
|
|
||||||
libGL,
|
|
||||||
wayland,
|
|
||||||
wayland-protocols,
|
|
||||||
wayland-scanner,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}:
|
|
||||||
buildNimPackage (finalAttrs: {
|
|
||||||
pname = "lucem";
|
|
||||||
version = "2.1.2";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "xTrayambak";
|
|
||||||
repo = "lucem";
|
|
||||||
tag = finalAttrs.version;
|
|
||||||
hash = "sha256-9i7YMXG6hXMcQmVdPYX+YxrtQPHZE1RZb+gv5dGEff8=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./lucem-disable-auto-updater.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
lockFile = ./lock.json;
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
gtk4.dev
|
|
||||||
libadwaita.dev
|
|
||||||
openssl.dev
|
|
||||||
curl.dev
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libXcursor.dev
|
|
||||||
xorg.libXrender
|
|
||||||
xorg.libXext
|
|
||||||
libxkbcommon.dev
|
|
||||||
libGL.dev
|
|
||||||
wayland.dev
|
|
||||||
wayland-protocols
|
|
||||||
wayland-scanner.dev
|
|
||||||
];
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
|
|
||||||
# env.LD_LIBRARY_PATH = lib.makeLibraryPath [
|
|
||||||
# gtk4.dev
|
|
||||||
# libadwaita.dev
|
|
||||||
# pkg-config
|
|
||||||
# curl.dev
|
|
||||||
# openssl.dev
|
|
||||||
# wayland.dev
|
|
||||||
# ];
|
|
||||||
})
|
|
@ -1,291 +0,0 @@
|
|||||||
{
|
|
||||||
"depends": [
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/n3pckbrnpfnlcm7n0c5i75lgl47ghgha-source",
|
|
||||||
"rev": "d9ee0328d5cec8fd216d3ce8676cebf1976e9272",
|
|
||||||
"sha256": "02wq4wad7r517rls5n1i9gww9a138a20kiy3d2ax723s3h6s0srg",
|
|
||||||
"url": "https://github.com/4zv4l/colored_logger/archive/d9ee0328d5cec8fd216d3ce8676cebf1976e9272.tar.gz",
|
|
||||||
"ref": "HEAD",
|
|
||||||
"packages": [
|
|
||||||
"colored_logger"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/bzcq8q439rdsqhhihikzv3rsx4l4ybdm-source",
|
|
||||||
"rev": "ea811bec7fa50f5abd3088ba94cda74285e93f18",
|
|
||||||
"sha256": "1720iqsxjhqmhw1zhhs7d2ncdz25r8fqadls1p1iry1wfikjlnba",
|
|
||||||
"url": "https://github.com/treeform/jsony/archive/ea811bec7fa50f5abd3088ba94cda74285e93f18.tar.gz",
|
|
||||||
"ref": "1.1.5",
|
|
||||||
"packages": [
|
|
||||||
"jsony"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/f3ghbm17akdg7dj5sarr616hvma09dr5-source",
|
|
||||||
"rev": "fea85b27f0badcf617033ca1bc05444b5fd8aa7a",
|
|
||||||
"sha256": "1m96c3k83sj1z2vgjp55fplzf0kym6hhhym4ywydjl9x4zw1a5la",
|
|
||||||
"url": "https://github.com/status-im/nim-toml-serialization/archive/fea85b27f0badcf617033ca1bc05444b5fd8aa7a.tar.gz",
|
|
||||||
"ref": "HEAD",
|
|
||||||
"packages": [
|
|
||||||
"toml_serialization"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/idsbhi7xb4dmfqbmbl5dq47qh2vs6mjj-source",
|
|
||||||
"rev": "9e770046c5cdf23d395d6b21c4657345481b1c76",
|
|
||||||
"sha256": "1li0r6ng3ynzh5qb12qs6czmaaay7gw45khs2niz291nia6navl1",
|
|
||||||
"url": "https://github.com/treeform/pretty/archive/9e770046c5cdf23d395d6b21c4657345481b1c76.tar.gz",
|
|
||||||
"ref": "0.2.0",
|
|
||||||
"packages": [
|
|
||||||
"pretty"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/ax2p5d7wz6ipj0y2zpd9rckzzj7a6f0q-source",
|
|
||||||
"rev": "861092dc931e754650a735af590fbc34becc3942",
|
|
||||||
"sha256": "100vxxdpzayj44syfkwn5nrpk5189qiky43xh7w3k908yxrq0jbj",
|
|
||||||
"url": "https://github.com/can-lehmann/owlkettle/archive/861092dc931e754650a735af590fbc34becc3942.tar.gz",
|
|
||||||
"ref": "v3.0.0",
|
|
||||||
"packages": [
|
|
||||||
"owlkettle"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/y4f3wxlh76h10kflz7vqmkd4vniqp6kw-source",
|
|
||||||
"rev": "309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81",
|
|
||||||
"sha256": "0b7givvg0lij4qkv8xpisp0ahcadggavpb85jds5z5k19palh74c",
|
|
||||||
"url": "https://github.com/nimgl/nimgl/archive/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81.tar.gz",
|
|
||||||
"ref": "1.3.2",
|
|
||||||
"packages": [
|
|
||||||
"nimgl"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/nqnhn3vpi49aj4pn722c1qpinnzq056b-source",
|
|
||||||
"rev": "7b4266458b7435349b28a4468e0af58f1674b198",
|
|
||||||
"sha256": "12j4rzlxpibxy2jfah21qj1lf63rbkkki971y5i52dmnp84bhjzp",
|
|
||||||
"url": "https://github.com/treeform/netty/archive/7b4266458b7435349b28a4468e0af58f1674b198.tar.gz",
|
|
||||||
"ref": "0.2.1",
|
|
||||||
"packages": [
|
|
||||||
"netty"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/cbzq2fmn5582kqx3w9ima7ll4x19cmx1-source",
|
|
||||||
"rev": "a0f42baacbc48f4e5924b18854c0df9dcc251466",
|
|
||||||
"sha256": "0033kxrh8s3wmmh5ky6vlbjk2mq3c3vy0syvl5rwah2zmg0k6wzf",
|
|
||||||
"url": "https://github.com/guzba/curly/archive/a0f42baacbc48f4e5924b18854c0df9dcc251466.tar.gz",
|
|
||||||
"ref": "1.1.1",
|
|
||||||
"packages": [
|
|
||||||
"curly"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/nzqdyy9q0q0rrlpmjmihrq084nyskidd-source",
|
|
||||||
"rev": "44dc097236de00c09ffed13d4e4aeaff1473870e",
|
|
||||||
"sha256": "0m7bdiz3dnmdb5cc8k4sksmb71mlg1n75582zv5hhvp2jsj9sxsa",
|
|
||||||
"url": "https://github.com/johnnovak/nim-nanovg/archive/44dc097236de00c09ffed13d4e4aeaff1473870e.tar.gz",
|
|
||||||
"ref": "v0.4.0",
|
|
||||||
"packages": [
|
|
||||||
"nanovg"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/85w9njq4kkp7cjhz40bmmksiv0053p50-source",
|
|
||||||
"rev": "9ce9aa3efa84f55bbf3d29ef0517b2411d08a357",
|
|
||||||
"sha256": "1lm4iynl0c8hzizwc723b29ss6cw78hhr6k62a7x7ddycmxyxsnm",
|
|
||||||
"url": "https://github.com/levovix0/siwin/archive/9ce9aa3efa84f55bbf3d29ef0517b2411d08a357.tar.gz",
|
|
||||||
"packages": [
|
|
||||||
"siwin"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/dvv6cgzl9xmax5rmjxnp5wrr08ibvjaw-source",
|
|
||||||
"rev": "8e2e098f82dc5eefd874488c37b5830233cd18f4",
|
|
||||||
"sha256": "01csz5bl4jiv7jx76k7izgknl7k73y2i9hd9s6brlhfqhq7cqxmz",
|
|
||||||
"url": "https://github.com/nim-lang/opengl/archive/8e2e098f82dc5eefd874488c37b5830233cd18f4.tar.gz",
|
|
||||||
"ref": "1.2.9",
|
|
||||||
"packages": [
|
|
||||||
"opengl"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/h98460b96pynrpwxawaq21w6rjhamlvi-source",
|
|
||||||
"rev": "ec7732a4810441a937fe3059494ba338090c4957",
|
|
||||||
"sha256": "0dw33jprxrc23bj0b6ypbg6n940nzxlrxa57df88q4ly1xvi6w1h",
|
|
||||||
"url": "https://github.com/euantorano/semver.nim/archive/ec7732a4810441a937fe3059494ba338090c4957.tar.gz",
|
|
||||||
"ref": "v1.2.3",
|
|
||||||
"packages": [
|
|
||||||
"semver"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/d6c7dvmzzvc1ja7kf65jbclbjv74zll7-source",
|
|
||||||
"rev": "2086c99608b4bf472e1ef5fe063710f280243396",
|
|
||||||
"sha256": "1m7c9bvxarw167kd5mpfnddzydji03azhz347hvad592qfw4vwrc",
|
|
||||||
"url": "https://github.com/status-im/nim-serialization/archive/2086c99608b4bf472e1ef5fe063710f280243396.tar.gz",
|
|
||||||
"ref": "v0.2.6",
|
|
||||||
"packages": [
|
|
||||||
"serialization"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/a5kmnnbk27rxk9vsx1vchiiq9znkpijf-source",
|
|
||||||
"rev": "79e4fa5a9d3374db17ed63622714d3e1094c7f34",
|
|
||||||
"sha256": "0x92sgnxczwx5ak067d6169j9qm0cdpbrcpp1ijrzgyfgknpyq0r",
|
|
||||||
"url": "https://github.com/status-im/nim-stew/archive/79e4fa5a9d3374db17ed63622714d3e1094c7f34.tar.gz",
|
|
||||||
"ref": "v0.2.0",
|
|
||||||
"packages": [
|
|
||||||
"stew"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/vx0a8hw7hs5an0dnbrn6l16bd6is7hdr-source",
|
|
||||||
"rev": "07f6ba8ab96238e5bd1264cf0cea1d1746abb00c",
|
|
||||||
"sha256": "005nrldaasfl09zdsni1vi8s7dk0y85ijv6rm2wpj94435x66s36",
|
|
||||||
"url": "https://github.com/treeform/flatty/archive/07f6ba8ab96238e5bd1264cf0cea1d1746abb00c.tar.gz",
|
|
||||||
"ref": "0.3.4",
|
|
||||||
"packages": [
|
|
||||||
"flatty"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/bqmdy8vic5wfvpc9hqp4rfrhjlxz4d7c-source",
|
|
||||||
"rev": "45b2b0bb753fe2376a205a183b2b3f291e19ba14",
|
|
||||||
"sha256": "1yz1lcclmhvji34ccymglzg535b3xfz0x4m12n3n22cxz156j63x",
|
|
||||||
"url": "https://github.com/Araq/libcurl/archive/45b2b0bb753fe2376a205a183b2b3f291e19ba14.tar.gz",
|
|
||||||
"ref": "v1.0.0",
|
|
||||||
"packages": [
|
|
||||||
"libcurl"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/zcd2hmjxlkp1bpb7c9xrpg153ssj3w0b-source",
|
|
||||||
"rev": "a99f6a7d8a8e3e0213b3cad0daf0ea974bf58e3f",
|
|
||||||
"sha256": "16qdnyql8d7nm7nwwpq0maflm3p6cpbb2jfaqx6xkld9xkc9lsbv",
|
|
||||||
"url": "https://github.com/guzba/zippy/archive/a99f6a7d8a8e3e0213b3cad0daf0ea974bf58e3f.tar.gz",
|
|
||||||
"ref": "0.10.16",
|
|
||||||
"packages": [
|
|
||||||
"zippy"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/4q986rlniaxascxkvx4q8rsx12frjd51-source",
|
|
||||||
"rev": "325d6ade0970562bee7d7d53961a2c3287f0c4bc",
|
|
||||||
"sha256": "0qa8hzvamsdszygra3lcc92zk6rzm3gh1mzgjq9khbanzbg3y67n",
|
|
||||||
"url": "https://github.com/treeform/webby/archive/325d6ade0970562bee7d7d53961a2c3287f0c4bc.tar.gz",
|
|
||||||
"ref": "0.2.1",
|
|
||||||
"packages": [
|
|
||||||
"webby"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/lk4hcmvwvliliyyidx7k3fk9yfijddc5-source",
|
|
||||||
"rev": "b2e71179174e040884ebf6a16cbac711c84620b9",
|
|
||||||
"sha256": "0pi6cq43ysm1wy5vva3i2dqvyh4dqppjjjl04yj9wfq7mngpqaa1",
|
|
||||||
"url": "https://github.com/treeform/chroma/archive/b2e71179174e040884ebf6a16cbac711c84620b9.tar.gz",
|
|
||||||
"ref": "0.2.7",
|
|
||||||
"packages": [
|
|
||||||
"chroma"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/f9dp6njaay5rf32f6l9gkw0dm25gim47-source",
|
|
||||||
"rev": "7282ae1247f2f384ebeaec3826d7fa38fd0e1df1",
|
|
||||||
"sha256": "1plw9lfrm42qar01rnjhm0d9mkzsc7c3b8kz43w5pb8j8drx1lyn",
|
|
||||||
"url": "https://github.com/treeform/vmath/archive/7282ae1247f2f384ebeaec3826d7fa38fd0e1df1.tar.gz",
|
|
||||||
"ref": "2.0.0",
|
|
||||||
"packages": [
|
|
||||||
"vmath"
|
|
||||||
],
|
|
||||||
"srcDir": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/8qaywzr8nzsiddjba77nhf75hzmxx0d9-source",
|
|
||||||
"rev": "29aca5e519ebf5d833f63a6a2769e62ec7bfb83a",
|
|
||||||
"sha256": "16npqgmi2qawjxaddj9ax15rfpdc7sqc37i2r5vg23lyr6znq4wc",
|
|
||||||
"url": "https://github.com/nim-lang/x11/archive/29aca5e519ebf5d833f63a6a2769e62ec7bfb83a.tar.gz",
|
|
||||||
"ref": "1.2",
|
|
||||||
"packages": [
|
|
||||||
"x11"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/cxdwn7p4cis5hd5w4jsn8lql5vzx5civ-source",
|
|
||||||
"rev": "2b08c774afaafd600cf4c6f994cf78b8aa090c0c",
|
|
||||||
"sha256": "10zl9a5phdsjj811v8by0yzadfc8d3azaj878an2hr8qsfi9y1ps",
|
|
||||||
"url": "https://github.com/status-im/nim-faststreams/archive/2b08c774afaafd600cf4c6f994cf78b8aa090c0c.tar.gz",
|
|
||||||
"ref": "HEAD",
|
|
||||||
"packages": [
|
|
||||||
"faststreams"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/2ksmfd7p93a1a7ibcv3qzsk8h3c3shz7-source",
|
|
||||||
"rev": "845b6af28b9f68f02d320e03ad18eccccea7ddb9",
|
|
||||||
"sha256": "1c55kl05pbavm9v5dv42n43sql9qcrblhh3hnp99p5xmlv20c9vf",
|
|
||||||
"url": "https://github.com/status-im/nim-unittest2/archive/845b6af28b9f68f02d320e03ad18eccccea7ddb9.tar.gz",
|
|
||||||
"ref": "v0.2.3",
|
|
||||||
"packages": [
|
|
||||||
"unittest2"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"method": "fetchzip",
|
|
||||||
"path": "/nix/store/17gj9sw2hw818cbxvd6i94n734inm1vf-source",
|
|
||||||
"rev": "df8113dda4c2d74d460a8fa98252b0b771bf1f27",
|
|
||||||
"sha256": "1h7amas16sbhlr7zb7n3jb5434k98ji375vzw72k1fsc86vnmcr9",
|
|
||||||
"url": "https://github.com/arnetheduck/nim-results/archive/df8113dda4c2d74d460a8fa98252b0b771bf1f27.tar.gz",
|
|
||||||
"ref": "v0.5.1",
|
|
||||||
"packages": [
|
|
||||||
"results"
|
|
||||||
],
|
|
||||||
"srcDir": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/src/config.nim b/src/config.nim
|
|
||||||
index 64e4370..92aee9a 100644
|
|
||||||
--- a/src/config.nim
|
|
||||||
+++ b/src/config.nim
|
|
||||||
@@ -32,7 +32,7 @@ type
|
|
||||||
|
|
||||||
LucemConfig* = object
|
|
||||||
discord_rpc*: bool = false
|
|
||||||
- auto_updater*: bool = true
|
|
||||||
+ auto_updater*: bool = false
|
|
||||||
notify_server_region*: bool = true
|
|
||||||
loading_screen*: bool = true
|
|
||||||
polling_delay*: uint = 100
|
|
@ -1,90 +0,0 @@
|
|||||||
diff --git a/src/nim_lk.nim b/src/nim_lk.nim
|
|
||||||
index 2b8b0bc..68d8b64 100644
|
|
||||||
--- a/src/nim_lk.nim
|
|
||||||
+++ b/src/nim_lk.nim
|
|
||||||
@@ -4,7 +4,7 @@
|
|
||||||
# https://cyclonedx.org/docs/1.6/json/
|
|
||||||
|
|
||||||
import
|
|
||||||
- std/[algorithm, deques, httpclient, json, options, os, osproc, parseutils, parseopt, streams, strutils, tables, uri],
|
|
||||||
+ std/[algorithm, deques, httpclient, json, options, os, osproc, parseutils, parseopt, streams, strutils, tables, uri, re],
|
|
||||||
pkg/nimblepkg/options,
|
|
||||||
pkg/nimblepkg/packageinfo,
|
|
||||||
pkg/nimblepkg/packageinfotypes,
|
|
||||||
@@ -89,6 +89,13 @@ proc startProcess(cmd: string; cmdArgs: varargs[string]): Process =
|
|
||||||
type GitPair = object
|
|
||||||
`ref`, `rev`: string
|
|
||||||
|
|
||||||
+proc cleanVersion(version: string): string =
|
|
||||||
+ let pattern = re"^v?(\d+\.\d+\.\d+.*)$" # Captures valid semantic versions
|
|
||||||
+ var matches: array[1, string]
|
|
||||||
+ if version.find(pattern, matches) >= 0:
|
|
||||||
+ return matches[0]
|
|
||||||
+ return version
|
|
||||||
+
|
|
||||||
proc gitLsRemote(url: string; tagsArg = false): seq[GitPair] =
|
|
||||||
var line, rev, refer: string
|
|
||||||
var process =
|
|
||||||
@@ -104,12 +111,15 @@ proc gitLsRemote(url: string; tagsArg = false): seq[GitPair] =
|
|
||||||
const
|
|
||||||
refsTags = "refs/tags/"
|
|
||||||
headsTags = "refs/heads/"
|
|
||||||
+ headRef = "HEAD"
|
|
||||||
if refer.startsWith(refsTags):
|
|
||||||
refer.removePrefix(refsTags)
|
|
||||||
result.add GitPair(`ref`: refer, `rev`: rev)
|
|
||||||
elif refer.startsWith(headsTags):
|
|
||||||
refer.removePrefix(headsTags)
|
|
||||||
result.add GitPair(`ref`: refer, `rev`: rev)
|
|
||||||
+ elif refer == headRef:
|
|
||||||
+ result.add GitPair(`ref`: refer, `rev`: rev)
|
|
||||||
stderr.write(process.errorStream.readAll)
|
|
||||||
close(process)
|
|
||||||
if tagsArg and result.len == 0:
|
|
||||||
@@ -120,22 +130,40 @@ proc matchRev(url: string; wanted: VersionRange): GitPair =
|
|
||||||
let special = $wanted.spe
|
|
||||||
if special[0] == '#':
|
|
||||||
result.rev = special[1..special.high]
|
|
||||||
+ return # early return
|
|
||||||
else:
|
|
||||||
quit("unhandled version " & url & " " & $wanted)
|
|
||||||
else:
|
|
||||||
let withTags = wanted.kind != verAny
|
|
||||||
let pairs = gitLsRemote(url, withTags)
|
|
||||||
var resultVersion: Version
|
|
||||||
+ var latestTag: GitPair
|
|
||||||
+
|
|
||||||
for pair in pairs:
|
|
||||||
try:
|
|
||||||
- var tagVer = pair.`ref`.newVersion
|
|
||||||
- if tagVer.withinRange(wanted) and resultVersion < tagVer:
|
|
||||||
+ var tagVer = cleanVersion(pair.`ref`).newVersion
|
|
||||||
+ if (tagVer.withinRange(wanted) or not withTags) and resultVersion < tagVer:
|
|
||||||
resultVersion = tagVer
|
|
||||||
- result = pair
|
|
||||||
+ latestTag = pair
|
|
||||||
except ParseVersionError: discard
|
|
||||||
- if result.rev == "" and pairs.len > 0:
|
|
||||||
- result = pairs[pairs.high]
|
|
||||||
- doAssert result.rev != "", url
|
|
||||||
+
|
|
||||||
+ if latestTag.rev != "":
|
|
||||||
+ result = latestTag
|
|
||||||
+ return # early return
|
|
||||||
+
|
|
||||||
+ let headPairs = gitLsRemote(url, false)
|
|
||||||
+ var headPair: GitPair
|
|
||||||
+
|
|
||||||
+ for pair in headPairs:
|
|
||||||
+ if pair.`ref` == "HEAD":
|
|
||||||
+ headPair = pair
|
|
||||||
+
|
|
||||||
+ if headPair.rev != "":
|
|
||||||
+ result = headPair
|
|
||||||
+ return # early return
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ doAssert false, "No matching revision found for " & url
|
|
||||||
|
|
||||||
proc collectMetadata(data: JsonNode) =
|
|
||||||
let storePath = data{"path"}.getStr
|
|
@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
nixpkgs ? <nixpkgs>,
|
|
||||||
pkgs ? (import nixpkgs) {},
|
|
||||||
}: let
|
|
||||||
inherit (pkgs) callPackage fetchFromSourcehut fetchFromGitHub lib;
|
|
||||||
inherit (lib) escapeShellArg;
|
|
||||||
|
|
||||||
lucem = pkgs.callPackage ./. {};
|
|
||||||
|
|
||||||
nim_lk_patched = pkgs.nim_lk.overrideAttrs (final: prev: {
|
|
||||||
src = pkgs.fetchFromSourcehut {
|
|
||||||
owner = "~ehmry";
|
|
||||||
repo = "nim_lk";
|
|
||||||
rev = "c2d601095d1961d8f59f1fffe5b56788b255c3de";
|
|
||||||
hash = "sha256-1WD1UVi6N7tftE69LAhx86Qxc97oMHKARFsCVGqtEm4=";
|
|
||||||
};
|
|
||||||
patches = [
|
|
||||||
./nim_lk-rev-order-fix.patch
|
|
||||||
];
|
|
||||||
});
|
|
||||||
in
|
|
||||||
pkgs.stdenvNoCC.mkDerivation {
|
|
||||||
name = "lucem-lock.json";
|
|
||||||
|
|
||||||
src = lucem.src;
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
nim_lk_patched
|
|
||||||
nix-prefetch-git
|
|
||||||
nix
|
|
||||||
# cacert
|
|
||||||
git
|
|
||||||
];
|
|
||||||
|
|
||||||
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
find .
|
|
||||||
nim_lk > $out
|
|
||||||
'';
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [./legacy-module.nix];
|
|
||||||
config = {
|
|
||||||
perSystem = {
|
|
||||||
system,
|
|
||||||
inputs',
|
|
||||||
self',
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
packages = {
|
|
||||||
lucem = pkgs.callPackage ./lucem {};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
flake = {
|
|
||||||
overlays.new-packages = final: prev: let
|
|
||||||
inherit (final) callPackage;
|
|
||||||
currentSystem = config.perSystem "${prev.system}";
|
|
||||||
flakePackages = currentSystem.packages;
|
|
||||||
addPackages = packages: lib.genAttrs packages (package: callPackage flakePackages.${package}.override {});
|
|
||||||
in
|
|
||||||
addPackages [
|
|
||||||
"lucem"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,9 +1,5 @@
|
|||||||
{
|
{ lib, python3Packages, fetchPypi, mopidy }:
|
||||||
lib,
|
|
||||||
python3Packages,
|
|
||||||
fetchPypi,
|
|
||||||
mopidy,
|
|
||||||
}:
|
|
||||||
# based on mopidy/jellyfin.nix
|
# based on mopidy/jellyfin.nix
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "mopidy-autoplay";
|
pname = "mopidy-autoplay";
|
||||||
@ -15,11 +11,11 @@ python3Packages.buildPythonApplication rec {
|
|||||||
sha256 = "sha256-E2Q+Cn2LWSbfoT/gFzUfChwl67Mv17uKmX2woFz/3YM=";
|
sha256 = "sha256-E2Q+Cn2LWSbfoT/gFzUfChwl67Mv17uKmX2woFz/3YM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [mopidy];
|
propagatedBuildInputs = [ mopidy ];
|
||||||
|
|
||||||
# no tests implemented
|
# no tests implemented
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
pythonImportsCheck = ["mopidy_autoplay"];
|
pythonImportsCheck = [ "mopidy_autoplay" ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://codeberg.org/sph/mopidy-autoplay";
|
homepage = "https://codeberg.org/sph/mopidy-autoplay";
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
{
|
{ lib, newScope, python }:
|
||||||
lib,
|
|
||||||
newScope,
|
|
||||||
python,
|
|
||||||
}:
|
|
||||||
# i have no idea what this is but there's some conflict if i don't do this
|
# i have no idea what this is but there's some conflict if i don't do this
|
||||||
# based on https://github.com/NixOS/nixpkgs/blob/77f0d2095a8271fdb6e0d08c90a7d93631fd2748/pkgs/applications/audio/mopidy/default.nix
|
# based on https://github.com/NixOS/nixpkgs/blob/77f0d2095a8271fdb6e0d08c90a7d93631fd2748/pkgs/applications/audio/mopidy/default.nix
|
||||||
lib.makeScope newScope (self:
|
lib.makeScope newScope (self: with self; {
|
||||||
with self; {
|
|
||||||
inherit python;
|
inherit python;
|
||||||
pythonPackages = python.pkgs;
|
pythonPackages = python.pkgs;
|
||||||
|
|
||||||
mopidy-autoplay = callPackage ./autoplay.nix {};
|
mopidy-autoplay = callPackage ./autoplay.nix { };
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{
|
{ lib, stdenvNoCC, fetchFromGitea }:
|
||||||
lib,
|
let
|
||||||
stdenvNoCC,
|
|
||||||
fetchFromGitea,
|
|
||||||
}: let
|
|
||||||
src = fetchFromGitea {
|
src = fetchFromGitea {
|
||||||
domain = "gitea.protogen.io";
|
domain = "gitea.protogen.io";
|
||||||
owner = "nullbite";
|
owner = "nullbite";
|
||||||
@ -13,11 +10,11 @@
|
|||||||
fetchLFS = true;
|
fetchLFS = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
pname = "nixfiles-assets";
|
pname = "nixfiles-assets";
|
||||||
version = src.rev;
|
version = src.rev;
|
||||||
inherit src;
|
inherit src;
|
||||||
phases = ["installPhase"];
|
phases = [ "installPhase" ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cd $src
|
cd $src
|
||||||
pwd
|
pwd
|
||||||
@ -25,4 +22,4 @@ in
|
|||||||
mkdir -p $out/share/
|
mkdir -p $out/share/
|
||||||
cp -a wallpapers $out/share/
|
cp -a wallpapers $out/share/
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
{
|
{ lib
|
||||||
lib,
|
, stdenv
|
||||||
stdenv,
|
, cacert
|
||||||
cacert,
|
, nixosTests
|
||||||
nixosTests,
|
, rustPlatform
|
||||||
rustPlatform,
|
, fetchFromGitHub
|
||||||
fetchFromGitHub,
|
, darwin
|
||||||
darwin,
|
, nix-update-script
|
||||||
nix-update-script,
|
|
||||||
}:
|
}:
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "redlib";
|
pname = "redlib";
|
||||||
version = "0.35.1-unstable-2025-03-01";
|
version = "0.35.1-unstable-2024-12-02";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "redlib-org";
|
owner = "redlib-org";
|
||||||
repo = "redlib";
|
repo = "redlib";
|
||||||
rev = "357e7c2e096c1aa3bb871e42860dfd3be62e0bfb";
|
rev = "d7ec07cd0d713fc308e1004663b0053db8f00a0f";
|
||||||
hash = "sha256-KX76kq3AX+GI8wIulGixgS5cENlNUcrKaes1dZwRhxI=";
|
hash = "sha256-bAsSLZWGLMrD21xdQtD5NyNsNSZwLOd/+6ujZpbsyQg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
@ -25,7 +24,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
./no-hash.patch
|
./no-hash.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
cargoHash = "sha256-5cwF+pntkAwtTwerYrJOfL4NRcL8Sb7lLZiajNcvSZY=";
|
cargoHash = "sha256-5eQRioAdB1OharUwAZEuPe7NpZOFvqAyh2m+NVio8EI=";
|
||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isDarwin [
|
buildInputs = lib.optionals stdenv.isDarwin [
|
||||||
darwin.apple_sdk.frameworks.Security
|
darwin.apple_sdk.frameworks.Security
|
||||||
@ -59,16 +58,14 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
env = {
|
env = {
|
||||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
GIT_HASH = src.rev;
|
GIT_HASH=src.rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
inherit (nixosTests) redlib;
|
inherit (nixosTests) redlib;
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru.updateScript = nix-update-script {extraArgs = ["--version=branch=main"];};
|
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch=main" ]; };
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
changelog = "https://github.com/redlib-org/redlib/releases/tag/v${version}";
|
changelog = "https://github.com/redlib-org/redlib/releases/tag/v${version}";
|
||||||
@ -76,6 +73,6 @@ rustPlatform.buildRustPackage rec {
|
|||||||
homepage = "https://github.com/redlib-org/redlib";
|
homepage = "https://github.com/redlib-org/redlib";
|
||||||
license = lib.licenses.agpl3Only;
|
license = lib.licenses.agpl3Only;
|
||||||
mainProgram = "redlib";
|
mainProgram = "redlib";
|
||||||
maintainers = with lib.maintainers; [soispha];
|
maintainers = with lib.maintainers; [ soispha ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
{
|
{ pkgs, lib, cap-volume ? true, unmute ? true, ...}:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
keysetting = pkgs.writeShellScriptBin "keysetting"
|
||||||
cap-volume ? true,
|
|
||||||
unmute ? true,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
keysetting =
|
|
||||||
pkgs.writeShellScriptBin "keysetting"
|
|
||||||
''
|
''
|
||||||
wpctl=${pkgs.wireplumber}/bin/wpctl
|
wpctl=${pkgs.wireplumber}/bin/wpctl
|
||||||
notify_send=${pkgs.libnotify}/bin/notify-send
|
notify_send=${pkgs.libnotify}/bin/notify-send
|
||||||
@ -79,7 +73,7 @@
|
|||||||
esac
|
esac
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.symlinkJoin {
|
pkgs.symlinkJoin {
|
||||||
name = "wm-helpers";
|
name = "wm-helpers";
|
||||||
paths = keysetting;
|
paths = keysetting;
|
||||||
}
|
}
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 YUrFgQ NHJ5J8Bm55hgualWjQrE3v7GsCzXYksWm3yQNgYhTG0
|
|
||||||
QPX9aBltBRKywC2UKkTpZ22lle+msS/CEx5ONbLkE2o
|
|
||||||
-> ssh-rsa I7EAZw
|
|
||||||
ABgbMbRfyKaryPJpyPySIOFGdr1Wo7TREskh5tQW0fQ+6wstKxo3eP6Xr5ds3EI3
|
|
||||||
OHDR8L7Z99IC1/L7LO4lEgqfjmLFEpVSW1h5LU6CNcb6So2eLfxSNLMVk8/wnnNu
|
|
||||||
wwiPN/JlQOX/7lmvetQUG+l+CGWKrU2Sbu2uRprg9P76cT469cp93yc5uDOjs+JD
|
|
||||||
n54odFEK3NAykLSbFB++sQiV7yKkCEZLRatBNeqrombgoqpuiCakVIOOFnWwCCZA
|
|
||||||
vGOiQgXjXdMw2LAzKJEbo0EBovwD6SOTrir60bss+Axx+98JI4Vh24Jww42v9kPR
|
|
||||||
frqo+BywkFTc3oxHCn72kx9JFiLbA3fsETy4e1/+1IQlNGs2dED89/98b8Am2LEQ
|
|
||||||
gO1jPNmBc+NXymG0hkP5zAhxsqKLzz26h8BR4tXQuFTcKFs3mktYBJo2dAoQaxGD
|
|
||||||
ysfwlKRiOwKbWZxWnJJWTbVl9LfqzBwYiTF/uZSp27dp45mC6vsglLZ4TQuXkbBH
|
|
||||||
|
|
||||||
-> ssh-rsa 0pGLuA
|
|
||||||
Ny2kEOHzisMQX5k8hm1GwINjs14gRAd/AG4VZ2Mc/SY/o31xu5mZV8ThkRt3KTWj
|
|
||||||
gFN5wdt78KcuXh0U0X0YStE9QLfiBrc1q7SJ95d2dzPaO5y4hETYJBNro1MthBW2
|
|
||||||
kM1RTikBV+AwECA7belYn098anbuH7P/yLTtn1a+/N7VsH29+wAcf9R1z2zlAJuS
|
|
||||||
psk0c+IUnOiVQ2zJwzZWvjxrQ/l2XpyaF1aktNkK4TZ6/XdA/jmLzxyyEiQ2YMZv
|
|
||||||
ppzn8AAZzka53eogZiTFrDBKChM+KKrZIffsRjUZ/p+qPsvcFoUyi16gorODoTor
|
|
||||||
uo453hjR1+4OkUYgozxlbTGDfSSUH+tI2/djZM/n3jIDAbpMIyzvO8L0wSUN9cTi
|
|
||||||
+6j8rYLvpi2JFmJZ61zDkVkSVjCH6MV2h9UDkxQQb4lcBcZ0BZa0Ms7DUoLFsJm1
|
|
||||||
5SqamCS8TO8lAgmc09b0WhR9sEX5sdjW9iTH5wzCLD2GA9tzZS4m0kSMJ7raWWeR
|
|
||||||
|
|
||||||
-> ssh-rsa JoBDow
|
|
||||||
p/xk0f+UXerpduZJ0oKUG21JthAzCzHp7I5W4UiNPQbAm/oplmdXwWVFlb/gCBbZ
|
|
||||||
EF0zIPBKijvO3IiB+QylzuVET9HgFLNqKye+2LkdsBI3oAmVrhdQkQJIoGco68QF
|
|
||||||
nhz+q05KkcYs3vOg4ZyvGsVa6idIpvNN//s7VJ2ezB+yvWDIkY6zfTxFmRH6NDzo
|
|
||||||
oP4HFCBPcVXYJiVcka8rNNMHNWrhLVFnHNsTMcDvXPyXXdwSfsg/unrZ0xxnxkt+
|
|
||||||
dgjIaM8STQ9BEn+IR6TODiO8xMCUKfzlOHwHYh9xcF/j01SRJTyvYQBQLoqsaESH
|
|
||||||
2NQOr7O0jJNzIzKVlp+UjMyvLcFMmi5aa5DuAJsXj5ktk9xDZ2CiXhv0qd9Xub9d
|
|
||||||
iNFHIRAYv5SNobGhHse3htHsazHfhxcPb1gTbRwxzP0qYdwD6pD/pFc39bZg8TzP
|
|
||||||
gRlSDBHzYnqWPWkJ+LxXzIsW6e9ZKUmNzVb4eq7xhRRpNi/0WQcy0VjWMafxVv+1
|
|
||||||
|
|
||||||
-> ssh-rsa wzTCUg
|
|
||||||
qx45EE/ATHxwpxI9PuIWpiLeZbXfDHFe0ha3QReUHeiosRhKkrVm2X3a+XUqrk3C
|
|
||||||
FhhGCqDKHj13s83Aelk5xYwlP55eLew6jgCDTALkFWnneQbCxKfKgF3PFPP3vjPI
|
|
||||||
V9kGN/nhZT30xJRIKwOPm1J4pEqLAGCKHAcdmBA6kM1Xt56y0Q4r/lNeUZAEYSpt
|
|
||||||
3LscZwVizvGH9uR3GXUN/Kq2BuOIX5v/xhkltStafXyD6oto6KUntK2RJ4L8cCq5
|
|
||||||
mtTSOb6O1nzYggFxDMTkr1qXYsbweHYBODMUh0A0YeZjnVIjIzdxp3YOqNdKqLs3
|
|
||||||
5l0bYh0mKCcwovJZSeBNou48iXq0AeFuyMI88DXuak1exWZZ/Cj2lISluz48I+aI
|
|
||||||
NTktiEjCoi3M3o4EImKlBQvKCFTfExIIF0ZwX64qBK0C8jUF1jcBnbAdxqtKAHJi
|
|
||||||
r74SAQdSkLaLii9QTytQKhOeThgNMXWSgjXuDPEijXPnHy8eA9oGxAZYTSL036Nh
|
|
||||||
|
|
||||||
--- ARnFzeXFOjvL/ktngJRHn9vPrfiwnIc1n+ep5PRU4nc
|
|
||||||
ÇCLÜÝÕzPgí•ñmƒ‡ˆÜÓX¡°Kægs¨µKçn†TÔ¦÷ég±íNvÔN_43ù8ÁFîqÑ24¶mð“À“ª{ ‘S˜neëiÎ'œ Ôp«Ñ
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user