Compare commits

...

18 Commits

Author SHA1 Message Date
f532f95c13
ci: update commit message for Firefox addons update job
Some checks failed
Build devcontainers / build-devcontainers (push) Waiting to run
Cache outputs / build-custom-packages (push) Waiting to run
Check flake outputs / check-outputs (push) Waiting to run
Publish every Git push to master to FlakeHub / flakehub-publish (push) Waiting to run
Build personalized bootstrap ISO / build-iso (x86_64-linux) (push) Waiting to run
Build project site / build (push) Waiting to run
Build project site / deploy (push) Blocked by required conditions
Update Firefox addons / update-firefox-addons (push) Has been cancelled
2025-01-12 18:01:34 +08:00
171d8f797d
lib: reformat code 2025-01-12 17:57:14 +08:00
2f93b33e0c
users/foo-dogsquared/programs/dconf: add indexer locations for GNOME Shell setups 2025-01-12 17:52:59 +08:00
a4871f04b6
nixos/profiles/installer: update default application list 2025-01-12 14:55:38 +08:00
5b68cf1f04
nixos/programs/blender: update addons build step
The previous one just overwrites existing directories from previous
paths if there's any similar directory.
2025-01-12 14:55:16 +08:00
5a0f61da58
hosts/ni/setups/desktop: disable Blender addons (temporarily) 2025-01-12 14:23:12 +08:00
b6a45633c9
hosts/ni: disable xpadneo driver and add ROTP in games list 2025-01-12 14:22:37 +08:00
82926d5d73
nixos/suites/server: update default SSH config 2025-01-12 14:21:43 +08:00
2f0eafcabf
overlays/rotp-foodogsquared: init 2025-01-12 14:21:02 +08:00
1d0eb3c32c
docs: update README 2025-01-12 14:12:34 +08:00
f30be27328
users/foo-dogsquared: update Tridactyl and homepage settings 2025-01-12 14:12:13 +08:00
f5cc6f27e6
hosts/ni/services: update base domain and config 2025-01-09 12:43:38 +08:00
abcbb46cac
pkgs/go-avahi-cname: init 2025-01-07 21:29:27 +08:00
2bc63930aa
home-manager/suites/desktop: update apps list 2025-01-05 19:01:37 +08:00
41ab997c3a
apps/run-workflow-with-vm: set to allow unfree in nixpkgs config 2025-01-05 19:01:11 +08:00
861aa28201
pkgs/firefox-addons: add RSSHub Radar 2025-01-05 18:53:54 +08:00
d80611d1c4
hosts/plover/setups/development: add Open-ISCSI server 2025-01-04 15:32:57 +08:00
aad18bfe2a
users/foo-dogsquared: update homepage links and layout 2025-01-04 15:32:18 +08:00
62 changed files with 1500 additions and 596 deletions

View File

@ -24,5 +24,5 @@ jobs:
run: nix develop --impure -c mozilla-addons-to-nix pkgs/firefox-addons/firefox-addons.json pkgs/firefox-addons/default.nix run: nix develop --impure -c mozilla-addons-to-nix pkgs/firefox-addons/firefox-addons.json pkgs/firefox-addons/default.nix
- uses: stefanzweifel/git-auto-commit-action@v5 - uses: stefanzweifel/git-auto-commit-action@v5
with: with:
commit_message: "firefox-addons: update as of ${{ steps.metadata.outputs.DATE }}" commit_message: "pkgs/firefox-addons: update as of ${{ steps.metadata.outputs.DATE }}"
file_pattern: pkgs/firefox-addons/ file_pattern: pkgs/firefox-addons/

View File

@ -191,7 +191,7 @@ Sudden changes can happen at any point.
This has been moved into its own dedicated page at the website. This has been moved into its own dedicated page at the website.
But still, we'll list it here. But still, we'll list it here.
include::./docs/content/en-US/08-acknowledgement/index.adoc[tag=acknowledgement] include::./docs/website/content/en/08-acknowledgement/index.adoc[tag=acknowledgement]

View File

@ -47,6 +47,8 @@ import <nixpkgs/nixos/lib/eval-config.nix> {
]; ];
config = { config = {
nixpkgs.config.allowUnfree = true;
# Enable the display manager of choice. # Enable the display manager of choice.
services.displayManager.enable = true; services.displayManager.enable = true;
services.xserver.displayManager.gdm.enable = true; services.xserver.displayManager.gdm.enable = true;

View File

@ -23,6 +23,7 @@ set update.nativeinstallcmd echo
" Additional and modified keybindings. " Additional and modified keybindings.
bind yt tabduplicate bind yt tabduplicate
bind yf hint -y
bind gK elementunhide bind gK elementunhide
@ -33,6 +34,14 @@ bind gR reader --tab
unbind d unbind d
bind dd tabclose bind dd tabclose
unbind f
unbind F
bind ff hint
bind fF hint -t
bind fB hint -b
bind fI hint -I
bind fz hint -z
" Recontaining them nicefully. " Recontaining them nicefully.
bind qQ recontain Personal bind qQ recontain Personal
bind qW recontain Work bind qW recontain Work

View File

@ -53,6 +53,7 @@ flavorText = "No matter how hard I try, it's pretty crap"
textOnly = true textOnly = true
links = [ links = [
{ url = "https://app.diagrams.net/", text = "lazy way of drawing things" }, { url = "https://app.diagrams.net/", text = "lazy way of drawing things" },
{ url = "https://penpot.app", text = "Penpot" },
{ url = "https://figma.com", text = "Figma..." }, { url = "https://figma.com", text = "Figma..." },
{ url = "https://www.awwwards.com/", text = "Awwwards" }, { url = "https://www.awwwards.com/", text = "Awwwards" },
{ url = "https://dribbble.com", text = "Dribbble" }, { url = "https://dribbble.com", text = "Dribbble" },
@ -89,3 +90,17 @@ links = [
] ]
icon.iconset = "material-design-icons" icon.iconset = "material-design-icons"
icon.name = "skull-crossbones" icon.name = "skull-crossbones"
[Business]
name = "Business"
flavorText = "Let's get down to bidness"
textOnly = true
weight = 25
links = [
{ url = "https://webmail.foodogsquared.one", text = "Mail" },
{ url = "https://microsoft365.com/", text = "Microsoft 365" },
{ url = "https://messenger.com/", text = "Messenger" },
{ url = "https://discord.com/", text = "Discord" },
]
icon.iconset = "material-design-icons"
icon.name = "card-account-details"

View File

@ -3,8 +3,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="no-referrer" /> <meta name="referrer" content="no-referrer" />
{{ $site := resources.Get "scss/main.scss" | resources.ToCSS }} {{ $site := resources.Get "scss/main.scss" | css.Sass }}
{{ $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS }} {{ $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | css.Sass }}
{{ $stylesheets := slice | append $site $themes | resources.Concat "css/main.css" }} {{ $stylesheets := slice | append $site $themes | resources.Concat "css/main.css" }}
<link rel="stylesheet" href="{{ $stylesheets.RelPermalink }}" /> <link rel="stylesheet" href="{{ $stylesheets.RelPermalink }}" />

View File

@ -1,6 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (config.xdg) userDirs;
userCfg = config.users.foo-dogsquared; userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.dconf; cfg = userCfg.programs.dconf;
in in
@ -26,6 +27,20 @@ in
base = 10; base = 10;
word-size = 64; word-size = 64;
}; };
"org/freedesktop/tracker/miner/files" = {
index-recursive-directories = [
# We could also use the values from home-manager but just to make GNOME Settings happy.
"&DESKTOP"
"&DOCUMENTS"
"&MUSIC"
"&PICTURES"
"&VIDEOS"
"&PUBLIC_SHARE"
userDirs.extraConfig.XDG_PROJECTS_DIR
];
};
}; };
}; };
} }

View File

@ -71,7 +71,8 @@ Take note, it requires `foo-dogsquared` to be defined in `setups.home-manager.co
setups.nixos.ni = { setups.nixos.ni = {
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
formats = null; formats = null;
homeManagerUsers = { home-manager = {
branch = "home-manager-unstable";
nixpkgsInstance = "global"; nixpkgsInstance = "global";
users.foo-dogsquared = { users.foo-dogsquared = {
userConfig = { userConfig = {
@ -99,10 +100,10 @@ Take note, it requires `foo-dogsquared` to be defined in `setups.home-manager.co
Points of interests include: Points of interests include:
* `homeManagerUsers.nixpkgsInstance = "global";` option where it enforces the system to use the same nixpkgs instance throughout all of the home-manager users. * `home-manager.nixpkgsInstance = "global";` option where it enforces the system to use the same nixpkgs instance throughout all of the home-manager users.
As an effect, it will apply of the home-manager users' overlays into the nixpkgs instance of the NixOS system instead. As an effect, it will apply of the home-manager users' overlays into the nixpkgs instance of the NixOS system instead.
* `homeManagerUsers.users.<name>.userConfig` where it simply maps the home-manager user into a NixOS system by applying `users.users.<name>` with the given `userConfig` value. * `home-manager.users.<name>.userConfig` where it simply maps the home-manager user into a NixOS system by applying `users.users.<name>` with the given `userConfig` value.
While this method makes for an incomplete system declaration in the config file and fully relies on the declarative host module to handle it, it isn't that much of a problem especially that you have to import third-party modules somewhere, regardless if it's with flakes or not. footnote:[Similar to the <<design-constraints, following design constraints for NixOS systems>>, home-manager configurations also don't allow for `inputs` to be part of the module arguments.] While this method makes for an incomplete system declaration in the config file and fully relies on the declarative host module to handle it, it isn't that much of a problem especially that you have to import third-party modules somewhere, regardless if it's with flakes or not. footnote:[Similar to the <<design-constraints, following design constraints for NixOS systems>>, home-manager configurations also don't allow for `inputs` to be part of the module arguments.]
-- --
@ -119,6 +120,9 @@ This set of NixOS configuration have some constraints mainly for consistency (ea
If you want to add home-manager users to it, make sure the included home-manager user is only buildable with the baseline home-manager configuration. If you want to add home-manager users to it, make sure the included home-manager user is only buildable with the baseline home-manager configuration.
Otherwise, you'll have to use the `setups.nixos.configs.<name>.homeManagerUsers.users.<name>` interface for that. Otherwise, you'll have to use the `setups.nixos.configs.<name>.homeManagerUsers.users.<name>` interface for that.
* Configuring nixpkgs instance is not allowed.
This is because the setup module for NixOS sets the nixpkgs instance themselves and NixOS systems doesn't allow further configuring the nixpkgs instance if `pkgs` is set externally.
* Private libraries and modules are allowed to be used here. * Private libraries and modules are allowed to be used here.
Both custom-made libraries and modules are easy to setup both with flake and non-flake way so it isn't limiting us to lean one over the other. Both custom-made libraries and modules are easy to setup both with flake and non-flake way so it isn't limiting us to lean one over the other.

View File

@ -6,7 +6,6 @@
]; ];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12; boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
hardware.xpadneo.enable = lib.mkForce false;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];

View File

@ -18,7 +18,7 @@ in
$ORIGIN foodogsquared.internal. $ORIGIN foodogsquared.internal.
$TTL 3600 $TTL 3600
@ IN SOA ns1.foodogsquared.internal. admin@foodogsquared.one. ( @ IN SOA ns1.foodogsquared.internal. admin.foodogsquared.one. (
2025010101 ;Serial 2025010101 ;Serial
3600 ;Refresh 3600 ;Refresh
3600 ;Retry 3600 ;Retry
@ -27,16 +27,13 @@ in
) )
3600 IN NS ns1.foodogsquared.internal. 3600 IN NS ns1.foodogsquared.internal.
ni 3600 IN A 127.0.0.1. ni 3600 IN A 127.0.0.1
ns1 3600 IN A 127.0.0.1. ns1 3600 IN A 127.0.0.1
rss 3600 IN A 127.0.0.1. rss 3600 IN A 127.0.0.1
''; '';
}; };
security.ipa = { services.resolved.domains = [ "~foodogsquared.internal" ];
enable = true; networking.nameservers = [ "127.0.0.1" ];
domain = "foodogsquared.internal";
dyndns.enable = true;
};
}; };
} }

View File

@ -65,8 +65,6 @@ in
# We're putting as a separate config file instead of configuring it # We're putting as a separate config file instead of configuring it
# in the service properly since secrets decrypted by sops-nix cannot # in the service properly since secrets decrypted by sops-nix cannot
# be read in Nix. # be read in Nix.
"--config"
"${config.sops.secrets."${pathPrefix}/secrets-config".path}"
]; ];
# Given an attribute set of jobs that contains a list of objects with # Given an attribute set of jobs that contains a list of objects with
@ -98,11 +96,6 @@ in
lib.listToAttrs jobsList; lib.listToAttrs jobsList;
in in
{ {
sops.secrets = getSecrets ./secrets.yaml
(attachSopsPathPrefix pathPrefix {
"secrets-config" = { };
});
suites.filesystem.setups.archive.enable = true; suites.filesystem.setups.archive.enable = true;
services.yt-dlp = { services.yt-dlp = {

View File

@ -22,12 +22,12 @@ in
adminCredentialsFile = config.sops.secrets."miniflux/admin".path; adminCredentialsFile = config.sops.secrets."miniflux/admin".path;
config = { config = {
LISTEN_ADDR = "127.0.0.1:${builtins.toString port}"; LISTEN_ADDR = "127.0.0.1:${builtins.toString port}";
BASE_URL = "http://rss.ni.internal"; BASE_URL = "http://rss.ni.local";
}; };
}; };
services.nginx.virtualHosts."rss.ni.internal" = { services.nginx.virtualHosts."rss.ni.local" = {
locations."/".proxyPass = "http://localhost:${builtins.toString port}"; locations."/".proxyPass = "http://ni.local:${builtins.toString port}";
}; };
}; };
} }

View File

@ -29,10 +29,6 @@ in
programs.blender = { programs.blender = {
enable = true; enable = true;
package = pkgs.blender-foodogsquared; package = pkgs.blender-foodogsquared;
addons = with pkgs; [
blender-blendergis
blender-machin3tools
];
}; };
# Make it in multiple languages. Take note the input method engine is set # Make it in multiple languages. Take note the input method engine is set

View File

@ -83,6 +83,11 @@ in
role = "server"; role = "server";
}; };
services.openiscsi = {
enable = true;
name = "iqn.2025-01.one.foodogsquared:ni-nixos";
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kubernetes-helm kubernetes-helm
kubernetes-polaris kubernetes-polaris

View File

@ -31,6 +31,7 @@ in
mindustry # Not a Minecraft industry simulator. mindustry # Not a Minecraft industry simulator.
minetest # Free Minecraft. minetest # Free Minecraft.
the-powder-toy # Free micro-Minecraft. the-powder-toy # Free micro-Minecraft.
rotp-foodogsquared # Free space Minecraft planet colonization simulator.
]; ];
# This is somewhat used for streaming games from it. # This is somewhat used for streaming games from it.

View File

@ -0,0 +1,21 @@
{ dockerTools, ruby, bundix, foodogsquaredLib }:
let name = s: "fds-ruby-on-rails-${ruby.version}${s}";
in dockerTools.buildImage {
name = name "";
copyToRoot = foodogsquaredLib.buildFDSEnv {
name = name "root";
paths = [ ruby bundix ];
};
runAsRoot = ''
mkdir -p /data
'';
config = {
Cmd = [ "/bin/bash" ];
WorkingDir = "/data";
Volumes."/data" = { };
};
}

View File

@ -4,6 +4,5 @@
{ dir, name ? baseNameOf dir, keyfiles, profile }@args: { dir, name ? baseNameOf dir, keyfiles, profile }@args:
runCommand "dconf-${name}" { runCommand "dconf-${name}" { nativeBuildInputs = [ (lib.getBin dconf) ]; }
nativeBuildInputs = [ (lib.getBin dconf) ]; "dconf compile $out ${dir}"
} "dconf compile $out ${dir}"

View File

@ -18,14 +18,7 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ { hugo, go, cacert, git, lib, stdenv, }:
hugo,
go,
cacert,
git,
lib,
stdenv,
}:
# A modified Go builder for generating a website with Hugo. Since it relies on # A modified Go builder for generating a website with Hugo. Since it relies on
# Hugo modules (which is basically wrapper around Go modules), this can be used # Hugo modules (which is basically wrapper around Go modules), this can be used
@ -34,297 +27,227 @@
# Take note, this doesn't work for Hugo projects with remote resources # Take note, this doesn't work for Hugo projects with remote resources
# right in the content since Hugo allows network access when generating # right in the content since Hugo allows network access when generating
# the website. # the website.
{ { name ? "${args'.pname}-${args'.version}",
name ? "${args'.pname}-${args'.version}",
nativeBuildInputs ? [ ], nativeBuildInputs ? [ ], passthru ? { },
passthru ? { },
# A function to override the goModules derivation # A function to override the goModules derivation
overrideModAttrs ? (_oldAttrs: { }), overrideModAttrs ? (_oldAttrs: { }),
# path to go.mod and go.sum directory # path to go.mod and go.sum directory
modRoot ? "./", modRoot ? "./",
# vendorHash is the SRI hash of the vendored dependencies # vendorHash is the SRI hash of the vendored dependencies
# #
# if vendorHash is null, then we won't fetch any dependencies and # if vendorHash is null, then we won't fetch any dependencies and
# rely on the vendor folder within the source. # rely on the vendor folder within the source.
vendorHash ? throw ( vendorHash ? throw (if args' ? vendorSha256 then
if args' ? vendorSha256 then "buildHugoSite: Expect vendorHash instead of vendorSha256"
"buildHugoSite: Expect vendorHash instead of vendorSha256" else
else "buildHugoSite: vendorHash is missing"),
"buildHugoSite: vendorHash is missing"
),
# Whether to delete the vendor folder supplied with the source. # Whether to delete the vendor folder supplied with the source.
deleteVendor ? false, deleteVendor ? false,
# Whether to fetch (go mod download) and proxy the vendor directory. # Whether to fetch (go mod download) and proxy the vendor directory.
# This is useful if your code depends on c code and go mod tidy does not # This is useful if your code depends on c code and go mod tidy does not
# include the needed sources to build or if any dependency has case-insensitive # include the needed sources to build or if any dependency has case-insensitive
# conflicts which will produce platform dependant `vendorHash` checksums. # conflicts which will produce platform dependant `vendorHash` checksums.
proxyVendor ? false, proxyVendor ? false,
# We want parallel builds by default # We want parallel builds by default
enableParallelBuilding ? true, enableParallelBuilding ? true,
# Do not enable this without good reason # Do not enable this without good reason
# IE: programs coupled with the compiler # IE: programs coupled with the compiler
allowGoReference ? false, allowGoReference ? false,
CGO_ENABLED ? go.CGO_ENABLED, CGO_ENABLED ? go.CGO_ENABLED,
meta ? { }, meta ? { },
ldflags ? [ ], ldflags ? [ ],
GOFLAGS ? [ ], GOFLAGS ? [ ],
... ... }@args':
}@args':
let let
args = removeAttrs args' [ args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ];
"overrideModAttrs"
"vendorSha256"
"vendorHash"
];
GO111MODULE = "on"; GO111MODULE = "on";
GOTOOLCHAIN = "local"; GOTOOLCHAIN = "local";
hugoModules = hugoModules = if (vendorHash == null) then
if (vendorHash == null) then ""
"" else
else (stdenv.mkDerivation {
(stdenv.mkDerivation { name = "${name}-hugo-modules";
name = "${name}-hugo-modules";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ nativeBuildInputs = (args.nativeBuildInputs or [ ])
hugo ++ [ hugo go git cacert ];
go
git
cacert
];
inherit (args) src;
inherit (go) GOOS GOARCH;
inherit GO111MODULE GOTOOLCHAIN;
# The following inheritence behavior is not trivial to expect, and some may
# argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and
# out in the wild. In anycase, it's documented in:
# doc/languages-frameworks/go.section.md
prePatch = args.prePatch or "";
patches = args.patches or [ ];
patchFlags = args.patchFlags or [ ];
postPatch = args.postPatch or "";
preBuild = args.preBuild or "";
postBuild = args.modPostBuild or "";
sourceRoot = args.sourceRoot or "";
setSourceRoot = args.setSourceRoot or "";
env = args.env or { };
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
"GIT_PROXY_COMMAND"
"SOCKS_SERVER"
"GOPROXY"
];
configurePhase =
args.modConfigurePhase or ''
runHook preConfigure
export GOCACHE=$TMPDIR/go-cache
export GOPATH="$TMPDIR/go"
cd "${modRoot}"
runHook postConfigure
'';
buildPhase =
args.modBuildPhase or (
''
runHook preBuild
''
+ lib.optionalString deleteVendor ''
if [ ! -d _vendor ]; then
echo "_vendor folder does not exist, 'deleteVendor' is not needed"
exit 10
else
rm -rf _vendor
fi
''
+ ''
if [ -d _vendor ]; then
echo "_vendor folder exists, please set 'vendorHash = null;' in your expression"
exit 10
fi
${
if proxyVendor then
''
mkdir -p "''${GOPATH}/pkg/mod/cache/download"
hugo mod vendor
''
else
''
if (( "''${NIX_DEBUG:-0}" >= 1 )); then
hugoModVendorFlags+=(-v)
fi
hugo mod vendor "''${hugoModVendorFlags[@]}"
''
}
mkdir -p _vendor
runHook postBuild
''
);
installPhase =
args.modInstallPhase or ''
runHook preInstall
${
if proxyVendor then
''
rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb"
cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out
''
else
''
cp -r --reflink=auto _vendor $out
''
}
if ! [ "$(ls -A $out)" ]; then
echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression"
exit 10
fi
runHook postInstall
'';
dontFixup = true;
outputHashMode = "recursive";
outputHash = vendorHash;
# Handle empty vendorHash; avoid
# error: empty hash requires explicit hash algorithm
outputHashAlgo = if vendorHash == "" then "sha256" else null;
}).overrideAttrs
overrideModAttrs;
package = stdenv.mkDerivation (
args
// {
nativeBuildInputs = [
hugo
git
go
] ++ nativeBuildInputs;
inherit (args) src;
inherit (go) GOOS GOARCH; inherit (go) GOOS GOARCH;
inherit GO111MODULE GOTOOLCHAIN;
GOFLAGS = # The following inheritence behavior is not trivial to expect, and some may
GOFLAGS # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and
++ # out in the wild. In anycase, it's documented in:
lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) # doc/languages-frameworks/go.section.md
"use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" prePatch = args.prePatch or "";
(lib.optional (!proxyVendor) "-mod=vendor") patches = args.patches or [ ];
++ patchFlags = args.patchFlags or [ ];
lib.warnIf (builtins.elem "-trimpath" GOFLAGS) postPatch = args.postPatch or "";
"`-trimpath` is added by default to GOFLAGS by buildHugoSite when allowGoReference isn't set to true" preBuild = args.preBuild or "";
(lib.optional (!allowGoReference) "-trimpath"); postBuild = args.modPostBuild or "";
inherit sourceRoot = args.sourceRoot or "";
CGO_ENABLED setSourceRoot = args.setSourceRoot or "";
enableParallelBuilding env = args.env or { };
GO111MODULE
GOTOOLCHAIN
;
# If not set to an explicit value, set the buildid empty for reproducibility. impureEnvVars = lib.fetchers.proxyImpureEnvVars
ldflags = ldflags ++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags) "-buildid="; ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" "GOPROXY" ];
configurePhase = configurePhase = args.modConfigurePhase or ''
args.configurePhase or ( runHook preConfigure
'' export GOCACHE=$TMPDIR/go-cache
runHook preConfigure export GOPATH="$TMPDIR/go"
cd "${modRoot}"
runHook postConfigure
'';
export GOCACHE=$TMPDIR/go-cache buildPhase = args.modBuildPhase or (''
export GOPATH="$TMPDIR/go" runHook preBuild
export GOPROXY=off '' + lib.optionalString deleteVendor ''
export GOSUMDB=off if [ ! -d _vendor ]; then
cd "$modRoot" echo "_vendor folder does not exist, 'deleteVendor' is not needed"
'' exit 10
+ lib.optionalString (vendorHash != null) '' else
${ rm -rf _vendor
if proxyVendor then fi
'' '' + ''
export GOPROXY=file://${hugoModules} if [ -d _vendor ]; then
'' echo "_vendor folder exists, please set 'vendorHash = null;' in your expression"
else exit 10
'' fi
rm -rf _vendor
cp -r --reflink=auto ${hugoModules} _vendor
''
}
''
+ ''
# currently pie is only enabled by default in pkgsMusl ${if proxyVendor then ''
# this will respect the `hardening{Disable,Enable}` flags if set mkdir -p "''${GOPATH}/pkg/mod/cache/download"
if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then hugo mod vendor
export GOFLAGS="-buildmode=pie $GOFLAGS" '' else ''
fi if (( "''${NIX_DEBUG:-0}" >= 1 )); then
hugoModVendorFlags+=(-v)
fi
hugo mod vendor "''${hugoModVendorFlags[@]}"
''}
runHook postConfigure mkdir -p _vendor
''
);
buildPhase = runHook postBuild
args.buildPhase or '' '');
runHook preBuild
hugo "''${buildFlags[@]}" --destination public
runHook postBuild
'';
doCheck = args.doCheck or true; installPhase = args.modInstallPhase or ''
checkPhase = runHook preInstall
args.checkPhase or ''
runHook preCheck
runHook postCheck ${if proxyVendor then ''
''; rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb"
cp -r --reflink=auto "''${GOPATH}/pkg/mod/cache/download" $out
'' else ''
cp -r --reflink=auto _vendor $out
''}
installPhase = if ! [ "$(ls -A $out)" ]; then
args.installPhase or '' echo "_vendor folder is empty, please set 'vendorHash = null;' in your expression"
runHook preInstall exit 10
fi
mkdir -p $out runHook postInstall
cp -r public/* $out '';
runHook postInstall dontFixup = true;
'';
strictDeps = true; outputHashMode = "recursive";
outputHash = vendorHash;
# Handle empty vendorHash; avoid
# error: empty hash requires explicit hash algorithm
outputHashAlgo = if vendorHash == "" then "sha256" else null;
}).overrideAttrs overrideModAttrs;
disallowedReferences = lib.optional (!allowGoReference) go; package = stdenv.mkDerivation (args // {
nativeBuildInputs = [ hugo git go ] ++ nativeBuildInputs;
passthru = passthru // { inherit (go) GOOS GOARCH;
inherit
go
hugo
hugoModules
vendorHash
;
};
meta = { GOFLAGS = GOFLAGS ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS)
# Add default meta information "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS"
platforms = go.meta.platforms or lib.platforms.all; (lib.optional (!proxyVendor) "-mod=vendor")
} // meta; ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS)
} "`-trimpath` is added by default to GOFLAGS by buildHugoSite when allowGoReference isn't set to true"
); (lib.optional (!allowGoReference) "-trimpath");
in inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN;
package
# If not set to an explicit value, set the buildid empty for reproducibility.
ldflags = ldflags
++ lib.optional (!lib.any (lib.hasPrefix "-buildid=") ldflags)
"-buildid=";
configurePhase = args.configurePhase or (''
runHook preConfigure
export GOCACHE=$TMPDIR/go-cache
export GOPATH="$TMPDIR/go"
export GOPROXY=off
export GOSUMDB=off
cd "$modRoot"
'' + lib.optionalString (vendorHash != null) ''
${if proxyVendor then ''
export GOPROXY=file://${hugoModules}
'' else ''
rm -rf _vendor
cp -r --reflink=auto ${hugoModules} _vendor
''}
'' + ''
# currently pie is only enabled by default in pkgsMusl
# this will respect the `hardening{Disable,Enable}` flags if set
if [[ $NIX_HARDENING_ENABLE =~ "pie" ]]; then
export GOFLAGS="-buildmode=pie $GOFLAGS"
fi
runHook postConfigure
'');
buildPhase = args.buildPhase or ''
runHook preBuild
hugo "''${buildFlags[@]}" --destination public
runHook postBuild
'';
doCheck = args.doCheck or true;
checkPhase = args.checkPhase or ''
runHook preCheck
runHook postCheck
'';
installPhase = args.installPhase or ''
runHook preInstall
mkdir -p $out
cp -r public/* $out
runHook postInstall
'';
strictDeps = true;
disallowedReferences = lib.optional (!allowGoReference) go;
passthru = passthru // { inherit go hugo hugoModules vendorHash; };
meta = {
# Add default meta information
platforms = go.meta.platforms or lib.platforms.all;
} // meta;
});
in package

View File

@ -6,24 +6,25 @@
typically in lowercase ASCII. typically in lowercase ASCII.
*/ */
{ {
# An optional string containing the name of the desktop to be associated # An optional string containing the name of the desktop to be associated
# with. # with.
desktopName ? "", desktopName ? "",
# Applications to be put in `Added Associations`. This is not set when the # Applications to be put in `Added Associations`. This is not set when the
# database is desktop-specific (when the `desktopName` is non-empty.) # database is desktop-specific (when the `desktopName` is non-empty.)
addedAssociations ? { }, addedAssociations ? { },
# Associations to be put in `Removed Associations` in the file. Similar to # Associations to be put in `Removed Associations` in the file. Similar to
# `addedAssociations`, this will not be added when it is desktop-specific. # `addedAssociations`, this will not be added when it is desktop-specific.
removedAssociations ? { }, removedAssociations ? { },
# Set of applications to be opened associated with the MIME type. # Set of applications to be opened associated with the MIME type.
defaultApplications ? { }, defaultApplications ? { }, }:
}:
writeTextFile { writeTextFile {
name = "xdg-mime-associations${lib.optionalString (desktopName != "") "-${desktopName}"}"; name = "xdg-mime-associations${
lib.optionalString (desktopName != "") "-${desktopName}"
}";
text = text =
# Non-desktop-specific mimeapps.list are only allowed to specify # Non-desktop-specific mimeapps.list are only allowed to specify
# default applications. # default applications.
@ -33,6 +34,8 @@ writeTextFile {
"Added Associations" = addedAssociations; "Added Associations" = addedAssociations;
"Removed Associations" = removedAssociations; "Removed Associations" = removedAssociations;
})); }));
destination = "/share/applications/${lib.optionalString (desktopName != "") "${desktopName}-"}mimeapps.list"; destination = "/share/applications/${
lib.optionalString (desktopName != "") "${desktopName}-"
}mimeapps.list";
} }

View File

@ -6,19 +6,18 @@
create something like an entry for a desktop session. create something like an entry for a desktop session.
*/ */
{ {
# Name of the desktop entry. Only used as part of the package name and the # Name of the desktop entry. Only used as part of the package name and the
# default value of the destination path. # default value of the destination path.
name, name,
# Nix-representable data to be exported as the desktop entry. # Nix-representable data to be exported as the desktop entry.
config, config,
# Add a validation check for the exported desktop entry. # Add a validation check for the exported desktop entry.
validate ? true, validate ? true,
# Destination path relative to the output path. # Destination path relative to the output path.
destination ? "/share/applications/${name}.desktop", destination ? "/share/applications/${name}.desktop", }:
}:
writeTextFile { writeTextFile {
name = "xdg-desktop-entry-${name}"; name = "xdg-desktop-entry-${name}";
@ -26,14 +25,14 @@ writeTextFile {
listsAsDuplicateKeys = false; listsAsDuplicateKeys = false;
mkKeyValue = lib.generators.mkKeyValueDefault { mkKeyValue = lib.generators.mkKeyValueDefault {
mkValueString = v: mkValueString = v:
if lib.isList v then lib.concatStringsSep ";" v if lib.isList v then
else lib.generators.mkValueStringDefault { } v; lib.concatStringsSep ";" v
else
lib.generators.mkValueStringDefault { } v;
} "="; } "=";
} config; } config;
inherit destination; inherit destination;
checkPhase = checkPhase = lib.optionalString validate ''
lib.optionalString validate ${lib.getExe' desktop-file-utils "desktop-file-validate"} "$target"
'' '';
${lib.getExe' desktop-file-utils "desktop-file-validate"} "$target"
'';
} }

View File

@ -1,17 +1,19 @@
{ lib, writeTextFile }: { lib, writeTextFile }:
/* Create an XDG Portals configuration with the given desktop name and its /* Create an XDG Portals configuration with the given desktop name and its
configuration. Similarly, the given desktop name is assumed to be already configuration. Similarly, the given desktop name is assumed to be already
in its suitable form of a lowercase ASCII. in its suitable form of a lowercase ASCII.
*/ */
{ { desktopName ? "common",
desktopName ? "common",
# Nix-representable data to be exported as the portal configuration. # Nix-representable data to be exported as the portal configuration.
config, config, }:
}:
writeTextFile { writeTextFile {
name = "xdg-portal-config${lib.optionalString (desktopName != "common") "-${desktopName}"}"; name = "xdg-portal-config${
lib.optionalString (desktopName != "common") "-${desktopName}"
}";
text = lib.generators.toINI { } config; text = lib.generators.toINI { } config;
destination = "/share/xdg-desktop-portal/${lib.optionalString (desktopName != "common") "${desktopName}-"}portals.conf"; destination = "/share/xdg-desktop-portal/${
lib.optionalString (desktopName != "common") "${desktopName}-"
}portals.conf";
} }

View File

@ -55,8 +55,7 @@
=> /nix/store/HASH-mustache-render-template => /nix/store/HASH-mustache-render-template
*/ */
renderMustacheTemplate = { template, context, extraArgs ? { } }: renderMustacheTemplate = { template, context, extraArgs ? { } }:
let let extraArgs' = lib.cli.toGNUCommandLineShell { } extraArgs;
extraArgs' = lib.cli.toGNUCommandLineShell { } extraArgs;
in pkgs.runCommand "mustache-render-template" { in pkgs.runCommand "mustache-render-template" {
nativeBuildInputs = with pkgs; [ mustache-go ]; nativeBuildInputs = with pkgs; [ mustache-go ];
context = builtins.toJSON context; context = builtins.toJSON context;

View File

@ -14,39 +14,30 @@
let let
# A set of nixos-generators modules including our custom ones. # A set of nixos-generators modules including our custom ones.
nixosGeneratorModules = nixosGeneratorModules = let
let officialFormats = builtins.readDir "${sources.nixos-generators}/formats";
officialFormats = builtins.readDir "${sources.nixos-generators}/formats"; unofficialFormats = builtins.readDir ../modules/nixos-generators;
unofficialFormats = builtins.readDir ../modules/nixos-generators; formats = officialFormats // unofficialFormats;
formats = officialFormats // unofficialFormats; in lib.mapAttrs' (n: _:
in lib.nameValuePair (lib.removeSuffix ".nix" n) {
lib.mapAttrs' (n: _: lib.nameValuePair (lib.removeSuffix ".nix" n) {
imports = [ imports = [
"${sources.nixos-generators}/format-module.nix" "${sources.nixos-generators}/format-module.nix"
( (if (lib.hasAttr n officialFormats) then
if (lib.hasAttr n officialFormats) "${sources.nixos-generators}/formats/${n}"
then "${sources.nixos-generators}/formats/${n}" else
else "${../modules/nixos-generators}/${n}" "${../modules/nixos-generators}/${n}")
)
]; ];
}) formats; }) formats;
in in rec {
rec { mkNixosSystem =
mkNixosSystem = { { pkgs, lib ? pkgs.lib, system, extraModules ? [ ], specialArgs ? { }, }:
pkgs,
lib ? pkgs.lib,
system,
extraModules ? [ ],
specialArgs ? { },
}:
let let
nixosModules = ../modules/nixos; nixosModules = ../modules/nixos;
# Evaluating the system ourselves (which is trivial) instead of relying # Evaluating the system ourselves (which is trivial) instead of relying
# on nixpkgs.lib.nixosSystem flake output. # on nixpkgs.lib.nixosSystem flake output.
nixosSystem = args: import "${pkgs.path}/nixos/lib/eval-config.nix" args; nixosSystem = args: import "${pkgs.path}/nixos/lib/eval-config.nix" args;
in in (lib.makeOverridable nixosSystem) {
(lib.makeOverridable nixosSystem) {
inherit pkgs; inherit pkgs;
specialArgs = specialArgs // { specialArgs = specialArgs // {
foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; }; foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; };
@ -55,9 +46,7 @@ rec {
modules = extraModules ++ [ modules = extraModules ++ [
nixosModules nixosModules
../modules/nixos/_private ../modules/nixos/_private
({ lib, ... }: { ({ lib, ... }: { nixpkgs.hostPlatform = lib.mkForce system; })
nixpkgs.hostPlatform = lib.mkForce system;
})
]; ];
# Since we're setting it through nixpkgs.hostPlatform, we'll have to pass # Since we're setting it through nixpkgs.hostPlatform, we'll have to pass
@ -66,44 +55,27 @@ rec {
}; };
# A very very thin wrapper around `mkNixosSystem` to build with the given format. # A very very thin wrapper around `mkNixosSystem` to build with the given format.
mkNixosImage = { mkNixosImage = { pkgs, system, lib ? pkgs.lib, extraModules ? [ ]
pkgs, , specialArgs ? { }, format ? "iso", }:
system,
lib ? pkgs.lib,
extraModules ? [ ],
specialArgs ? { },
format ? "iso",
}:
let let
extraModules' = extraModules ++ [ nixosGeneratorModules.${format} ]; extraModules' = extraModules ++ [ nixosGeneratorModules.${format} ];
nixosSystem = mkNixosSystem { nixosSystem = mkNixosSystem {
inherit pkgs lib system specialArgs; inherit pkgs lib system specialArgs;
extraModules = extraModules'; extraModules = extraModules';
}; };
in in nixosSystem.config.system.build.${nixosSystem.config.formatAttr};
nixosSystem.config.system.build.${nixosSystem.config.formatAttr};
mkHome = { mkHome =
pkgs, { pkgs, homeManagerSrc, lib ? pkgs.lib, modules ? [ ], specialArgs ? { }, }:
homeManagerSrc, let homeModules = ../modules/home-manager;
lib ? pkgs.lib, in import "${homeManagerSrc}/modules" {
modules ? [ ],
specialArgs ? { },
}:
let
homeModules = ../modules/home-manager;
in
import "${homeManagerSrc}/modules" {
inherit pkgs lib; inherit pkgs lib;
check = true; check = true;
extraSpecialArgs = specialArgs // { extraSpecialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString homeModules; foodogsquaredModulesPath = builtins.toString homeModules;
}; };
configuration = { lib, ... }: { configuration = { lib, ... }: {
imports = modules ++ [ imports = modules ++ [ homeModules ../modules/home-manager/_private ];
homeModules
../modules/home-manager/_private
];
config = { config = {
programs.home-manager.path = homeManagerSrc; programs.home-manager.path = homeManagerSrc;
@ -113,25 +85,17 @@ rec {
}; };
}; };
mkWrapper = { mkWrapper = { pkgs, lib ? pkgs.lib, wrapperManagerSrc, modules ? [ ]
pkgs, , specialArgs ? { }, }:
lib ? pkgs.lib,
wrapperManagerSrc,
modules ? [ ],
specialArgs ? { },
}:
let let
wrapperManagerModules = ../modules/wrapper-manager; wrapperManagerModules = ../modules/wrapper-manager;
wrapperManager = import wrapperManagerSrc { }; wrapperManager = import wrapperManagerSrc { };
in in wrapperManager.lib.build {
wrapperManager.lib.build { inherit pkgs lib;
inherit pkgs lib; specialArgs = specialArgs // {
specialArgs = specialArgs // { foodogsquaredModulesPath = builtins.toString wrapperManagerModules;
foodogsquaredModulesPath = builtins.toString wrapperManagerModules;
};
modules = modules ++ [
wrapperManagerModules
../modules/wrapper-manager/_private
];
}; };
modules = modules
++ [ wrapperManagerModules ../modules/wrapper-manager/_private ];
};
} }

View File

@ -2,9 +2,8 @@
{ pkgs, lib, self }: { pkgs, lib, self }:
rec { rec {
/* /* Checks if there is the `osConfig` attribute and get the attribute path from
Checks if there is the `osConfig` attribute and get the attribute path from its system configuration.
its system configuration.
*/ */
hasNixOSConfigAttr = hasNixOSConfigAttr =
# The configuration attribute set of the home-manager configuration. # The configuration attribute set of the home-manager configuration.
@ -26,11 +25,10 @@ rec {
# The default value when `attrPath` is missing. # The default value when `attrPath` is missing.
default: default:
attrs ? darwinConfig && pkgs.lib.attrByPath attrPath default attrs.darwinConfig; attrs ? darwinConfig
&& pkgs.lib.attrByPath attrPath default attrs.darwinConfig;
/* # A quick function to check if the optional NixOS system module is enabled.
A quick function to check if the optional NixOS system module is enabled.
*/
hasOSModuleEnabled = hasOSModuleEnabled =
# The configuration attribute set of the home-manager configuration. # The configuration attribute set of the home-manager configuration.
attrs: attrs:

View File

@ -5,12 +5,10 @@
# Checks if the NixOS configuration is part of the nixos-generator build. # Checks if the NixOS configuration is part of the nixos-generator build.
# Typically, we just check if there's a certain attribute that is imported # Typically, we just check if there's a certain attribute that is imported
# from it. # from it.
hasNixosFormat = config: hasNixosFormat = config: lib.hasAttrByPath [ "formatAttr" ] config;
lib.hasAttrByPath [ "formatAttr" ] config;
# Checks if the NixOS config is being built for a particular format. # Checks if the NixOS config is being built for a particular format.
isFormat = config: format: isFormat = config: format: (config.formatAttr or "") == format;
(config.formatAttr or "") == format;
# Create a separate environment similar to NixOS `system.path`. This is # Create a separate environment similar to NixOS `system.path`. This is
# typically used to create isolated environments for custom desktop sessions # typically used to create isolated environments for custom desktop sessions
@ -21,17 +19,16 @@
pkgs.buildEnv (args // { pkgs.buildEnv (args // {
inherit (config.environment) pathsToLink extraOutputsToInstall; inherit (config.environment) pathsToLink extraOutputsToInstall;
ignoreCollisions = true; ignoreCollisions = true;
postBuild = postBuild = ''
'' # Remove wrapped binaries, they shouldn't be accessible via PATH.
# Remove wrapped binaries, they shouldn't be accessible via PATH. find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
$out/bin/glib-compile-schemas $out/share/glib-2.0/schemas $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
fi fi
${config.environment.extraSetup} ${config.environment.extraSetup}
''; '';
}); });
# Given an environment (built with `pkgs.buildEnv`), create a systemd # Given an environment (built with `pkgs.buildEnv`), create a systemd
@ -44,26 +41,24 @@
# Create a range object (as [start, end) in notation) that is typically used # Create a range object (as [start, end) in notation) that is typically used
# in module options that accept them. # in module options that accept them.
makeRange = start: range: makeRange = start: range: {
{ from = start; to = start + range; }; from = start;
to = start + range;
};
# Create a range object (as [start + 1, end + 1] in notation) that is typically used # Create a range object (as [start + 1, end + 1] in notation) that is typically used
# in module options that accept them except that the starting port is included. # in module options that accept them except that the starting port is included.
makeRange' = start: range: makeRange' = start: range:
let let start' = start + 1;
start' = start + 1; in {
in from = start';
{ from = start'; to = start' + range; }; to = start' + range;
};
/* # A specific function that checks if specific filesystem setups are set.
A specific function that checks if specific filesystem setups are set.
*/
isFilesystemSet = config: setupName: isFilesystemSet = config: setupName:
config.suites.filesystem.setups.${setupName}.enable or false; config.suites.filesystem.setups.${setupName}.enable or false;
/* # Get the path from the state variable.
Get the path from the state variable. getFilesystem = config: setupName: config.state.paths.${setupName};
*/
getFilesystem = config: setupName:
config.state.paths.${setupName};
} }

View File

@ -2,5 +2,5 @@
{ {
isStandalone = config: isStandalone = config:
!config?hmConfig && !config?nixosConfig && !config?darwinConfig; !config ? hmConfig && !config ? nixosConfig && !config ? darwinConfig;
} }

View File

@ -18,13 +18,8 @@
} }
*/ */
getSecrets = sopsFile: secrets: getSecrets = sopsFile: secrets:
let let getKey = key: { inherit key sopsFile; };
getKey = key: { inherit key sopsFile; }; in lib.mapAttrs (path: attrs: (getKey path) // attrs) secrets;
in
lib.mapAttrs
(path: attrs:
(getKey path) // attrs)
secrets;
/* Prepend a prefix for the given secrets. This allows a workflow for /* Prepend a prefix for the given secrets. This allows a workflow for
separate sops file. separate sops file.
@ -44,10 +39,7 @@
})) }))
*/ */
attachSopsPathPrefix = prefix: secrets: attachSopsPathPrefix = prefix: secrets:
lib.mapAttrs' lib.mapAttrs' (key: settings:
(key: settings: lib.nameValuePair "${prefix}/${key}" ({ inherit key; } // settings))
lib.nameValuePair secrets;
"${prefix}/${key}"
({ inherit key; } // settings))
secrets;
} }

View File

@ -5,15 +5,12 @@ rec {
containing all of the addons properly placed as a system resource folder. containing all of the addons properly placed as a system resource folder.
*/ */
wrapBlenderAddons = { blenderPackage, addons }: wrapBlenderAddons = { blenderPackage, addons }:
let let blenderVersion = lib.versions.majorMinor blenderPackage.version;
blenderVersion = lib.versions.majorMinor blenderPackage.version; in pkgs.runCommand "blender-system-resources" {
in passAsFile = [ "paths" ];
pkgs.runCommand "blender-system-resources" paths = addons ++ [ blenderPackage ];
{ nativeBuildInputs = with pkgs; [ outils ];
passAsFile = [ "paths" ]; } ''
paths = addons ++ [ blenderPackage ];
nativeBuildInputs = with pkgs; [ outils ];
} ''
mkdir -p $out mkdir -p $out
for i in $(cat $pathsPath); do for i in $(cat $pathsPath); do
resourcesPath="$i/share/blender" resourcesPath="$i/share/blender"
@ -24,11 +21,10 @@ rec {
done done
''; '';
makeBlenderWrapper = module@{ blenderPackage, blenderArgs ? [ ] , addons ? [ ], ... }: makeBlenderWrapper =
let module@{ blenderPackage, blenderArgs ? [ ], addons ? [ ], ... }:
blenderAddons = wrapBlenderAddons { inherit blenderPackage addons; }; let blenderAddons = wrapBlenderAddons { inherit blenderPackage addons; };
in in lib.mkMerge [
lib.mkMerge [
{ {
arg0 = lib.getExe' blenderPackage "blender"; arg0 = lib.getExe' blenderPackage "blender";
prependArgs = lib.mkBefore blenderArgs; prependArgs = lib.mkBefore blenderArgs;
@ -41,48 +37,49 @@ rec {
(lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ]) (lib.removeAttrs module [ "blenderPackage" "blenderArgs" "addons" ])
]; ];
/* Create a configuration module for quickly wrapping with Boxxy. # Create a configuration module for quickly wrapping with Boxxy.
*/ makeBoxxyWrapper =
makeBoxxyWrapper = module@{ boxxyArgs, wraparound, wraparoundArgs ? [], ... }: module@{ boxxyArgs, wraparound, wraparoundArgs ? [ ], ... }:
lib.mkMerge [ lib.mkMerge [
{ {
arg0 = lib.getExe' pkgs.boxxy "boxxy"; arg0 = lib.getExe' pkgs.boxxy "boxxy";
prependArgs = lib.mkBefore (boxxyArgs ++ [ "--" wraparound ] ++ wraparoundArgs); prependArgs =
lib.mkBefore (boxxyArgs ++ [ "--" wraparound ] ++ wraparoundArgs);
} }
(builtins.removeAttrs module [ "boxxyArgs" "wraparound" "wraparoundArgs" ]) (builtins.removeAttrs module [
"boxxyArgs"
"wraparound"
"wraparoundArgs"
])
]; ];
/* Given the path to the source code, the attribute path, and the executable /* Given the path to the source code, the attribute path, and the executable
name, return the store path to one of its executables. name, return the store path to one of its executables.
*/ */
getNixglExecutable = { src, variant ? [ "auto" "nixGLDefault" ], nixglProgram ? "nixGL" }: getNixglExecutable =
{ src, variant ? [ "auto" "nixGLDefault" ], nixglProgram ? "nixGL" }:
let let
nixgl = import src { inherit pkgs; }; nixgl = import src { inherit pkgs; };
nixglPkg = lib.getAttrFromPath variant nixgl; nixglPkg = lib.getAttrFromPath variant nixgl;
in in lib.getExe' nixglPkg nixglProgram;
lib.getExe' nixglPkg nixglProgram;
/* Create a configuration module for quickly wrapping with NixGL. # Create a configuration module for quickly wrapping with NixGL.
*/ makeNixglWrapper = { nixglSrc, nixglArgs, nixglVariant, nixglExecutable
makeNixglWrapper = { , wraparound, wraparoundArgs ? [ ], ... }@module:
nixglSrc,
nixglArgs,
nixglVariant,
nixglExecutable,
wraparound,
wraparoundArgs ? [],
...
}@module:
lib.mkMerge [ lib.mkMerge [
{ {
arg0 = getNixglExecutable nixglSrc nixglVariant nixglExecutable; arg0 = getNixglExecutable nixglSrc nixglVariant nixglExecutable;
prependArgs = lib.mkBefore (nixglArgs ++ [ "--" wraparound ] ++ wraparoundArgs); prependArgs =
lib.mkBefore (nixglArgs ++ [ "--" wraparound ] ++ wraparoundArgs);
} }
(builtins.removeAttrs module [ (builtins.removeAttrs module [
"nixglArgs" "nixglVariant" "nixglExecutable" "nixglArgs"
"wraparound" "wraparoundArgs" "nixglVariant"
"nixglExecutable"
"wraparound"
"wraparoundArgs"
]) ])
]; ];
} }

View File

@ -1,27 +1,20 @@
{ stdenvNoCC, lib, fetchzip, fetchurl, curl }: { stdenvNoCC, lib, fetchzip, fetchurl, curl }:
{ { id, file ? "", formats ? [ ], hash ? "", name ? "internet-archive-${id}",
id,
file ? "",
formats ? [ ],
hash ? "",
name ? "internet-archive-${id}",
}@args: }@args:
let let
isFormatIndiciated = formats != [ ]; isFormatIndiciated = formats != [ ];
url = url = if isFormatIndiciated then
if isFormatIndiciated "https://archive.org/compress/${lib.escapeURL id}/formats=${
then "https://archive.org/compress/${lib.escapeURL id}/formats=${lib.concatStringsSep "," formats}" lib.concatStringsSep "," formats
else "https://archive.org/download/${lib.escapeURL id}/${lib.escapeURL file}"; }"
else
"https://archive.org/download/${lib.escapeURL id}/${lib.escapeURL file}";
args' = lib.removeAttrs args [ "id" "file" "formats" ] // { args' = lib.removeAttrs args [ "id" "file" "formats" ] // {
inherit url hash name; inherit url hash name;
}; };
fetcher = fetcher = if isFormatIndiciated then fetchzip else fetchurl;
if isFormatIndiciated in fetcher args'
then fetchzip
else fetchurl;
in
fetcher args'

View File

@ -1,15 +1,8 @@
{ fetchzip, lib }: { fetchzip, lib }:
{ { fileId, pid, ext ? "gz", ... }@args:
fileId,
pid,
ext ? "gz",
...
}@args:
let let args' = lib.removeAttrs args [ "fileId" "pid" "ext" ];
args' = lib.removeAttrs args [ "fileId" "pid" "ext" ]; in fetchzip (args' // {
in
fetchzip (args' // {
url = "https://www.ugee.com/download/file/id/${fileId}/pid/${pid}/ext/${ext}"; url = "https://www.ugee.com/download/file/id/${fileId}/pid/${pid}/ext/${ext}";
}) })

View File

@ -1,7 +1,7 @@
# No, this is not a flake of the library set, it is a library subset for # No, this is not a flake of the library set, it is a library subset for
# flake-related shtick. This should be used VERY RARELY in most parts of the # flake-related shtick. This should be used VERY RARELY in most parts of the
# configuration because they are set up to be usable both in flakes- and # configuration because they are set up to be usable both in flakes and
# non-flakes-enabled environment. # flake-less environment.
# #
# Take note it has a very strict design constraint of not relying on the # Take note it has a very strict design constraint of not relying on the
# `inputs` attribute of the flake output. Instead, we're relying on the # `inputs` attribute of the flake output. Instead, we're relying on the
@ -22,6 +22,5 @@ rec {
fetchTree = metadata: inputName: fetchTree = metadata: inputName:
builtins.fetchTree metadata.nodes.${inputName}.locked; builtins.fetchTree metadata.nodes.${inputName}.locked;
fetchInput = metadata: inputName: fetchInput = metadata: inputName: (fetchTree metadata inputName).outPath;
(fetchTree metadata inputName).outPath;
} }

View File

@ -11,8 +11,7 @@ rec {
abs (1 / 5) abs (1 / 5)
=> 0.2 => 0.2
*/ */
abs = number: abs = number: if number < 0 then -(number) else number;
if number < 0 then -(number) else number;
/* Exponentiates the given base with the exponent. /* Exponentiates the given base with the exponent.
Example: Example:
@ -28,10 +27,10 @@ rec {
let let
absValue = abs exponent; absValue = abs exponent;
iter = product: counter: maxCount: iter = product: counter: maxCount:
if counter > maxCount if counter > maxCount then
then product product
else iter (product * base) (counter + 1) maxCount; else
iter (product * base) (counter + 1) maxCount;
value = iter 1 1 absValue; value = iter 1 1 absValue;
in in if exponent < 0 then (1 / value) else value;
if exponent < 0 then (1 / value) else value;
} }

View File

@ -23,7 +23,7 @@ rec {
*/ */
countAttrs = pred: attrs: countAttrs = pred: attrs:
lib.count (attr: pred attr.name attr.value) lib.count (attr: pred attr.name attr.value)
(lib.mapAttrsToList lib.nameValuePair attrs); (lib.mapAttrsToList lib.nameValuePair attrs);
/* Filters and groups the attribute set into two separate attribute where it /* Filters and groups the attribute set into two separate attribute where it
either accepted or denied from a given predicate function. either accepted or denied from a given predicate function.
@ -33,14 +33,15 @@ rec {
=> { ok = { a = 4; }; notOk = { b = 2; c = 6; }; } => { ok = { a = 4; }; notOk = { b = 2; c = 6; }; }
*/ */
filterAttrs' = f: attrs: filterAttrs' = f: attrs:
lib.foldlAttrs (acc: name: value: let lib.foldlAttrs (acc: name: value:
isOk = f name value; let isOk = f name value;
in { in {
ok = acc.ok // lib.optionalAttrs isOk { ${name} = value; }; ok = acc.ok // lib.optionalAttrs isOk { ${name} = value; };
notOk = acc.notOk // lib.optionalAttrs (!isOk) { ${name} = value; }; notOk = acc.notOk // lib.optionalAttrs (!isOk) { ${name} = value; };
}) }) {
{ ok = { }; notOk = { }; } ok = { };
attrs; notOk = { };
} attrs;
/* Convenient function for converting bits to bytes. /* Convenient function for converting bits to bytes.
@ -87,8 +88,7 @@ rec {
r = -27; r = -27;
q = -30; q = -30;
}; };
in in prefixes.${c};
prefixes.${c};
/* Gives the multiplier for the metric units. /* Gives the multiplier for the metric units.
@ -99,8 +99,7 @@ rec {
metricPrefixMultiplier "G" metricPrefixMultiplier "G"
=> 1000000000 => 1000000000
*/ */
metricPrefixMultiplier = c: metricPrefixMultiplier = c: self.math.pow 10 (SIPrefixExponent c);
self.math.pow 10 (SIPrefixExponent c);
/* Gives the exponent with the associated binary prefix. /* Gives the exponent with the associated binary prefix.
@ -126,8 +125,7 @@ rec {
M = 20; M = 20;
K = 10; K = 10;
}; };
in in prefixes.${c};
prefixes.${c};
/* Gives the multiplier for the given byte unit. Essentially returns the /* Gives the multiplier for the given byte unit. Essentially returns the
value in number of bytes. value in number of bytes.
@ -139,8 +137,7 @@ rec {
binaryPrefixMultiplier "G" binaryPrefixMultiplier "G"
=> 1.099511628×10¹² => 1.099511628×10¹²
*/ */
binaryPrefixMultiplier = c: binaryPrefixMultiplier = c: self.math.pow 2 (binaryPrefixExponent c);
self.math.pow 2 (binaryPrefixExponent c);
/* Parse the given string containing the size into its appropriate value. /* Parse the given string containing the size into its appropriate value.
Returns the value in number of bytes. Returns the value in number of bytes.
@ -157,37 +154,37 @@ rec {
*/ */
parseBytesSizeIntoInt = str: parseBytesSizeIntoInt = str:
let let
matches = builtins.match "([[:digit:]]+)[[:space:]]*([[:alpha:]]{1})(i?[B|b])" str; matches =
builtins.match "([[:digit:]]+)[[:space:]]*([[:alpha:]]{1})(i?[B|b])"
str;
numeral = lib.toInt (lib.lists.head matches); numeral = lib.toInt (lib.lists.head matches);
prefix = lib.lists.elemAt matches 1; prefix = lib.lists.elemAt matches 1;
suffix = lib.lists.last matches; suffix = lib.lists.last matches;
isBinary = lib.hasPrefix "i" suffix; isBinary = lib.hasPrefix "i" suffix;
multiplier = multiplier = let
let multiplierFn =
multiplierFn = if isBinary then binaryPrefixMultiplier else metricPrefixMultiplier; if isBinary then binaryPrefixMultiplier else metricPrefixMultiplier;
in in multiplierFn prefix;
multiplierFn prefix;
bitDivider = if lib.hasSuffix "b" suffix then 8 else 1; bitDivider = if lib.hasSuffix "b" suffix then 8 else 1;
in in numeral * multiplier / bitDivider;
numeral * multiplier / bitDivider;
/* /* Given an attrset of unit size object, return the size in bytes.
Given an attrset of unit size object, return the size in bytes.
Example: Example:
unitsToInt { size = 4; prefix = "G"; type = "binary"; } unitsToInt { size = 4; prefix = "G"; type = "binary"; }
=> 4294967296 => 4294967296
unitsToInt { size = 4; prefix = "G"; type = "metric"; } unitsToInt { size = 4; prefix = "G"; type = "metric"; }
=> 4000000000 => 4000000000
*/ */
unitsToInt = { size, prefix, type ? "binary" }: unitsToInt = { size, prefix, type ? "binary" }:
let let
multiplierFn = multiplierFn = if type == "binary" then
if type == "binary" then binaryPrefixMultiplier binaryPrefixMultiplier
else if type == "metric" then metricPrefixMultiplier else if type == "metric" then
else builtins.throw "no multiplier type ${type}"; metricPrefixMultiplier
in else
size * (multiplierFn prefix); builtins.throw "no multiplier type ${type}";
in size * (multiplierFn prefix);
} }

View File

@ -3,10 +3,8 @@
{ {
# This is only used for home-manager users without a NixOS user counterpart. # This is only used for home-manager users without a NixOS user counterpart.
mapHomeManagerUser = user: settings: mapHomeManagerUser = user: settings:
let let homeDirectory = "/home/${user}";
homeDirectory = "/home/${user}"; in ({ lib, ... }: {
in
({ lib, ... }: {
home-manager.users."${user}" = { ... }: { home-manager.users."${user}" = { ... }: {
imports = [ imports = [
{ {

View File

@ -36,6 +36,7 @@ in
inkscape-with-extensions # Illustration wannabe tool. inkscape-with-extensions # Illustration wannabe tool.
gimp-with-plugins # Photo editing wannabe tool. gimp-with-plugins # Photo editing wannabe tool.
krita # Digital art wannabe tool. krita # Digital art wannabe tool.
pureref # Pure references.
ffmpeg-full # Ah yes, everyman's multimedia swiss army knife. ffmpeg-full # Ah yes, everyman's multimedia swiss army knife.
imagemagick # Ah yes, everyman's image manipulation tool. imagemagick # Ah yes, everyman's image manipulation tool.
@ -54,7 +55,7 @@ in
audacity # EGADS!!! audacity # EGADS!!!
musescore # You won't find muses to score, only music: a common misconception. musescore # You won't find muses to score, only music: a common misconception.
zrythm # The freer FL Studio (if you're sailing by the high seven seas). zrythm # The freer FL Studio (if you're sailing by the high seven seas).
supercollider # Not to be confused with the other Super Collider. supercollider-with-plugins # Not to be confused with the other Super Collider.
sonic-pi # The only pie you'll get from this is worms which I heard is addicting. sonic-pi # The only pie you'll get from this is worms which I heard is addicting.
ffmpeg-full # Ah yes, everyman's multimedia swiss army knife. ffmpeg-full # Ah yes, everyman's multimedia swiss army knife.
] ]

View File

@ -48,6 +48,7 @@ in
# Both are good for hardening as it only requires the keyfiles. # Both are good for hardening as it only requires the keyfiles.
PasswordAuthentication = false; PasswordAuthentication = false;
PermitRootLogin = "no"; PermitRootLogin = "no";
PermitEmptyPasswords = "no";
}; };
}; };

View File

@ -0,0 +1,5 @@
= Horizontal hunger
:toc:
A custom desktop session fully made with https://github.com/YaLTeR/niri[niri] and https://github.com/Aylur/ags[ags].

View File

@ -0,0 +1,5 @@
App.config({
windows: [
// this is where window definitions will go
],
});

View File

@ -0,0 +1,195 @@
input {
keyboard {
xkb {
// You can set rules, model, layout, variant and options.
// For more information, see xkeyboard-config(7).
layout "us"
options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
}
}
touchpad {
tap
natural-scroll
accel-speed 0.2
}
mouse {
natural-scroll
accel-speed 0.2
}
warp-mouse-to-focus
focus-follows-mouse
}
// You can configure outputs by their name, which you can find
// by running `niri msg outputs` while inside a niri instance.
// The built-in laptop monitor is usually called "eDP-1".
// Find more information on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
// Remember to uncomment the node by removing "/-"!
/-output "eDP-1" {
mode "1920x1080@120.030"
scale 2.0
transform "normal"
position x=1280 y=0
}
layout {
gaps 5
center-focused-column "on-overflow"
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
default-column-width { proportion 0.33; }
focus-ring {
width 4
active-color "#7fc8ff"
inactive-color "#505050"
}
border {
off
width 4
active-color "#ffc87f"
inactive-color "#505050"
}
}
screenshot-path null
animations {
slowdown 2.0
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
}
binds {
Mod+T { spawn "alacritty"; }
Mod+D { spawn "fuzzel"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
Mod+Q { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
Mod+Ctrl+Left { move-column-left; }
Mod+Ctrl+Down { move-window-down; }
Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; }
Mod+Ctrl+H { move-column-left; }
Mod+Ctrl+J { move-window-down; }
Mod+Ctrl+K { move-window-up; }
Mod+Ctrl+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
// Mod+J { focus-window-or-workspace-down; }
// Mod+K { focus-window-or-workspace-up; }
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Shift+Left { focus-monitor-left; }
Mod+Shift+Down { focus-monitor-down; }
Mod+Shift+Up { focus-monitor-up; }
Mod+Shift+Right { focus-monitor-right; }
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+J { focus-monitor-down; }
Mod+Shift+K { focus-monitor-up; }
Mod+Shift+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
// ...
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Shift+U { move-workspace-down; }
Mod+Shift+I { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
Mod+Shift+WheelScrollDown { focus-column-right; }
Mod+Shift+WheelScrollUp { focus-column-left; }
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Ctrl+1 { move-column-to-workspace 1; }
Mod+Ctrl+2 { move-column-to-workspace 2; }
Mod+Ctrl+3 { move-column-to-workspace 3; }
Mod+Ctrl+4 { move-column-to-workspace 4; }
Mod+Ctrl+5 { move-column-to-workspace 5; }
Mod+Ctrl+6 { move-column-to-workspace 6; }
Mod+Ctrl+7 { move-column-to-workspace 7; }
Mod+Ctrl+8 { move-column-to-workspace 8; }
Mod+Ctrl+9 { move-column-to-workspace 9; }
}

View File

@ -0,0 +1,188 @@
{ config, options, lib, pkgs, foodogsquaredLib, ... }:
let
workflowId = "one.foodogsquared.HorizontalHunger";
cfg = config.workflows.workflows.${workflowId};
sessionConfig = config.programs.gnome-session.sessions.${workflowId};
requiredPackages = with pkgs; [
# The window manager. We only put this here since it has some commands that
# are useful to be having.
cfg.package
# The application opener.
junction
];
workflowEnvironment = foodogsquaredLib.nixos.mkNixoslikeEnvironment config {
name = "${workflowId}-env";
paths = requiredPackages ++ cfg.extraApps;
};
in
{
options.workflows.enable = lib.mkOption {
type = with lib.types; listOf (enum [ workflowId ]);
};
options.workflows.workflows.${workflowId} = {
package = lib.mkOption {
type = lib.types.package;
description = ''
Derivation containing {program}`niri` executable which is the preferred
window manager for this workflow.
'';
default = pkgs.niri;
};
extraApps = lib.mkOption {
type = with lib.types; listOf package;
default = with pkgs; [
flowtime
dialect
blanket
];
description = ''
A list of extraneous applications to be included with the desktop
session.
'';
};
};
config = lib.mkIf (lib.elem workflowId config.workflows.enable) {
# Enable all of the core services.
hardware.bluetooth.enable = true;
programs.dconf.enable = true;
programs.xwayland.enable = true;
programs.gnupg.agent = {
enable = lib.mkDefault true;
pinentryPackage = pkgs.pinentry-gnome3;
};
security.polkit.enable = true;
services.colord.enable = lib.mkDefault true;
services.gnome.gnome-keyring.enable = lib.mkDefault true;
services.power-profiles-daemon.enable = true;
services.udisks2.enable = lib.mkDefault true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
# Configuring the preferred network manager.
networking.networkmanager.enable = true;
# Configuring the XDG desktop components. Take note all of these are
# required for the desktop widgets components to work since they rely on
# them.
xdg.mime.enable = true;
xdg.icons.enable = true;
# For now, the portal configuration doesn't work since Niri is now
# hardcoded to set the apprioriate envs for portal component. It is
# considered broken (or rather unused) for now.
xdg.portal =
lib.mkMerge [
{
enable = lib.mkDefault true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
# The option value is only a coerced `lib.type.str` so ehhh...
config.${workflowId}.default =
[ "gtk" ]
++ lib.optionals (config.services.gnome.gnome-keyring.enable) [ "gnome" ];
}
(lib.mkIf config.services.gnome.gnome-keyring.enable {
config.${workflowId} = {
"org.freedesktop.impl.portal.Secret" = "gnome-keyring";
};
})
];
# Install of the programs.
environment.systemPackages = requiredPackages ++ cfg.extraApps;
# Configuring the actual desktop session.
programs.gnome-session.sessions.${workflowId} = {
fullName = "Horizontal Hunger";
desktopNames = [ workflowId ];
systemd.targetUnit =
let
requiredComponents = [ "window-manager" ];
getId = lib.foldlAttrs (acc: _: v: acc ++ [ "${v.id}.target" ]) [ ];
in {
requires = getId (lib.filterAttrs (n: _: lib.elem n requiredComponents) sessionConfig.components);
wants = getId (lib.attrsets.removeAttrs sessionConfig.components requiredComponents);
};
components = {
window-manager = {
script = "${lib.getExe' cfg.package "niri"} --config /tmp/shared/modules/nixos/_private/workflows/horizontal-hunger/config/niri/config";
description = "Window manager";
systemd.serviceUnit = {
serviceConfig = {
Type = "notify";
NotifyAccess = "all";
OOMScoreAdjust = -1000;
};
unitConfig = {
OnFailure = [ "gnome-session-shutdown.target" ];
OnFailureJobMode = "replace-irreversibly";
};
startLimitBurst = 5;
startLimitIntervalSec = 10;
};
systemd.targetUnit = {
partOf = [ "gnome-session-initialized.target" ];
after = [ "gnome-session-initialized.target" ];
};
};
desktop-widgets = {
script = "${lib.getExe' pkgs.ags "ags"} --config /tmp/shared/modules/nixos/_private/workflows/horizontal-hunger/config/ags/config.js";
description = "Desktop widgets";
systemd.serviceUnit = {
serviceConfig = {
Type = "notify";
NotifyAccess = "all";
OOMScoreAdjust = -1000;
};
unitConfig = {
OnFailure = [ "gnome-session-shutdown.target" ];
OnFailureJobMode = "replace-irreversibly";
};
};
systemd.targetUnit = {
partOf = [ "gnome-session-initialized.target" ];
after = [ "gnome-session-initialized.target" ];
};
};
auth-agent = {
script = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
description = "Authentication agent";
systemd.serviceUnit = {
serviceConfig = {
Type = "notify";
NotifyAccess = "all";
OOMScoreAdjust = -500;
};
};
systemd.targetUnit = {
partOf = [ "graphical-session.target" "gnome-session.target" ];
};
};
};
};
};
}

View File

@ -1,7 +1,7 @@
# A dedicated profile for installers with some niceties in it. This is also # A dedicated profile for installers with some niceties in it. This is also
# used for persistent live installers so you'll have to exclude setting up shop # used for persistent live installers so you'll have to exclude setting up shop
# and do that in the respective NixOS configuration instead. # and do that in the respective NixOS configuration instead.
{ pkgs, lib, modulesPath, ... }: { pkgs, lib, modulesPath, foodogsquaredLib, ... }:
{ {
imports = [ imports = [
@ -12,13 +12,14 @@
# Include some modern niceties. # Include some modern niceties.
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
curl
disko disko
ripgrep ripgrep
git git
lazygit lazygit
neovim neovim
zellij zellij
]; ] ++ foodogsquaredLib.stdenv;
# Yeah, that's right, this is also a Guix System installer because SCREW YOU, # Yeah, that's right, this is also a Guix System installer because SCREW YOU,
# NIXOS USERS! # NIXOS USERS!

View File

@ -7,21 +7,12 @@ let
let let
blenderVersion = lib.versions.majorMinor cfg.package.version; blenderVersion = lib.versions.majorMinor cfg.package.version;
in in
pkgs.runCommand "blender-system-resources" pkgs.symlinkJoin {
{ name = "blender-${blenderVersion}-addons";
passAsFile = [ "paths" ]; paths = let
paths = cfg.addons ++ [ cfg.package ]; _paths = cfg.addons ++ [ cfg.package ];
nativeBuildInputs = with pkgs; [ outils ]; in lib.concatMap (p: [ "${p}/share/blender" ]) _paths;
} '' };
mkdir -p $out
for i in $(cat $pathsPath); do
resourcesPath="$i/share/blender"
if [ -d $i/share/blender/${blenderVersion} ]; then
resourcesPath="$i/share/blender/${blenderVersion}";
fi
lndir -silent $resourcesPath $out
done
'';
in in
{ {
options.programs.blender = { options.programs.blender = {

View File

@ -0,0 +1,91 @@
{ config, lib, pkgs, utils, ... }:
let
cfg = config.services.docker-compose;
settingsFormat = pkgs.formats.yaml { };
jobModule = { name, lib, config, ... }: {
options = {
extraArgs = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
description = ''
Job-specific set of arguments to be added to {command}`docker compose`.
'';
};
files = lib.mkOption {
type = with lib.types; listOf path;
description = ''
List of files to be used when setting up the docker-compose service.
'';
default = [];
example = lib.literalExpression ''
[
/path/to/docker-compose.yml
]
'';
};
settings = lib.mkOption {
type = settingsFormat.type;
description = ''
Configuration to be used for the docker-compose process.
'';
default = { };
example = {
};
};
};
config = {
extraArgs =
cfg.extraArgs
++ lib.concatMap (f: [ "--file" f ]) config.files;
files = lib.optionals (config.settings != { }) [
(settingsFormat.generate "docker-compose-generated-${name}" config.settings)
];
};
};
mkDockerComposeService = name: value:
lib.nameValuePair "docker-compose-${utils.escapeSystemdPath name}" {
path = [ config.virtualisation.docker.package ];
script = "docker compose --project-name ${name} up";
postStop = "docker compose --project-name ${name} down";
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
in
{
options.services.docker-compose = {
enable = lib.mkEnableOption "integration with docker-compose";
extraArgs = lib.mkOption {
type = with lib.types; listOf str;
default = [];
};
jobs = lib.mkOption {
type = with lib.types; attrsOf (submodule jobModule);
default = { };
description = ''
A jobset of Docker compose services to be integrated with the system.
'';
};
};
config = lib.mkIf cfg.enable {
assertions = lib.singleton {
assertion = cfg.enable && config.virtualisation.docker.enable;
message = "Docker server is not enabled.";
};
systemd.services = lib.mapAttrs' mkDockerComposeService cfg.jobs;
};
}

View File

@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }:
let
cfg = config.fonts;
fontsModuleFactory = { isGlobal ? false }: {
enable = lib.mkEnableOption "local fonts support" // {
default = if isGlobal then false else cfg.enable;
};
packages = lib.mkOption {
type = with lib.types; listOf package;
description =
if isGlobal then ''
Global list of fonts to be added per wrapper (with the local fonts
support enabled anyways).
'' else ''
List of fonts to be added to the wrapper.
'';
default = [ ];
example = lib.literalExpression ''
with pkgs; [
noto-sans
source-sans-pro
source-code-pro
stix
]
'';
};
};
in
{
options.fonts = fontsModuleFactory { isGlobal = true; };
wrappers =
let
fontsSubmodule = { config, lib, name, pkgs, ... }: let
submoduleCfg = config.fonts;
in {
options.fonts = fontsModuleFactory { isGlobal = false; };
config = let
fontCache = pkgs.makeFontsCache {
inherit (pkgs) fontconfig;
fontsDirectories = submoduleCfg.packages;
};
in lib.mkIf submoduleCfg.enable {
fonts.packages = cfg.packages;
};
};
in lib.mkOption {
type = with lib.types; attrsOf (submodule fontsSubmodule);
};
}

View File

@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
let
cfg = config.programs.tmux;
in
{
options.programs.tmux = {
enable = lib.mkEnableOption "configuring a tmux wrapper";
package = lib.mkPackageOption pkgs "tmux" { };
plugins = lib.mkOption {
type = with lib.types; listOf (either package pluginSubmodule);
description = ''
List of tmux plugins to be included at your
configuration.
'';
default = [ ];
example = lib.literalExpression ''
with pkgs; [
tmuxPlugins.cpu
{
plugin = tmuxPlugins.resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
]
'';
};
executableName = lib.mkOption {
type = lib.types.nonEmptyStr;
description = "The wrapper's executable name.";
default = "tmux-custom";
example = "tmux-your-mom";
};
extraArgs = lib.mkOption {
type = with lib.types; listOf str;
description = ''
List of arguments to be prepended to the user-given arguments.
'';
};
};
config = lib.mkIf cfg.enable {
basePackage = cfg.package;
wrappers.tmux = {
inherit (cfg) executableName;
prependArgs = cfg.extraArgs;
};
};
}

View File

@ -7,5 +7,6 @@
ffmpeg-foodogsquared = import ./ffmpeg-foodogsquared; ffmpeg-foodogsquared = import ./ffmpeg-foodogsquared;
firefox-foodogsquared = import ./firefox-foodogsquared; firefox-foodogsquared = import ./firefox-foodogsquared;
blender-foodogsquared = import ./blender-foodogsquared; blender-foodogsquared = import ./blender-foodogsquared;
rotp-foodogsquared = import ./rotp-foodogsquared;
thunderbird-foodogsquared = import ./thunderbird-foodogsquared; thunderbird-foodogsquared = import ./thunderbird-foodogsquared;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -0,0 +1,24 @@
final: prev:
let
rotpDesktop = prev.makeDesktopItem {
name = "com.remnantsoftheprecursors.ROTP";
desktopName = "Remnants of the Precursors";
exec = "rotp";
type = "Application";
icon = "com.remnantsoftheprecursors.ROTP";
categories = [ "Application" "Game" ];
};
in
{
rotp-foodogsquared = prev.rotp.overrideAttrs (finalAttrs: prevAttrs: {
desktopItems = (prevAttrs.desktopItems or []) ++ [ rotpDesktop ];
nativeBuildInputs = prevAttrs.nativeBuildInputs or [] ++ [
prev.copyDesktopItems
];
postInstall = ''
${prevAttrs.postInstall or ""}
install -Dm0644 ${./com.remnantsoftheprecursors.ROTP.png} ${placeholder "out"}/share/icons/hicolor/128x128/apps/com.remnantsoftheprecursors.ROTP.png
'';
});
}

View File

@ -23,6 +23,7 @@ in lib.makeScope pkgs.newScope (self: {
distant = callPackage ./distant.nix { }; distant = callPackage ./distant.nix { };
gnome-search-provider-recoll = gnome-search-provider-recoll =
callPackage ./gnome-search-provider-recoll.nix { }; callPackage ./gnome-search-provider-recoll.nix { };
go-avahi-cname = callPackage ./go-avahi-cname { };
hush-shell = callPackage ./hush-shell.nix { }; hush-shell = callPackage ./hush-shell.nix { };
lazyjj = callPackage ./lazyjj { }; lazyjj = callPackage ./lazyjj { };
lwp = callPackage ./lwp { }; lwp = callPackage ./lwp { };

View File

@ -88,10 +88,10 @@
}; };
"open-access-helper" = buildFirefoxXpiAddon { "open-access-helper" = buildFirefoxXpiAddon {
pname = "open-access-helper"; pname = "open-access-helper";
version = "2025.2.1"; version = "2025.2";
addonId = "info@oahelper.org"; addonId = "info@oahelper.org";
url = "https://addons.mozilla.org/firefox/downloads/file/4414378/open_access_helper-2025.2.1.xpi"; url = "https://addons.mozilla.org/firefox/downloads/file/4414263/open_access_helper-2025.2.xpi";
sha256 = "ecba30f17d957323ed0bf9f6c246fba59d1232f42d6f90caa4b8d83716a57783"; sha256 = "8acfb2a15b39e406e3b9e59272424e35627892e76acb4b0e3ed42b09968eed4a";
meta = with lib; meta = with lib;
{ {
homepage = "https://www.oahelper.org"; homepage = "https://www.oahelper.org";
@ -129,6 +129,20 @@
platforms = platforms.all; platforms = platforms.all;
}; };
}; };
"rsshub-radar" = buildFirefoxXpiAddon {
pname = "rsshub-radar";
version = "2.0.21";
addonId = "i@diygod.me";
url = "https://addons.mozilla.org/firefox/downloads/file/4369623/rsshub_radar-2.0.21.xpi";
sha256 = "ffa6bd7d98080feea5e551f4873b02ec923af061f1db79c22accad2e14458e1e";
meta = with lib;
{
homepage = "https://github.com/DIYgod/RSSHub-Radar";
description = "Easily find and subscribe to RSS and RSSHub.";
mozPermissions = [ "storage" "tabs" "offscreen" "alarms" "<all_urls>" ];
platforms = platforms.all;
};
};
"simple-translate" = buildFirefoxXpiAddon { "simple-translate" = buildFirefoxXpiAddon {
pname = "simple-translate"; pname = "simple-translate";
version = "3.0.0"; version = "3.0.0";
@ -214,4 +228,3 @@
platforms = platforms.all; platforms = platforms.all;
}; };
}; };
}

View File

@ -31,5 +31,8 @@
}, },
{ {
"slug": "open-access-helper" "slug": "open-access-helper"
},
{
"slug": "rsshub-radar"
} }
] ]

View File

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "go-avahi-cname";
version = "2.0.6";
src = fetchFromGitHub {
owner = "grishy";
repo = "go-avahi-cname";
rev = "v${version}";
hash = "sha256-hOX7/9mgWkdm6Rwe5zg0n4WC6y4erilMP5QPEWVSadI=";
};
vendorHash = "sha256-EmEnnENKzWUY5djFZlKWNFLkyZ1hzNW+4HF0ui45GjI=";
meta = with lib; {
homepage = "https://github.com/grishy/go-avahi-cname";
license = licenses.mit;
description = "Lightweight mDNS publisher of subdomains for your machine";
mainProgram = "go-avahi-cname";
maintainers = with maintainers; [ foo-dogsquared ];
};
}

View File

@ -0,0 +1,26 @@
{ rustPlatform, cargo-tauri_1, fetchFromGitHub, wrapGAppsHook, wasm-bindgen-cli, pkg-config, lib }:
rustPlatform.buildRustPackage rec {
pname = "graphite-design-tool";
version = "unstable-2024-12-07";
src = fetchFromGitHub {
owner = "GraphiteEditor";
repo = "graphite";
rev = "b21b1cbfc7cb808ec5e2c66b090660506f07833f";
hash = "sha256-RJYzS7TUViszDXomShw2h6DOVrER/VkW7cP69aEOQ/k=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-+p9bpj+cSd0Bkpg+e4lwo4C7XqxZBc0McYYsNxAqzaA=";
nativeBuildInputs = [ cargo-tauri_1 pkg-config wrapGAppsHook wasm-bindgen-cli ];
meta = with lib; {
homepage = "https://graphite.rs/";
description = "2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow";
license = licenses.asl20;
maintainers = with maintainers; [ foo-dogsquared ];
mainProgram = "graphite";
};
}

42
pkgs/pd-l2ork/default.nix Normal file
View File

@ -0,0 +1,42 @@
{ stdenv,
lib,
fetchFromGitHub,
autoreconfHook,
bison,
fftw,
libtool,
libjack2,
bluez,
udev
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pd-l2ork";
version = "20241224";
src = fetchFromGitHub {
owner = "pd-l2ork";
repo = "pd-l2ork";
rev = finalAttrs.version;
hash = "sha256-A+ETptD1R+Pb4r2qgD0YxV7KYeAb9iLBwENhYQyjBc4=";
};
nativeBuildInputs = [
libtool
];
buildInputs = [
bison
fftw
libjack2
bluez
udev
];
meta = with lib; {
homepage = "http://l2ork.music.vt.edu/";
description = "Pure Data flavor based on Purr Data";
license = licenses.bsd3;
platforms = platforms.linux ++ platforms.darwin;
};
})

View File

@ -0,0 +1,51 @@
{ stdenv,
lib,
fetchFromGitHub,
bison,
fftw,
libtool,
libjack2,
bluez,
udev,
wget,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pd-l2ork";
version = "20241224";
src = fetchFromGitHub {
owner = "pd-l2ork";
repo = "pd-l2ork";
rev = finalAttrs.version;
hash = "sha256-A+ETptD1R+Pb4r2qgD0YxV7KYeAb9iLBwENhYQyjBc4=";
};
nativeBuildInputs = [
libtool
];
buildInputs = [
bison
fftw
libjack2
bluez
udev
wget
];
preBuild = ''
patchShebangs l2ork_addons/*.sh
'';
buildFlags = [
"prefix=${placeholder "out"}"
];
meta = with lib; {
homepage = "http://l2ork.music.vt.edu/";
description = "Pure Data flavor based on Purr Data";
license = licenses.bsd3;
platforms = platforms.linux ++ platforms.darwin;
};
})

View File

@ -0,0 +1,52 @@
{ lib,
fetchFromGitHub,
maven,
libwebp,
vorbis-tools,
}:
maven.buildMavenPackage rec {
pname = "rotp-fusion";
version = "2024/06/13/2254";
src = fetchFromGitHub {
owner = "Xilmi";
repo = "Rotp-Fusion";
# We'll just use URL-encoded strings just to be safe.
rev = "2024%2F06%2F13%2F2254";
hash = "sha256-gupeVfIrbFm5B11NdERtnXgkzRMa+yw5vC9MJVeXcys=";
};
mvnHash = "";
nativeBuildInputs = [
libwebp
vorbis-tools
];
meta = with lib; {
description = "Mod of Remnants of the Precursors with more features";
homepage = "https://github.com/Xilmi/Rotp-Fusion";
license = with licenses; [
# For the Java codebase made by Ray Fowler.
gpl3Only
# Java Files in `src/rotp/apachemath` folder.
asl20
# The Java-rewrite of the following code at:
#
# http://hjemmesider.diku.dk/~torbenm/Planet
{
free = true;
url = "http://hjemmesider.diku.dk/~torbenm/Planet";
}
# All images made by Peter Penev, audio from Remi Agullo, and
# various text written by Jeff Colucci and its translations.
cc-by-nc-nd-40
];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,11 @@
{
lib,
rotp,
fetchFromGitHub,
}:
rotp.overrideAttrs (finalAttrs: prevAttrs: {
src = fetchFromGitHub {
};
})

30
pkgs/tailcall/default.nix Normal file
View File

@ -0,0 +1,30 @@
{ rustPlatform, lib, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "tailcall";
version = "0.129.0";
src = fetchFromGitHub {
owner = "tailcallhq";
repo = "tailcall";
rev = "v${version}";
hash = "sha256-tTj1hugq6a6rAKwUsS072pCizsB/BYaBlu8OWGYKNsk=";
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"genai-0.1.7-wip" = "sha256-peqM0rBLnL4F0M6o8CO/+ttv9eOLV4VkDEy2e4x7dn0=";
"htpasswd-verify-0.3.0" = "sha256-GbkY590xWEZ+lVT9nffs4HIRW6CwBjll4rGIk27waxo=";
"posthog-rs-0.2.3" = "sha256-1HxOEzc8GROStxuxG0cfCNa4iA04sCD7jD6uWT5bl2o=";
"serde_json_borrow-0.7.0" = "sha256-UcgIWjdSCkYRYxEcWbwQs+BxX41ITqkvFSFtzEJchVk=";
};
};
meta = with lib; {
homepage = "https://tailcall.run";
description = "GraphQL runtime";
license = licenses.asl20;
mainProgram = "tailcall";
};
}

View File

@ -0,0 +1,25 @@
= Changelog
:toc:
All changes in Bahaghari will be documented here for their users to see.
The structure is loosely based on https://keepachangelog.com/en/1.1.0/[Keep a changelog format] except we separate the sections by the module and the library set instead.
This is structured like this so it is easier to skim things.
// TODO: Update the release date once released.
[#0-1-0]
== 0.1.0 (unreleased)
[#0-1-0-module-sets]
=== Module sets
* Initialize Bahaghari module set including options for its schemes, templates, and builder.
* Include the Bahaghari library set as part of the module argument.
[#0-1-0-library-set]
=== Library set
* Initialize Tinted Theming-specific library subset.
* Implement a basic math subset intended for computing with color namespaces (or whatever use cases for basic mathematics).
* Implement basic color namespace for RGB, HSL, and HSLUV.
* Create Tinted Theming-speific utilities subset.

View File

@ -0,0 +1,45 @@
# HSLuv implementation in Nix. This is taken from the reference implementation,
# specifically from the JavaScript implementation at
# https://github.com/hsluv/hsluv-javascript.
{ pkgs, lib, self }:
let
inherit (self.colors) rgb hsl;
refY = 1.0;
refU = 0.19783000664283;
refV = 0.46831999493879;
kappa = 903.2962962;
epsilon = 0.0088564516;
m = {
r = [ 3.240969941904521 (-1.537383177570093) (-0.498610760293) ];
g = [ (-0.96924363628087) 1.87596750150772 0.041555057407175 ];
b = [ 0.055630079696993 (-0.20397695888897) 1.056971514242878 ];
};
fromLinear = number:
if number <= 0.0031308 then
12.92 * number
else
1.055 * (self.math.pow number (1 / 2.4)) - 0.055;
toLinear = number:
if number > 0.04045 then
self.math.pow ((number + 0.055) / 1.055) 2.4
else
number / 12.92;
in
rec {
inherit (hsl) valueHueMin valueHueMax valueParamMin valueParamMax;
HSLuv = color: {};
toRgb = { h, s, l, ... }@color: {
};
toHex = color: rgb.toHex (toRgb color);
toHex' = color: rgb.toHex' (toRgb color);
}

View File

@ -0,0 +1,57 @@
{ config, options, lib, pkgs, bahaghariLib, ... }:
{
options.bahaghari.panapton = {
package = lib.mkPackageOption pkgs "panapton" { };
dataFiles = lib.mkOption {
type = with lib.types; listOf package;
default = [ ];
description = ''
A list of derivations containing Panapton data files (e.g., templates,
schemes) to be included within Panapton builder operations. It is
expected that the data files are in `$out/share/panapton`.
If you want to include only a specific type of data file, you can use
{option}`bahaghari.panapton.{scheme,template}Dirs` instead.
'';
example = ''
[
(pkgs.callPackage ./custom-panapton-schemes-and-templates.nix)
pkgs.foodogsquared-panapton-data-files
]
'';
};
schemeDirs = lib.mkOption {
type = with lib.types; listOf path;
description = ''
A list of scheme directories to be included within Panapton builder
operations.
'';
default = [ ];
example = ''
[
./foodogsquared-custom-panapton-schemes
./foodogsquared-custom-panapton-schemes-extension
]
'';
};
templateDirs = lib.mkOption {
type = with lib.types; listOf path;
description = ''
A list of template directories to be included within Panapton builder
operations.
'';
default = [ ];
example = ''
[
./my-panapton-templates
./my-other-panapton-templates
]
'';
};
};
}

View File

@ -0,0 +1,8 @@
# A bunch of utilities to be used in a bunch of tests.
{ lib, self }:
{
# The typical rounding procedure for our results. 10 decimal places should be
# enough to test accuracy at least for a basic math subset like this.
round' = self.math.round' (-10);
}