Compare commits

..

No commits in common. "d87680738d2e90850f284765e07a26e87cd4eb4e" and "eefda2047d63ba701a59f290813a2ba0388f5883" have entirely different histories.

19 changed files with 113 additions and 167 deletions

View file

@ -115,7 +115,7 @@ sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7+12 /dev/disk/by-labe
> [!NOTE] > [!NOTE]
> If you already had something in the tpm2 module, you'll want to add `--wipe-slot=tpm2` too. > If you already had something in the tpm2 module, you'll want to add `--wipe-slot=tpm2` too.
> [!TIP] > [!NOTE]
> If you're extra paranoid, you can also provide `--tpm2-with-pin=yes`, to prompt for a PIN code on each boot. > If you're extra paranoid, you can also provide `--tpm2-with-pin=yes`, to prompt for a PIN code on each boot.
> >
> I have mentioned why you may want to do this in the beginning. > I have mentioned why you may want to do this in the beginning.

View file

@ -238,11 +238,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718018037, "lastModified": 1713898448,
"narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=", "narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414", "rev": "c0302ec12d569532a6b6bd218f698bc402e93adc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -285,11 +285,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719037157, "lastModified": 1717931644,
"narHash": "sha256-aOKd8+mhBsLQChCu1mn/W5ww79ta5cXVE59aJFrifM8=", "narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "cd886711998fe5d9ff7979fdd4b4cbd17b1f1511", "rev": "3d65009effd77cb0d6e7520b68b039836a7606cf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -321,11 +321,11 @@
}, },
"impermanence": { "impermanence": {
"locked": { "locked": {
"lastModified": 1719091691, "lastModified": 1717932370,
"narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=", "narHash": "sha256-7C5lCpiWiyPoIACOcu2mukn/1JRtz6HC/1aEMhUdcw0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a", "rev": "27979f1c3a0d3b9617a3563e2839114ba7d48d3f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -370,11 +370,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718850197, "lastModified": 1717865884,
"narHash": "sha256-EAb/EhurT7KIIqqZ8cMYM6rL8eJh95ZPdJbwv1j06ds=", "narHash": "sha256-imcv6tx4lSfffv6o8T0cIxJmgheItGSSGzxyO4cWnKg=",
"owner": "nixpak", "owner": "nixpak",
"repo": "nixpak", "repo": "nixpak",
"rev": "98931e88e39da1daf17adbd5e4a839de1059cb4b", "rev": "f938c3c01026c00a305b5fba8edeb8f7efcfb85a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -411,11 +411,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1719075281, "lastModified": 1717786204,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", "rev": "051f920625ab5aabe37c920346e3e69d7d34400e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -539,11 +539,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1719058240, "lastModified": 1717289290,
"narHash": "sha256-pprpeDB/mvINS5m5FIOq/1I0xpBvO8l7FyWNmmO0Ir0=", "narHash": "sha256-NS2WFE2mEodtPATQIC16N0ylWnog8B0IownZWnM9JPE=",
"owner": "schizofox", "owner": "schizofox",
"repo": "schizofox", "repo": "schizofox",
"rev": "becff9b92a28c3cd6e6a215da7f5f56883d3a304", "rev": "04e204d8f605a45e2537343a5e467d5af0518eef",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -2,8 +2,11 @@
dconf = { dconf = {
enable = true; enable = true;
settings = { settings = {
"org/gtk/settings/file-chooser" = { # This is like a system-wide dark mode swithc that some apps respect
sort-directories-first = true; # Equivalent of the following dconf command:
# `conf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"`
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
}; };
}; };
}; };

View file

@ -2,6 +2,5 @@ _: {
imports = [ imports = [
./spotify ./spotify
./vesktop ./vesktop
./webcord
]; ];
} }

View file

@ -1,34 +0,0 @@
{
lib,
osConfig,
pkgs,
...
}: let
inherit (lib) mkIf;
cfg = osConfig.myOptions.home-manager.programs.applications.webcord;
in {
config = mkIf cfg.enable {
home.packages = with pkgs; [
# Webcord with vencord extension installed
webcord-vencord
];
systemd.user.services."webcord" = mkIf cfg.autoStart {
Unit = {
Description = "Webcord (An electron-based Discord client implemented without Discord API with Vencord built-in)";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
Restart = "on-failure";
ExecStart = "${pkgs.webcord-vencord}/bin/webcord";
};
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

View file

@ -14,6 +14,7 @@ in {
enable = true; enable = true;
package = pkgs.ungoogled-chromium.override { package = pkgs.ungoogled-chromium.override {
nss = pkgs.nss_latest;
commandLineArgs = [ commandLineArgs = [
# Ungoogled features # Ungoogled features
"--disable-search-engine-collection" "--disable-search-engine-collection"

View file

@ -2,6 +2,7 @@
osConfig, osConfig,
config, config,
pkgs, pkgs,
lib,
... ...
}: let }: let
cfg = osConfig.myOptions.home-manager.theme.gtk; cfg = osConfig.myOptions.home-manager.theme.gtk;
@ -76,16 +77,4 @@ in {
gtk-application-prefer-dark-theme = true; gtk-application-prefer-dark-theme = true;
}; };
}; };
dconf.settings = {
# This is like a system-wide dark mode swithc that some apps respect it.
# Equivalent of the following dconf command:
# `conf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"`
"org/gnome/desktop/interface".color-scheme = "prefer-dark";
"org/gnome/desktop/interface".gtk-theme = cfg.theme.name;
# For Gnome shell
"org/gnome/shell/extensions/user-theme".name = cfg.theme.name;
};
} }

View file

@ -10,13 +10,9 @@
in { in {
qt = { qt = {
enable = true; enable = true;
# just an override for QT_QPA_PLATFORMTHEME, takes "gtk", "gnome", "qtct" or "kde" platformTheme.name = mkIf cfg.forceGtk "gtk"; # just an override for QT_QPA_PLATFORMTHEME, takes "gtk", "gnome", "qtct" or "kde"
platformTheme.name =
if cfg.forceGtk
then "gtk"
else "qtct";
style = mkIf (!cfg.forceGtk) { style = mkIf (!cfg.forceGtk) {
name = "Kvantum"; name = cfg.theme.name;
package = cfg.theme.package; package = cfg.theme.package;
}; };
}; };
@ -39,16 +35,6 @@ in {
libsForQt5.qtstyleplugins libsForQt5.qtstyleplugins
qt6Packages.qt6gtk2 qt6Packages.qt6gtk2
]) ])
(mkIf (!cfg.forceGtk) [
# If we're not forcing GTK themes, use Kvantum.
# Kvantum as a library and a program to theme qt applications.
qt6Packages.qtstyleplugin-kvantum
libsForQt5.qtstyleplugin-kvantum
# Also add the theme package to path just in case
cfg.theme.package
])
]; ];
sessionVariables = { sessionVariables = {
@ -67,11 +53,5 @@ in {
# tell calibre to use the dark theme, because the light one hurts my eyes # tell calibre to use the dark theme, because the light one hurts my eyes
CALIBRE_USE_DARK_PALETTE = "1"; CALIBRE_USE_DARK_PALETTE = "1";
}; };
xdg.configFile = mkIf (!cfg.forceGtk) {
"Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
General.theme = cfg.theme.name;
};
};
}; };
} }

View file

@ -70,7 +70,6 @@
# Applications # Applications
".config/spotify" ".config/spotify"
".config/vesktop" ".config/vesktop"
".config/WebCord"
".local/share/Smart Code ltd/Stremio" ".local/share/Smart Code ltd/Stremio"
# Tools # Tools
@ -100,11 +99,6 @@
devices."/dev/disk/by-label/NIXOS-FS".subvolumes = [ "root" ]; devices."/dev/disk/by-label/NIXOS-FS".subvolumes = [ "root" ];
}; };
}; };
boot = {
secure-boot.enable = true;
#tmpOnTmpfs = true;
};
}; };
device = { device = {
@ -179,7 +173,6 @@
enable = true; enable = true;
autoStart = true; autoStart = true;
}; };
webcord.enable = true;
mpv.enable = true; mpv.enable = true;
nomacs.enable = true; # TODO: probably disable nomacs.enable = true; # TODO: probably disable
qimgv.enable = true; qimgv.enable = true;

View file

@ -33,10 +33,6 @@ in
enable = mkEnableOption "Vesktop (An alternate client for Discord with Vencord built-in)"; enable = mkEnableOption "Vesktop (An alternate client for Discord with Vencord built-in)";
autoStart = mkEnableOption "Auto-Start for Vesktop"; autoStart = mkEnableOption "Auto-Start for Vesktop";
}; };
webcord = {
enable = mkEnableOption "Webcord (An electron-based Discord client implemented without Discord API with Vencord built-in)";
autoStart = mkEnableOption "Auto-Start for Webcord";
};
nomacs.enable = mkEnableOption "Nomacs (Qt-based image viewer)"; nomacs.enable = mkEnableOption "Nomacs (Qt-based image viewer)";
qimgv.enable = mkEnableOption "QImgV (Qt-based image viewer with video support)"; qimgv.enable = mkEnableOption "QImgV (Qt-based image viewer with video support)";
qbittorrent.enable = mkEnableOption "Qbittorrent (Free software BitTorrent client)"; qbittorrent.enable = mkEnableOption "Qbittorrent (Free software BitTorrent client)";

View file

@ -62,31 +62,19 @@ in
forceGtk = mkOption { forceGtk = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description = "Whether to force QT applications to try and use the GTK theme.";
Whether to force QT applications to try and use the GTK theme.
If false, qtct platform theme & Kvantum will be used instead.
'';
}; };
theme = { theme = {
name = mkOption { name = mkOption {
type = types.str; type = types.str;
default = "Catppuccin-Mocha-Dark"; default = "Catppuccin-Mocha-Dark";
description = '' description = "The name for the QT theme package";
The name for the QT theme package.
This has no effect if forceGtk is set.
'';
}; };
package = mkOption { package = mkOption {
type = types.package; type = types.package;
description = '' description = "The theme package to be used for QT programs";
The theme package to be used for QT programs.
This has no effect if forceGtk is set.
'';
default = pkgs.catppuccin-kde.override { default = pkgs.catppuccin-kde.override {
flavour = ["mocha"]; flavour = ["mocha"];
accents = ["blue"]; accents = ["blue"];

View file

@ -1,23 +0,0 @@
{ pkgs, lib, config, ...}: let
inherit (lib) mkIf;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"];
in {
config = mkIf (builtins.elem deviceType acceptedTypes) {
hardware.acpilight.enable = true;
environment.systemPackages = with pkgs; [ acpi ];
# handle ACPI events
services.acpid.enable = true;
boot = {
kernelModules = ["acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [
acpi_call
cpupower
];
};
};
}

View file

@ -0,0 +1,47 @@
# This sets up power management using auto-cpufreq,
# alongside with upower and power-profiles-daemon.
# Together, this provides a complete alternative to TLP
{ pkgs, lib, config, ...}: let
inherit (lib) mkIf mkDefault;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"];
in {
imports = [
./power-profiles-daemon
];
config = mkIf (builtins.elem deviceType acceptedTypes) {
services = {
# superior power management
auto-cpufreq = {
enable = true;
settings = let
MHz = x: x * 1000;
in {
battery = {
governor = "powersave";
scaling_min_freq = mkDefault (MHz 1200);
scaling_max_freq = mkDefault (MHz 1800);
turbo = "never";
};
charger = {
governor = "performance";
scaling_min_freq = mkDefault (MHz 1800);
scaling_max_freq = mkDefault (MHz 3800);
turbo = "auto";
};
};
};
# DBus service that provides power management support to applications
upower = {
enable = true;
percentageLow = 15;
percentageCritical = 5;
percentageAction = 3;
criticalPowerAction = "Hibernate";
};
};
};
}

View file

@ -1,15 +1,37 @@
{ pkgs, lib, config, ...}: let { pkgs, lib, config, ...}: let
inherit (lib) mkIf; inherit (lib) mkIf mkDefault;
deviceType = config.myOptions.device.roles.type; deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"]; acceptedTypes = ["laptop"];
in { in {
imports = [ imports = [
./power-profiles-daemon ./auto-cpufreq
./upower.nix
./acpi.nix
]; ];
config = mkIf (builtins.elem deviceType acceptedTypes) { config = mkIf (builtins.elem deviceType acceptedTypes) {
environment.systemPackages = with pkgs; [ powertop ]; hardware.acpilight.enable = true;
environment.systemPackages = with pkgs; [
acpi
powertop
];
services = {
# handle ACPI events
acpid.enable = true;
# temperature target on battery
undervolt = {
tempBat = 65; # deg C
package = pkgs.undervolt;
};
};
boot = {
kernelModules = ["acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [
acpi_call
cpupower
];
};
}; };
} }

View file

@ -1,19 +0,0 @@
{ pkgs, lib, config, ...}: let
inherit (lib) mkIf;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"];
in {
config = mkIf (builtins.elem deviceType acceptedTypes) {
services = {
# DBus service that provides power management support to applications
upower = {
enable = true;
percentageLow = 15;
percentageCritical = 5;
percentageAction = 3;
criticalPowerAction = "Hibernate";
};
};
};
}

View file

@ -23,12 +23,16 @@ in
]; ];
# Enable OpenGL # Enable OpenGL
hardware.graphics = { hardware.opengl = {
enable = true; enable = true;
# Enable OpenCL and AMDVLK # Enable OpenCL and AMDVLK
extraPackages = with pkgs; [ amdvlk ]; extraPackages = with pkgs; [
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
}; };
}; };
} }

View file

@ -63,7 +63,7 @@ in
}; };
# Enable OpenGL # Enable OpenGL
graphics = { opengl = {
enable = true; enable = true;
# VA-API implementation using NVIDIA's NVDEC # VA-API implementation using NVIDIA's NVDEC