mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
chore: reformat codebase
This commit is contained in:
parent
5ea8fcb0cf
commit
3a7816a901
@ -3,7 +3,8 @@
|
|||||||
let
|
let
|
||||||
lib' = pkgs.lib.extend (final: prev:
|
lib' = pkgs.lib.extend (final: prev:
|
||||||
import ./lib { lib = prev; } // import ./lib/private.nix { lib = final; });
|
import ./lib { lib = prev; } // import ./lib/private.nix { lib = final; });
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
lib = import ./lib { lib = pkgs.lib; };
|
lib = import ./lib { lib = pkgs.lib; };
|
||||||
modules = lib'.importModules (lib'.filesToAttr ./modules/nixos);
|
modules = lib'.importModules (lib'.filesToAttr ./modules/nixos);
|
||||||
overlays.foo-dogsquared-pkgs = final: prev: import ./pkgs { pkgs = prev; };
|
overlays.foo-dogsquared-pkgs = final: prev: import ./pkgs { pkgs = prev; };
|
||||||
|
@ -395,7 +395,8 @@
|
|||||||
# Take note for automatically imported nodes, various options should be
|
# Take note for automatically imported nodes, various options should be
|
||||||
# overridden in the deploy utility considering that most have only
|
# overridden in the deploy utility considering that most have only
|
||||||
# certain values and likely not work if run with the intended value.
|
# certain values and likely not work if run with the intended value.
|
||||||
deploy.nodes = (lib'.mapAttrs' (name: value:
|
deploy.nodes = (lib'.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib'.nameValuePair name {
|
lib'.nameValuePair name {
|
||||||
hostname = name;
|
hostname = name;
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
@ -403,7 +404,8 @@
|
|||||||
user = "root";
|
user = "root";
|
||||||
path = inputs.deploy.lib.${defaultSystem}.activate.nixos value;
|
path = inputs.deploy.lib.${defaultSystem}.activate.nixos value;
|
||||||
};
|
};
|
||||||
}) self.nixosConfigurations);
|
})
|
||||||
|
self.nixosConfigurations);
|
||||||
|
|
||||||
# How to make yourself slightly saner than before. So far the main checks
|
# How to make yourself slightly saner than before. So far the main checks
|
||||||
# are for deploy nodes.
|
# are for deploy nodes.
|
||||||
|
@ -31,7 +31,8 @@ rec {
|
|||||||
|
|
||||||
collect = file: type: {
|
collect = file: type: {
|
||||||
name = lib.removeSuffix ".nix" file;
|
name = lib.removeSuffix ".nix" file;
|
||||||
value = let path = dirPath + "/${file}";
|
value =
|
||||||
|
let path = dirPath + "/${file}";
|
||||||
in if (type == "regular")
|
in if (type == "regular")
|
||||||
|| (type == "directory" && lib.pathExists (path + "/default.nix")) then
|
|| (type == "directory" && lib.pathExists (path + "/default.nix")) then
|
||||||
path
|
path
|
||||||
@ -40,7 +41,8 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
files = lib.filterAttrs isModule (builtins.readDir dirPath);
|
files = lib.filterAttrs isModule (builtins.readDir dirPath);
|
||||||
in lib.filterAttrs (name: value: value != { })
|
in
|
||||||
|
lib.filterAttrs (name: value: value != { })
|
||||||
(lib.mapAttrs' collect files);
|
(lib.mapAttrs' collect files);
|
||||||
|
|
||||||
/* Collect all modules (results from `filesToAttr`) into a list.
|
/* Collect all modules (results from `filesToAttr`) into a list.
|
||||||
|
@ -14,7 +14,8 @@ rec {
|
|||||||
# TODO: Effectively override the option.
|
# TODO: Effectively override the option.
|
||||||
# We assume all users set with this module are normal users.
|
# We assume all users set with this module are normal users.
|
||||||
absoluteOverrides = { isNormalUser = true; };
|
absoluteOverrides = { isNormalUser = true; };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home-manager.users."${user}" = { ... }: {
|
home-manager.users."${user}" = { ... }: {
|
||||||
imports = [ (getUser "home-manager" user) ];
|
imports = [ (getUser "home-manager" user) ];
|
||||||
};
|
};
|
||||||
@ -32,15 +33,18 @@ rec {
|
|||||||
userList = lib.attrNames users';
|
userList = lib.attrNames users';
|
||||||
|
|
||||||
nonExistentUsers = lib.filter (name: !lib.elem name userList) users;
|
nonExistentUsers = lib.filter (name: !lib.elem name userList) users;
|
||||||
in lib.trivial.throwIfNot ((lib.length nonExistentUsers) == 0)
|
in
|
||||||
|
lib.trivial.throwIfNot ((lib.length nonExistentUsers) == 0)
|
||||||
"there are no users ${lib.concatMapStringsSep ", " (u: "'${u}'") nonExistentUsers} from ${type}"
|
"there are no users ${lib.concatMapStringsSep ", " (u: "'${u}'") nonExistentUsers} from ${type}"
|
||||||
(r: r) users';
|
(r: r)
|
||||||
|
users';
|
||||||
|
|
||||||
getUser = type: user:
|
getUser = type: user:
|
||||||
lib.getAttr user (getUsers type [ user ]);
|
lib.getAttr user (getUsers type [ user ]);
|
||||||
|
|
||||||
# Import modules with a set blocklist.
|
# Import modules with a set blocklist.
|
||||||
importModules = attrs: let
|
importModules = attrs:
|
||||||
|
let
|
||||||
blocklist = [
|
blocklist = [
|
||||||
# The modules under this attribute are often incomplete and needing
|
# The modules under this attribute are often incomplete and needing
|
||||||
# very specific requirements that is 99% going to be absent from the
|
# very specific requirements that is 99% going to be absent from the
|
||||||
|
@ -15,9 +15,11 @@ let
|
|||||||
# Some plugins may be packaged ala-busybox with multiple plugins coming from
|
# Some plugins may be packaged ala-busybox with multiple plugins coming from
|
||||||
# the same binary. Similar reasons as to why we don't want to rewrite
|
# the same binary. Similar reasons as to why we don't want to rewrite
|
||||||
# symlinks with the main package.
|
# symlinks with the main package.
|
||||||
plugins = lib.map (p: p.overrideAttrs (prev: {
|
plugins = lib.map
|
||||||
|
(p: p.overrideAttrs (prev: {
|
||||||
dontRewriteSymlinks = true;
|
dontRewriteSymlinks = true;
|
||||||
})) cfg.plugins;
|
}))
|
||||||
|
cfg.plugins;
|
||||||
|
|
||||||
# Plugins and scripts are assumed to be packaged at
|
# Plugins and scripts are assumed to be packaged at
|
||||||
# `$out/share/pop-launcher`.
|
# `$out/share/pop-launcher`.
|
||||||
@ -57,7 +59,7 @@ in
|
|||||||
List of packages containing Pop launcher plugins and scripts to be
|
List of packages containing Pop launcher plugins and scripts to be
|
||||||
installed as system-wide plugins.
|
installed as system-wide plugins.
|
||||||
'';
|
'';
|
||||||
default = [];
|
default = [ ];
|
||||||
defaultText = "[]";
|
defaultText = "[]";
|
||||||
example = lib.literalExpression ''
|
example = lib.literalExpression ''
|
||||||
with pkgs; [
|
with pkgs; [
|
||||||
|
@ -40,7 +40,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.archivebox = {
|
options.services.archivebox = {
|
||||||
enable = lib.mkEnableOption "Archivebox service";
|
enable = lib.mkEnableOption "Archivebox service";
|
||||||
|
|
||||||
@ -92,10 +93,12 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
pkgSet = [ pkgs.archivebox ] ++ (lib.optionals cfg.withDependencies
|
pkgSet = [ pkgs.archivebox ] ++ (lib.optionals cfg.withDependencies
|
||||||
(with pkgs; [ chromium nodejs_latest wget curl youtube-dl ]));
|
(with pkgs; [ chromium nodejs_latest wget curl youtube-dl ]));
|
||||||
in lib.mkIf cfg.enable {
|
in
|
||||||
|
lib.mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
(lib.hm.assertions.assertPlatform "services.archivebox" pkgs
|
(lib.hm.assertions.assertPlatform "services.archivebox" pkgs
|
||||||
lib.platforms.linux)
|
lib.platforms.linux)
|
||||||
@ -104,7 +107,8 @@ in {
|
|||||||
home.packages = pkgSet;
|
home.packages = pkgSet;
|
||||||
|
|
||||||
systemd.user.services = lib.mkMerge [
|
systemd.user.services = lib.mkMerge [
|
||||||
(lib.mapAttrs' (name: value:
|
(lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description =
|
Description =
|
||||||
@ -113,7 +117,8 @@ in {
|
|||||||
Documentation = [ "https://docs.archivebox.io/" ];
|
Documentation = [ "https://docs.archivebox.io/" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = let
|
Service =
|
||||||
|
let
|
||||||
scriptName = "archivebox-job-${config.home.username}-${name}";
|
scriptName = "archivebox-job-${config.home.username}-${name}";
|
||||||
script = pkgs.writeShellApplication {
|
script = pkgs.writeShellApplication {
|
||||||
name = scriptName;
|
name = scriptName;
|
||||||
@ -125,11 +130,13 @@ in {
|
|||||||
| archivebox add ${lib.concatStringsSep " " value.extraArgs}
|
| archivebox add ${lib.concatStringsSep " " value.extraArgs}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
ExecStart = "${script}/bin/${scriptName}";
|
ExecStart = "${script}/bin/${scriptName}";
|
||||||
WorkingDirectory = cfg.archivePath;
|
WorkingDirectory = cfg.archivePath;
|
||||||
};
|
};
|
||||||
}) cfg.jobs)
|
})
|
||||||
|
cfg.jobs)
|
||||||
|
|
||||||
(lib.mkIf cfg.webserver.enable {
|
(lib.mkIf cfg.webserver.enable {
|
||||||
archivebox-server = {
|
archivebox-server = {
|
||||||
@ -152,7 +159,8 @@ in {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.timers = lib.mapAttrs' (name: value:
|
systemd.user.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Archivebox additions for ${cfg.archivePath}";
|
Description = "Archivebox additions for ${cfg.archivePath}";
|
||||||
@ -167,6 +175,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "timers.target" ];
|
Install.WantedBy = [ "timers.target" ];
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,8 @@ let
|
|||||||
"thunderbird.passwords"
|
"thunderbird.passwords"
|
||||||
"thunderbird.sessionjson"
|
"thunderbird.sessionjson"
|
||||||
];
|
];
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.bleachbit = {
|
options.services.bleachbit = {
|
||||||
enable = lib.mkEnableOption "automated cleanup with Bleachbit";
|
enable = lib.mkEnableOption "automated cleanup with Bleachbit";
|
||||||
startAt = lib.mkOption {
|
startAt = lib.mkOption {
|
||||||
@ -81,7 +82,7 @@ in {
|
|||||||
cleaners = lib.mkOption {
|
cleaners = lib.mkOption {
|
||||||
type = with lib.types; listOf str;
|
type = with lib.types; listOf str;
|
||||||
description = "List of cleaners to be used when cleaning.";
|
description = "List of cleaners to be used when cleaning.";
|
||||||
default = [];
|
default = [ ];
|
||||||
example = lib.literalExpression ''
|
example = lib.literalExpression ''
|
||||||
[
|
[
|
||||||
"bash.history"
|
"bash.history"
|
||||||
|
@ -82,7 +82,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.gallery-dl = {
|
options.services.gallery-dl = {
|
||||||
enable = lib.mkEnableOption "archiving services with gallery-dl";
|
enable = lib.mkEnableOption "archiving services with gallery-dl";
|
||||||
|
|
||||||
@ -163,7 +164,8 @@ in {
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services = lib.mapAttrs' (name: value:
|
systemd.user.services = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "gallery-dl archive job for group '${name}'";
|
Description = "gallery-dl archive job for group '${name}'";
|
||||||
@ -171,7 +173,8 @@ in {
|
|||||||
Documentation = "man:gallery-dl(1)";
|
Documentation = "man:gallery-dl(1)";
|
||||||
};
|
};
|
||||||
|
|
||||||
Service.ExecStart = let
|
Service.ExecStart =
|
||||||
|
let
|
||||||
scriptName = "gallery-dl-service-${config.home.username}-${name}";
|
scriptName = "gallery-dl-service-${config.home.username}-${name}";
|
||||||
jobSpecificSettingsFile =
|
jobSpecificSettingsFile =
|
||||||
settingsFormat.generate "gallery-dl-service-job-${name}-settings"
|
settingsFormat.generate "gallery-dl-service-job-${name}-settings"
|
||||||
@ -187,10 +190,13 @@ in {
|
|||||||
"--config ${jobSpecificSettingsFile}"
|
"--config ${jobSpecificSettingsFile}"
|
||||||
} --destination ${cfg.archivePath} ${lib.escapeShellArgs value.urls}
|
} --destination ${cfg.archivePath} ${lib.escapeShellArgs value.urls}
|
||||||
'';
|
'';
|
||||||
in "${archiveScript}/bin/${scriptName}";
|
in
|
||||||
}) cfg.jobs;
|
"${archiveScript}/bin/${scriptName}";
|
||||||
|
})
|
||||||
|
cfg.jobs;
|
||||||
|
|
||||||
systemd.user.timers = lib.mapAttrs' (name: value:
|
systemd.user.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "gallery-dl archive job for group '${name}'";
|
Description = "gallery-dl archive job for group '${name}'";
|
||||||
@ -204,6 +210,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "timers.target" ];
|
Install.WantedBy = [ "timers.target" ];
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,8 @@ let
|
|||||||
|
|
||||||
toPloverINI = with lib;
|
toPloverINI = with lib;
|
||||||
generators.toINI {
|
generators.toINI {
|
||||||
mkKeyValue = generators.mkKeyValueDefault {
|
mkKeyValue = generators.mkKeyValueDefault
|
||||||
|
{
|
||||||
mkValueString = v:
|
mkValueString = v:
|
||||||
if v == true then
|
if v == true then
|
||||||
"True"
|
"True"
|
||||||
@ -16,13 +17,14 @@ let
|
|||||||
} " = ";
|
} " = ";
|
||||||
};
|
};
|
||||||
|
|
||||||
ploverIniFormat = { }: {
|
ploverIniFormat = {}: {
|
||||||
type = (pkgs.formats.ini { }).type;
|
type = (pkgs.formats.ini { }).type;
|
||||||
generate = name: value: pkgs.writeText name (toPloverINI value);
|
generate = name: value: pkgs.writeText name (toPloverINI value);
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsFormat = ploverIniFormat { };
|
settingsFormat = ploverIniFormat { };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.plover = {
|
options.services.plover = {
|
||||||
enable = lib.mkEnableOption "Plover stenography engine service";
|
enable = lib.mkEnableOption "Plover stenography engine service";
|
||||||
|
|
||||||
|
@ -63,7 +63,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.yt-dlp = {
|
options.services.yt-dlp = {
|
||||||
enable = lib.mkEnableOption "archiving service with yt-dlp";
|
enable = lib.mkEnableOption "archiving service with yt-dlp";
|
||||||
|
|
||||||
@ -135,7 +136,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.user.services = lib.mapAttrs' (name: value:
|
systemd.user.services = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "yt-dlp archive job for group '${name}'";
|
Description = "yt-dlp archive job for group '${name}'";
|
||||||
@ -149,7 +151,8 @@ in {
|
|||||||
lib.escapeShellArg cfg.archivePath
|
lib.escapeShellArg cfg.archivePath
|
||||||
}"
|
}"
|
||||||
'';
|
'';
|
||||||
ExecStart = let
|
ExecStart =
|
||||||
|
let
|
||||||
scriptName =
|
scriptName =
|
||||||
"yt-dlp-archive-service-${config.home.username}-${name}";
|
"yt-dlp-archive-service-${config.home.username}-${name}";
|
||||||
jobLevelArgs = lib.escapeShellArgs value.extraArgs;
|
jobLevelArgs = lib.escapeShellArgs value.extraArgs;
|
||||||
@ -158,13 +161,16 @@ in {
|
|||||||
${cfg.package}/bin/yt-dlp ${serviceLevelArgs} ${jobLevelArgs} \
|
${cfg.package}/bin/yt-dlp ${serviceLevelArgs} ${jobLevelArgs} \
|
||||||
${urls} --paths ${lib.escapeShellArg cfg.archivePath}
|
${urls} --paths ${lib.escapeShellArg cfg.archivePath}
|
||||||
'';
|
'';
|
||||||
in "${archiveScript}/bin/${scriptName}";
|
in
|
||||||
|
"${archiveScript}/bin/${scriptName}";
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
|
|
||||||
systemd.user.timers = lib.mapAttrs' (name: value:
|
systemd.user.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "yt-dlp archive job for group '${name}'";
|
Description = "yt-dlp archive job for group '${name}'";
|
||||||
@ -178,6 +184,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ "timers.target" ];
|
Install.WantedBy = [ "timers.target" ];
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.profiles.filesystem;
|
cfg = config.profiles.filesystem;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.profiles.filesystem = {
|
options.profiles.filesystem = {
|
||||||
archive.enable = lib.mkOption {
|
archive.enable = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
@ -217,7 +217,8 @@ in {
|
|||||||
};
|
};
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
flags = [
|
flags = [
|
||||||
"--update-input" "nixpkgs"
|
"--update-input"
|
||||||
|
"nixpkgs"
|
||||||
"--commit-lock-file"
|
"--commit-lock-file"
|
||||||
"--no-write-lock-file"
|
"--no-write-lock-file"
|
||||||
];
|
];
|
||||||
|
@ -6,7 +6,8 @@ let
|
|||||||
cardboardPackage = cfg.package.overrideAttrs (super: rec {
|
cardboardPackage = cfg.package.overrideAttrs (super: rec {
|
||||||
passthru.providedSessions = [ "cardboard" ];
|
passthru.providedSessions = [ "cardboard" ];
|
||||||
});
|
});
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.programs.cardboard-wm = {
|
options.programs.cardboard-wm = {
|
||||||
enable =
|
enable =
|
||||||
lib.mkEnableOption "Cardboard, a scrollable tiling Wayland compositor";
|
lib.mkEnableOption "Cardboard, a scrollable tiling Wayland compositor";
|
||||||
@ -23,13 +24,13 @@ in {
|
|||||||
|
|
||||||
extraOptions = lib.mkOption {
|
extraOptions = lib.mkOption {
|
||||||
type = with lib.types; listOf str;
|
type = with lib.types; listOf str;
|
||||||
default = [];
|
default = [ ];
|
||||||
description = "Command-line arguments to be passed to Cardboard.";
|
description = "Command-line arguments to be passed to Cardboard.";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraPackages = lib.mkOption {
|
extraPackages = lib.mkOption {
|
||||||
type = with lib.types; listOf package;
|
type = with lib.types; listOf package;
|
||||||
default = [];
|
default = [ ];
|
||||||
description = ''
|
description = ''
|
||||||
Extra packages to be installed with this program.
|
Extra packages to be installed with this program.
|
||||||
'';
|
'';
|
||||||
|
@ -4,7 +4,8 @@ let
|
|||||||
cfg = config.programs.kiwmi;
|
cfg = config.programs.kiwmi;
|
||||||
|
|
||||||
package = cfg.package.override { extraOptions = cfg.extraOptions; };
|
package = cfg.package.override { extraOptions = cfg.extraOptions; };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.programs.kiwmi = {
|
options.programs.kiwmi = {
|
||||||
enable = lib.mkEnableOption "Kiwmi, a fully programmable Wayland compositor";
|
enable = lib.mkEnableOption "Kiwmi, a fully programmable Wayland compositor";
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
|
@ -14,9 +14,11 @@ let
|
|||||||
|
|
||||||
# Some plugins may be packaged busybox-style with multiple plugins in one
|
# Some plugins may be packaged busybox-style with multiple plugins in one
|
||||||
# binary.
|
# binary.
|
||||||
plugins = lib.lists.map (p: p.overrideAttrs (prev: {
|
plugins = lib.lists.map
|
||||||
|
(p: p.overrideAttrs (prev: {
|
||||||
dontRewriteSymlinks = true;
|
dontRewriteSymlinks = true;
|
||||||
})) cfg.plugins;
|
}))
|
||||||
|
cfg.plugins;
|
||||||
|
|
||||||
# Plugins and scripts are assumed to be packaged at
|
# Plugins and scripts are assumed to be packaged at
|
||||||
# `$out/share/pop-launcher`.
|
# `$out/share/pop-launcher`.
|
||||||
@ -58,7 +60,7 @@ in
|
|||||||
List of packages containing Pop launcher plugins and scripts to be
|
List of packages containing Pop launcher plugins and scripts to be
|
||||||
installed as system-wide plugins.
|
installed as system-wide plugins.
|
||||||
'';
|
'';
|
||||||
default = [];
|
default = [ ];
|
||||||
defaultText = "[]";
|
defaultText = "[]";
|
||||||
example = lib.literalExpression ''
|
example = lib.literalExpression ''
|
||||||
with pkgs; [
|
with pkgs; [
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.wezterm;
|
cfg = config.programs.wezterm;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.programs.wezterm = {
|
options.programs.wezterm = {
|
||||||
enable = lib.mkEnableOption "Wezterm terminal emulator";
|
enable = lib.mkEnableOption "Wezterm terminal emulator";
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
|
@ -42,7 +42,8 @@ let
|
|||||||
persistent = lib.mkEnableOption "service persistence for this job";
|
persistent = lib.mkEnableOption "service persistence for this job";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.archivebox = {
|
options.services.archivebox = {
|
||||||
enable = lib.mkEnableOption "Archivebox service";
|
enable = lib.mkEnableOption "Archivebox service";
|
||||||
|
|
||||||
@ -96,12 +97,15 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
|
let
|
||||||
pkgSet = [ pkgs.archivebox ] ++ (lib.optionals cfg.withDependencies
|
pkgSet = [ pkgs.archivebox ] ++ (lib.optionals cfg.withDependencies
|
||||||
(with pkgs; [ chromium nodejs_latest wget curl youtube-dl ]));
|
(with pkgs; [ chromium nodejs_latest wget curl youtube-dl ]));
|
||||||
in lib.mkIf cfg.enable {
|
in
|
||||||
|
lib.mkIf cfg.enable {
|
||||||
systemd.services = lib.mkMerge [
|
systemd.services = lib.mkMerge [
|
||||||
(lib.mapAttrs' (name: value:
|
(lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
description =
|
description =
|
||||||
"Archivebox archive group '${name}' for ${cfg.archivePath}";
|
"Archivebox archive group '${name}' for ${cfg.archivePath}";
|
||||||
@ -131,7 +135,8 @@ in {
|
|||||||
SystemCallErrorNumber = "EPERM";
|
SystemCallErrorNumber = "EPERM";
|
||||||
WorkingDirectory = cfg.archivePath;
|
WorkingDirectory = cfg.archivePath;
|
||||||
};
|
};
|
||||||
}) cfg.jobs)
|
})
|
||||||
|
cfg.jobs)
|
||||||
|
|
||||||
(lib.mkIf cfg.webserver.enable {
|
(lib.mkIf cfg.webserver.enable {
|
||||||
archivebox-server = {
|
archivebox-server = {
|
||||||
@ -165,7 +170,8 @@ in {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.timers = lib.mapAttrs' (name: value:
|
systemd.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
description =
|
description =
|
||||||
"Archivebox archive group '${name}' for ${cfg.archivePath}";
|
"Archivebox archive group '${name}' for ${cfg.archivePath}";
|
||||||
@ -177,6 +183,7 @@ in {
|
|||||||
RandomizedDelaySec = 120;
|
RandomizedDelaySec = 120;
|
||||||
};
|
};
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.gallery-dl = {
|
options.services.gallery-dl = {
|
||||||
enable = lib.mkEnableOption "archiving services with gallery-dl";
|
enable = lib.mkEnableOption "archiving services with gallery-dl";
|
||||||
|
|
||||||
@ -157,7 +158,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.services = lib.mapAttrs' (name: value:
|
systemd.services = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "gallery-dl archive job for group '${name}'";
|
description = "gallery-dl archive job for group '${name}'";
|
||||||
@ -177,11 +179,13 @@ in {
|
|||||||
# `--config` option. This means that it will cascade resultings
|
# `--config` option. This means that it will cascade resultings
|
||||||
# settings from `extraArgs` if there's any related option that is
|
# settings from `extraArgs` if there's any related option that is
|
||||||
# given like another `--config` for example.
|
# given like another `--config` for example.
|
||||||
script = let
|
script =
|
||||||
|
let
|
||||||
jobLevelSettingsFile =
|
jobLevelSettingsFile =
|
||||||
settingsFormat.generate "gallery-dl-job-${name}-settings"
|
settingsFormat.generate "gallery-dl-job-${name}-settings"
|
||||||
value.settings;
|
value.settings;
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
gallery-dl ${lib.escapeShellArgs cfg.extraArgs} ${
|
gallery-dl ${lib.escapeShellArgs cfg.extraArgs} ${
|
||||||
lib.optionalString (cfg.settings != null)
|
lib.optionalString (cfg.settings != null)
|
||||||
"--config ${settingsFormatFile}"
|
"--config ${settingsFormatFile}"
|
||||||
@ -207,14 +211,17 @@ in {
|
|||||||
SystemCallFilter = "@system-service";
|
SystemCallFilter = "@system-service";
|
||||||
SystemCallErrorNumber = "EPERM";
|
SystemCallErrorNumber = "EPERM";
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
|
|
||||||
systemd.timers = lib.mapAttrs' (name: value:
|
systemd.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
Persistent = value.persistent;
|
Persistent = value.persistent;
|
||||||
RandomizedDelaySec = "2min";
|
RandomizedDelaySec = "2min";
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,8 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.services.yt-dlp = {
|
options.services.yt-dlp = {
|
||||||
enable = lib.mkEnableOption "archiving service with yt-dlp";
|
enable = lib.mkEnableOption "archiving service with yt-dlp";
|
||||||
|
|
||||||
@ -130,7 +131,9 @@ in {
|
|||||||
# There's no need to go to the working directory since yt-dlp has the
|
# There's no need to go to the working directory since yt-dlp has the
|
||||||
# `--paths` flag.
|
# `--paths` flag.
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.services = lib.mapAttrs' (name: value: let
|
systemd.services = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
|
let
|
||||||
jobLevelArgs = lib.escapeShellArgs value.extraArgs;
|
jobLevelArgs = lib.escapeShellArgs value.extraArgs;
|
||||||
in
|
in
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
@ -163,14 +166,17 @@ in {
|
|||||||
SystemCallFilter = "@system-service";
|
SystemCallFilter = "@system-service";
|
||||||
SystemCallErrorNumber = "EPERM";
|
SystemCallErrorNumber = "EPERM";
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
|
|
||||||
systemd.timers = lib.mapAttrs' (name: value:
|
systemd.timers = lib.mapAttrs'
|
||||||
|
(name: value:
|
||||||
lib.nameValuePair (jobUnitName name) {
|
lib.nameValuePair (jobUnitName name) {
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
Persistent = value.persistent;
|
Persistent = value.persistent;
|
||||||
RandomizedDelaySec = "2min";
|
RandomizedDelaySec = "2min";
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
})
|
||||||
|
cfg.jobs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
# We're combining all of the custom dconf database into a package to be installed.
|
# We're combining all of the custom dconf database into a package to be installed.
|
||||||
dconfConfig = pkgs.runCommand "install-a-happy-gnome-dconf-keyfiles" {} ''
|
dconfConfig = pkgs.runCommand "install-a-happy-gnome-dconf-keyfiles" { } ''
|
||||||
install -Dm644 ${./config/dconf}/*.conf -t $out/etc/dconf/db/${name}-conf.d
|
install -Dm644 ${./config/dconf}/*.conf -t $out/etc/dconf/db/${name}-conf.d
|
||||||
install -Dm644 ${enabledExtensions} $out/etc/dconf/db/${name}-conf.d/90-enabled-extensions.conf
|
install -Dm644 ${enabledExtensions} $out/etc/dconf/db/${name}-conf.d/90-enabled-extensions.conf
|
||||||
'';
|
'';
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.workflows.workflows.knome;
|
cfg = config.workflows.workflows.knome;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.workflows.workflows.knome.enable = lib.mkEnableOption "KNOME, an attempt to bring as much GNOME to KDE Plasma";
|
options.workflows.workflows.knome.enable = lib.mkEnableOption "KNOME, an attempt to bring as much GNOME to KDE Plasma";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
{ lib, callPackage, newScope, python3Packages, ... }:
|
{ lib, callPackage, newScope, python3Packages, ... }:
|
||||||
|
|
||||||
lib.fix' (self: let
|
lib.fix' (self:
|
||||||
|
let
|
||||||
callPackage = newScope self;
|
callPackage = newScope self;
|
||||||
in lib.recurseIntoAttrs {
|
in
|
||||||
|
lib.recurseIntoAttrs {
|
||||||
attrs-strict = callPackage ./attrs-strict.nix { inherit python3Packages; };
|
attrs-strict = callPackage ./attrs-strict.nix { inherit python3Packages; };
|
||||||
aiohttp-utils = callPackage ./aiohttp-utils.nix { inherit python3Packages; };
|
aiohttp-utils = callPackage ./aiohttp-utils.nix { inherit python3Packages; };
|
||||||
|
|
||||||
|
@ -27,6 +27,6 @@
|
|||||||
}) // {
|
}) // {
|
||||||
overlays.default = final: prev: import ./pkgs { pkgs = prev; };
|
overlays.default = final: prev: import ./pkgs { pkgs = prev; };
|
||||||
|
|
||||||
nixosModules = {};
|
nixosModules = { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@ let
|
|||||||
|
|
||||||
musicDir = config.xdg.userDirs.music;
|
musicDir = config.xdg.userDirs.music;
|
||||||
playlistsDir = "${musicDir}/playlists";
|
playlistsDir = "${musicDir}/playlists";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
songrec
|
songrec
|
||||||
vscodium-fhs
|
vscodium-fhs
|
||||||
|
Loading…
Reference in New Issue
Block a user