chore: organise modules

Organise modules in a significantly better way with categories.
This commit is contained in:
Nico 2025-05-03 16:16:03 +10:00
parent 7444260d7d
commit 3660ef23f1
33 changed files with 77 additions and 76 deletions

33
modules/nix/darwin.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
{
system.activationScripts.applications.text = let
appsSrc = config.system.build.applications + /Applications;
baseDir = "/Applications/Nix Apps";
in
pkgs.lib.mkForce ''
echo 'Setting up /Applications/Nix Apps...' >&2
appsSrc="${appsSrc}"
if [ -d "$appsSrc" ]; then
baseDir="${baseDir}"
rsyncFlags=(
--archive
--checksum
--chmod=-w
--copy-unsafe-links
--delete
--no-group
--no-owner
)
$DRY_RUN_CMD mkdir -p "$baseDir"
$DRY_RUN_CMD ${lib.getBin pkgs.rsync}/bin/rsync \
''${VERBOSE_ARG:+-v} "''${rsyncFlags[@]}" "$appsSrc/" "$baseDir"
fi
'';
# use determinate nix
nix.enable = false;
# changing this might break
system.stateVersion = 5;
}

9
modules/nix/linux.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
# Nix Configuration
nixpkgs.config.allowUnfree = true;
# Enable nix-command and flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}