nix fmt
This commit is contained in:
@@ -254,9 +254,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixOnDroidConfigurations.default = let
|
||||
nixOnDroidConfigurations.default =
|
||||
let
|
||||
pkgs = mkPkgs { system = arm; };
|
||||
in nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
in
|
||||
nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
modules = [
|
||||
./common
|
||||
./nix-on-droid
|
||||
|
@@ -797,19 +797,28 @@ let
|
||||
${pure_flags [ "genshin" "D" ] (envelope_is "genshin@shelvacu.com")}
|
||||
${pure_flags [ "jork" "B" ] (envelope_is "jork@shelvacu.com")}
|
||||
${pure_flags [ "patreon" "not-spamish" ] (envelope_is "patreon@shelvacu.com")}
|
||||
${pure_flags [ "patreon-post" "B.subscriptions" ] [
|
||||
${pure_flags
|
||||
[ "patreon-post" "B.subscriptions" ]
|
||||
[
|
||||
(has_flag "patreon")
|
||||
(header_is "X-Mailgun-Tag" "template_newsletterpostcontrol")
|
||||
]}
|
||||
${pure_flags [ "patreon-free-member-digest" "D" ] [
|
||||
]
|
||||
}
|
||||
${pure_flags
|
||||
[ "patreon-free-member-digest" "D" ]
|
||||
[
|
||||
(has_flag "patreon")
|
||||
(header_is "X-Mailgun-Tag" "template_freememberdigest")
|
||||
]}
|
||||
${pure_flags [ "patreon-other" "B" ] [
|
||||
]
|
||||
}
|
||||
${pure_flags
|
||||
[ "patreon-other" "B" ]
|
||||
[
|
||||
(has_flag "patreon")
|
||||
(not (has_flag "patreon-post"))
|
||||
(not (has_flag "patreon-free-member-digest"))
|
||||
]}
|
||||
]
|
||||
}
|
||||
${pure_flags [ "rsb" "B" ] (from_is "support@rapidseedbox.com")}
|
||||
${pure_flags [ "fresh-avocado-dis8" "D" ] (envelope_is "fresh.avocado@dis8.net")}
|
||||
${pure_flags [ "discord" "A" ] (envelope_matches "discord@*")}
|
||||
|
@@ -81,13 +81,19 @@ in
|
||||
enable = true;
|
||||
package = cfg.lfs.package;
|
||||
};
|
||||
vacu.git.config = lib.mkIf cfg.lfs.enable (let bin = lib.getExe cfg.lfs.package; in {
|
||||
vacu.git.config = lib.mkIf cfg.lfs.enable (
|
||||
let
|
||||
bin = lib.getExe cfg.lfs.package;
|
||||
in
|
||||
{
|
||||
filter.lfs = {
|
||||
clean = "${bin} clean -- %f";
|
||||
smudge = "${bin} smudge -- %f";
|
||||
process = "${bin} filter-process";
|
||||
required = true;
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
} // lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
}
|
||||
// lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
|
@@ -80,4 +80,5 @@ in
|
||||
// lib.optionalAttrs (vacuModuleType == "nix-on-droid") {
|
||||
environment.etc.hosts.text = config.vacu.etcHostsText;
|
||||
};
|
||||
} // lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
}
|
||||
// lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
|
@@ -111,4 +111,5 @@ in
|
||||
// lib.optionalAttrs (vacuModuleType == "nix-on-droid") {
|
||||
environment.packages = config.vacu.finalPackageList;
|
||||
};
|
||||
} // lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
}
|
||||
// lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
|
@@ -91,4 +91,5 @@ in
|
||||
// lib.optionalAttrs (vacuModuleType == "nix-on-droid") {
|
||||
environment.etc."ssh/ssh_config".text = config.vacu.ssh.config;
|
||||
};
|
||||
} // lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
}
|
||||
// lib.optionalAttrs (vacuModuleType == "nixos") { _class = "nixos"; }
|
||||
|
@@ -464,7 +464,8 @@ in
|
||||
default = pkgs.writeFile "autoexec.cfg" cfg.autoexecLines;
|
||||
readOnly = true;
|
||||
};
|
||||
build.classes = mkAttrsOfClasses (classname:
|
||||
build.classes = mkAttrsOfClasses (
|
||||
classname:
|
||||
mkOption {
|
||||
type = types.pkg;
|
||||
default = pkgs.writeText "${classname}.cfg" cfg.classLines.${classname};
|
||||
|
4
nur.nix
4
nur.nix
@@ -3,6 +3,8 @@
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
packagePaths = import ./packages;
|
||||
shelPackages = builtins.mapAttrs (_: path: lib.callPackageWith (pkgs // shelPackages) path { }) packagePaths;
|
||||
shelPackages = builtins.mapAttrs (
|
||||
_: path: lib.callPackageWith (pkgs // shelPackages) path { }
|
||||
) packagePaths;
|
||||
in
|
||||
shelPackages
|
||||
|
@@ -6,7 +6,8 @@
|
||||
let
|
||||
filePkg = writeText "shellvaculib.bash" (builtins.readFile ./shellvaculib.bash);
|
||||
in
|
||||
runCommandLocal "shellvaculib" {
|
||||
runCommandLocal "shellvaculib"
|
||||
{
|
||||
passthru.file = filePkg;
|
||||
|
||||
meta = {
|
||||
@@ -16,7 +17,8 @@ runCommandLocal "shellvaculib" {
|
||||
# no mainProgram
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
} ''
|
||||
}
|
||||
''
|
||||
mkdir -p "$out"/share
|
||||
mkdir -p "$out"/bin
|
||||
ln -s ${filePkg} "$out"/share/shellvaculib.bash
|
||||
|
@@ -3,7 +3,15 @@ let
|
||||
btrfs-progs = pkgs.btrfs-progs;
|
||||
btrfs = "${btrfs-progs}/bin/btrfs";
|
||||
btrfsDevice = "/dev/mapper/prophecy-root-decrypted";
|
||||
btrfsOpts = [ "compress=zstd:2" "datacow" "datasum" "discard=async" "ssd_spread" "noatime" "fatal_errors=panic" ];
|
||||
btrfsOpts = [
|
||||
"compress=zstd:2"
|
||||
"datacow"
|
||||
"datasum"
|
||||
"discard=async"
|
||||
"ssd_spread"
|
||||
"noatime"
|
||||
"fatal_errors=panic"
|
||||
];
|
||||
in
|
||||
{
|
||||
fileSystems."/" = {
|
||||
|
@@ -19,11 +19,13 @@ in
|
||||
clientKeyPath = config.sops.secrets.hathClientKey.path;
|
||||
};
|
||||
};
|
||||
environment.persistence."/persistent".directories = [ {
|
||||
environment.persistence."/persistent".directories = [
|
||||
{
|
||||
directory = "/var/lib/hath";
|
||||
user = config.vacu.hath.user;
|
||||
group = config.vacu.hath.group;
|
||||
mode = "u=rwx,g=,o=";
|
||||
} ];
|
||||
}
|
||||
];
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ from typing import Any
|
||||
|
||||
import humanfriendly
|
||||
|
||||
|
||||
@dataclass
|
||||
class ProcessResult[T]:
|
||||
stdout: T
|
||||
@@ -90,13 +91,17 @@ args = parser.parse_args()
|
||||
min_space_bytes = human_friendly.parse_size(args.min_space)
|
||||
min_space_text = human_friendly.format_size(min_space_bytes)
|
||||
|
||||
|
||||
def clean_if_space_needed():
|
||||
usage = shutil.disk_usage("/nix/store")
|
||||
if usage.free < min_space_bytes:
|
||||
free_space_text = human_friendly.format_size(usage.free)
|
||||
print(f"free space ({free_space_text}) is less than min ({min_space_text}), running a gc")
|
||||
print(
|
||||
f"free space ({free_space_text}) is less than min ({min_space_text}), running a gc"
|
||||
)
|
||||
must_succeed("nix", "store", "gc")
|
||||
|
||||
|
||||
res = run_json("nix", "eval", ".#.", "--json", "--apply", "f: f.archival.archiveList")
|
||||
assert res.success()
|
||||
build_list = res.stdout
|
||||
|
@@ -1,6 +1,4 @@
|
||||
{
|
||||
python3Packages,
|
||||
writers,
|
||||
}: writers.writePython3Bin "vacu-flake-archive" {
|
||||
libraries = [ python3Packages.humanfriendly ];
|
||||
} (builtins.readFile ./archive.py)
|
||||
{ python3Packages, writers }:
|
||||
writers.writePython3Bin "vacu-flake-archive" { libraries = [ python3Packages.humanfriendly ]; } (
|
||||
builtins.readFile ./archive.py
|
||||
)
|
||||
|
@@ -1,7 +1,9 @@
|
||||
{ ... }@passedArgs:
|
||||
let
|
||||
lib = passedArgs.lib or passedArgs.pkgs.lib;
|
||||
args = passedArgs // { inherit lib vaculib; };
|
||||
args = passedArgs // {
|
||||
inherit lib vaculib;
|
||||
};
|
||||
directoryListing = builtins.removeAttrs (builtins.readDir ./.) [ "default.nix" ];
|
||||
filePaths = lib.mapAttrsToList (
|
||||
k: v:
|
||||
|
Reference in New Issue
Block a user