mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-10 02:19:41 +00:00
Compare commits
9 commits
eefda2047d
...
d87680738d
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | d87680738d | ||
ItsDrike | 919a2efc17 | ||
ItsDrike | 8f6137e52b | ||
ItsDrike | cfd9ccb24f | ||
ItsDrike | 08864662bb | ||
ItsDrike | 6545dda7f8 | ||
ItsDrike | 6bedfed95c | ||
ItsDrike | d796eea045 | ||
ItsDrike | b75946fde4 |
|
@ -115,7 +115,7 @@ sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7+12 /dev/disk/by-labe
|
|||
> [!NOTE]
|
||||
> If you already had something in the tpm2 module, you'll want to add `--wipe-slot=tpm2` too.
|
||||
|
||||
> [!NOTE]
|
||||
> [!TIP]
|
||||
> 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.
|
||||
|
|
36
flake.lock
36
flake.lock
|
@ -238,11 +238,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1713898448,
|
||||
"narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=",
|
||||
"lastModified": 1718018037,
|
||||
"narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"rev": "c0302ec12d569532a6b6bd218f698bc402e93adc",
|
||||
"rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -285,11 +285,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717931644,
|
||||
"narHash": "sha256-Sz8Wh9cAiD5FhL8UWvZxBfnvxETSCVZlqWSYWaCPyu0=",
|
||||
"lastModified": 1719037157,
|
||||
"narHash": "sha256-aOKd8+mhBsLQChCu1mn/W5ww79ta5cXVE59aJFrifM8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "3d65009effd77cb0d6e7520b68b039836a7606cf",
|
||||
"rev": "cd886711998fe5d9ff7979fdd4b4cbd17b1f1511",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -321,11 +321,11 @@
|
|||
},
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1717932370,
|
||||
"narHash": "sha256-7C5lCpiWiyPoIACOcu2mukn/1JRtz6HC/1aEMhUdcw0=",
|
||||
"lastModified": 1719091691,
|
||||
"narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "27979f1c3a0d3b9617a3563e2839114ba7d48d3f",
|
||||
"rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -370,11 +370,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717865884,
|
||||
"narHash": "sha256-imcv6tx4lSfffv6o8T0cIxJmgheItGSSGzxyO4cWnKg=",
|
||||
"lastModified": 1718850197,
|
||||
"narHash": "sha256-EAb/EhurT7KIIqqZ8cMYM6rL8eJh95ZPdJbwv1j06ds=",
|
||||
"owner": "nixpak",
|
||||
"repo": "nixpak",
|
||||
"rev": "f938c3c01026c00a305b5fba8edeb8f7efcfb85a",
|
||||
"rev": "98931e88e39da1daf17adbd5e4a839de1059cb4b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -411,11 +411,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1717786204,
|
||||
"narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=",
|
||||
"lastModified": 1719075281,
|
||||
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "051f920625ab5aabe37c920346e3e69d7d34400e",
|
||||
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -539,11 +539,11 @@
|
|||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717289290,
|
||||
"narHash": "sha256-NS2WFE2mEodtPATQIC16N0ylWnog8B0IownZWnM9JPE=",
|
||||
"lastModified": 1719058240,
|
||||
"narHash": "sha256-pprpeDB/mvINS5m5FIOq/1I0xpBvO8l7FyWNmmO0Ir0=",
|
||||
"owner": "schizofox",
|
||||
"repo": "schizofox",
|
||||
"rev": "04e204d8f605a45e2537343a5e467d5af0518eef",
|
||||
"rev": "becff9b92a28c3cd6e6a215da7f5f56883d3a304",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -2,11 +2,8 @@
|
|||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# This is like a system-wide dark mode swithc that some apps respect
|
||||
# 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/gtk/settings/file-chooser" = {
|
||||
sort-directories-first = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -2,5 +2,6 @@ _: {
|
|||
imports = [
|
||||
./spotify
|
||||
./vesktop
|
||||
./webcord
|
||||
];
|
||||
}
|
||||
|
|
34
home/programs/graphical/apps/webcord/default.nix
Normal file
34
home/programs/graphical/apps/webcord/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -14,7 +14,6 @@ in {
|
|||
enable = true;
|
||||
|
||||
package = pkgs.ungoogled-chromium.override {
|
||||
nss = pkgs.nss_latest;
|
||||
commandLineArgs = [
|
||||
# Ungoogled features
|
||||
"--disable-search-engine-collection"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
osConfig,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = osConfig.myOptions.home-manager.theme.gtk;
|
||||
|
@ -77,4 +76,16 @@ in {
|
|||
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;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,9 +10,13 @@
|
|||
in {
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = mkIf cfg.forceGtk "gtk"; # just an override for QT_QPA_PLATFORMTHEME, takes "gtk", "gnome", "qtct" or "kde"
|
||||
# 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) {
|
||||
name = cfg.theme.name;
|
||||
name = "Kvantum";
|
||||
package = cfg.theme.package;
|
||||
};
|
||||
};
|
||||
|
@ -35,6 +39,16 @@ in {
|
|||
libsForQt5.qtstyleplugins
|
||||
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 = {
|
||||
|
@ -53,5 +67,11 @@ in {
|
|||
# tell calibre to use the dark theme, because the light one hurts my eyes
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
# Applications
|
||||
".config/spotify"
|
||||
".config/vesktop"
|
||||
".config/WebCord"
|
||||
".local/share/Smart Code ltd/Stremio"
|
||||
|
||||
# Tools
|
||||
|
@ -99,6 +100,11 @@
|
|||
devices."/dev/disk/by-label/NIXOS-FS".subvolumes = [ "root" ];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
secure-boot.enable = true;
|
||||
#tmpOnTmpfs = true;
|
||||
};
|
||||
};
|
||||
|
||||
device = {
|
||||
|
@ -173,6 +179,7 @@
|
|||
enable = true;
|
||||
autoStart = true;
|
||||
};
|
||||
webcord.enable = true;
|
||||
mpv.enable = true;
|
||||
nomacs.enable = true; # TODO: probably disable
|
||||
qimgv.enable = true;
|
||||
|
|
|
@ -33,6 +33,10 @@ in
|
|||
enable = mkEnableOption "Vesktop (An alternate client for Discord with Vencord built-in)";
|
||||
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)";
|
||||
qimgv.enable = mkEnableOption "QImgV (Qt-based image viewer with video support)";
|
||||
qbittorrent.enable = mkEnableOption "Qbittorrent (Free software BitTorrent client)";
|
||||
|
|
|
@ -62,19 +62,31 @@ in
|
|||
forceGtk = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to force QT applications to try and use the GTK theme.";
|
||||
description = ''
|
||||
Whether to force QT applications to try and use the GTK theme.
|
||||
|
||||
If false, qtct platform theme & Kvantum will be used instead.
|
||||
'';
|
||||
};
|
||||
|
||||
theme = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "Catppuccin-Mocha-Dark";
|
||||
description = "The name for the QT theme package";
|
||||
description = ''
|
||||
The name for the QT theme package.
|
||||
|
||||
This has no effect if forceGtk is set.
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "The theme package to be used for QT programs";
|
||||
description = ''
|
||||
The theme package to be used for QT programs.
|
||||
|
||||
This has no effect if forceGtk is set.
|
||||
'';
|
||||
default = pkgs.catppuccin-kde.override {
|
||||
flavour = ["mocha"];
|
||||
accents = ["blue"];
|
||||
|
|
23
system/roles/laptop/power/acpi.nix
Normal file
23
system/roles/laptop/power/acpi.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
# 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,37 +1,15 @@
|
|||
{ pkgs, lib, config, ...}: let
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (lib) mkIf;
|
||||
deviceType = config.myOptions.device.roles.type;
|
||||
acceptedTypes = ["laptop"];
|
||||
in {
|
||||
imports = [
|
||||
./auto-cpufreq
|
||||
./power-profiles-daemon
|
||||
./upower.nix
|
||||
./acpi.nix
|
||||
];
|
||||
|
||||
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||
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
|
||||
];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [ powertop ];
|
||||
};
|
||||
}
|
||||
|
|
19
system/roles/laptop/power/upower.nix
Normal file
19
system/roles/laptop/power/upower.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -23,16 +23,12 @@ in
|
|||
];
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.opengl = {
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
|
||||
# Enable OpenCL and AMDVLK
|
||||
extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
];
|
||||
extraPackages32 = with pkgs; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
extraPackages = with pkgs; [ amdvlk ];
|
||||
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ in
|
|||
};
|
||||
|
||||
# Enable OpenGL
|
||||
opengl = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
|
||||
# VA-API implementation using NVIDIA's NVDEC
|
||||
|
|
Loading…
Reference in a new issue