clean up some scopes
This commit is contained in:
parent
95d2252b1e
commit
fad8e51f94
54 changed files with 1281 additions and 1296 deletions
|
@ -5,117 +5,120 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (lib)
|
||||||
sync_mod =
|
types
|
||||||
with lib;
|
mkOption
|
||||||
types.submodule (
|
concatStrings
|
||||||
{ config, ... }:
|
mkIf
|
||||||
{
|
mkEnableOption
|
||||||
options = {
|
;
|
||||||
remote = mkOption {
|
inherit (config.grimmShared) enable cloudSync;
|
||||||
type = types.nonEmptyStr;
|
inherit (pkgs) nextcloud-client writeShellScriptBin;
|
||||||
description = "path on the cloud server";
|
|
||||||
};
|
|
||||||
|
|
||||||
local = mkOption {
|
sync_mod = types.submodule (
|
||||||
type = types.nonEmptyStr;
|
{ config, ... }:
|
||||||
default = "$HOME/" + (concatStrings (builtins.match "/*(.+)" config.remote));
|
{
|
||||||
description = "local path to sync";
|
options = {
|
||||||
|
remote = mkOption {
|
||||||
|
type = types.nonEmptyStr;
|
||||||
|
description = "path on the cloud server";
|
||||||
|
};
|
||||||
|
|
||||||
|
local = mkOption {
|
||||||
|
type = types.nonEmptyStr;
|
||||||
|
default = "$HOME/" + (concatStrings (builtins.match "/*(.+)" config.remote));
|
||||||
|
description = "local path to sync";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (enable && cloudSync.enable) (
|
||||||
|
let
|
||||||
|
cloud_cmd = ''${nextcloud-client}/bin/nextcloudcmd -u ${cloudSync.username} -p "$(cat ${cloudSync.passwordFile})" -h -n --path'';
|
||||||
|
sync_server = "https://${cloudSync.server}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
(writeShellScriptBin "cloudsync-cmd" (cloud_cmd + " $@ " + sync_server))
|
||||||
|
nextcloud-client
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services = lib.mkMerge (
|
||||||
|
lib.mapAttrsToList (
|
||||||
|
local_user: user_conf:
|
||||||
|
let
|
||||||
|
paths = user_conf.syncPaths;
|
||||||
|
sync_script = lib.strings.concatLines (
|
||||||
|
map (
|
||||||
|
{ local, remote }:
|
||||||
|
let
|
||||||
|
remote_clean = lib.strings.concatStrings (builtins.match "/*(.+)" remote);
|
||||||
|
in
|
||||||
|
"${cloud_cmd} /${remote_clean} ${local} ${sync_server}"
|
||||||
|
) paths
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# user-specific sync jobs
|
||||||
|
"nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
|
||||||
|
description = "Auto sync Nextcloud";
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
serviceConfig.Type = "simple";
|
||||||
|
serviceConfig.User = local_user;
|
||||||
|
serviceConfig.Group = "users";
|
||||||
|
script = sync_script;
|
||||||
|
# TimeoutStopSec = "180";
|
||||||
|
# KillMode = "process";
|
||||||
|
# KillSignal = "SIGINT";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) config.users.users
|
||||||
|
);
|
||||||
|
|
||||||
|
systemd.timers = lib.mkMerge (
|
||||||
|
lib.mapAttrsToList (
|
||||||
|
local_user: user_conf:
|
||||||
|
let
|
||||||
|
paths = user_conf.syncPaths;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# user-specific sync jobs
|
||||||
|
"nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
|
||||||
|
description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes";
|
||||||
|
timerConfig.OnBootSec = "5min";
|
||||||
|
timerConfig.OnUnitActiveSec = "60min";
|
||||||
|
wantedBy = [
|
||||||
|
"multi-user.target"
|
||||||
|
"timers.target"
|
||||||
|
];
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) config.users.users
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
options.users.users = mkOption {
|
||||||
|
type = types.attrsOf (
|
||||||
|
types.submodule {
|
||||||
|
options = {
|
||||||
|
syncPaths = mkOption {
|
||||||
|
type = types.listOf sync_mod;
|
||||||
|
default = [ ];
|
||||||
|
description = "paths to sync via nextcloud";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
};
|
||||||
{
|
|
||||||
config =
|
|
||||||
with cfg;
|
|
||||||
lib.mkIf (enable && cloudSync.enable) (
|
|
||||||
let
|
|
||||||
cloud_cmd = ''${pkgs.nextcloud-client}/bin/nextcloudcmd -u ${config.grimmShared.cloudSync.username} -p "$(cat ${config.grimmShared.cloudSync.passwordFile})" -h -n --path'';
|
|
||||||
sync_server = "https://${config.grimmShared.cloudSync.server}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
(writeShellScriptBin "cloudsync-cmd" (cloud_cmd + " $@ " + sync_server))
|
|
||||||
nextcloud-client
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services = lib.mkMerge (
|
options.grimmShared.cloudSync = {
|
||||||
lib.mapAttrsToList (
|
|
||||||
local_user: user_conf:
|
|
||||||
let
|
|
||||||
paths = user_conf.syncPaths;
|
|
||||||
sync_script = lib.strings.concatLines (
|
|
||||||
map (
|
|
||||||
{ local, remote }:
|
|
||||||
let
|
|
||||||
remote_clean = lib.strings.concatStrings (builtins.match "/*(.+)" remote);
|
|
||||||
in
|
|
||||||
"${cloud_cmd} /${remote_clean} ${local} ${sync_server}"
|
|
||||||
) paths
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# user-specific sync jobs
|
|
||||||
"nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
|
|
||||||
description = "Auto sync Nextcloud";
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wants = [ "network-online.target" ];
|
|
||||||
serviceConfig.Type = "simple";
|
|
||||||
serviceConfig.User = local_user;
|
|
||||||
serviceConfig.Group = "users";
|
|
||||||
script = sync_script;
|
|
||||||
# TimeoutStopSec = "180";
|
|
||||||
# KillMode = "process";
|
|
||||||
# KillSignal = "SIGINT";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
) config.users.users
|
|
||||||
);
|
|
||||||
|
|
||||||
systemd.timers = lib.mkMerge (
|
|
||||||
lib.mapAttrsToList (
|
|
||||||
local_user: user_conf:
|
|
||||||
let
|
|
||||||
paths = user_conf.syncPaths;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# user-specific sync jobs
|
|
||||||
"nextcloud-autosync-${local_user}" = lib.mkIf (paths != [ ]) {
|
|
||||||
description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes";
|
|
||||||
timerConfig.OnBootSec = "5min";
|
|
||||||
timerConfig.OnUnitActiveSec = "60min";
|
|
||||||
wantedBy = [
|
|
||||||
"multi-user.target"
|
|
||||||
"timers.target"
|
|
||||||
];
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
) config.users.users
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
options.users.users =
|
|
||||||
with lib;
|
|
||||||
mkOption {
|
|
||||||
type = types.attrsOf (
|
|
||||||
types.submodule {
|
|
||||||
options = {
|
|
||||||
syncPaths = mkOption {
|
|
||||||
type = types.listOf sync_mod;
|
|
||||||
default = [ ];
|
|
||||||
description = "paths to sync via nextcloud";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
options.grimmShared.cloudSync = with lib; {
|
|
||||||
enable = mkEnableOption "cloud_sync";
|
enable = mkEnableOption "cloud_sync";
|
||||||
|
|
||||||
username = mkOption {
|
username = mkOption {
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ lib, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.grimmShared = {
|
options.grimmShared = {
|
||||||
|
|
|
@ -5,68 +5,77 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared)
|
||||||
|
enable
|
||||||
|
firefox
|
||||||
|
tooling
|
||||||
|
locale
|
||||||
|
sway
|
||||||
|
;
|
||||||
|
inherit (lib)
|
||||||
|
mkIf
|
||||||
|
optionals
|
||||||
|
mapAttrs
|
||||||
|
optionalAttrs
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && firefox.enable) {
|
||||||
with cfg;
|
environment.systemPackages =
|
||||||
lib.mkIf (enable && firefox.enable) {
|
[ ]
|
||||||
environment.systemPackages =
|
++ optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
|
||||||
|
|
||||||
|
programs.firefox = {
|
||||||
|
package = pkgs.firefox-beta;
|
||||||
|
enable = true;
|
||||||
|
nativeMessagingHosts.packages =
|
||||||
[ ]
|
[ ]
|
||||||
++ lib.optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
|
++ lib.optionals (tooling.enable && tooling.pass) [ pkgs.passff-host ];
|
||||||
|
languagePacks = optionals locale [
|
||||||
programs.firefox = {
|
"de"
|
||||||
package = pkgs.firefox-beta;
|
"en-US"
|
||||||
enable = true;
|
];
|
||||||
nativeMessagingHosts.packages =
|
policies = {
|
||||||
[ ]
|
ExtensionSettings =
|
||||||
++ lib.optionals (cfg.tooling.enable && cfg.tooling.pass) [ pkgs.passff-host ];
|
(mkIf firefox.disableUserPlugins { "*".installation_mode = "blocked"; })
|
||||||
languagePacks = lib.optionals cfg.locale [
|
// (mapAttrs (guid: shortId: {
|
||||||
"de"
|
# explicit plugins by config
|
||||||
"en-US"
|
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
|
||||||
];
|
installation_mode = "force_installed";
|
||||||
policies = {
|
}) firefox.plugins)
|
||||||
ExtensionSettings = lib.mkMerge [
|
// (mkIf (tooling.enable && tooling.pass) {
|
||||||
(lib.mkIf cfg.firefox.disableUserPlugins { "*".installation_mode = "blocked"; })
|
# password-store support
|
||||||
(lib.mapAttrs (guid: shortId: {
|
"passff@invicem.pro" = {
|
||||||
# explicit plugins by config
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi";
|
||||||
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
|
|
||||||
installation_mode = "force_installed";
|
installation_mode = "force_installed";
|
||||||
}) cfg.firefox.plugins)
|
};
|
||||||
(lib.mkIf (cfg.tooling.enable && cfg.tooling.pass) {
|
});
|
||||||
# password-store support
|
DisableTelemetry = true;
|
||||||
"passff@invicem.pro" = {
|
DisableFirefoxStudies = true;
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/passff/latest.xpi";
|
EnableTrackingProtection = {
|
||||||
installation_mode = "force_installed";
|
Value = true;
|
||||||
};
|
Locked = true;
|
||||||
})
|
Cryptomining = true;
|
||||||
];
|
Fingerprinting = true;
|
||||||
DisableTelemetry = true;
|
|
||||||
DisableFirefoxStudies = true;
|
|
||||||
EnableTrackingProtection = {
|
|
||||||
Value = true;
|
|
||||||
Locked = true;
|
|
||||||
Cryptomining = true;
|
|
||||||
Fingerprinting = true;
|
|
||||||
};
|
|
||||||
DisablePocket = true;
|
|
||||||
DisableFirefoxAccounts = true;
|
|
||||||
DisableAccounts = true;
|
|
||||||
DisableFirefoxScreenshots = true;
|
|
||||||
OverrideFirstRunPage = "";
|
|
||||||
OverridePostUpdatePage = "";
|
|
||||||
DontCheckDefaultBrowser = true;
|
|
||||||
Preferences = {
|
|
||||||
"pdfjs.enableScripting" = false;
|
|
||||||
|
|
||||||
"media.hardware-video-decoding.enabled" = true;
|
|
||||||
"media.ffmpeg.vaapi.enabled" = true;
|
|
||||||
"media.rdd-ffmpeg.enabled" = true;
|
|
||||||
"media.navigator.mediadatadecoder_vpx_enabled" = true;
|
|
||||||
} // lib.optionalAttrs cfg.sway.enable { "browser.tabs.inTitlebar" = 0; };
|
|
||||||
};
|
};
|
||||||
|
DisablePocket = true;
|
||||||
|
DisableFirefoxAccounts = true;
|
||||||
|
DisableAccounts = true;
|
||||||
|
DisableFirefoxScreenshots = true;
|
||||||
|
OverrideFirstRunPage = "";
|
||||||
|
OverridePostUpdatePage = "";
|
||||||
|
DontCheckDefaultBrowser = true;
|
||||||
|
Preferences = {
|
||||||
|
"pdfjs.enableScripting" = false;
|
||||||
|
|
||||||
|
"media.hardware-video-decoding.enabled" = true;
|
||||||
|
"media.ffmpeg.vaapi.enabled" = true;
|
||||||
|
"media.rdd-ffmpeg.enabled" = true;
|
||||||
|
"media.navigator.mediadatadecoder_vpx_enabled" = true;
|
||||||
|
} // optionalAttrs sway.enable { "browser.tabs.inTitlebar" = 0; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.firefox = with lib; {
|
options.grimmShared.firefox = with lib; {
|
||||||
enable = mkEnableOption "grimm-firefox";
|
enable = mkEnableOption "grimm-firefox";
|
||||||
|
@ -77,6 +86,6 @@ in
|
||||||
description = "set of plugins to install. Format: guid = short-id";
|
description = "set of plugins to install. Format: guid = short-id";
|
||||||
};
|
};
|
||||||
|
|
||||||
disableUserPlugins = lib.mkEnableOption "disables user controlled plugins";
|
disableUserPlugins = mkEnableOption "disables user controlled plugins";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,58 +5,57 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable gaming;
|
||||||
|
inherit (lib) mkIf getExe mkEnableOption;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && gaming) {
|
||||||
with cfg;
|
programs.steam = {
|
||||||
lib.mkIf (enable && gaming) {
|
enable = true;
|
||||||
programs.steam = {
|
gamescopeSession.enable = true;
|
||||||
enable = true;
|
gamescopeSession.env = {
|
||||||
gamescopeSession.enable = true;
|
DRI_PRIME = "1";
|
||||||
gamescopeSession.env = {
|
|
||||||
DRI_PRIME = "1";
|
|
||||||
};
|
|
||||||
extraCompatPackages = with pkgs; [ proton-ge-bin ];
|
|
||||||
# extest.enable = true;
|
|
||||||
};
|
};
|
||||||
|
extraCompatPackages = with pkgs; [ proton-ge-bin ];
|
||||||
programs.gamemode = {
|
# extest.enable = true;
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
general = {
|
|
||||||
inhibit_screensaver = 0;
|
|
||||||
renice = 10;
|
|
||||||
};
|
|
||||||
custom = {
|
|
||||||
start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
|
|
||||||
end = "${lib.getExe pkgs.libnotify} 'GameMode ended'";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.packages = [ pkgs.wooting-udev-rules ];
|
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
GAMEMODERUNEXEC = "env DRI_PRIME=1";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
heroic
|
|
||||||
prismlauncher
|
|
||||||
mangohud
|
|
||||||
the-powder-toy
|
|
||||||
(pkgs.symlinkJoin {
|
|
||||||
name = "osu";
|
|
||||||
paths = [
|
|
||||||
(pkgs.writeShellScriptBin "osu!" ''
|
|
||||||
exec gamemoderun ${lib.getExe pkgs.osu-lazer-bin}
|
|
||||||
'')
|
|
||||||
pkgs.osu-lazer-bin
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.gaming = lib.mkEnableOption "enables steam, heroic, prism and gamemoded";
|
programs.gamemode = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
general = {
|
||||||
|
inhibit_screensaver = 0;
|
||||||
|
renice = 10;
|
||||||
|
};
|
||||||
|
custom = {
|
||||||
|
start = "${lib.getExe pkgs.libnotify} 'GameMode started'";
|
||||||
|
end = "${lib.getExe pkgs.libnotify} 'GameMode ended'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.udev.packages = [ pkgs.wooting-udev-rules ];
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
GAMEMODERUNEXEC = "env DRI_PRIME=1";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
heroic
|
||||||
|
prismlauncher
|
||||||
|
mangohud
|
||||||
|
the-powder-toy
|
||||||
|
(symlinkJoin {
|
||||||
|
name = "osu";
|
||||||
|
paths = [
|
||||||
|
(writeShellScriptBin "osu!" ''
|
||||||
|
exec gamemoderun ${getExe osu-lazer-bin}
|
||||||
|
'')
|
||||||
|
osu-lazer-bin
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
options.grimmShared.gaming = mkEnableOption "enables steam, heroic, prism and gamemoded";
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,24 +4,25 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
inherit (config.grimmShared) enable graphical;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && graphical) {
|
||||||
with config.grimmShared;
|
fonts = {
|
||||||
lib.mkIf (enable && graphical) {
|
packages = with pkgs; [
|
||||||
fonts = {
|
noto-fonts
|
||||||
packages = with pkgs; [
|
noto-fonts-cjk
|
||||||
noto-fonts
|
font-awesome
|
||||||
noto-fonts-cjk
|
noto-fonts-emoji
|
||||||
font-awesome
|
roboto
|
||||||
noto-fonts-emoji
|
liberation_ttf
|
||||||
roboto
|
];
|
||||||
liberation_ttf
|
|
||||||
];
|
|
||||||
|
|
||||||
fontDir.enable = true;
|
fontDir.enable = true;
|
||||||
};
|
|
||||||
environment.sessionVariables = {
|
|
||||||
FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
environment.sessionVariables = {
|
||||||
|
FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,74 +5,72 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable graphical screens;
|
||||||
screen =
|
inherit (lib) types mkOption mkIf;
|
||||||
with lib;
|
|
||||||
types.submodule {
|
|
||||||
options = {
|
|
||||||
fps = mkOption {
|
|
||||||
type = types.either types.int (types.nonEmptyListOf types.int);
|
|
||||||
default = 60;
|
|
||||||
description = "max framerate of screen";
|
|
||||||
};
|
|
||||||
|
|
||||||
mode = mkOption {
|
screen = types.submodule {
|
||||||
type = types.nonEmptyStr;
|
options = {
|
||||||
default = "1920x1080";
|
fps = mkOption {
|
||||||
description = "pixel format of the screen";
|
type = types.either types.int (types.nonEmptyListOf types.int);
|
||||||
};
|
default = 60;
|
||||||
|
description = "max framerate of screen";
|
||||||
|
};
|
||||||
|
|
||||||
id = mkOption {
|
mode = mkOption {
|
||||||
type = types.nonEmptyStr;
|
type = types.nonEmptyStr;
|
||||||
description = "ID of the screen";
|
default = "1920x1080";
|
||||||
};
|
description = "pixel format of the screen";
|
||||||
|
};
|
||||||
|
|
||||||
pos = mkOption {
|
id = mkOption {
|
||||||
type = types.nullOr types.nonEmptyStr;
|
type = types.nonEmptyStr;
|
||||||
default = null;
|
description = "ID of the screen";
|
||||||
example = "0,0";
|
};
|
||||||
description = "position where to place the screen";
|
|
||||||
};
|
pos = mkOption {
|
||||||
|
type = types.nullOr types.nonEmptyStr;
|
||||||
|
default = null;
|
||||||
|
example = "0,0";
|
||||||
|
description = "position where to place the screen";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && graphical) {
|
||||||
with cfg;
|
# Enable OpenGL
|
||||||
lib.mkIf (enable && graphical) {
|
hardware.opengl = {
|
||||||
# Enable OpenGL
|
enable = true;
|
||||||
hardware.opengl = {
|
driSupport = true;
|
||||||
enable = true;
|
driSupport32Bit = true;
|
||||||
driSupport = true;
|
extraPackages = [ ];
|
||||||
driSupport32Bit = true;
|
|
||||||
extraPackages = with pkgs; [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
chaotic.mesa-git.enable = true;
|
|
||||||
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
__GL_LOG_MAX_ANISO = "0";
|
|
||||||
__GL_SHADER_DISK_CACHE = "1";
|
|
||||||
__GL_SYNC_TO_VBLANK = "0";
|
|
||||||
__GL_THREADED_OPTIMIZATIONS = "1";
|
|
||||||
__GL_VRR_ALLOWED = "1";
|
|
||||||
# MESA_LOADER_DRIVER_OVERRIDE="zink";
|
|
||||||
# FLATPAK_GL_DRIVERS="mesa-git";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
glfw
|
|
||||||
glxinfo
|
|
||||||
vulkan-tools
|
|
||||||
mangohud
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared = with lib; {
|
chaotic.mesa-git.enable = true;
|
||||||
|
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
__GL_LOG_MAX_ANISO = "0";
|
||||||
|
__GL_SHADER_DISK_CACHE = "1";
|
||||||
|
__GL_SYNC_TO_VBLANK = "0";
|
||||||
|
__GL_THREADED_OPTIMIZATIONS = "1";
|
||||||
|
__GL_VRR_ALLOWED = "1";
|
||||||
|
# MESA_LOADER_DRIVER_OVERRIDE="zink";
|
||||||
|
# FLATPAK_GL_DRIVERS="mesa-git";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
glfw
|
||||||
|
glxinfo
|
||||||
|
vulkan-tools
|
||||||
|
mangohud
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
options.grimmShared = {
|
||||||
graphical = mkOption {
|
graphical = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = cfg.screens != { };
|
default = screens != { };
|
||||||
description = "whether to force enable graphical components";
|
description = "whether to force enable graphical components";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,51 +5,49 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable graphical sway;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && graphical) {
|
||||||
with cfg;
|
qt = {
|
||||||
lib.mkIf (enable && graphical) {
|
enable = true;
|
||||||
qt = {
|
style = "kvantum";
|
||||||
enable = true;
|
platformTheme = "qt5ct";
|
||||||
style = "kvantum";
|
|
||||||
platformTheme = "qt5ct";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages =
|
|
||||||
with pkgs;
|
|
||||||
with kdePackages;
|
|
||||||
[
|
|
||||||
qtstyleplugin-kvantum
|
|
||||||
catppuccin-sddm-corners
|
|
||||||
libsForQt5.qtgraphicaleffects
|
|
||||||
catppuccin-kvantum
|
|
||||||
kdePackages.audiocd-kio
|
|
||||||
kdePackages.kio-extras
|
|
||||||
kdePackages.kio
|
|
||||||
xcb-util-cursor
|
|
||||||
qt6ct
|
|
||||||
kdePackages.dolphin
|
|
||||||
qtwayland
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.pathsToLink = [ "/share/Kvantum" ];
|
|
||||||
|
|
||||||
services.displayManager = {
|
|
||||||
sddm = {
|
|
||||||
enable = true;
|
|
||||||
theme = "catppuccin-sddm-corners";
|
|
||||||
wayland.enable = true;
|
|
||||||
wayland.compositor = "weston";
|
|
||||||
};
|
|
||||||
defaultSession = lib.optionalString cfg.sway.enable "sway";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.plymouth = {
|
|
||||||
themePackages = with pkgs; [ catppuccin-plymouth ];
|
|
||||||
theme = "catppuccin-macchiato";
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages =
|
||||||
|
with pkgs;
|
||||||
|
with kdePackages;
|
||||||
|
[
|
||||||
|
qtstyleplugin-kvantum
|
||||||
|
catppuccin-sddm-corners
|
||||||
|
libsForQt5.qtgraphicaleffects
|
||||||
|
catppuccin-kvantum
|
||||||
|
kdePackages.audiocd-kio
|
||||||
|
kdePackages.kio-extras
|
||||||
|
kdePackages.kio
|
||||||
|
xcb-util-cursor
|
||||||
|
qt6ct
|
||||||
|
kdePackages.dolphin
|
||||||
|
qtwayland
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.pathsToLink = [ "/share/Kvantum" ];
|
||||||
|
|
||||||
|
services.displayManager = {
|
||||||
|
sddm = {
|
||||||
|
enable = true;
|
||||||
|
theme = "catppuccin-sddm-corners";
|
||||||
|
wayland.enable = true;
|
||||||
|
wayland.compositor = "weston";
|
||||||
|
};
|
||||||
|
defaultSession = lib.optionalString sway.enable "sway";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.plymouth = {
|
||||||
|
themePackages = with pkgs; [ catppuccin-plymouth ];
|
||||||
|
theme = "catppuccin-macchiato";
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,61 +5,78 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable sway screens;
|
||||||
sway_conf =
|
inherit (lib)
|
||||||
with lib;
|
types
|
||||||
types.submodule (
|
mkOption
|
||||||
{ config, ... }:
|
mkEnableOption
|
||||||
rec {
|
mapAttrsToList
|
||||||
options = {
|
optionalString
|
||||||
keybinds = mkOption {
|
concatMapStrings
|
||||||
type = types.attrsOf types.str;
|
isInt
|
||||||
default = { };
|
min
|
||||||
description = "set of keybinds assigning key combo to action";
|
max
|
||||||
};
|
foldl'
|
||||||
|
getExe
|
||||||
|
isPath
|
||||||
|
isDerivation
|
||||||
|
concatLines
|
||||||
|
optional
|
||||||
|
mkIf
|
||||||
|
;
|
||||||
|
inherit (pkgs) writeShellScriptBin;
|
||||||
|
|
||||||
autolaunch = mkOption {
|
sway_conf = types.submodule (
|
||||||
type = types.listOf (types.either types.nonEmptyStr types.package);
|
{ ... }:
|
||||||
default = [ ];
|
{
|
||||||
description = "set of commands to be run at sway startup";
|
options = {
|
||||||
};
|
keybinds = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
execAlways = mkOption {
|
default = { };
|
||||||
type = types.listOf (types.either types.nonEmptyStr types.package);
|
description = "set of keybinds assigning key combo to action";
|
||||||
default = [ ];
|
|
||||||
description = "set of commands to be run at sway reload";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "";
|
|
||||||
description = "additional sway config to be included";
|
|
||||||
};
|
|
||||||
|
|
||||||
definitions = mkOption {
|
|
||||||
type = types.attrsOf types.str;
|
|
||||||
default = { };
|
|
||||||
description = "set of definitions assigning variable to value";
|
|
||||||
};
|
|
||||||
|
|
||||||
modes = mkOption {
|
|
||||||
type = types.attrsOf sway_conf;
|
|
||||||
default = { };
|
|
||||||
description = "possible modes to switch to, e.g. resize";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
);
|
autolaunch = mkOption {
|
||||||
|
type = types.listOf (types.either types.nonEmptyStr types.package);
|
||||||
|
default = [ ];
|
||||||
|
description = "set of commands to be run at sway startup";
|
||||||
|
};
|
||||||
|
|
||||||
|
execAlways = mkOption {
|
||||||
|
type = types.listOf (types.either types.nonEmptyStr types.package);
|
||||||
|
default = [ ];
|
||||||
|
description = "set of commands to be run at sway reload";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "additional sway config to be included";
|
||||||
|
};
|
||||||
|
|
||||||
|
definitions = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = { };
|
||||||
|
description = "set of definitions assigning variable to value";
|
||||||
|
};
|
||||||
|
|
||||||
|
modes = mkOption {
|
||||||
|
type = types.attrsOf sway_conf;
|
||||||
|
default = { };
|
||||||
|
description = "possible modes to switch to, e.g. resize";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
build_screen_def =
|
build_screen_def =
|
||||||
fps_func:
|
fps_func:
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
output_def = mapAttrsToList (
|
output_def = mapAttrsToList (
|
||||||
name: value:
|
name: value:
|
||||||
"output ${value.id} mode ${value.mode}@${toString (fps_func value.fps)}Hz"
|
"output ${value.id} mode ${value.mode}@${toString (fps_func value.fps)}Hz"
|
||||||
+ (optionalString (value.pos != null) " position ${value.pos}")
|
+ (optionalString (value.pos != null) " position ${value.pos}")
|
||||||
) cfg.screens;
|
) screens;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
|
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
|
||||||
|
@ -72,30 +89,25 @@ let
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
inherit (lib) getExe;
|
|
||||||
|
|
||||||
fps_min = fps: with lib; if isInt fps then fps else (foldl' min 2147483647 fps);
|
fps_min = fps: if isInt fps then fps else (foldl' min 2147483647 fps);
|
||||||
fps_max = fps: with lib; if isInt fps then fps else (foldl' max 0 fps);
|
fps_max = fps: if isInt fps then fps else (foldl' max 0 fps);
|
||||||
init_screens_min_fps =
|
init_screens_min_fps = writeShellScriptBin "init-screens-min" (build_screen_def fps_min);
|
||||||
with lib;
|
init_screens_max_fps = writeShellScriptBin "init-screens-max" (build_screen_def fps_max);
|
||||||
pkgs.writeShellScriptBin "init-screens-min" (build_screen_def fps_min);
|
init_screens_auto = writeShellScriptBin "init-screens-auto" "which run-on-ac && which run-on-bat && run-on-ac ${getExe init_screens_max_fps} && run-on-bat ${getExe init_screens_min_fps} || ${getExe init_screens_max_fps}";
|
||||||
init_screens_max_fps =
|
|
||||||
with lib;
|
|
||||||
pkgs.writeShellScriptBin "init-screens-max" (build_screen_def fps_max);
|
|
||||||
init_screens_auto = pkgs.writeShellScriptBin "init-screens-auto" "which run-on-ac && which run-on-bat && run-on-ac ${getExe init_screens_max_fps} && run-on-bat ${getExe init_screens_min_fps} || ${getExe init_screens_max_fps}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
bar_conf_file =
|
bar_conf_file =
|
||||||
if (lib.isPath cfg.sway.bar.config) then
|
if (isPath sway.bar.config) then
|
||||||
cfg.sway.bar.config
|
sway.bar.config
|
||||||
else
|
else
|
||||||
pkgs.writers.writeJSON "config.json" cfg.sway.bar.config;
|
pkgs.writers.writeJSON "config.json" sway.bar.config;
|
||||||
waybar_full = pkgs.writeShellScriptBin "waybar-full" (
|
waybar_full = writeShellScriptBin "waybar-full" (
|
||||||
(lib.getExe config.programs.waybar.package)
|
(getExe config.programs.waybar.package)
|
||||||
+ (lib.optionalString (!isNull cfg.sway.bar.config) " -c ${bar_conf_file}")
|
+ (optionalString (!isNull sway.bar.config) " -c ${bar_conf_file}")
|
||||||
+ (lib.optionalString (!isNull cfg.sway.bar.style) " -s ${cfg.sway.bar.style}")
|
+ (optionalString (!isNull sway.bar.style) " -s ${sway.bar.style}")
|
||||||
);
|
);
|
||||||
|
|
||||||
bar_config = ''
|
bar_config = ''
|
||||||
|
@ -111,7 +123,6 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
build_conf =
|
build_conf =
|
||||||
with lib;
|
|
||||||
sway_conf:
|
sway_conf:
|
||||||
let
|
let
|
||||||
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
|
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
|
||||||
|
@ -133,20 +144,19 @@ in
|
||||||
++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig
|
++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
sway_conf = lib.concatLines (
|
sway_conf = concatLines (
|
||||||
(build_conf cfg.sway.config)
|
(build_conf sway.config)
|
||||||
++ lib.optional cfg.sway.bar.enable bar_config
|
++ optional sway.bar.enable bar_config
|
||||||
++ (lib.mapAttrsToList (
|
++ (mapAttrsToList (
|
||||||
name: value:
|
name: value:
|
||||||
"output ${value.id} mode ${value.mode}"
|
"output ${value.id} mode ${value.mode}"
|
||||||
+ (lib.optionalString (value.pos != null) " position ${value.pos}")
|
+ (optionalString (value.pos != null) " position ${value.pos}")
|
||||||
) cfg.screens)
|
) screens)
|
||||||
);
|
);
|
||||||
|
|
||||||
conf_path = "sway.conf";
|
conf_path = "sway.conf";
|
||||||
in
|
in
|
||||||
with cfg;
|
mkIf (enable && sway.enable) {
|
||||||
lib.mkIf (enable && sway.enable) {
|
|
||||||
environment.etc."${conf_path}".text = sway_conf;
|
environment.etc."${conf_path}".text = sway_conf;
|
||||||
|
|
||||||
grimmShared.sway.config.execAlways = [
|
grimmShared.sway.config.execAlways = [
|
||||||
|
@ -232,7 +242,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.sway = with lib; {
|
options.grimmShared.sway = {
|
||||||
enable = mkEnableOption "grimm-sway";
|
enable = mkEnableOption "grimm-sway";
|
||||||
|
|
||||||
bar = {
|
bar = {
|
||||||
|
|
|
@ -5,77 +5,75 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable laptop_hardware graphical;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && laptop_hardware.enable) {
|
||||||
with cfg;
|
environment.systemPackages =
|
||||||
lib.mkIf (enable && laptop_hardware.enable) {
|
with pkgs;
|
||||||
environment.systemPackages =
|
[
|
||||||
with pkgs;
|
lm_sensors
|
||||||
[
|
lshw
|
||||||
lm_sensors
|
pciutils
|
||||||
lshw
|
usbutils
|
||||||
pciutils
|
ddcutil
|
||||||
usbutils
|
python312Packages.py-cpuinfo
|
||||||
ddcutil
|
(writeShellScriptBin "lsiommu" ./lsiommu)
|
||||||
python312Packages.py-cpuinfo
|
]
|
||||||
(writeShellScriptBin "lsiommu" ./lsiommu)
|
++ lib.optionals graphical [
|
||||||
]
|
opentabletdriver
|
||||||
++ lib.optionals graphical [
|
ddcui
|
||||||
opentabletdriver
|
wootility
|
||||||
ddcui
|
];
|
||||||
wootility
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.i2c.enable = true;
|
hardware.i2c.enable = true;
|
||||||
services.libinput.enable = true;
|
services.libinput.enable = true;
|
||||||
hardware.opentabletdriver.enable = true;
|
hardware.opentabletdriver.enable = true;
|
||||||
services.udisks2.enable = true;
|
services.udisks2.enable = true;
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
SUBSYSTEM=="i2c-dev", ACTION=="add",\
|
SUBSYSTEM=="i2c-dev", ACTION=="add",\
|
||||||
ATTR{name}=="NVIDIA i2c adapter*",\
|
ATTR{name}=="NVIDIA i2c adapter*",\
|
||||||
TAG+="ddcci",\
|
TAG+="ddcci",\
|
||||||
TAG+="systemd",\
|
TAG+="systemd",\
|
||||||
ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
|
ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemd.services."ddcci@" = {
|
||||||
|
scriptArgs = "%i";
|
||||||
|
script = ''
|
||||||
|
sleep 20
|
||||||
|
echo Trying to attach ddcci to $1
|
||||||
|
i=0
|
||||||
|
id=$(echo $1 | cut -d "-" -f 2)
|
||||||
|
if ${pkgs.ddcutil}/bin/ddcutil getvcp 10 -b $id; then
|
||||||
|
echo ddcci 0x37 > /sys/bus/i2c/devices/$1/new_device
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
systemd.services."ddcci@" = {
|
|
||||||
scriptArgs = "%i";
|
|
||||||
script = ''
|
|
||||||
sleep 20
|
|
||||||
echo Trying to attach ddcci to $1
|
|
||||||
i=0
|
|
||||||
id=$(echo $1 | cut -d "-" -f 2)
|
|
||||||
if ${pkgs.ddcutil}/bin/ddcutil getvcp 10 -b $id; then
|
|
||||||
echo ddcci 0x37 > /sys/bus/i2c/devices/$1/new_device
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
kernelParams = [ "quiet" ];
|
|
||||||
loader.efi.canTouchEfiVariables = true;
|
|
||||||
initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"nvme"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
loader.systemd-boot.enable = true;
|
|
||||||
extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ];
|
|
||||||
kernelModules = [
|
|
||||||
"ddcci_backlight"
|
|
||||||
"i2c-dev"
|
|
||||||
"ec_sys"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelParams = [ "quiet" ];
|
||||||
|
loader.efi.canTouchEfiVariables = true;
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
|
loader.systemd-boot.enable = true;
|
||||||
|
extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ];
|
||||||
|
kernelModules = [
|
||||||
|
"ddcci_backlight"
|
||||||
|
"i2c-dev"
|
||||||
|
"ec_sys"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.laptop_hardware = {
|
options.grimmShared.laptop_hardware = {
|
||||||
enable = lib.mkEnableOption "grimm-laptop";
|
enable = lib.mkEnableOption "grimm-laptop";
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,34 +6,39 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
optionals
|
optionals
|
||||||
optional
|
optional
|
||||||
optionalString
|
|
||||||
concatLines
|
concatLines
|
||||||
getExe
|
getExe
|
||||||
|
elem
|
||||||
|
mkIf
|
||||||
|
;
|
||||||
|
inherit (pkgs) writeShellScriptBin tlp tlpui;
|
||||||
|
inherit (config.grimmShared)
|
||||||
|
enable
|
||||||
|
laptop_hardware
|
||||||
|
graphical
|
||||||
|
sway
|
||||||
;
|
;
|
||||||
inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower;
|
inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower;
|
||||||
enable_perf_policy = (lib.elem system x86_energy_perf_policy.meta.platforms);
|
enable_perf_policy = (elem system x86_energy_perf_policy.meta.platforms);
|
||||||
|
|
||||||
powersave =
|
powersave = writeShellScriptBin "powersave-mode" (
|
||||||
with pkgs;
|
concatLines (
|
||||||
writeShellScriptBin "powersave-mode" (
|
[
|
||||||
concatLines (
|
"${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed
|
||||||
[
|
"${getExe pkgs.brightnessctl} s 20%" # display brightness
|
||||||
"${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed
|
]
|
||||||
"${getExe pkgs.brightnessctl} s 20%" # display brightness
|
++ optionals enable_perf_policy [
|
||||||
]
|
"${getExe x86_energy_perf_policy} 15" # power save preference
|
||||||
++ optionals enable_perf_policy [
|
"${getExe x86_energy_perf_policy} --turbo-enable 0" # disable turbo
|
||||||
"${getExe x86_energy_perf_policy} 15" # power save preference
|
]
|
||||||
"${getExe x86_energy_perf_policy} --turbo-enable 0" # disable turbo
|
++ optional sway.enable "init-screens-min"
|
||||||
]
|
)
|
||||||
++ optional cfg.sway.enable "init-screens-min"
|
);
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
performance = pkgs.writeShellScriptBin "performance-mode" (
|
performance = writeShellScriptBin "performance-mode" (
|
||||||
concatLines (
|
concatLines (
|
||||||
[
|
[
|
||||||
"${getExe cpupower} frequency-set frequency-set -g performance -u 5000000" # clock speed
|
"${getExe cpupower} frequency-set frequency-set -g performance -u 5000000" # clock speed
|
||||||
|
@ -43,66 +48,61 @@ let
|
||||||
"${getExe x86_energy_perf_policy} 0" # performance preference
|
"${getExe x86_energy_perf_policy} 0" # performance preference
|
||||||
"${getExe x86_energy_perf_policy} --turbo-enable 1" # enable turbo
|
"${getExe x86_energy_perf_policy} --turbo-enable 1" # enable turbo
|
||||||
]
|
]
|
||||||
++ optional cfg.sway.enable "init-screens-max"
|
++ optional sway.enable "init-screens-max"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
auto =
|
auto = writeShellScriptBin "auto-mode" ''
|
||||||
let
|
${tlp}/bin/run-on-ac ${getExe performance}
|
||||||
inherit (pkgs) tlp;
|
${tlp}/bin/run-on-bat ${getExe powersave}
|
||||||
in
|
'';
|
||||||
pkgs.writeShellScriptBin "auto-mode" ''
|
|
||||||
${tlp}/bin/run-on-ac ${getExe performance}
|
|
||||||
${tlp}/bin/run-on-bat ${getExe powersave}
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && laptop_hardware.enable) {
|
||||||
with cfg;
|
environment.systemPackages =
|
||||||
lib.mkIf (enable && laptop_hardware.enable) {
|
(with pkgs; [
|
||||||
environment.systemPackages =
|
acpi
|
||||||
with pkgs;
|
powertop
|
||||||
[
|
brightnessctl
|
||||||
acpi
|
])
|
||||||
powertop
|
++ [
|
||||||
brightnessctl
|
cpupower
|
||||||
cpupower
|
powersave
|
||||||
powersave
|
performance
|
||||||
performance
|
auto
|
||||||
auto
|
]
|
||||||
]
|
++ optionals graphical [ tlpui ]
|
||||||
++ optionals graphical [ tlpui ]
|
++ optional enable_perf_policy x86_energy_perf_policy;
|
||||||
++ optional enable_perf_policy x86_energy_perf_policy;
|
|
||||||
|
|
||||||
services.acpid = {
|
services.acpid = {
|
||||||
enable = true;
|
enable = true;
|
||||||
acEventCommands = getExe auto;
|
acEventCommands = getExe auto;
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
||||||
|
|
||||||
services.power-profiles-daemon.enable = false;
|
services.power-profiles-daemon.enable = false;
|
||||||
services.upower.enable = true;
|
services.upower.enable = true;
|
||||||
boot.extraModulePackages = [ cpupower ] ++ optional enable_perf_policy x86_energy_perf_policy;
|
boot.extraModulePackages = [ cpupower ] ++ optional enable_perf_policy x86_energy_perf_policy;
|
||||||
|
|
||||||
services.tlp = {
|
services.tlp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
USB_AUTOSUSPEND = 1;
|
USB_AUTOSUSPEND = 1;
|
||||||
USB_EXCLUDE_BTUSB = 1;
|
USB_EXCLUDE_BTUSB = 1;
|
||||||
USB_EXCLUDE_PHONE = 1;
|
USB_EXCLUDE_PHONE = 1;
|
||||||
SOUND_POWER_SAVE_ON_AC = 0;
|
SOUND_POWER_SAVE_ON_AC = 0;
|
||||||
SOUND_POWER_SAVE_ON_BAT = 1;
|
SOUND_POWER_SAVE_ON_BAT = 1;
|
||||||
SATA_LINKPWR_ON_AC = "max_performance";
|
SATA_LINKPWR_ON_AC = "max_performance";
|
||||||
SATA_LINKPWR_ON_BAT = "min_power";
|
SATA_LINKPWR_ON_BAT = "min_power";
|
||||||
MAX_LOST_WORK_SECS_ON_BAT = 15;
|
MAX_LOST_WORK_SECS_ON_BAT = 15;
|
||||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||||
CPU_BOOST_ON_AC = 1;
|
CPU_BOOST_ON_AC = 1;
|
||||||
CPU_BOOST_ON_BAT = 0;
|
CPU_BOOST_ON_BAT = 0;
|
||||||
RUNTIME_PM_ON_AC = "on";
|
RUNTIME_PM_ON_AC = "on";
|
||||||
RUNTIME_PM_ON_BAT = "auto";
|
RUNTIME_PM_ON_BAT = "auto";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,33 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable locale;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && locale) {
|
||||||
with cfg;
|
time.timeZone = "Europe/Berlin";
|
||||||
lib.mkIf (enable && locale) {
|
|
||||||
time.timeZone = "Europe/Berlin";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
i18n.extraLocaleSettings = {
|
i18n.extraLocaleSettings = {
|
||||||
LC_ADDRESS = "de_DE.UTF-8";
|
LC_ADDRESS = "de_DE.UTF-8";
|
||||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||||
LC_MONETARY = "de_DE.UTF-8";
|
LC_MONETARY = "de_DE.UTF-8";
|
||||||
LC_NAME = "de_DE.UTF-8";
|
LC_NAME = "de_DE.UTF-8";
|
||||||
LC_NUMERIC = "de_DE.UTF-8";
|
LC_NUMERIC = "de_DE.UTF-8";
|
||||||
LC_PAPER = "de_DE.UTF-8";
|
LC_PAPER = "de_DE.UTF-8";
|
||||||
LC_TELEPHONE = "de_DE.UTF-8";
|
LC_TELEPHONE = "de_DE.UTF-8";
|
||||||
LC_TIME = "de_DE.UTF-8";
|
LC_TIME = "de_DE.UTF-8";
|
||||||
};
|
|
||||||
|
|
||||||
console.keyMap = "de";
|
|
||||||
|
|
||||||
services.xserver.xkb = {
|
|
||||||
layout = "de";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.keyMap = "de";
|
||||||
|
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "de";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.locale = lib.mkEnableOption "Sets german units but english language";
|
options.grimmShared.locale = lib.mkEnableOption "Sets german units but english language";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,24 +5,27 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared)
|
||||||
|
enable
|
||||||
|
network
|
||||||
|
graphical
|
||||||
|
sound
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && network && config.hardware.bluetooth.enable) {
|
||||||
with cfg;
|
services.blueman.enable = lib.mkIf graphical true;
|
||||||
lib.mkIf (enable && network && config.hardware.bluetooth.enable) {
|
|
||||||
services.blueman.enable = lib.mkIf graphical true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ bluetuith ] ++ lib.optional sound.enable pkgs.bluez;
|
environment.systemPackages = [ pkgs.bluetuith ] ++ lib.optional sound.enable pkgs.bluez;
|
||||||
|
|
||||||
systemd.user.services.mpris-proxy = lib.mkIf sound.enable {
|
systemd.user.services.mpris-proxy = lib.mkIf sound.enable {
|
||||||
description = "Mpris proxy";
|
description = "Mpris proxy";
|
||||||
after = [
|
after = [
|
||||||
"network.target"
|
"network.target"
|
||||||
"sound.target"
|
"sound.target"
|
||||||
];
|
];
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,27 +5,25 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable network laptop_hardware;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && network) {
|
||||||
with cfg;
|
networking.networkmanager.enable = true;
|
||||||
lib.mkIf (enable && network) {
|
networking.useDHCP = lib.mkDefault true;
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
hardware.bluetooth.enable = lib.mkDefault laptop_hardware.enable;
|
hardware.bluetooth.enable = lib.mkDefault laptop_hardware.enable;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
openconnect
|
openconnect
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowPing = true;
|
allowPing = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
imports = [ ./bluetooth.nix ];
|
imports = [ ./bluetooth.nix ];
|
||||||
|
|
||||||
|
|
|
@ -5,33 +5,31 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable printing graphical;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && printing) {
|
||||||
with cfg;
|
# Enable CUPS to print documents.
|
||||||
lib.mkIf (enable && printing) {
|
services.printing.enable = true;
|
||||||
# Enable CUPS to print documents.
|
services.printing.drivers = with pkgs; [
|
||||||
services.printing.enable = true;
|
brgenml1lpr
|
||||||
services.printing.drivers = with pkgs; [
|
brgenml1cupswrapper
|
||||||
brgenml1lpr
|
];
|
||||||
brgenml1cupswrapper
|
services.avahi = {
|
||||||
];
|
enable = true;
|
||||||
services.avahi = {
|
nssmdns4 = true;
|
||||||
enable = true;
|
openFirewall = true;
|
||||||
nssmdns4 = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
services.printing.cups-pdf.enable = true;
|
|
||||||
hardware.sane.brscan4.enable = true; # enables support for SANE scanners
|
|
||||||
|
|
||||||
environment.systemPackages =
|
|
||||||
with pkgs;
|
|
||||||
(lib.optionals cfg.graphical [
|
|
||||||
kdePackages.skanpage
|
|
||||||
# libsForQt5.skanpage
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
services.printing.cups-pdf.enable = true;
|
||||||
|
hardware.sane.brscan4.enable = true; # enables support for SANE scanners
|
||||||
|
|
||||||
|
environment.systemPackages = (
|
||||||
|
lib.optionals graphical [
|
||||||
|
pkgs.kdePackages.skanpage
|
||||||
|
# libsForQt5.skanpage
|
||||||
|
]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.printing = lib.mkEnableOption "Enables print and scan related options";
|
options.grimmShared.printing = lib.mkEnableOption "Enables print and scan related options";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,32 +5,30 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable sound;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && sound.enable) {
|
||||||
with cfg;
|
sound.enable = true;
|
||||||
lib.mkIf (enable && sound.enable) {
|
hardware.pulseaudio.enable = false;
|
||||||
sound.enable = true;
|
|
||||||
hardware.pulseaudio.enable = false;
|
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
alsa.support32Bit = true;
|
alsa.support32Bit = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
jack.enable = true; # osu uses jack
|
jack.enable = true; # osu uses jack
|
||||||
lowLatency.enable = true;
|
lowLatency.enable = true;
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
pwvucontrol
|
|
||||||
playerctl
|
|
||||||
openal
|
|
||||||
pulseaudio
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pwvucontrol
|
||||||
|
playerctl
|
||||||
|
openal
|
||||||
|
pulseaudio
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./spotify.nix
|
./spotify.nix
|
||||||
./midi.nix
|
./midi.nix
|
||||||
|
|
|
@ -5,24 +5,23 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
|
||||||
sound_font = pkgs.soundfont-fluid;
|
sound_font = pkgs.soundfont-fluid;
|
||||||
|
inherit (config.grimmShared) enable sound;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && sound.midi) {
|
||||||
with cfg;
|
environment.systemPackages =
|
||||||
lib.mkIf (enable && sound.midi) {
|
(with pkgs; [
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
mpv
|
mpv
|
||||||
timidity
|
timidity
|
||||||
ffmpeg-full
|
ffmpeg-full
|
||||||
sound_font
|
])
|
||||||
];
|
++ [ sound_font ];
|
||||||
|
|
||||||
environment.pathsToLink = [ "/share/soundfonts" ];
|
environment.pathsToLink = [ "/share/soundfonts" ];
|
||||||
|
|
||||||
environment.etc."timidity/timidity.cfg".text = "soundfont ${sound_font}/share/soundfonts/FluidR3_GM2-2.sf2";
|
environment.etc."timidity/timidity.cfg".text = "soundfont ${sound_font}/share/soundfonts/FluidR3_GM2-2.sf2";
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.sound.midi = lib.mkEnableOption "enable midi";
|
options.grimmShared.sound.midi = lib.mkEnableOption "enable midi";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,19 +5,17 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable spotify graphical;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && spotify.enable) {
|
||||||
with cfg;
|
environment.systemPackages = [ pkgs.ncspot ] ++ lib.optional graphical pkgs.spotify;
|
||||||
lib.mkIf (enable && spotify.enable) {
|
|
||||||
environment.systemPackages = [ pkgs.ncspot ] ++ lib.optional graphical pkgs.spotify;
|
|
||||||
|
|
||||||
grimmShared = {
|
grimmShared = {
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
network = true;
|
network = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.spotify = {
|
options.grimmShared.spotify = {
|
||||||
enable = lib.mkEnableOption "grimm-spotify";
|
enable = lib.mkEnableOption "grimm-spotify";
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
spotifyd_cache_dir = "/tmp/spotifyd";
|
spotifyd_cache_dir = "/tmp/spotifyd";
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable spotify;
|
||||||
spotifyd-dbus = pkgs.writeTextDir "share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf" ''
|
spotifyd-dbus = pkgs.writeTextDir "share/dbus-1/system.d/org.mpris.MediaPlayer2.spotifyd.conf" ''
|
||||||
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
|
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
|
||||||
|
|
||||||
|
@ -27,77 +27,72 @@ let
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && spotify.spotifyd.enable) {
|
||||||
with cfg;
|
environment.systemPackages = [
|
||||||
lib.mkIf (enable && spotify.spotifyd.enable) {
|
pkgs.spotifyd
|
||||||
environment.systemPackages = with pkgs; [
|
spotifyd-dbus
|
||||||
spotifyd
|
];
|
||||||
spotifyd-dbus
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.init-spotifyd-cache-dir = {
|
systemd.services.init-spotifyd-cache-dir = {
|
||||||
description = "Create the spotifyd cache dir";
|
description = "Create the spotifyd cache dir";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script = ''
|
||||||
mkdir -p ${spotifyd_cache_dir}
|
mkdir -p ${spotifyd_cache_dir}
|
||||||
chown spotifyd:spotifyd -R ${spotifyd_cache_dir}
|
chown spotifyd:spotifyd -R ${spotifyd_cache_dir}
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
grimmShared = {
|
|
||||||
sound.enable = true;
|
|
||||||
network = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.pipewire.systemWide = true; # required for spotifyd as spotifyd runs as the spotifyd user
|
|
||||||
|
|
||||||
# spotifyd config
|
|
||||||
services.spotifyd = {
|
|
||||||
enable = true;
|
|
||||||
settings.global = {
|
|
||||||
bitrate = 320;
|
|
||||||
username = cfg.spotify.spotifyd.username;
|
|
||||||
device_name = "grimm_laptop";
|
|
||||||
password_cmd =
|
|
||||||
let
|
|
||||||
pass = cfg.spotify.spotifyd.pass;
|
|
||||||
in
|
|
||||||
with lib;
|
|
||||||
if (lib.isPath pass || lib.isString pass) then
|
|
||||||
"${pkgs.coreutils-full}/bin/cat ${pass}"
|
|
||||||
else
|
|
||||||
(getExe pass);
|
|
||||||
device_type = "computer";
|
|
||||||
dbus_type = "system";
|
|
||||||
device = "default";
|
|
||||||
control = "default";
|
|
||||||
volume_controller = "softvol";
|
|
||||||
# no_audio_cache = true;
|
|
||||||
spotifyd_cache_dir = spotifyd_cache_dir;
|
|
||||||
max_cache_size = 10000000000;
|
|
||||||
initial_volume = "90";
|
|
||||||
backend = "alsa"; # fixme
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.dbus.packages = with pkgs; [ spotifyd-dbus ];
|
|
||||||
|
|
||||||
# spotifyd has access to global pipewire
|
|
||||||
users.users.spotifyd = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "spotifyd";
|
|
||||||
extraGroups = [
|
|
||||||
"audio"
|
|
||||||
"pipewire"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# spotifyd is also a group
|
|
||||||
users.groups.spotifyd = { };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
grimmShared = {
|
||||||
|
sound.enable = true;
|
||||||
|
network = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.pipewire.systemWide = true; # required for spotifyd as spotifyd runs as the spotifyd user
|
||||||
|
|
||||||
|
# spotifyd config
|
||||||
|
services.spotifyd = {
|
||||||
|
enable = true;
|
||||||
|
settings.global = {
|
||||||
|
bitrate = 320;
|
||||||
|
username = spotify.spotifyd.username;
|
||||||
|
device_name = "grimm_laptop";
|
||||||
|
password_cmd =
|
||||||
|
let
|
||||||
|
pass = spotify.spotifyd.pass;
|
||||||
|
inherit (lib) isPath isString getExe;
|
||||||
|
in
|
||||||
|
if (isPath pass || isString pass) then "${pkgs.coreutils-full}/bin/cat ${pass}" else (getExe pass);
|
||||||
|
device_type = "computer";
|
||||||
|
dbus_type = "system";
|
||||||
|
device = "default";
|
||||||
|
control = "default";
|
||||||
|
volume_controller = "softvol";
|
||||||
|
# no_audio_cache = true;
|
||||||
|
spotifyd_cache_dir = spotifyd_cache_dir;
|
||||||
|
max_cache_size = 10000000000;
|
||||||
|
initial_volume = "90";
|
||||||
|
backend = "alsa"; # fixme
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.dbus.packages = [ spotifyd-dbus ];
|
||||||
|
|
||||||
|
# spotifyd has access to global pipewire
|
||||||
|
users.users.spotifyd = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "spotifyd";
|
||||||
|
extraGroups = [
|
||||||
|
"audio"
|
||||||
|
"pipewire"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# spotifyd is also a group
|
||||||
|
users.groups.spotifyd = { };
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.spotify.spotifyd = with lib; {
|
options.grimmShared.spotify.spotifyd = with lib; {
|
||||||
enable = mkEnableOption "grimm-spotify-tui";
|
enable = mkEnableOption "grimm-spotify-tui";
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,16 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable tooling graphical;
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkOption
|
||||||
|
types
|
||||||
|
getExe
|
||||||
|
optionals
|
||||||
|
mkIf
|
||||||
|
concatLines
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -15,146 +24,144 @@ in
|
||||||
./python.nix
|
./python.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config =
|
config = mkIf (enable && tooling.enable) {
|
||||||
with cfg;
|
environment.systemPackages =
|
||||||
lib.mkIf (enable && tooling.enable) {
|
with pkgs;
|
||||||
environment.systemPackages =
|
[
|
||||||
with pkgs;
|
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
||||||
[
|
(writeShellScriptBin "tree" "${getExe eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
||||||
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
(writeShellScriptBin "spawn" ''exec "$@" &> /dev/null &'')
|
||||||
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
|
||||||
(writeShellScriptBin "spawn" ''exec "$@" &> /dev/null &'')
|
|
||||||
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
|
|
||||||
|
|
||||||
urlencode
|
urlencode
|
||||||
pstree
|
pstree
|
||||||
dos2unix
|
dos2unix
|
||||||
treefmt
|
treefmt
|
||||||
file
|
file
|
||||||
wget
|
wget
|
||||||
hyfetch
|
hyfetch
|
||||||
util-linux
|
util-linux
|
||||||
btop
|
btop
|
||||||
neovim-remote
|
neovim-remote
|
||||||
linuxPackages.perf
|
linuxPackages.perf
|
||||||
eza
|
eza
|
||||||
|
|
||||||
gcc
|
gcc
|
||||||
jdk17
|
jdk17
|
||||||
pkg-config
|
pkg-config
|
||||||
unzip
|
unzip
|
||||||
p7zip
|
p7zip
|
||||||
|
|
||||||
tea
|
tea
|
||||||
|
|
||||||
fbcat
|
fbcat
|
||||||
gomuks
|
gomuks
|
||||||
ranger
|
ranger
|
||||||
|
|
||||||
visualvm
|
visualvm
|
||||||
imagemagick
|
imagemagick
|
||||||
nmap
|
nmap
|
||||||
|
|
||||||
parted
|
parted
|
||||||
glib
|
glib
|
||||||
glibc
|
glibc
|
||||||
expect
|
expect
|
||||||
]
|
]
|
||||||
++ lib.optionals cfg.graphical [
|
++ optionals graphical [
|
||||||
wev
|
wev
|
||||||
qdirstat
|
qdirstat
|
||||||
libva-utils
|
libva-utils
|
||||||
gparted
|
gparted
|
||||||
jetbrains.clion
|
jetbrains.clion
|
||||||
jetbrains.idea-community
|
jetbrains.idea-community
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
config = {
|
config = {
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
credential.username = cfg.tooling.git_user;
|
credential.username = tooling.git_user;
|
||||||
core.editor = lib.getExe pkgs.neovim;
|
core.editor = getExe pkgs.neovim;
|
||||||
user.name = cfg.tooling.git_user;
|
user.name = tooling.git_user;
|
||||||
user.email = cfg.tooling.git_email;
|
user.email = tooling.git_email;
|
||||||
push.autoSetupRemote = true;
|
push.autoSetupRemote = true;
|
||||||
core.autocrlf = "input";
|
core.autocrlf = "input";
|
||||||
commit.gpgsign = true;
|
commit.gpgsign = true;
|
||||||
pull.rebase = true;
|
pull.rebase = true;
|
||||||
alias = {
|
alias = {
|
||||||
pfusch = "push --force-with-lease --force-if-includes";
|
pfusch = "push --force-with-lease --force-if-includes";
|
||||||
fuck = "reset HEAD~1";
|
fuck = "reset HEAD~1";
|
||||||
fixup = "commit --fixup";
|
fixup = "commit --fixup";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.shellAliases = {
|
|
||||||
":q" = "exit";
|
|
||||||
"ls" = "eza";
|
|
||||||
"lix" = "nix";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.tmux = {
|
|
||||||
enable = true;
|
|
||||||
historyLimit = 42000;
|
|
||||||
#keyMode = "vi";
|
|
||||||
};
|
|
||||||
|
|
||||||
# virtualisation.docker.enable = true;
|
|
||||||
|
|
||||||
services.dbus.implementation = "broker";
|
|
||||||
|
|
||||||
grimmShared.tooling.nvim = {
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
|
||||||
fugitive
|
|
||||||
nvim-lspconfig
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.tmp.cleanOnBoot = true;
|
|
||||||
zramSwap.enable = true;
|
|
||||||
|
|
||||||
programs.neovim = {
|
|
||||||
enable = true;
|
|
||||||
viAlias = true;
|
|
||||||
defaultEditor = true;
|
|
||||||
configure = {
|
|
||||||
customRC =
|
|
||||||
let
|
|
||||||
luarc = pkgs.writeText "init.lua" (lib.concatLines tooling.nvim.extraLuaRC);
|
|
||||||
in
|
|
||||||
''
|
|
||||||
set number
|
|
||||||
set hidden
|
|
||||||
set fileencodings=utf-8
|
|
||||||
set nocompatible
|
|
||||||
set clipboard+=unnamedplus
|
|
||||||
set ff=unix
|
|
||||||
|
|
||||||
luafile ${luarc}
|
|
||||||
|
|
||||||
if filereadable($HOME . "/.vimrc")
|
|
||||||
source ~/.vimrc
|
|
||||||
endif
|
|
||||||
'';
|
|
||||||
packages.myVimPackage = {
|
|
||||||
start = tooling.nvim.plugins;
|
|
||||||
opt = [ ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.ssh = {
|
|
||||||
startAgent = true;
|
|
||||||
enableAskPassword = graphical;
|
|
||||||
askPassword = lib.mkIf graphical (lib.getExe pkgs.lxqt.lxqt-openssh-askpass);
|
|
||||||
};
|
|
||||||
programs.thefuck.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.tooling = with lib; {
|
environment.shellAliases = {
|
||||||
|
":q" = "exit";
|
||||||
|
"ls" = "eza";
|
||||||
|
"lix" = "nix";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
historyLimit = 42000;
|
||||||
|
#keyMode = "vi";
|
||||||
|
};
|
||||||
|
|
||||||
|
# virtualisation.docker.enable = true;
|
||||||
|
|
||||||
|
services.dbus.implementation = "broker";
|
||||||
|
|
||||||
|
grimmShared.tooling.nvim = {
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
fugitive
|
||||||
|
nvim-lspconfig
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.tmp.cleanOnBoot = true;
|
||||||
|
zramSwap.enable = true;
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
viAlias = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
configure = {
|
||||||
|
customRC =
|
||||||
|
let
|
||||||
|
luarc = pkgs.writeText "init.lua" (concatLines tooling.nvim.extraLuaRC);
|
||||||
|
in
|
||||||
|
''
|
||||||
|
set number
|
||||||
|
set hidden
|
||||||
|
set fileencodings=utf-8
|
||||||
|
set nocompatible
|
||||||
|
set clipboard+=unnamedplus
|
||||||
|
set ff=unix
|
||||||
|
|
||||||
|
luafile ${luarc}
|
||||||
|
|
||||||
|
if filereadable($HOME . "/.vimrc")
|
||||||
|
source ~/.vimrc
|
||||||
|
endif
|
||||||
|
'';
|
||||||
|
packages.myVimPackage = {
|
||||||
|
start = tooling.nvim.plugins;
|
||||||
|
opt = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
startAgent = true;
|
||||||
|
enableAskPassword = graphical;
|
||||||
|
askPassword = mkIf graphical (getExe pkgs.lxqt.lxqt-openssh-askpass);
|
||||||
|
};
|
||||||
|
programs.thefuck.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
options.grimmShared.tooling = {
|
||||||
enable = mkEnableOption "grimm-tooling";
|
enable = mkEnableOption "grimm-tooling";
|
||||||
|
|
||||||
nvim = {
|
nvim = {
|
||||||
|
|
|
@ -5,49 +5,53 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable tooling graphical;
|
||||||
|
inherit (lib)
|
||||||
|
getExe
|
||||||
|
optional
|
||||||
|
mkIf
|
||||||
|
optionalString
|
||||||
|
mkEnableOption
|
||||||
|
;
|
||||||
|
|
||||||
viewer_pkg = pkgs.zathura;
|
viewer_pkg = pkgs.zathura;
|
||||||
viewer_def = lib.optionalString cfg.graphical ''pdf_viewer = "${lib.getExe pkgs.zathura}",'';
|
viewer_def = optionalString graphical ''pdf_viewer = "${lib.getExe pkgs.zathura}",'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && tooling.enable && tooling.lilypond) {
|
||||||
with cfg;
|
environment.systemPackages = [ pkgs.lilypond-with-fonts ] ++ optional graphical viewer_pkg;
|
||||||
lib.mkIf (enable && tooling.enable && tooling.lilypond) {
|
environment.sessionVariables = {
|
||||||
environment.systemPackages =
|
LYEDITOR = "${getExe pkgs.neovim-remote} -s +:'dr %(file)s | call cursor(%(line)s,%(char)s+1)'";
|
||||||
with pkgs;
|
|
||||||
[ lilypond-with-fonts ] ++ lib.optional graphical viewer_pkg;
|
|
||||||
environment.sessionVariables = {
|
|
||||||
LYEDITOR = "${lib.getExe pkgs.neovim-remote} -s +:'dr %(file)s | call cursor(%(line)s,%(char)s+1)'";
|
|
||||||
};
|
|
||||||
|
|
||||||
grimmShared.sound.midi = true;
|
|
||||||
|
|
||||||
grimmShared.tooling.nvim = {
|
|
||||||
extraLuaRC = lib.singleton ''
|
|
||||||
require('nvls').setup({
|
|
||||||
lilypond = {
|
|
||||||
options = {
|
|
||||||
${viewer_def}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
latex = {
|
|
||||||
options = {
|
|
||||||
${viewer_def}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
player = {
|
|
||||||
options = {
|
|
||||||
fluidsynth_flags = {
|
|
||||||
"/run/current-system/sw/share/soundfonts/FluidR3_GM2-2.sf2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ nvim-lilypond-suite ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.tooling.lilypond = lib.mkEnableOption "enable lilypond tooling";
|
grimmShared.sound.midi = true;
|
||||||
|
|
||||||
|
grimmShared.tooling.nvim = {
|
||||||
|
extraLuaRC = lib.singleton ''
|
||||||
|
require('nvls').setup({
|
||||||
|
lilypond = {
|
||||||
|
options = {
|
||||||
|
${viewer_def}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
latex = {
|
||||||
|
options = {
|
||||||
|
${viewer_def}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
player = {
|
||||||
|
options = {
|
||||||
|
fluidsynth_flags = {
|
||||||
|
"/run/current-system/sw/share/soundfonts/FluidR3_GM2-2.sf2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ nvim-lilypond-suite ];
|
||||||
|
};
|
||||||
|
|
||||||
|
options.grimmShared.tooling.lilypond = mkEnableOption "enable lilypond tooling";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = config.grimmShared;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@")
|
(writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@")
|
||||||
|
@ -43,6 +34,7 @@ in
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
|
|
||||||
# nix.package = pkgs.nixVersions.latest;
|
# nix.package = pkgs.nixVersions.latest;
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,44 +5,30 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable tooling graphical;
|
||||||
|
pyLibs =
|
||||||
|
python-pkgs: with python-pkgs; [
|
||||||
|
requests
|
||||||
|
matplotlib
|
||||||
|
numpy
|
||||||
|
scipy
|
||||||
|
pygobject3
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && tooling.enable) {
|
||||||
with cfg;
|
environment.systemPackages = [
|
||||||
lib.mkIf (enable && tooling.enable) {
|
(pkgs.python3.withPackages pyLibs)
|
||||||
environment.systemPackages =
|
] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]);
|
||||||
with pkgs;
|
|
||||||
[
|
|
||||||
(python3.withPackages (
|
|
||||||
python-pkgs: with python-pkgs; [
|
|
||||||
requests
|
|
||||||
matplotlib
|
|
||||||
numpy
|
|
||||||
scipy
|
|
||||||
pygobject3
|
|
||||||
]
|
|
||||||
))
|
|
||||||
]
|
|
||||||
++ lib.optionals cfg.graphical [ jetbrains.pycharm-community ];
|
|
||||||
|
|
||||||
programs.xonsh = {
|
programs.xonsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = lib.concatLines (
|
config = lib.concatLines (
|
||||||
lib.mapAttrsToList (
|
lib.mapAttrsToList (
|
||||||
name: value: ''aliases["${name}"] = "${value}"''
|
name: value: ''aliases["${name}"] = "${value}"''
|
||||||
) config.environment.shellAliases
|
) config.environment.shellAliases
|
||||||
);
|
);
|
||||||
package = pkgs.xonsh.wrapper.override {
|
package = pkgs.xonsh.wrapper.override { extraPackages = pyLibs; };
|
||||||
extraPackages =
|
|
||||||
ps: with ps; [
|
|
||||||
requests
|
|
||||||
matplotlib
|
|
||||||
numpy
|
|
||||||
scipy
|
|
||||||
pygobject3
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,50 +5,56 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable tooling graphical;
|
||||||
|
inherit (lib)
|
||||||
|
optional
|
||||||
|
optionals
|
||||||
|
filterAttrs
|
||||||
|
mkForce
|
||||||
|
mkIf
|
||||||
|
attrNames
|
||||||
|
mkEnableOption
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf enable {
|
||||||
with cfg;
|
security.polkit.enable = true;
|
||||||
lib.mkIf enable {
|
security.rtkit.enable = true;
|
||||||
security.polkit.enable = true;
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
security.doas.enable = true;
|
security.doas.enable = true;
|
||||||
security.sudo.enable = false;
|
security.sudo.enable = false;
|
||||||
security.doas.extraRules = [
|
security.doas.extraRules = [
|
||||||
{
|
{
|
||||||
users = lib.attrNames (lib.filterAttrs (n: v: v.isNormalUser) config.users.users);
|
users = attrNames (filterAttrs (n: v: v.isNormalUser) config.users.users);
|
||||||
keepEnv = true;
|
keepEnv = true;
|
||||||
persist = true;
|
persist = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
(with pkgs; [
|
||||||
[
|
mkpasswd
|
||||||
mkpasswd
|
gnupg
|
||||||
gnupg
|
libsecret
|
||||||
libsecret
|
vulnix
|
||||||
vulnix
|
doas-sudo-shim # muscle memory
|
||||||
doas-sudo-shim # muscle memory
|
agenix
|
||||||
agenix
|
])
|
||||||
]
|
++ optionals (tooling.enable && tooling.pass) [
|
||||||
++ lib.optionals (tooling.enable && tooling.pass) [
|
pkgs.pass
|
||||||
pass
|
(pkgs.writeShellScriptBin "passw" "pass $@")
|
||||||
(writeShellScriptBin "passw" "pass $@")
|
]
|
||||||
]
|
++ optional graphical pkgs.lxqt.lxqt-policykit;
|
||||||
++ lib.optional graphical lxqt.lxqt-policykit;
|
|
||||||
|
|
||||||
services.passSecretService.enable = lib.mkIf (tooling.enable && tooling.pass) true;
|
services.passSecretService.enable = mkIf (tooling.enable && tooling.pass) true;
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
settings = {
|
settings = {
|
||||||
# default-cache-ttl = 6000;
|
# default-cache-ttl = 6000;
|
||||||
};
|
|
||||||
pinentryPackage = with pkgs; lib.mkForce (if graphical then pinentry-qt else pinentry-tty);
|
|
||||||
enable = true;
|
|
||||||
};
|
};
|
||||||
|
pinentryPackage = mkForce (if graphical then pkgs.pinentry-qt else pkgs.pinentry-tty);
|
||||||
|
enable = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
options.grimmShared.tooling.pass = lib.mkEnableOption "Enables password-store, gnupg and such secret handling";
|
options.grimmShared.tooling.pass = mkEnableOption "Enables password-store, gnupg and such secret handling";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared) enable portals graphical;
|
||||||
browsers = [
|
browsers = [
|
||||||
"firefox-beta.desktop"
|
"firefox-beta.desktop"
|
||||||
"firefox.desktop"
|
"firefox.desktop"
|
||||||
|
@ -35,111 +35,109 @@ let
|
||||||
tex_editors = [ ] ++ text_editors;
|
tex_editors = [ ] ++ text_editors;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = lib.mkIf (enable && portals && graphical) {
|
||||||
with cfg;
|
environment.systemPackages = with pkgs; [
|
||||||
lib.mkIf (enable && portals && graphical) {
|
deskwhich
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
deskwhich
|
|
||||||
|
|
||||||
zathura
|
zathura
|
||||||
alacritty
|
alacritty
|
||||||
imhex
|
imhex
|
||||||
libreoffice-qt
|
libreoffice-qt
|
||||||
filezilla
|
filezilla
|
||||||
obsidian
|
obsidian
|
||||||
nomacs
|
nomacs
|
||||||
pdfarranger
|
pdfarranger
|
||||||
geany
|
geany
|
||||||
krita
|
krita
|
||||||
weasis
|
weasis
|
||||||
# kicad
|
# kicad
|
||||||
prusa-slicer
|
prusa-slicer
|
||||||
freecad
|
freecad
|
||||||
openscad
|
openscad
|
||||||
vlc
|
vlc
|
||||||
blender
|
blender
|
||||||
thunderbird
|
thunderbird
|
||||||
xdg-terminal-exec
|
xdg-terminal-exec
|
||||||
xdg-utils
|
xdg-utils
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.terminal-exec = {
|
xdg.terminal-exec = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
default = [
|
default = [
|
||||||
"Alacritty.desktop"
|
"Alacritty.desktop"
|
||||||
"kitty.desktop"
|
"kitty.desktop"
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.mime.enable = true;
|
|
||||||
xdg.mime.addedAssociations = {
|
|
||||||
"application/java-vm" = [
|
|
||||||
"idea-community.desktop"
|
|
||||||
"imhex.desktop"
|
|
||||||
];
|
];
|
||||||
"application/json" = text_editors ++ [ "firefox-beta.desktop" ];
|
|
||||||
"application/mp4" = video_viewers;
|
|
||||||
"application/ogg" = audio_players;
|
|
||||||
"application/octet-stream" = "imhex.desktop";
|
|
||||||
"application/pdf" = document_viewers;
|
|
||||||
"application/rss+xml" = text_editors;
|
|
||||||
"application/x-chess-pgn" = [ ] ++ text_editors; # fixme
|
|
||||||
"application/x-krita" = "org.kde.krita.desktop";
|
|
||||||
"application/x-latex" = tex_editors;
|
|
||||||
"application/x-tex" = tex_editors;
|
|
||||||
"application/x-texinfo" = tex_editors;
|
|
||||||
"application/xml" = text_editors;
|
|
||||||
"image/svg+xml" = image_viewers ++ browsers ++ text_editors;
|
|
||||||
"image/*" = image_viewers;
|
|
||||||
"image/vnd.dwg" = cad;
|
|
||||||
"model/*" = cad;
|
|
||||||
"gcode" = [
|
|
||||||
"PrusaGcodeviewer.desktop"
|
|
||||||
"PrusaSlicer.desktop"
|
|
||||||
];
|
|
||||||
"audio/*" = audio_players;
|
|
||||||
"text/*" = text_editors;
|
|
||||||
"text/plain" = text_editors;
|
|
||||||
"text/markdown" = [ "obsidian.desktop" ] ++ text_editors;
|
|
||||||
"text/csv" = [ "calc.desktop" ] ++ text_editors;
|
|
||||||
"text/html" = browsers ++ text_editors;
|
|
||||||
"text/x-python" = [ "pycharm-community.desktop" ] ++ text_editors;
|
|
||||||
"text/x-c" = [ "clion.desktop" ] ++ text_editors;
|
|
||||||
"text/x-java-source" = [ "idea-community.desktop" ] ++ text_editors;
|
|
||||||
"video/*" = video_viewers;
|
|
||||||
"inode/directory" = [
|
|
||||||
"ranger.desktop"
|
|
||||||
"dolphin.desktop"
|
|
||||||
];
|
|
||||||
"x-scheme-handler/mailto" = "thunderbird.desktop";
|
|
||||||
|
|
||||||
"application/vnd.oasis.opendocument.chart" = "calc.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.chart-template" = "calc.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.database" = "base.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.formula" = "math.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.formula-template" = "math.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.graphics" = "draw.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.graphics-template" = "draw.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.image" = "draw.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.image-template" = "draw.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.presentation" = "impress.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.presentation-template" = "impress.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.spreadsheet" = "calc.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.spreadsheet-template" = "calc.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.text" = "writer.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.text-master" = "writer.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.text-template" = "writer.desktop";
|
|
||||||
"application/vnd.oasis.opendocument.text-web" = "writer.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "impress.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.slide" = "impress.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.slideshow" = "impress.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.template" = "impress.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "calc.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.template" = "calc.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.template" = "writer.desktop";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.mime.enable = true;
|
||||||
|
xdg.mime.addedAssociations = {
|
||||||
|
"application/java-vm" = [
|
||||||
|
"idea-community.desktop"
|
||||||
|
"imhex.desktop"
|
||||||
|
];
|
||||||
|
"application/json" = text_editors ++ [ "firefox-beta.desktop" ];
|
||||||
|
"application/mp4" = video_viewers;
|
||||||
|
"application/ogg" = audio_players;
|
||||||
|
"application/octet-stream" = "imhex.desktop";
|
||||||
|
"application/pdf" = document_viewers;
|
||||||
|
"application/rss+xml" = text_editors;
|
||||||
|
"application/x-chess-pgn" = [ ] ++ text_editors; # fixme
|
||||||
|
"application/x-krita" = "org.kde.krita.desktop";
|
||||||
|
"application/x-latex" = tex_editors;
|
||||||
|
"application/x-tex" = tex_editors;
|
||||||
|
"application/x-texinfo" = tex_editors;
|
||||||
|
"application/xml" = text_editors;
|
||||||
|
"image/svg+xml" = image_viewers ++ browsers ++ text_editors;
|
||||||
|
"image/*" = image_viewers;
|
||||||
|
"image/vnd.dwg" = cad;
|
||||||
|
"model/*" = cad;
|
||||||
|
"gcode" = [
|
||||||
|
"PrusaGcodeviewer.desktop"
|
||||||
|
"PrusaSlicer.desktop"
|
||||||
|
];
|
||||||
|
"audio/*" = audio_players;
|
||||||
|
"text/*" = text_editors;
|
||||||
|
"text/plain" = text_editors;
|
||||||
|
"text/markdown" = [ "obsidian.desktop" ] ++ text_editors;
|
||||||
|
"text/csv" = [ "calc.desktop" ] ++ text_editors;
|
||||||
|
"text/html" = browsers ++ text_editors;
|
||||||
|
"text/x-python" = [ "pycharm-community.desktop" ] ++ text_editors;
|
||||||
|
"text/x-c" = [ "clion.desktop" ] ++ text_editors;
|
||||||
|
"text/x-java-source" = [ "idea-community.desktop" ] ++ text_editors;
|
||||||
|
"video/*" = video_viewers;
|
||||||
|
"inode/directory" = [
|
||||||
|
"ranger.desktop"
|
||||||
|
"dolphin.desktop"
|
||||||
|
];
|
||||||
|
"x-scheme-handler/mailto" = "thunderbird.desktop";
|
||||||
|
|
||||||
|
"application/vnd.oasis.opendocument.chart" = "calc.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.chart-template" = "calc.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.database" = "base.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.formula" = "math.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.formula-template" = "math.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.graphics" = "draw.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.graphics-template" = "draw.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.image" = "draw.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.image-template" = "draw.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.presentation" = "impress.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.presentation-template" = "impress.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.spreadsheet" = "calc.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.spreadsheet-template" = "calc.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.text" = "writer.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.text-master" = "writer.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.text-template" = "writer.desktop";
|
||||||
|
"application/vnd.oasis.opendocument.text-web" = "writer.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "impress.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.slide" = "impress.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.slideshow" = "impress.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.template" = "impress.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "calc.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.template" = "calc.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
|
||||||
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.template" = "writer.desktop";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,44 +5,55 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
inherit (config.grimmShared)
|
||||||
|
enable
|
||||||
|
portals
|
||||||
|
sound
|
||||||
|
screens
|
||||||
|
;
|
||||||
|
inherit (lib)
|
||||||
|
mkIf
|
||||||
|
mkEnableOption
|
||||||
|
mapAttrs'
|
||||||
|
foldl'
|
||||||
|
min
|
||||||
|
getExe
|
||||||
|
isInt
|
||||||
|
nameValuePair
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config = mkIf (enable && portals) {
|
||||||
with cfg;
|
xdg.icons.enable = true;
|
||||||
lib.mkIf (enable && portals) {
|
xdg.sounds.enable = lib.mkIf sound.enable true;
|
||||||
xdg.icons.enable = true;
|
|
||||||
xdg.sounds.enable = lib.mkIf sound.enable true;
|
|
||||||
|
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xdgOpenUsePortal = true;
|
xdgOpenUsePortal = true;
|
||||||
extraPortals = with pkgs; [
|
extraPortals = with pkgs; [
|
||||||
xdg-desktop-portal-wlr
|
xdg-desktop-portal-wlr
|
||||||
xdg-desktop-portal-kde
|
xdg-desktop-portal-kde
|
||||||
xdg-desktop-portal-gtk
|
xdg-desktop-portal-gtk
|
||||||
];
|
];
|
||||||
|
|
||||||
wlr.enable = true;
|
wlr.enable = true;
|
||||||
wlr.settings =
|
wlr.settings = mapAttrs' (
|
||||||
with lib;
|
name: value:
|
||||||
mapAttrs' (
|
nameValuePair ("screencast_" + name) {
|
||||||
name: value:
|
output_name = value.id;
|
||||||
nameValuePair ("screencast_" + name) {
|
max_fps = if isInt value.fps then value.fps else (foldl' min 2147483647 value.fps);
|
||||||
output_name = value.id;
|
chooser_type = "simple";
|
||||||
max_fps = if isInt value.fps then value.fps else (foldl' min 2147483647 value.fps);
|
chooser_cmd = "${getExe pkgs.slurp} -f %o -or";
|
||||||
chooser_type = "simple";
|
}
|
||||||
chooser_cmd = "${getExe pkgs.slurp} -f %o -or";
|
) screens;
|
||||||
}
|
|
||||||
) cfg.screens;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
XDG_CONFIG_HOME = "$HOME/.config";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ xwaylandvideobridge ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.portals = lib.mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts";
|
environment.sessionVariables = {
|
||||||
|
XDG_CONFIG_HOME = "$HOME/.config";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ xwaylandvideobridge ];
|
||||||
|
};
|
||||||
|
|
||||||
|
options.grimmShared.portals = mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./overlays
|
./overlays
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
}:
|
}:
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage {
|
||||||
pname = "deskwhich";
|
pname = "deskwhich";
|
||||||
version = "unstable-2024-04-30";
|
version = "unstable-2024-04-30";
|
||||||
|
|
||||||
|
|
16
custom/searchclip/package.nix
Normal file
16
custom/searchclip/package.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
writeShellScriptBin,
|
||||||
|
lib,
|
||||||
|
urlencode,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) getExe;
|
||||||
|
in
|
||||||
|
writeShellScriptBin "searchclip" ''
|
||||||
|
xdg-open https://www.google.com/search?q=$(wl-paste -p | ${getExe urlencode})
|
||||||
|
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
||||||
|
if [[ -v SWAYSOCK ]]; then
|
||||||
|
sleep .1
|
||||||
|
swaymsg [app_id="$browser" urgent="newest"] focus
|
||||||
|
fi
|
||||||
|
''
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
cairo,
|
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
gobject-introspection,
|
gobject-introspection,
|
||||||
gtk3,
|
gtk3,
|
||||||
|
|
|
@ -56,9 +56,13 @@ in
|
||||||
distroName = "LixOS";
|
distroName = "LixOS";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.sessionVariables = with config.system.nixos; {
|
environment.sessionVariables =
|
||||||
distro = "${distroName} ${version} (${codeName}) ${system}";
|
let
|
||||||
};
|
inherit (config.system.nixos) distroName version codeName;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
distro = "${distroName} ${version} (${codeName}) ${system}";
|
||||||
|
};
|
||||||
|
|
||||||
documentation.doc.enable = false;
|
documentation.doc.enable = false;
|
||||||
|
|
||||||
|
@ -66,15 +70,23 @@ in
|
||||||
programs.ccache.enable = true;
|
programs.ccache.enable = true;
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
let
|
||||||
with lib;
|
inherit (lib)
|
||||||
|
getExe
|
||||||
|
attrNames
|
||||||
|
optionalString
|
||||||
|
elem
|
||||||
|
concatLines
|
||||||
|
;
|
||||||
|
inherit (pkgs) writeShellScriptBin nix-output-monitor;
|
||||||
|
in
|
||||||
[
|
[
|
||||||
(writeShellScriptBin "nixos-build-all" (
|
(writeShellScriptBin "nixos-build-all" (
|
||||||
concatLines (
|
concatLines (
|
||||||
map (
|
map (
|
||||||
n:
|
n:
|
||||||
"NIXOS_TARGET_HOST=${n} nixos-rebuild build --show-trace --upgrade"
|
"NIXOS_TARGET_HOST=${n} nixos-rebuild build --show-trace --upgrade"
|
||||||
+ optionalString (elem nix-output-monitor config.environment.systemPackages) " |& ${lib.getExe pkgs.nix-output-monitor}"
|
+ optionalString (elem nix-output-monitor config.environment.systemPackages) " |& ${getExe nix-output-monitor}"
|
||||||
) (attrNames host_modules)
|
) (attrNames host_modules)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) vhosts;
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{ lib, config, ... }:
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
root_email = "contact@${domain}";
|
root_email = "contact@${domain}";
|
||||||
|
@ -25,73 +19,77 @@ in
|
||||||
./nix_cache.nix
|
./nix_cache.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.serverConfig = with lib; {
|
options.serverConfig =
|
||||||
ports = mkOption {
|
let
|
||||||
type = types.attrsOf (
|
inherit (lib) mkOption types mkEnableOption;
|
||||||
types.submodule (
|
in
|
||||||
{ config, ... }:
|
{
|
||||||
rec {
|
ports = mkOption {
|
||||||
options = {
|
type = types.attrsOf (
|
||||||
port = mkOption {
|
types.submodule (
|
||||||
type = types.int;
|
{ ... }:
|
||||||
description = "port to define";
|
{
|
||||||
|
options = {
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
description = "port to define";
|
||||||
|
};
|
||||||
|
open = mkEnableOption "whether to open the port" // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
open = mkEnableOption "whether to open the port" // {
|
}
|
||||||
default = true;
|
)
|
||||||
};
|
);
|
||||||
};
|
default = { };
|
||||||
}
|
description = "ports associated with services";
|
||||||
)
|
};
|
||||||
);
|
|
||||||
default = { };
|
|
||||||
description = "ports associated with services";
|
|
||||||
};
|
|
||||||
|
|
||||||
vhosts = mkOption {
|
vhosts = mkOption {
|
||||||
type = types.attrsOf (
|
type = types.attrsOf (
|
||||||
types.submodule (
|
types.submodule (
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
type_lookup = {
|
type_lookup = {
|
||||||
proxy = {
|
proxy = {
|
||||||
locations."/".proxyPass = "http://127.0.0.1:${builtins.toString config.port}";
|
locations."/".proxyPass = "http://127.0.0.1:${builtins.toString config.port}";
|
||||||
|
};
|
||||||
|
redirect = {
|
||||||
|
locations."/".return = "307 https://${domain}";
|
||||||
|
};
|
||||||
|
custom = { };
|
||||||
|
none = { };
|
||||||
};
|
};
|
||||||
redirect = {
|
in
|
||||||
locations."/".return = "307 https://${domain}";
|
{
|
||||||
|
options = {
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 80;
|
||||||
|
description = "port to redirect to this vhost";
|
||||||
|
};
|
||||||
|
host = mkOption {
|
||||||
|
type = types.nonEmptyStr;
|
||||||
|
description = "name if the vhost";
|
||||||
|
};
|
||||||
|
accessType = mkOption {
|
||||||
|
type = types.enum (lib.attrNames type_lookup);
|
||||||
|
default = "none";
|
||||||
|
description = "nginx template to use";
|
||||||
|
};
|
||||||
|
extraNginx = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = type_lookup.${config.accessType};
|
||||||
|
description = "location definition for nginx";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
custom = { };
|
}
|
||||||
none = { };
|
)
|
||||||
};
|
);
|
||||||
in
|
default = { };
|
||||||
{
|
description = "vhosts associated with services";
|
||||||
options = {
|
};
|
||||||
port = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 80;
|
|
||||||
description = "port to redirect to this vhost";
|
|
||||||
};
|
|
||||||
host = mkOption {
|
|
||||||
type = types.nonEmptyStr;
|
|
||||||
description = "name if the vhost";
|
|
||||||
};
|
|
||||||
accessType = mkOption {
|
|
||||||
type = types.enum (lib.attrNames type_lookup);
|
|
||||||
default = "none";
|
|
||||||
description = "nginx template to use";
|
|
||||||
};
|
|
||||||
extraNginx = mkOption {
|
|
||||||
type = types.attrs;
|
|
||||||
default = type_lookup.${config.accessType};
|
|
||||||
description = "location definition for nginx";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
default = { };
|
|
||||||
description = "vhosts associated with services";
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) ports;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age;
|
age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) vhosts;
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{ config, pkgs, ... }:
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) ports vhosts;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) vhosts;
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
inputs,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) vhosts;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, ... }:
|
{ ... }:
|
||||||
let
|
let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ pkgs, config, ... }:
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) ports vhosts;
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
{
|
{ config, ... }:
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) vhosts;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.harmonia = {
|
services.harmonia = {
|
||||||
|
|
|
@ -13,7 +13,14 @@ in
|
||||||
static_configs = [
|
static_configs = [
|
||||||
{
|
{
|
||||||
targets =
|
targets =
|
||||||
with lib;
|
let
|
||||||
|
inherit (lib)
|
||||||
|
toString
|
||||||
|
filter
|
||||||
|
isAttrs
|
||||||
|
attrValues
|
||||||
|
;
|
||||||
|
in
|
||||||
map (v: "127.0.0.1:${toString v.port}") (
|
map (v: "127.0.0.1:${toString v.port}") (
|
||||||
filter (v: (isAttrs v) && v.enable) (attrValues config.services.prometheus.exporters)
|
filter (v: (isAttrs v) && v.enable) (attrValues config.services.prometheus.exporters)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{ config, pkgs, ... }:
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (config.serverConfig) ports vhosts;
|
inherit (config.serverConfig) ports vhosts;
|
||||||
in
|
in
|
||||||
|
@ -15,7 +9,6 @@ in
|
||||||
PUFFER_WEB_HOST = ":${builtins.toString vhosts.puffer_host.port}";
|
PUFFER_WEB_HOST = ":${builtins.toString vhosts.puffer_host.port}";
|
||||||
PUFFER_DAEMON_SFTP_HOST = ":${builtins.toString ports.puffer_sftp_port.port}";
|
PUFFER_DAEMON_SFTP_HOST = ":${builtins.toString ports.puffer_sftp_port.port}";
|
||||||
};
|
};
|
||||||
extraPackages = with pkgs; [ ];
|
|
||||||
extraGroups = [ "docker" ];
|
extraGroups = [ "docker" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ prev, config, ... }:
|
||||||
final,
|
|
||||||
prev,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
ccacheWrapper = prev.ccacheWrapper.override {
|
ccacheWrapper = prev.ccacheWrapper.override {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
|
@ -27,5 +27,6 @@
|
||||||
./tlpui.nix
|
./tlpui.nix
|
||||||
./mcontrolcenter.nix
|
./mcontrolcenter.nix
|
||||||
./ccache-wrapper.nix
|
./ccache-wrapper.nix
|
||||||
|
./searchclip.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ final, prev, ... }:
|
{ prev, ... }:
|
||||||
{
|
{
|
||||||
deskwhich = prev.callPackage ../custom/deskwhich/package.nix { };
|
deskwhich = prev.callPackage ../custom/deskwhich/package.nix { };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ final, prev, ... }:
|
{ prev, ... }:
|
||||||
{
|
{
|
||||||
matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
|
matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
|
||||||
src = prev.fetchFromGitHub {
|
src = prev.fetchFromGitHub {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ final, prev, ... }:
|
{ prev, ... }:
|
||||||
{
|
{
|
||||||
mcontrolcenter = prev.callPackage (prev.fetchurl {
|
mcontrolcenter = prev.callPackage (prev.fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/2efffaa70e6de4cb34fd694798af5d433250f4e8/pkgs/by-name/mc/mcontrolcenter/package.nix";
|
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/2efffaa70e6de4cb34fd694798af5d433250f4e8/pkgs/by-name/mc/mcontrolcenter/package.nix";
|
||||||
|
|
4
overlays/searchclip.nix
Normal file
4
overlays/searchclip.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ prev, ... }:
|
||||||
|
{
|
||||||
|
searchclip = prev.callPackage ../custom/searchclip/package.nix { };
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ final, prev, ... }:
|
{ prev, ... }:
|
||||||
{
|
{
|
||||||
tlpui = prev.callPackage ../custom/tlpui/package.nix { };
|
tlpui = prev.callPackage ../custom/tlpui/package.nix { };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
{
|
{ lib, ... }:
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (config.networking) domain;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ ./hardware-configuration.nix ];
|
imports = [ ./hardware-configuration.nix ];
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
{
|
{ lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
inherit (lib) getExe;
|
inherit (lib) getExe;
|
||||||
|
inherit (pkgs)
|
||||||
|
rmenu
|
||||||
|
btop
|
||||||
|
xdg-terminal-exec
|
||||||
|
waybar-mpris
|
||||||
|
pwvucontrol
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
grimmShared.sway.bar = {
|
grimmShared.sway.bar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = with pkgs; {
|
config = {
|
||||||
backlight = {
|
backlight = {
|
||||||
format = "{percent}%";
|
format = "{percent}%";
|
||||||
format-icons = [
|
format-icons = [
|
||||||
|
|
|
@ -1,22 +1,4 @@
|
||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
searchclip =
|
|
||||||
let
|
|
||||||
inherit (lib) getExe;
|
|
||||||
in
|
|
||||||
with pkgs;
|
|
||||||
writeShellScriptBin "searchclip" ''
|
|
||||||
xdg-open https://www.google.com/search?q=$(wl-paste -p | ${getExe urlencode})
|
|
||||||
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
|
||||||
sleep .1
|
|
||||||
swaymsg [app_id="$browser" urgent="newest"] focus
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ ./bar ];
|
imports = [ ./bar ];
|
||||||
|
|
||||||
|
@ -37,9 +19,19 @@ in
|
||||||
grimmShared.sway = {
|
grimmShared.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config =
|
config =
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
inherit (lib) getExe;
|
inherit (lib) getExe;
|
||||||
|
inherit (pkgs)
|
||||||
|
rmenu
|
||||||
|
xdg-terminal-exec
|
||||||
|
slurp
|
||||||
|
swaymux
|
||||||
|
grim
|
||||||
|
brightnessctl
|
||||||
|
searchclip
|
||||||
|
ranger
|
||||||
|
deskwhich
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
definitions = {
|
definitions = {
|
||||||
|
|
|
@ -35,15 +35,16 @@
|
||||||
{ remote = "Videos"; }
|
{ remote = "Videos"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
packages =
|
packages = lib.optionals config.grimmShared.graphical (
|
||||||
with pkgs;
|
with pkgs;
|
||||||
lib.optionals config.grimmShared.graphical [
|
[
|
||||||
webcord
|
webcord
|
||||||
discord
|
discord
|
||||||
obs-studio
|
obs-studio
|
||||||
element-desktop
|
element-desktop
|
||||||
ghidra
|
ghidra
|
||||||
# rmview
|
# rmview
|
||||||
];
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue